Skip to Content
avatar image
Former Member

How to read row values in customer exit

Hi guys,

I need a report with the Exch Rate to MXN for a specific month (0P_PER3). This is one of the variables where I will filter the report (including year, version, etc).

I can obtain the value of the month and the other required variables with the following code:

Ex:

WHEN 'ZEXC_RATE'.

IF I_STEP = 2.

...

LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = '0P_PER3'.

month = LOC_VAR_RANGE-LOW.

ENDLOOP.

...

SELECT SINGLE * FROM TCURR

WHERE KURST = RATE_TYPE

AND FCURR = ????

AND TCURR = 'MXN'

AND GDATU = l_date.

IF SY-SUBRC eq 0.

  • ZTC_1001 = TCURR-UKURS.

L_S_RANGE-LOW = TCURR-UKURS.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

APPEND L_S_RANGE TO E_T_RANGE.

EXIT.

ENDIF.

However I dont know how to specify the FCURR (This currency may be different for each row).

Is there a way to read the current value of the current row, or is it limited to variables?

Just in case you were wondering why I dont use the class conversion, the reason is the following:

I need the cummulated value (balance) to a specific month in local currency and in MXN (Mexican pesos).

If I use the class conversion it applies a different exch rate for each month, wether I just want to apply the total to the actual exch rate. Even if the posting period is not included (internally it does the the following calculus)

let me clarify:

Month____LC________________Exc Rate__MXN

-


Jun______ 518,184.24 BRL_____6.407_____3,319,902.79 MXN

Jul_______-8,235.48 BRL______6.442_____-53,049.67 MXN

Ago______-509,948.76 BRL____6.254_____-3,189,066.56 MXN

Balance AGO___0.00 BRL______________77,786.56 MXN (nonsense!)

Expected 0.00 BRL = 0.00 MXN

I tried using another column with constant selection for the current month and dividing MXN by LC to obtain the same exc rate for all the months and then use a formula to multiply. IT worked, however if the last month had value 0, then the exc. rate would not be obtained, thus not for the cummulated.

Any ideas, help or creative work around to solve this issue will be rewarded.

Thanks,

David Guerra

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 10, 2008 at 08:58 AM

    It does not help but a variable customer exit will only influence other variables and not each row in the report.

    You could change using an enhanced version of the table class to modify each row of a query as long as it is a WT 3.x (not 7.0).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks for all your help.

      I solved it another way. I created another conversion type in RSCUR.

      -> In time Ref: Fixed Time Reference

      -> Time Reference from Variable: 0DAT Current Calendar Day (SAP Exit)

      I used this conversion instead of the original and it uses the last conversion defined before todays date for all the posting periods.