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

Dynamic rows increment according to user input in Table Control Module Pool

biswajit_das6
Participant
0 Likes
1,167

HI All,

I'm doing a Table Control module pool Program. Now suppose there are two fields - MATNR & MAKTX.

Our requirement is while weu2019ll give the material No (MATNR field), material desc. will be populated in corresponding field (MAKTX field),

Now the problem is, while we are entering Material No. in 1st row it is Material Desc. coming in to corresponding field but while the data is given to next row it replaces the 1st rows data .

eg - ............................... ........ MATNR.............................MAKTX

1st entry in 1st row ..................... 23................................... XXX --after pressing 'ENTER' mat desc XXX comes. now 2nd entry in 2nd row 24 .............................. YYY --after pressing 'ENTER'

1st row details like MATERIAL NO(23) & Desc(XXX) got deleted & that is replaced by 24 YYY

We can not extend that no. of rows of Table Control Table more than one row.

If you kindly help me how it is possible to increase the no. of rows of that table dynamically without replacing the previous row it will be very helpful for me.

Thanks & Regards,

Biswajit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
518

Hi

Try this out.

In PAI

loop at itab.

field itab-matnr module get_maktx.

module modify_tab.

endloop.

in Program

module get_matkx.

if not itab-matnr is initial.

select single maktx from makt into itab-maktx where matnr = itab-matnr and spras = 'EN'.

endif.

endmodule.

module modify_tab.

describe table itab lines tc-lines.

if tc-current_line > tc-lines.

append itab.

else.

modify itab index tc-current_line.

endif.

endmodule

Cheers.

Ramchander Rao.K

2 REPLIES 2
Read only

Former Member
0 Likes
518

Hi Biswajit,

This probably means that the table control PAI is modifying the first line always in the internal table instead of current line

eg: we wite the code

loop at screen and then modify the internal table with current line

table_control => name of table control as given on screen

in PAI of the screen

loop at internaltable.

modify internaltable index table_control-current_line .

    • put a break point here and see*

    • it will always be updating the first record because of some reason - logic error or coding error*

endloop.

Also in PBO we can see that the internal table will be having just one record after the action mentioned above....it is a case of overwrite

To simply increment the number of lines

table_control-lines = table_control-lines + 1. in PAI

Pls check and revert

Hope it helps

Regards

Byju

Read only

Former Member
0 Likes
519

Hi

Try this out.

In PAI

loop at itab.

field itab-matnr module get_maktx.

module modify_tab.

endloop.

in Program

module get_matkx.

if not itab-matnr is initial.

select single maktx from makt into itab-maktx where matnr = itab-matnr and spras = 'EN'.

endif.

endmodule.

module modify_tab.

describe table itab lines tc-lines.

if tc-current_line > tc-lines.

append itab.

else.

modify itab index tc-current_line.

endif.

endmodule

Cheers.

Ramchander Rao.K