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

HI EXPERTS

Former Member
0 Likes
367

HI GUYS

I have a doubt, can we display the internal table (fields from many tables) in table control. For example internal table as follows.

DATA : BEGIN OF itab OCCURS 0,

TDDAT LIKE VBEP-TDDAT,

DWERK LIKE AFPO-DWERK,

WEMNG LIKE AFPO-WEMNG,

PSMNG LIKE AFPO-PSMNG,

KUNNR LIKE VBAK-KUNNR,

PLNBEZ LIKE AFKO-PLNBEZ,

STLBEZ LIKE AFKO-STLBEZ,

END OF ITAB.

Thanks in advance.

Regards

Rajaram

HI GUYS

I have a doubt, can we display the internal table (fields from many tables) in table control. For example internal table as follows.

DATA : BEGIN OF itab OCCURS 0,

TDDAT LIKE VBEP-TDDAT,

DWERK LIKE AFPO-DWERK,

WEMNG LIKE AFPO-WEMNG,

PSMNG LIKE AFPO-PSMNG,

KUNNR LIKE VBAK-KUNNR,

PLNBEZ LIKE AFKO-PLNBEZ,

STLBEZ LIKE AFKO-STLBEZ,

END OF ITAB.

Thanks in advance.

Regards

Rajaram

1 REPLY 1
Read only

Former Member
0 Likes
334

HI

You need to use both PBO as well PAI ,loop endloop,then only data will come

pbo.
loop at it_kna1 with control tbl2.
endloop.


PAI
loop at it_kna1.
endloop.

follow these steps for implemeting table control in module pool program.

1) Declaration of table control in the module pool program

syntax

CONTROLS <name> TYPE TABLEVIEW USING SCREEN <screen number>.

here name----> table control name( give you as per your needs)

screen number---->provide in which screen you design table control

2) Desiging table control on screen.

to design table control on the screen, you need SE51(screen painter) here click on TABLE in control bar and place it on the screen . you can adjust the length and width of the table control.

name the table control (here you need to use the same name which you have used for declaration of table control in module pool program.

3) passing data to table control.

you need to code a LOOP statement in both PBO and PAI event of the screen.

with LOOP statement ypu can transfer data from program to table control and table control to program.

 

PBO.
 
LOOP AT <internal table> WITH CONTROL CURSOR < scroll variable>.
module assign.
ENDLOOP.
 
PAI.
LOOP AT <internal table>.
ENDLOOP.
 
<b>in module poop program.</b>
 
module assign.
**sample code.
kna1-kunnr = itab-kunnr.
kna1-name1 = itab-name1.
kna1-ort01 = itab-ort01.
endmodule.

the tableview has few importent fields like..

LINE----> number of displayable rows in a table.

TOP_LINE----> the row of table where the screen dispalys start.

CUREENT_LINE----> the row currently being placed inside LOOP.

Check these links

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm