01-02-2007 6:52 AM
HI All ,
I am creating a transaction with 2 screens.the 2nd screen displays the list of a dbtable according to some of the selections made on the 1st screen. In my 2nd screen I want to provide the option to the user to update the db table with a new row. Can anyone guide me in solving the problem?
Thanks in Advance ...
Ranjita
01-02-2007 7:03 AM
Provide the option to insert a new row in the table control and append this row to the corresponding internal table in the PAI of the screen. When the Save button is clicked. modify the database table from the internal table using the MODIFY statement.
Regards,
Manoj
01-02-2007 7:17 AM
Thanks Manoj,
I have already provided the options to create an empty row in the tab con. As I am new to the table control operations can I get some sample codes on what you explained ...esp the appending part ...
01-02-2007 7:18 AM
Thanks Manoj,
I have already provided the options to create an empty row in the tab con. As I am new to the table control operations can I get some sample codes on what you explained ...esp the appending part ...
01-02-2007 7:22 AM
You can use the following code in the PAI of the screen.
LOOP AT itab.
MODULE modify_from_screen.
ENDLOOP.
MODULE modify_from_screen INPUT.
MODIFY itab FROM wa INDEX tctrl-current_line.
IF sy-subrc NE 0.
APPEND wa TO itab.
ENDIF.
ENDMODULE.
itab - The Internal table.
wa - The name of the structure on the screen
tctrl - Name of the table control
Use this itab to save to your database table using the statement:
MODIFY dbtab FROM TABLE itab.
Regards,
Manoj
01-02-2007 8:45 AM
02-15-2007 12:08 PM