08-04-2008 12:06 PM
i have 3 fields in my ztable zvxxallocobj. i have to append the values of these 3 fields into Vbap table.using the user exit
USEREXIT_SOURCE_DETERMINATION .
how can i write logic for this inside the user exit.
plz provide me some inputs.
VKORG,VTWEG,SPART,MATNR,KDGRP,KUNNR are the primary keys in my Ztable.
any rought inputs will be enough
Regards.
08-04-2008 12:15 PM
Hi,
Use select query to get the values from the ztable into an internal table .
Now loop at this internal table and use Insert statement to insert the same values into the database table.
Hope this will help.
Regards,
Swarna Munukoti
08-04-2008 12:16 PM
Hi,
I hope the following link will help you,
https://forums.sdn.sap.com/click.jspa?searchID=14807299&messageID=4010983
Regards,
Harish
08-04-2008 12:17 PM
Hi,
I hope the following links will help you,
https://forums.sdn.sap.com/click.jspa?searchID=14807299&messageID=4010983
https://forums.sdn.sap.com/click.jspa?searchID=14807299&messageID=3097450
Regards,
Harish
08-04-2008 12:21 PM
hi,
u need to read the ztable with the sales orderno of ur current sale order and other details and then modify the ztable with the sales order details,
modify dbtab from inttab.
Regards,
Sumanjeet.
08-04-2008 1:16 PM
Hello Pavan,
In the user-exit, retrive the required date using SELECT stmt into and itab and use the stmt,
INSERT <target> FROM TABLE <itab> [ACCEPTING DUPLICATE KEYS].
to insert them into the vbap table.
e.g.:
SELECT <fields>
FROM zvxxallocobj
INTO <itab>
WHERE <condition>.
if sy-subrc eq 0.
INSERT vbap
FROM <itab>
ACCEPTING DUPLICATE KEYS.
endif.
p.s.: If the system is able to insert all of the lines from the internal table, SY-SUBRC is set to 0. If one or more lines cannot be inserted because the database already contains a line with the same primary key, a runtime error occurs. You can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS. In this case, the lines that would otherwise cause runtime errors are discarded, and SY-SUBRC is set to 4.
Regards
Indu.