05-05-2016 2:40 PM
Hi masters so ive been able to insert multiple records in 1 database but i am using table control atm im am not sure if table control is able to insert in multiple database since i can only assign 1 loop in in PBO flow logic of that screen or so i know still new to abap
05-06-2016 7:37 AM
Hi,
i will give you a sample code.
In your PAI create one module inside loop internal table.write logic inside the module to update database table.the values which are given inside table control in screen are passed into program by assiging workarea of table control to workarea of corresponding table.then pass the value accordingly.
then use insert or update to reflect these values in database.
PROCESS BEFORE OUTPUT.
LOOP AT IT INTO WA WITH CONTROL TC1.
ENDLOOP.
MODULE STATUS_9000.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
LOOP AT IT.
module update."doubleclick here space will be created in se38 program inside write logic to insert in db
ENDLOOP.
*&---------------------------------------------------------------------*
*& Module update INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE update INPUT.
wa_db1-f1 = wa-f1.
wa_db1-f2 = wa-f2.
wa_db2-f1= wa-f3.
wa_db2-f2= wa-f4.
INSERT zdb1 FROM wa_db1."or use update
INSERT zdb2 FROM wa_db2." por use update
ENDMODULE. " update INPUT
here i have used two database table.likewise we can use any number of database table.
05-05-2016 2:53 PM
hi,
you can create a module and in it you can run loops also you can move data between tables and use modify to update database tables
05-06-2016 7:37 AM
Hi,
i will give you a sample code.
In your PAI create one module inside loop internal table.write logic inside the module to update database table.the values which are given inside table control in screen are passed into program by assiging workarea of table control to workarea of corresponding table.then pass the value accordingly.
then use insert or update to reflect these values in database.
PROCESS BEFORE OUTPUT.
LOOP AT IT INTO WA WITH CONTROL TC1.
ENDLOOP.
MODULE STATUS_9000.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
LOOP AT IT.
module update."doubleclick here space will be created in se38 program inside write logic to insert in db
ENDLOOP.
*&---------------------------------------------------------------------*
*& Module update INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE update INPUT.
wa_db1-f1 = wa-f1.
wa_db1-f2 = wa-f2.
wa_db2-f1= wa-f3.
wa_db2-f2= wa-f4.
INSERT zdb1 FROM wa_db1."or use update
INSERT zdb2 FROM wa_db2." por use update
ENDMODULE. " update INPUT
here i have used two database table.likewise we can use any number of database table.