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

how to modify data in table control

Former Member
0 Likes
448

hi

i have created table control where i have displayed data into table control

logic used

screen 200

PROCESS BEFORE OUTPUT.

MODULE SELECT_RECORD.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TBC_200'

MODULE TBC_200_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.

LOOP AT IT_MARA

INTO WA_MARA

WITH CONTROL TBC_200

CURSOR TBC_200-CURRENT_LINE.

MODULE TBC_200_GET_LINES.

*&SPWIZARD: MODULE TBC_200_CHANGE_FIELD_ATTR

ENDLOOP.

  • MODULE STATUS_0200.

*

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TBC_200'

LOOP AT IT_MARA.

CHAIN.

FIELD WA_MARA-MATNR.

FIELD WA_MARA-ERSDA.

FIELD WA_MARA-ERNAM.

MODULE TBC_200_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

FIELD WA_MARA-MARK

MODULE TBC_200_MARK ON REQUEST.

ENDLOOP.

MODULE TBC_200_USER_COMMAND.

*&SPWIZARD: MODULE TBC_200_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.

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

module -


MODULE SELECT_RECORD.

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

MODULE SELECT_RECORD OUTPUT.

SELECT MATNR ERSDA ERNAM

FROM MARA

INTO CORRESPONDING FIELDS OF TABLE it_mara.

ENDMODULE. " SELECT_RECORD OUTPUT

and

another thing

i have made field MARA-ERSDA. and FIELD WA_MARA-ERNAM editable by

input possible using layout

so

now those 2 fields contents are editable

i want to know how to edit and save the data

some body guide.

and i want to put the lock so that i can update

can tell how to implement lock.

Thanks

Edited by: viju bangalore on Jan 27, 2011 10:40 AM

2 REPLIES 2
Read only

Former Member
0 Likes
414

Hi,

In the user command of the screen you can put the logic for modifying your internal table from the fields in the table control.

and from that modify the databse table.

Read only

Former Member
0 Likes
414

Hi Viju,

In PAI do something like this


LOOP AT itab.
    MODULE mod_table_control.
ENDLOOP.
MODULE user_command_0100.

at module mod_table_control put this


MODULE mod_table_control INPUT.
  MODIFY itab FROM demo_conn INDEX flights-current_line.
  if sy-subrc ne 0.
       insert itab.
  endif.
ENDMODULE.

for saving you can create at custom gui status with a save button, and at MODULE user_command_0100 save the data.