Application Development 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: 

Hi everyone

Former Member
0 Kudos

I need to data from one table control from screen say 100 to another table control in screen say 200.

Any help would be greatly appreciated

waiting for your replies.

Suchitra

6 REPLIES 6

Former Member
0 Kudos

In se51, when you create a table control, you get the data from the program(In the layout editor screen).

Use the same internal table for both table controls,

Regards,

Sampath

Former Member
0 Kudos

if you have the same field names for both the TC then use the same PBO logic for both of them. the only thing that would change is the TC number. (TC1 and TC2).

screen 3000.

*PBO.

loop at int_table with control TC1 cursor tc1-current_line.

  • read int_table index TC1-current_line.

  • logic for filllng scr fields wit your int_table fields

  • for convenience use same field names so that you can

  • just do a move-correspoinding

endloop.

screen 3010.

loop at int_table with control TC2 cursor tc2-current_line.

  • read int_table index TC2-current_line.

  • logic for filllng scr fields wit your int_table fields

  • for convenience use same field names so that you can

  • just do a move-correspoinding

endloop.

0 Kudos

Hi KP,

THANKS FOR YOUR CAN YOU BE LITLE BIT MORE SPECIFIC REGARDING THE MOVE STATEMENT.

WAITING FOR YOUR REPLY

SUCHITRA

Former Member
0 Kudos

Hi suchitra,

Its pretty simple..

I am sure you are displaying the contents of the internal table in the table control in screen say 100.

Now all you have to do in <b>use the same internal table</b> for table control in screen 200.

All the code remains the same..

In case, you have a problem in table control...

here is the sample code..

Screen Flow Logic

******************

----


  • Screen 200: Flow Logic *

&----


PROCESS BEFORE OUTPUT.

MODULE STATUS_0200.

LOOP AT INT_FLIGHTS WITH CONTROL FLIGHTS

CURSOR FLIGHTS-CURRENT_LINE.

MODULE DISPLAY_FLIGHTS.

ENDLOOP.

*

*

PROCESS AFTER INPUT.

LOOP AT INT_FLIGHTS.

MODULE SET_LINE_COUNT.

ENDLOOP.

MODULE USER_COMMAND_0200.

ABAP Code

**********

The following PBO module transfers internal table fields to the proper screen table fields at PBO.

&----


*& Module DISPLAY_FLIGHTS OUTPUT

&----


MODULE DISPLAY_FLIGHTS OUTPUT.

SFLIGHT-FLDATE = INT_FLIGHTS-FLDATE.

SFLIGHT-PRICE = INT_FLIGHTS-PRICE.

SFLIGHT-CURRENCY = INT_FLIGHTS-CURRENCY.

SFLIGHT-PLANETYPE = INT_FLIGHTS-PLANETYPE.

SFLIGHT-SEATSMAX = INT_FLIGHTS-SEATSMAX.

SFLIGHT-SEATSOCC = INT_FLIGHTS-SEATSOCC.

ENDMODULE.

At PAI, the program must loop again, to transfer screen table fields back to the program. During this looping, the program can use SY_LOOPC to find out how many rows were transferred. SY_LOOPC is a system variable telling the total number of rows currently showing in the display.

&----


*& Module SET_LINE_COUNT INPUT

&----


MODULE SET_LINE_COUNT INPUT.

LINE-COUNT = SY-LOOPC.

ENDMODULE

Regards,

Tanveer.

Please mark helpful answers.

0 Kudos

Hi Tanveer,

ihave screen no's 100 and 200. when i go to screen 100 and press new i go to screen 200.

when i update tablecontrol in screen 200 and use back button to come back to screen 100 , the data that has been updated in screen 200 has to be displayed in screen 100.

I hope you can help me out.

suchitra

0 Kudos

Hi suchitra,

When you first come to screen 100, it shall have no data.

When you go to screen 200, you would populate the data in the table control, get the contents into an internal table..

Use that internal table to populate the table control in screen 100.

Refer to help.sap at this link...

http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

Also refer to sample programs on table control in transaction ABAPDOCU.

Hope that helps ...

Regards,

Tanveer.

Please dont forget to mark helpful answers..

Hi suchitra,

Is your doubt resolved? Any help required?

Let me know..

Message was edited by: Tanveer Shaikh