Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VBKD table not updated while on order change

former_member244346
Participant
0 Kudos

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.

5 REPLIES 5

maulik
Contributor
0 Kudos

MV45AFZZ is a standard old style user exit for SAPMV45A which is the base of VA01 and VA02.

SimoneMilesi
Active Contributor
0 Kudos

Or, in the same include, you can check the Form  SAVE_DOCUMENT_PREPARE

former_member244346
Participant
0 Kudos

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,

0 Kudos

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

0 Kudos

Hello Ramesh,

Paste your code, so that we can look into it for What went wrong.

Regards,

TP