Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

EXIT_SAPLCMAT_001

Former Member
0 Kudos

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.

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

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

0 Kudos

thanks for ur answer. let me try this and see .