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

Table Control---URGETNT

Former Member
0 Likes
569

Hi,

Can anybody please let me know, how to dynamically populate a table control.

For example, I have 2 columns in table control. 1st Field is Customer Number and 2nd is Customer Name. I just want to give the customer number in table control and dynamically the customer name should be populated.

Thank you in advance.

1 ACCEPTED SOLUTION
Read only

former_member632991
Active Contributor
0 Likes
544

Hi,

In the PBO of that screen, select the data i.e. customer name from KNA1 based on the customer name and then move the data i.e. name into the field .

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

MODULE SELECT.

LOOP WITH CONTROL TC_SER.

  • CURSOR TC_SER-CURRENT_LINE.

****for dispalying data into TC**

MODULE DATA_TO_TC.

ENDLOOP.

MODULE SELECT OUTPUT.

select name1 from kna1 into itab-name1 where kunnr = kna1-kunnr.

endmodule.

MODULE DATA_TO_TC.

READ TABLE ITAB_TC INDEX TC_SER-CURRENT_LINE.

IF SY-SUBRC = 0.

kna1-name1 = itab1-name1.

endif.

endmodule.

Hope it helps.

Regards,

Sonika

Message was edited by:

Sonika Ahuja

5 REPLIES 5
Read only

former_member632991
Active Contributor
0 Likes
545

Hi,

In the PBO of that screen, select the data i.e. customer name from KNA1 based on the customer name and then move the data i.e. name into the field .

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

MODULE SELECT.

LOOP WITH CONTROL TC_SER.

  • CURSOR TC_SER-CURRENT_LINE.

****for dispalying data into TC**

MODULE DATA_TO_TC.

ENDLOOP.

MODULE SELECT OUTPUT.

select name1 from kna1 into itab-name1 where kunnr = kna1-kunnr.

endmodule.

MODULE DATA_TO_TC.

READ TABLE ITAB_TC INDEX TC_SER-CURRENT_LINE.

IF SY-SUBRC = 0.

kna1-name1 = itab1-name1.

endif.

endmodule.

Hope it helps.

Regards,

Sonika

Message was edited by:

Sonika Ahuja

Read only

rodrigo_paisante3
Active Contributor
0 Likes
544

Hi

See this link:

Read only

former_member673464
Active Contributor
0 Likes
544

Hi..

Use demo program <b>demo_dynpro_tabcont_loop_at.</b> for table control modifications.Read table contents and change the table accordingly and then in loop retrieve data required from the data base tables and modify the internal table and use this table for display.

regards,

veeresh

Read only

former_member491305
Active Contributor
0 Likes
544

Hi Choudhuri,

In PAI Event give like thie

LOOP AT it_kna1 into x_kna1.

CHAIN.

FIELD x_kna1-kunnr MODULE get_name ON input.

ENDCHAIN.

ENDLOOP.

MODULE get_name

select name1 from kna1 into x_kna1-name where kunnr = x_kna1-kunnr.

if sy-subrc = 0.

modify it_kna1 from x_kna1 index tc-current_line.

if sy-subrc ne 0.

append it_kna1.

endif.

endif.

endmodule.

Read only

Former Member
0 Likes
544

<b>wat u can do is if the user enter his number and press enter then in the pai can select the name and in pbo that will get displayed.............if facing still some prob........do let me know</b>