07-15-2015 7:11 PM
Hi Experts,
I have a requirement to update the VBKD table while we are going change the order line item.
Means when we create a new order with line item number the header label only getting update in VBAD along with VBAK and VBAP table's.
In header label update in VBKD table value will be in field posnr = 000000.
While we go for a item label change the VBKD table will update like Posnr = 10,20,30......
But in VA01 and VA02 in our system have done customized two tab name as a Additional A and Additional B in Additional B tab sales district field is there VBKD-BZIRK if we go for change sales district field value its not updating in VBKDtable but its updating in VBAP- ZZBZIRK field.
So below logic i need to write fr this requirement.
Compare the value of VBAP-ZZBZIRK with VBKD-BZIRK,
If the values are same, no actions needs to be taken,
If the values are different, check already entry is available in VBKD-POSNR for VBAP-POSNR.
Entry is available in VBKD, change the value of VBKD- BZIRK filed value with VBAP-ZZBZIRK. The entry is not available insert the new entry with VBKD-POSNR with VBAP-POSNR, copy all the field values except VBKD-BZIRK, move the VBAP-ZZBZIRK filed value to VBKD-BZIRK.
Anybody can help me for this requirement where i need to write logic and find below attachment for VA02 additional tab's.
Thanks.
07-15-2015 7:33 PM
MV45AFZZ is a standard old style user exit for SAPMV45A which is the base of VA01 and VA02.
07-16-2015 7:46 AM
Or, in the same include, you can check the Form SAVE_DOCUMENT_PREPARE
07-16-2015 8:33 PM
Hi Guys,
I am appreciate your valuable suggestion, Can you help me in these user exit's inside what logic i should write for my requirement bcoz i tried many way i am facing issue with VBKD table updation.
Please look my original post for requirement details.
Thanks,
07-17-2015 9:53 AM
My suggestion:
Form SAVE_DOCUMENT_PREPARE
You got internal tables XVBAP and XVBKD
->loop xvbap
read xvbdk with vbeln/posnr
if found->update XVBKD
else
insert XVBKD
endloop.
PAY ATTENTION TO UPDKZ field!
XVBKD got UPDKZ field which tells to SAP if a record is updated (U) or new (I) and should be setted.
Even more, if you are Updating a row, you should previously append the original one in YVBKD (or corresponding one Y...) table.
Hope this can help.
But, outside the correct Userexit / Form to use (which you know only with experience or googling a bit...), i think the logic is pretty basic!
You should study a bit more about dev logic and how to manage data in SAP
07-17-2015 11:54 AM
Hello Ramesh,
Paste your code, so that we can look into it for What went wrong.
Regards,
TP