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: 

table control problem?

Former Member
0 Kudos
72

Hi,

I have to fix one issue in table control.

i have 3 fields into the table control.

user will give values field1 = 100

field2 = 200 when user will give f4 for field3 and select the values from another screen, field1 and field2 is becoming empty.

please suggest on this.

regards,

vijay

1 ACCEPTED SOLUTION

Former Member
0 Kudos
48

If you made the search help by your self first check if you checked field1 and field2 for output or something like that...

DS

3 REPLIES 3

Former Member
0 Kudos
48

Hi,

Seems you have not used chain-endchain in your PAI module.

Also, you need to in the same loop where you use chain-endchain, also move the data from screen to the internal table.

This way, when the user presses f4, the data from screen is first populated to the internal table and then the function code is processed. the same data is again displayed on the screen thru pbo module which gets the data from internal table and shows it on the screen.

<b>Reward if helpful.</b>

Regards,

Pritha.

Former Member
0 Kudos
48

hi

chk this program :

REPORT demo_dynpro_tabcont_loop_at.

CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.

DATA cols LIKE LINE OF flights-cols.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: itab TYPE TABLE OF demo_conn.

TABLES demo_conn.

SELECT * FROM spfli INTO TABLE itab.

LOOP AT flights-cols INTO cols WHERE index GT 2.

cols-screen-input = '0'.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDLOOP.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE read_table_control INPUT.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDMODULE.

MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'TOGGLE'.

LOOP AT flights-cols INTO cols WHERE index GT 2.

IF cols-screen-input = '0'.

cols-screen-input = '1'.

ELSEIF cols-screen-input = '1'.

cols-screen-input = '0'.

ENDIF.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDLOOP.

WHEN 'SORT_UP'.

READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.

IF sy-subrc = 0.

SORT itab STABLE BY (cols-screen-name+10) ASCENDING.

cols-selected = ' '.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDIF.

WHEN 'SORT_DOWN'.

READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.

IF sy-subrc = 0.

SORT itab STABLE BY (cols-screen-name+10) DESCENDING.

cols-selected = ' '.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDIF.

WHEN 'DELETE'.

READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.

IF sy-subrc = 0.

LOOP AT itab INTO demo_conn WHERE mark = 'X'.

DELETE itab.

ENDLOOP.

ENDIF.

ENDCASE.

ENDMODULE.

  • flow logic

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.

ENDLOOP.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

LOOP AT ITAB.

module read_table_control.

ENDLOOP.

module user_command_0100.

Regards,

Prasant

*reward if useful

Former Member
0 Kudos
49

If you made the search help by your self first check if you checked field1 and field2 for output or something like that...

DS