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: 

modify data in the table control

Former Member
0 Kudos
88

hello:

i would like to ask a favor , i am working with a table control (it already has the information i need) all the fields all my table control are present in output form only, but i need when the user press a pushbutton to modify a specific data one of the cell of the table control permit to be change.

my output is:

field1 field2 field3 (only output )

if the user press the button 'CHANGE DATA' it will be present as

field1 field2 fiel3(ready to recibe new data ).

but i don´t know how to do it, if somebody knows how to do it

thanks a lot.

2 REPLIES 2

Former Member
0 Kudos
55

Hi,

It is easy to do so.

In the PAI, write a module for user command, and in the module, set a flag to X if you hit the modify or change button.

In the PBO table contol loop, write a module to change the screen attributes and in the module, if the flag is X, then change the screen-input attribute X if the screen-name is field3, and use modify screen.

So that when you hit the change button, it goes into change mode.

Let me know if you need any clarification.

--points if helped.

Former Member
0 Kudos
55

this will be your's main program

&----


*& Report ZEMP

*&

&----


*&

*&

&----


REPORT ZEMP.

TABLES: ZEMP." Z TABLE

CONTROLS: TAB_CONTROL TYPE TABLEVIEW USING SCREEN 1000.

DATA: IT LIKE ZEMP OCCURS 0 WITH HEADER LINE.

SELECT * FROM ZEMP INTO CORRESPONDING FIELDS OF TABLE IT.

CALL SCREEN 1000.

&----


*& Module STATUS_1000 OUTPUT

&----


  • text

----


MODULE STATUS_1000 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_1000 OUTPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


MODULE USER_COMMAND_1000 INPUT.

IF SY-UCOMM = 'BACK'.

LEAVE PROGRAM.

endif.

ENDMODULE. " USER_COMMAND_1000 INPUT

&----


*& Module MODIFY INPUT

&----


  • text

----


MODULE MODIFY INPUT.

MODIFY IT INDEX TAB_CONTROL-CURRENT_LINE.

MODIFY ZEMP FROM IT.

ENDMODULE. " MODIFY INPUT

and this should be your flow logic

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

LOOP AT IT WITH CONTROL TAB_CONTROL.

ENDLOOP.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

LOOP AT IT.

MODULE MODIFY.

ENDLOOP.

Regards

Prakash Varun