‎2007 Apr 17 2:10 PM
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.
‎2007 Apr 17 2:14 PM
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
‎2007 Apr 17 2:14 PM
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
‎2007 Apr 17 2:38 PM
‎2007 Apr 17 3:01 PM
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
‎2007 Apr 17 5:54 PM
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.
‎2007 Apr 24 3:28 PM
<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>