Application Development and Automation 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: 
Read only

In table control internal table records are duplicated

akil_syed1
Explorer
0 Likes
704

hi all,

I am developing the table control in the module pool.

Table control has 5 fields;

sr_no   roll_no   pan_details   city   country   age   division

here in roll_no(serach help provided) when i select roll no and press enter button the following fields pan_details , city ,country are populated automatically.

and after populating the user is manually entering the age and division.

Then the user is supposed to press save button.

after pressing save button the internal table is automatically modifying 2 times.  1st---when i press enter and 2----when i press save.

so my internal table now having 2 records which are same

but my requirement is the internal table should be modified only once i.e after i press save button and should contain only 1 record. 

please guide me where to write the code so that internal table does not get modified two times.

hi all,

I am developing the table control in the module pool.

Table control has 5 fields;

sr_no   roll_no   pan_details   city   country   age   division

here in roll_no(serach help provided) when i select roll no and press enter button the following fields pan_details , city ,country are populated automatically.

and after populating the user is manually entering the age and division.

Then the user is supposed to press save button.

after pressing save button the internal table is automatically modifying 2 times.  1st---when i press enter and 2----when i press save.

so my internal table now having 2 records which are same

but my requirement is the internal table should be modified only once i.e after i press save button and should contain only 1 record. 

please guide me where to write the code so that internal table does not get modified two times.

2 REPLIES 2
Read only

VenkatRamesh_V
Active Contributor
0 Likes
672

Hi,

Try,

process after input


loop at itab.

module my_fab_modify on chain-request.

endloop.


MODIFY itab

     FROM Wa

     INDEX MY_FAB-CURRENT_LINE.

      if sy-subrc ne 0.

     append wa to itab.

     endif.


Hope it helpful,


Regards,

Venkat.

Read only

Former Member
0 Likes
672

Hi Akil,

Take a temparory Internal table, After enter rollno write the below code

select pan_details , city ,country from <table> into table <temp_itab> where rollno = <tablecontrol-rollno>.

dont modify tour internal table.

After enterning remainning details modify your internal table.

Please provide your code,  I will analyze it.