11-20-2007 8:03 PM
hi
i am working on this EXIT_SAPLCMAT_001. requirement is to change values in some fields before this structure goes to scm side. here is code i have written. but is not working. has anyone worked on this exit before. please help me.
data : wa_cif_matloc like ct_cif_matloc,
wa_cif_matlocx like ct_cif_matlocx.
For updating planning procedure field
loop at ct_cif_matloc into wa_cif_matloc.
wa_cif_matloc-rrp_type = '5'.
append wa_cif_matloc to ct_cif_matloc.
endloop.
clear wa_cif_matloc.
for updating the changes to apo
loop at ct_cif_matlocx into wa_cif_matlocx.
wa_cif_matlocx-rrp_type = 'X'.
append wa_cif_matlocx to ct_cif_matlocx.
endloop.
clear wa_cif_matlocx.
11-20-2007 8:10 PM
I think you are using APPEND instead of the MODIFY. You must use MODIFY, if you want to change the values.
* For updating planning procedure field
loop at ct_cif_matloc into wa_cif_matloc.
wa_cif_matloc-rrp_type = '5'.
MODIFY wa_cif_matloc to ct_cif_matloc.
endloop.
clear wa_cif_matloc.
* for updating the changes to apo
loop at ct_cif_matlocx into wa_cif_matlocx.
wa_cif_matlocx-rrp_type = 'X'.
MODIFY wa_cif_matlocx to ct_cif_matlocx.
endloop.
And you are appending the same table on which you are doing the loop. Which leads to the run time error.
loop at <b>ct_cif_matlocx</b> into wa_cif_matlocx.
wa_cif_matlocx-rrp_type = 'X'.
MODIFY wa_cif_matlocx to <b>ct_cif_matlocx</b>.
endloop.
Regards,
Naimesh Patel
11-20-2007 8:59 PM