cancel
Showing results for 
Search instead for 
Did you mean: 

Currency to be copied from sales document for VEVE delivery document

0 Kudos
  • As per SAP standard behaviour, currency in the VEVE delivery document is getting picked from the company code when created through handling unit transaction - /n/USEE/SOMA_VEVE_HU and currency from the sale order is getting copied to VEVE delivery document when created through VL01n transaction.
  • Business requirement is to get the currency of the sale order to get copied to VEVE delivery document when created through handling unit transaction code - /n/USEE/SOMA_VEVE_HU.
  • This change should be specifically only for the sales organizations – 5451 and 2451.
  • The reason for this change is that customer requested that currency should be the same for sales document and delivery document when created through handling unit transaction code.Expected currency is 'USD' and value only .
  • Please help me to resolve this issue as this is very urgent.

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

Could you please let me know is there any standard configuration involved to copy the currency from sales order to handling unit delivery.

0 Kudos

After making changes in 'VL02N' for currency it is not reflecting in 'VL03N' display.(The above logic is written for vl02n to change currency)

JL23
Active Contributor
0 Kudos

Coding questions should be asked with the tag Abap Development.

I wonder what you want update with VL03N, which is a display transaction. VL02N would make much more sense.

0 Kudos

Thank you for your quick reply,

Technically i have implemented the code in MV50AF0P_PRICING_SUBSCREEN_SET for vl02n t-code as below but it is not working as expected as currency is showing as USD but the currency value when converting from 'EUR' to 'USD' value is not calculating correctly or not saving when 'VL03N' display. Could you please help me to correct this code or any ehhancment point if am wrong.

if likp-vkorg eq '5451' or likp-vkorg eq '2451'.

DATA: lv_vbelv TYPE vbfa-vbelv,
lv_waerk TYPE vbak-waerk.

CONSTANTS: lc_waerk_usd TYPE likp-waerk VALUE 'USD'.
FIELD-SYMBOLS: <fs_komp> TYPE komp,
<fs_komv> TYPE komv.

CLEAR: lv_vbelv,
lv_waerk.
* Get the corresponding sales order from the delivery
SELECT vbelv
FROM vbfa
into lv_vbelv
UP TO 1 rows
WHERE vbeln eq likp-vbeln.
ENDSELECT.
IF NOT lv_vbelv IS INITIAL.
* Get the sales order currency based on the sales order
SELECT SINGLE waerk
FROM vbak
INTO lv_waerk
WHERE vbeln eq lv_vbelv.
ENDIF.

IF NOT lv_waerk IS INITIAL.
* Change the header currency key
tkomk-waerk = lv_waerk.
ENDIF.

LOOP AT tkomp ASSIGNING <fs_komp>.
* Change currency amount
CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY'
EXPORTING
date = likp-erdat
foreign_currency = likp-waerk
foreign_amount = <fs_komp>-netwr
local_currency = lc_waerk_usd
IMPORTING
local_amount = <fs_komp>-netwr.
ENDLOOP.
IF <fs_komp> IS ASSIGNED.
UNASSIGN <fs_komp>.
ENDIF.

LOOP AT tkomv ASSIGNING <fs_komv>.
* Change currency amount
CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY'
EXPORTING
date = likp-erdat
foreign_currency = likp-waerk
foreign_amount = <fs_komv>-kwert
local_currency = lc_waerk_usd
IMPORTING
local_amount = <fs_komv>-kwert.
* Change the currency key
IF NOT <fs_komv>-waers IS INITIAL AND NOT lv_waerk IS INITIAL.
<fs_komv>-waers = lv_waerk.
ENDIF.
ENDLOOP.
IF <fs_komv> IS ASSIGNED.
UNASSIGN <fs_komv>.
ENDIF.

ENDIF.
ENDIF.

Thank you.

JL23
Active Contributor
0 Kudos

VEVE is an add-on, I guess you have to ask this question the supplier of this add-on to get urgent help.

As you say that you want this function only for specific sales organizations I bet it is anyway something that you have to influence yourself using enhancements.