cancel
Showing results for 
Search instead for 
Did you mean: 

Need codes

Aummad
Participant
0 Kudos

Hi,

i am using a FM in the start routine for currency translation which is using a table tcurx for find the decimal.

I need a code if currency is EUR, then dont run the FM. and directly transfer into the bw.

here is the FM.

Currency conversion for CDRETPRI

IF NOT DATAPAK[] IS INITIAL.

LOOP AT DATAPAK INTO S_DATAPAK.

CLEAR V_INDEX.

V_INDEX = SY-TABIX.

IF S_DATAPAK-/BIC/CDRETPRI CO ' 0123456789.'.

CLEAR: V_AMOUNT, V_PRC.

V_AMOUNT = S_DATAPAK-/BIC/CDETPRI.

CALL FUNCTION 'RSAR_CURRENCY_CONVERT'

EXPORTING

I_CURRENCY = S_DATAPAK-CURRENCY

CHANGING

C_AMOUNT = V_AMOUNT.

V_PRC = V_AMOUNT.

S_DATAPAK-/BIC/CDRETPRI = V_PRC.

ENDIF.

*Currency conversion for EFWHLPRCE starts******************

IF S_DATAPAK-/BIC/EFWHLPRCE CO ' 0123456789.'.

CLEAR: V_AMOUNT1, V_PRC1.

V_AMOUNT1 = S_DATAPAK-/BIC/EFNKWHLPRCE.

CALL FUNCTION 'RSAR_CURRENCY_CONVERT'

EXPORTING

I_CURRENCY = S_DATAPAK-CURRENCY

CHANGING

C_AMOUNT = V_AMOUNT1.

V_PRC1 = V_AMOUNT1.

S_DATAPAK-/BIC/EFWHLPRCE = V_PRC1.

ENDIF.

Please help me

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

IF NOT DATAPAK[] IS INITIAL.

LOOP AT DATAPAK INTO S_DATAPAK.

<i><b>CHECK S_DATAPAK-CURRENCY NE 'EUR'.</b></i>

CLEAR V_INDEX.

V_INDEX = SY-TABIX.

IF S_DATAPAK-/BIC/CDRETPRI CO ' 0123456789.'.

CLEAR: V_AMOUNT, V_PRC.

V_AMOUNT = S_DATAPAK-/BIC/CDETPRI.

CALL FUNCTION 'RSAR_CURRENCY_CONVERT'

EXPORTING

I_CURRENCY = S_DATAPAK-CURRENCY

CHANGING

C_AMOUNT = V_AMOUNT.

V_PRC = V_AMOUNT.

S_DATAPAK-/BIC/CDRETPRI = V_PRC.

ENDIF.

*Currency conversion for EFWHLPRCE starts******************

IF S_DATAPAK-/BIC/EFWHLPRCE CO ' 0123456789.'.

CLEAR: V_AMOUNT1, V_PRC1.

V_AMOUNT1 = S_DATAPAK-/BIC/EFNKWHLPRCE.

CALL FUNCTION 'RSAR_CURRENCY_CONVERT'

EXPORTING

I_CURRENCY = S_DATAPAK-CURRENCY

CHANGING

C_AMOUNT = V_AMOUNT1.

V_PRC1 = V_AMOUNT1.

S_DATAPAK-/BIC/EFWHLPRCE = V_PRC1.

ENDIF.

<i><b>MODIFY DATAPAK FROM S_DATAPAK.</b></i>

<i><b>ENDLOOP.

ENDIF.</b></i>

Rgards

Joe

Aummad
Participant
0 Kudos

Hi there,

What happend if the currency is EUR then, how it is work,

Thanks

Former Member
0 Kudos

I think the statement should be CHECK S_DATAPAK-CURRENCY EQ 'EUR'.It should be replaced by EQ instead of NE. If the currency is equals to EUR, execute the FM otherwise, skip (Whatever currency comes in, will be transferred).

thanks.

Wond

Aummad
Participant
0 Kudos

i need to transfer all currency, situation is EUR is not going through the FM, it will transfer without FM.

Thanks

Former Member
0 Kudos

Sorry, if that is the case then NE is correct.

thanks.

Wond