Skip to Content
0
Former Member
Jul 03, 2009 at 07:51 PM

Copying the purchanse order no. with ref to quote via item selection

71 Views

Hi Gurus!

I want to copy the PO number from the quote to the sales order when a sales order is created with refernec to a quote. SO I used a user exit and added down a code for it.

IF sy-ucomm = 'UEBR'. 
  SELECT SINGLE * FROM vbkd INTO wa_vbkd
         WHERE vbeln = vbak-vgbel.
  IF sy-subrc = 0.
    vbkd-bstkd = wa_vbkd-bstkd.
  ENDIF.
ENDIF.
ENDIF.

The code works perfect when I create a sales order with refernce to quote and hit the copy button at bottom , the PO gets copied over. But when I click on teh item selectiion button and then select the item and then hit tye copy button the PO number dosent get copied.

Is there something missing in my code which si preventing it to get copied when I go through teh item selection.

Please suggest.

Thanks