When you are adding the new records in dso then you also need to increment the record number.
If not then it will give error while activating the data.
You can make use of this method CALL METHOD me->new_record__end_routine
Please check this note 1223532 as well.
Regards,
AL
Hi Ajay,
Can you enable the Error stack and then run the DTP. This will help us in identifying the erroneous record.
The error occurs due to the Fields in the select Query and the internal table fields are unsynchronized.
please check the select query fields as well as internal table fields as their assignment should be in proper way.
Regards,
Amit
Hi Ajay,
You can re-active transformation and DTP and see if you can load the data without any issues.
Regards,
Vengal.
Hi Ajay,
Whenever you append any records to END_ROUTINE, you must increment your record number manually else there will error .....
pls use below code... i have made changes to your code in BOLD.
data : itab1 type standard table of /BIC/AZP2_ODIG00,
lwa1 type /BIC/AZP2_ODIG00,
itab2 type standard table of _ty_s_TG_1,
lwa2 type _ty_s_TG_1,
itab_target type standard table of _ty_s_TG_1.
DATA: LV_count Type I.
select * from /BIC/AZP2_ODIG00 into table itab1.
loop at RESULT_PACKAGE assigning <result_fields>.
clear lwa1.
read table itab1 into lwa1 with key
/BIC/ZP2_AUFNR = <result_fields>-/BIC/ZP2_AUFNR
/BIC/ZP2_AUFS1 = <result_fields>-/BIC/ZP2_AUFS1
/BIC/ZP2_EQUNR = <result_fields>-/BIC/ZP2_EQUNR
/BIC/ZP2_DICPO = <result_fields>-/BIC/ZP2_DICPO
/BIC/ZP2_DISPN = <result_fields>-/BIC/ZP2_DISPN.
if sy-subrc eq 0.
<result_fields>-/BIC/ZP2_CFAW = 'A'.
Else.
<result_fields>-/BIC/ZP2_CFAW = 'N'.
endif.
Endloop.
clear lwa1.
Describe table RESULT_PACKAGE lines LV_count.
loop at itab1 into lwa1.
clear lwa2.
read table RESULT_PACKAGE into lwa2 with key
/BIC/ZP2_AUFNR = lwa1-/BIC/ZP2_AUFNR
/BIC/ZP2_AUFS1 = lwa1-/BIC/ZP2_AUFS1
/BIC/ZP2_EQUNR = lwa1-/BIC/ZP2_EQUNR
/BIC/ZP2_DICPO = lwa1-/BIC/ZP2_DICPO
/BIC/ZP2_DISPN = lwa1-/B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lwa2-/BIC/ZP2_DIDIL = lwa1-/BIC/ZP2_DIDIL.
lwa2-/BIC/ZDIG_VKF1 = lwa1-/BIC/ZDIG_VKF1.
lwa2-BBP_GRFLAG = lwa1-BBP_GRFLAG.
lwa2-/BIC/ZP2_CFAW = 'D'.
LWA2-record = LV_count + 1.
append lwa2 to RESULT_PACKAGE.
endif.
endloop.
*** pls ensure presence of record field inside internal table LWA2...
Regards,
Hitesh
Add comment