Skip to Content
0
Dec 22, 2022 at 11:40 AM

Pricing Date in sales return order from Billing

82 Views

Hi, Experts.

I have a simple scenario. I want your help.

My scenario is creating a return sales order from billing doc but I want to get the pricing date from sales order that related to the billing doc.

Please tell me how can I do that from user exist VA01.

I tried this but it didn't work.

DATA : PRCD TYPE VBKD-PRSDT.
DATA : SO TYPE VBRK-XBLNR.
SELECT SINGLE XBLNR INTO SO
  FROM CVBRK
  WHERE XBLNR = vbak-VGBEL.
SELECT SINGLE PRSDT INTO PRCD
  FROM VBKD
  WHERE VBELN = SO.
  IF sy-tcode = 'VA01' or sy-tcode = 'Va02' AND VBAK-AUART = 'ZRET'.
      vbkd-prsdt = prcd.
  ENDIF.<br>

Thank you.