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
301

hi All,

i am not able to pass data into the screen. i have 2 int tables with 1 column each with char length 15 each, i am linking them to sdyn_conn cityto and cityfrom columns .

but its not passing the data, but when i am applying loop to those int tables and giving output to a basic list its is giving correct output.

what may be the reason.

regards

Siddhartha Sengupta

2 REPLIES 2
Read only

Former Member
0 Likes
283

Plz help.

i am giving the whole code.

DATA: BEGIN OF STRUC1,

COL1(18) TYPE C,

END OF STRUC1.

TYPES: BEGIN OF OUT,

GEN(18) TYPE C,

REQ(18) TYPE C,

REP(18) TYPE C,

UNI(18) TYPE C,

END OF OUT.

DATA: T TYPE I value 1,

OK_CODE TYPE SY-UCOMM,

INTTAB TYPE sdyn_conn OCCURS 0 WITH HEADER LINE.

DATA: ITAB LIKE STRUC1,

ITAB3 LIKE STRUC1,

WA1 LIKE STRUC1 OCCURS 0 WITH HEADER LINE,

WA2 LIKE STRUC1 OCCURS 0 WITH HEADER LINE,

WA3 LIKE STRUC1 OCCURS 0 WITH HEADER LINE,

WA4 LIKE STRUC1 OCCURS 0 WITH HEADER LINE,

WA LIKE STRUC1.

CONTROLS TABLE1 TYPE TABLEVIEW USING SCREEN 100.

SELECT-OPTIONS ITAB1 FOR ITAB NO INTERVALS. "REQUESTED

SELECT-OPTIONS ITAB2 FOR WA NO INTERVALS. "GENERATED

LOOP AT ITAB1.

ITAB3 = ITAB1-LOW.

APPEND ITAB3 TO WA1.

ENDLOOP.

LOOP AT ITAB2.

ITAB3 = ITAB2-LOW.

APPEND ITAB3 TO WA2.

ENDLOOP.

.

LOOP AT WA1.

perform compare TABLES wa1 WA2 wa3 wa4.

ENDLOOP.

LOOP AT WA3.

WRITE 😕 'REPEATED =', WA3.

ENDLOOP.

LOOP AT WA4.

WRITE 😕 'UNIQUE =', WA4.

ENDLOOP.

CALL SCREEN 100.

&----


*& Form compare

&----


  • text

----


  • -->P_WA1 text

----


FORM compare TABLES P_WA1 P_WA2 p_wa3 p_wa4.

data: y type c value '',

p type i value 1.

loop at P_wa2.

if p_wa1 CS P_wa2.

APPEND P_WA1 TO P_WA3.

else.

t = 0.

endif.

endloop.

if t = 0.

loop at p_wa3.

if p_wa1 co p_wa3.

p = 1.

else.

p = 0.

endif.

endloop.

if p = 0 OR P_WA3 IS INITIAL.

append p_wa1 to p_wa4.

endif.

endif.

ENDFORM. " compare

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'STATS1'.

SET TITLEBAR 'COMPARISON'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE TO SCREEN 0 .

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module PUT_DATA INPUT

&----


  • text

----


MODULE PUT_DATA INPUT.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " PUT_DATA INPUT

&----


*& Module GET_DATA OUTPUT

&----


  • text

----


MODULE GET_DATA OUTPUT.

LOOP AT WA3.

INTTAB-CITYTO = WA3-COL1.

ENDLOOP.

LOOP AT WA4.

INTTAB-CITYFROM = WA4-COL1.

ENDLOOP.

ENDMODULE.

and this is the code in FLOW LOGIC.

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

LOOP WITH CONTROL TABLE1.

MODULE GET_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

loop WITH CONTROL TABLE1.

module put_data.

endloop.

please help urgently.

Read only

0 Likes
283

Sid,

I am assuming from your code thus far that your table control has 2 columns attached to an internal table called INTTAB (if I were to view the table control in Screen Painter)?

If so, you are appending values into this int table.

So add this add in your PBO module...

&----


*& Module GET_DATA OUTPUT

&----


  • text

----


MODULE GET_DATA OUTPUT.

LOOP AT WA3.

INTTAB-CITYTO = WA3-COL1.

append inttab. " <---- HERE

ENDLOOP.

LOOP AT WA4.

INTTAB-CITYFROM = WA4-COL1.

append inttab. " <---- HERE

ENDLOOP.

ENDMODULE.