Hi Tanvi,
Please find the below code.
TYPES: BEGIN OF TY_PLAN,
EMPLOYEE_NO TYPE PERNR_D,
PLAN TYPE PLAN,
BEGDA TYPE BEGDA,
ENDDA TYPE ENDDA,
DEL_IND TYPE I,
END OF TY_PLAN.
DATA: IT_PLAN TYPE TABLE OF TY_PLAN,
IT_PLAN_CP TYPE TABLE OF TY_PLAN,
WA_PLAN TYPE TY_PLAN.
FIELD-SYMBOLS: <FS_PLAN> TYPE TY_PLAN.
"Sort the internal Table
SORT IT_PLAN BY EMPLOYEE_NO.
"Copy the values
IT_PLAN_CP[] = IT_PLAN[].
"Loop the Internal Table
LOOP AT IT_PLAN ASSIGNING <FS_PLAN>.
AT NEW EMPLOYEE_NO.
L_COUNT = 0.
ENDAT.
L_COUNT = L_COUNT + 1.
AT END OF EMPLOYEE_NO.
"Check Condition for Multiple plan
IF L_COUNT = 1.
"Assign Deletion Indicator for the employee - Single Plan
<FS_PLAN>-DEL_IND = 1.
ENDIF.
ENDAT.
ENDLOOP.
"Delete the value from Internal table based on Deletion Indicator
DELETE IT_PLAN WHERE DEL_IND = 1.
Regards
Rajkumar Narasimman