Hello Arun,
you are absolutely right..!!
I have written the below coding in the end routine.. but the SID no, data package no, record no are not getting updated.. hence the appended fields are getting added to the result_package.
Key fields for DSO --> 0Doc_num, 0Doc_item..
Source for DSO --> Data Source (2LiS_11_VAITM).
yes, I checked in the debugging mode and we get the duplicate records in i_result for the doc_num and doc_itm.. hence i hv to add the field1 and field2 to the key fields of DSO..
Could you please suggest the changes in the below coding so that the recrds no, datapackage no, sid no are updated in the appending records . thank you..
loop at RESULT_PACKAGE assigning <RESULT_FIELDS>.
Clear: wa_itab1, wa_itab2.
if <result_fields>-REFER_DOC is not INITIAL.
read table itab1 into wa_itab1 with key
doc_num = <result_fields>-refer_doc
doc_item = <result_fields>-refer_itm
Binary search.
If sy-subrc = 0.
wa_itab1-/bic/PAA1C2033 = <Result_fields>-doc_num.
wa_itab1-/bic/PAA1C2032 = <Result_fields>-doc_item.
MOVE-CORRESPONDING wa_itab1 to wa_itab2.
Append wa_itab2 to i_result.
endif.
endif.
endloop.
Append lines of i_result to RESULT_PACKAGE.