11-28-2007 2:57 PM
Hi experts,
I m having a table control as a selection screen.When I enter a material number in the first field of the table control and press enter, then i m doing some validations for some fields and populating the data into the fields of the table control by using the material no.This is working fine.After that again if i press enter,again the process is starting and data in the 1st row is copied to 2nd row.If i press enter again the process is repeating and the rows are filled with the same data of 1st row.How can i prevent this?any suggestions please?
Thanks,
dp.
11-28-2007 3:02 PM
Check your PAI module for the table control.
Your APPEND ITAB must be triggering each and every time you are pressing enter.
So, do like this in that module:
MODULE loop_lines.
read table itab with index sy-stepl.
if sy-subrc = 0.
modify itab
else.
append itab.
endif.
ENDMODULE.
Regards,
Naimesh Patel
11-28-2007 3:02 PM
Check your PAI module for the table control.
Your APPEND ITAB must be triggering each and every time you are pressing enter.
So, do like this in that module:
MODULE loop_lines.
read table itab with index sy-stepl.
if sy-subrc = 0.
modify itab
else.
append itab.
endif.
ENDMODULE.
Regards,
Naimesh Patel