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: 

problem in table control

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

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

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

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