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

Former Member
0 Likes
911

Hi All,

I have defined a table control using wizard. Table control is based on a ABAP internal table (G_DELIVERY_DATA_ITAB

) and I have defined a explicit work area (G_DELIVERY_DATA_WA) for the internal table. I have data populated in the internal table and in the PBO I am using the following statement to move the data to the screen.

LOOP AT G_DELIVERY_DATA_ITAB

INTO G_DELIVERY_DATA_WA

WITH CONTROL DELIVERY_TAB

CURSOR DELIVERY_TAB-CURRENT_LINE.

ENDLOOP.

I can see that G_DELIVERY_DATA_WA gets the data from the internal table in the above loop ( and my screen fields are defined as G_DELIVERY_DATA_WA-VBELN, G_DELIVERY_DATA_WA-POSNR etc..) but I don't see them on the screen.

Please let me know what could be causing this problem?

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
890

Have you set DELIVERY_TAB-CURRENT_LINE?

Rob

10 REPLIES 10
Read only

Former Member
0 Likes
891

Have you set DELIVERY_TAB-CURRENT_LINE?

Rob

Read only

0 Likes
890

Do you need to explicitly set it? I do see the current line getting incremented along with the internal table index in that loop.

Read only

0 Likes
890
Read only

Former Member
0 Likes
890

you can use following psuedo code

i think u cant define screen fields with WA rather define them as G_DELIVERY_DATA_ITAB-fieldname.

LOOP AT G_DELIVERY_DATA_ITAB WITH CONTROL TCTRCL.

MODULE DISPLAY.

ENDLOOP.

MODULE DISPLAY OUTPUT.

READ TABLE G_DELIVERY_DATA_ITAB INDEX TCTRCL-CURRENT_LINE

TRANSPORTING NO FIELDS .

ENDMODULE.

Read only

0 Likes
890

I changed the screen fields to point to G_DELIVERY_DATA_ITAB-fieldname and tried the below code.

Still doesn't work. I can see the internal table header line has all the data in module DISPLAY, but the screen shows up blank after this PBO code.

LOOP AT G_DELIVERY_DATA_ITAB WITH CONTROL TCTRCL.

MODULE DISPLAY.

ENDLOOP.

MODULE DISPLAY OUTPUT.

READ TABLE G_DELIVERY_DATA_ITAB INDEX TCTRCL-CURRENT_LINE

TRANSPORTING NO FIELDS .

ENDMODULE.

Read only

0 Likes
890

Hi

If you have define your screen fields as G_DELIVERY_DATA_WA, in PBO module you should write

READ TABLE G_DELIVERY_DATA_ITAB INTO G_DELIVERY_DATA_WA

INDEX TCTRCL-CURRENT_LINE.

IF SY-SUBRC <> 0. CLEAR G_DELIVERY_DATA_WA. ENDIF.

instead of

READ TABLE G_DELIVERY_DATA_ITAB INDEX TCTRCL-CURRENT_LINE

TRANSPORTING NO FIELDS .

If you have define your screen fields as G_DELIVERY_DATA_ITAB, it's useless the statament

READ TABLE G_DELIVERY_DATA_ITAB INDEX TCTRCL-CURRENT_LINE

TRANSPORTING NO FIELDS

Max

Message was edited by: max bianchi

Read only

Former Member
0 Likes
890

Hi Chandrika,

The code you have written should work fine. I would suggest you double-check your screen fields, data declarations etc.

Sudha

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
890

Hi,

Check the link.In this, I am handling Table control without wizard.It will help you.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table control in abap.pdf

Kindly reward points by clicking the star on the left of reply,if it helps.

Read only

Former Member
0 Likes
890

why are u using 'transporting no fields' to your read statement?

transporting no fields will not place the required contents in the workarea and hence in the screen fields which u defined same as the work area.

Read only

0 Likes
890

Thanks all for your helpful answers. I have given points to all of you.

I did solve the problem. All I did is delete the table control from the screen and add it back using the wizard and it works now. I don't know what was causing the problem since the table control definition and PBO logic is the same as before.