‎2008 Aug 19 8:39 AM
hi
I want the syntax for how to inert the data to the two tables through module pool programming ,please help me
‎2008 Aug 19 8:46 AM
Hi,
Try this.
Create two internal tables of same structure of the DB table.
In the module pgm either you may have a button or press enter to perform this save option. <according to your requirement>
Check the SY-UCOMM according to it, then fill the internal table with the values as given in the module pool pgm.
Then use call function ENQUEUE_E_TABLE to lock the table and use modify stmt.
MODIFY <TABLE NAME> FROM TABLE ITAB1.
then release the lock by calling the function module DEQUEUE_E_TABLE.
Sharin.
‎2008 Aug 20 1:01 PM
hi,
First you create two internal tables same as your tables.
then use
SELECT SINGLE ......Fields..... FROM ...Table...
INTO CORRESPONDING FIELDS OF ITABLE1
SELECT SINGLE ..Fields... FROM table
INTO CORRESPONDING FIELDS OF Itable2
if sy-subrc = 0.
append itable1.
append itable2.
else.
message.....
hope it will help you.
regards,
Lokesh
‎2008 Aug 22 3:26 AM
Hai Dhanunjay,
For example LIFNR is ur field in the database table LFA1 with primary key then define like this,
DATA : LIFNR_CHK TYPE LFA1-LIFNR,
IT_LIFNR TYPE LFA1-LIFNR OCCURS 0,
WA_LIFNR LIKE LINE OF IT_LIFNR.
Now in PAI of ur screen
when u click a button ur coding should be like this ,
CASE SY-UCOMM.
WHEN 'sAVE'.
LIFNR_CHK = ZLFA1-LIFNR.
SELECT SINGLE LIFNR INTO WA_LIFNR FROM LFA1 WHERE LIFNR = LIFNR_CHK.
INSERT ZLFA1.
ENDCASE.
do the same for two tables .
Regards,
Syam