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: 

Change the Customer PO Type VBKD-BSARK

Former Member
0 Kudos

Hi,

I have requirement where I need to clear the values entered in the PO Type field in the PO Data tab of VA01/02. So whatever the user enters in this field, if they press the Save button, should not get saved. I tried to clear the values in XVBKD-BSART in the exit : userexit_save_document_prepare, but it did not work.

Does anyone know how I can handle this?

Regards,

K!

11 REPLIES 11

Former Member
0 Kudos

Hi Kaustubh,

You have to set the update field XVBKD-UPKDZ = 'U' to update the record before save in the user exit. Let us know if you already did it with some more description of the problem.

Giri..

0 Kudos

Yes the UPDKZ flag is already set to 'U' as I have already tried to change the PO type.. I just need that, this BSARK field should not get updated to the value which the user has tried to enter but should be changed to initial.

XVBKD has:

BSARK UPDKZ

TELE U

I changed it to

BSARK UPDKZ

U

Regards,

Kaustubh

0 Kudos

I am sorry the field is UPDKZ not UPKDZ...Clear the required field and change the field from UPDKZ = 'I' to UPDKZ = 'U'.

0 Kudos

Can you copy paste you code so that I'll have a better understanding and can see where its going wrong...

0 Kudos

LOOP AT xvbkd where updkz = 'U'.

CLEAR xvbkd-bsark.

MODIFY xvbkd.

ENDLOOP.

0 Kudos

Kaustub,

The code below should work fine for VA02 item level. Means when you change the purchase order type at the item level it will work as desired. To make it work at the header level check if the field is open at the header level in your system. If the field is open and it is mannually changed even the header record will have U in the xvbkd and the code below should work fine. If the field is not open you should find a SAP note to open the field at the header level or else you should control it from config.

LOOP AT xvbkd where updkz = 'U'.

CLEAR xvbkd-bsark.

MODIFY xvbkd.

ENDLOOP.

If you want to restrict at the sales order creation level VA01 I am sure your code will not work either at header level or Item level. You might need to modify the code if that is desired..

Giri..

Giri..

0 Kudos

Giri,

We are changing the header level fld, and it gets updated at the detail level on it own. these are values that XVBKD has

MANDT VBELN POSNR UPDKZ BSARK

208 |0000047066|000000 |U |ZUS1 |

208 |0000047066|000010 |U |ZUS1 |

I have added the code which I had mentioned, still when I open the order the next time, it has the value ZUS1 in it..

For VA01, I understand my code would not work...

Regards,

Kaustubh

0 Kudos

I got your point. Are you mannually able to change the PO type at the header level while you are in VA02 transaction? If that is possible your code will work otherwise it wont. To open that field you should find an appropriate note is SAP.

Giri.

0 Kudos

yes we are manually able to change the PO type at the header level in VA02. I just enter PO type there, but would like it to be cleared when I save it,

Regards,

Kaustubh

0 Kudos

I think i got it, it also updates VBAK-BSARK with the same value, and somewhere after the user-exit there is a code: if VBKD-BSARK is initial. then VBKD-BSARK = VBAK-BSARK.

So I guess I need to also clear the value in VBAK-BSARK..

0 Kudos

?