Thank you all ...for your help...But i am still not able to fix the routine...its the End routine..Here is what i am doing...
DATA: lt_result TYPE _ty_t_TG_1,
lr_result TYPE _ty_s_TG_1.
LOOP AT RESULT_PACKAGE INTO lr_result.
lr_result-DIV = '01'.
APPEND lr_result TO lt_result.
*** This is my logic, if the Customer has a masterdata entry with Div = '02' and D_CHAN = '01' then ONLY i have to do append , otherwise skip and go to next record. ****
*****Basically, i have 100 records ( Each recordd has customer # in it ) in to DSO and i have to load those 100 records for DIV = '01' AND i have to load the same record with DIV = '02' if that customer exists for DIV 2. Thats why i am blindly updating all the records for DIV = '01' but checking using Select statement, if there is an entry exists for the customer with DIV = '02'. ****
SELECT /BIC/ZCUST FROM /BIC/PZCUSTOMER
INTO RESULT_PACKAGE
WHERE DIV = '02' and D_CHAN = '01' and /BIC/ZCUST = lr_result-zcust.
IF result is NOT initial.
lr_result-DIV = '02'.
APPEND lr_result TO lt_result.
ENDIF.
ENDLOOP.
RESULT_PACKAGE = lt_result.