‎2005 Sep 29 9:17 PM
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,
‎2005 Sep 29 9:49 PM
‎2005 Sep 29 9:49 PM
‎2005 Sep 29 11:37 PM
Do you need to explicitly set it? I do see the current line getting incremented along with the internal table index in that loop.
‎2005 Sep 29 11:59 PM
Chandrika,
Check out this link.
http://members.aol.com/_ht_a/skarkada/sap/table_control/table_control.htm
Thanks,
‎2005 Sep 30 12:06 AM
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.
‎2005 Sep 30 3:13 PM
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.
‎2005 Sep 30 3:41 PM
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
‎2005 Sep 30 6:43 AM
Hi Chandrika,
The code you have written should work fine. I would suggest you double-check your screen fields, data declarations etc.
Sudha
‎2005 Sep 30 7:09 AM
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.
‎2005 Sep 30 3:50 PM
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.
‎2005 Oct 03 10:43 PM
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.