cancel
Showing results for 
Search instead for 
Did you mean: 

Currency Conversion - Logic in Variable

Former Member
0 Kudos

Hi All,


Im working with Currency Conversion in RSCUR transaction, we were using 0CALDAY as time reference but i need to modify this logic, for example:

-The user execute a report and fill a Time Reference variable (for example 01.01.2012)


-Then i have to compare :

          IF ( 0CALDAY date from the current record is LE Time Reference variable )

             Use 0CALDAY date to currency conversion

          ELSE

             Use TIME REFERENCE date to currency conversion

          ENDIF

Any way to apply this logic in Currency Conversion?

Regards !!

Accepted Solutions (1)

Accepted Solutions (1)

former_member186082
Active Contributor
0 Kudos

Hi Marcus,

Create a variable in Bex on 0CALDAY and write exit in CMOD as per your requirement. Now use this created variable in RSCUR under 'Time Reference from Variable'

Regards
Chandu

Former Member
0 Kudos

Hi Chandu,

Thanks a lot but i have a doubt,

If i create a bex variable on 0CALDAY how can i compare the Time reference variable with the 0CALDAY value from every records? Can i get the value of 0calday for every record in CMOD using Exits in order to compare those values? or this has to be done by a virtual key figure?

Regards !!

former_member186082
Active Contributor
0 Kudos

Hi Marcus,

When we maintain 'Source Currency from Data record', each record in the source will be selected and the logic in the exit will be applied where ever the processor come across the values of calday.

Regards

Chandu

Former Member
0 Kudos

Thanks again for your quick response but may be i did not explain very weel, my doubt is :

*From CMOD in Customer Exit Variable, how can i access the 0CALDAY value from every record? because i have to compare the Time Reference Value (bex variable ready for imput) to the 0CALDAY value from every record in order to know which date is the correct date to use in Currency Conversion.

Example:

Time Reference Value (Bex variable Ready For Iimput) : 03/10/2012

Record       0CALDAY                   CORRECT VALUE TO USE IN CURR.CONVERSION

1                03/09/2012              03/09/2012 because 0CADALY is less than 03/10/2012

2                03/11/2012              03/11/2012 because 0CADALY is greather than 03/10/2012

3                03/15/2012              03/11/2012 because 0CADALY is greather than 03/10/2012

Regards !!

Answers (1)

Answers (1)

former_member185132
Active Contributor
0 Kudos

Hi,

I don't see how it can be done using exits, because exits cannot access the query output data. You can try it with Virtual Chars/Key Figs, but that may not be very desirable considering performance.

A third option that might work is below.

First create two currency conversion types. Let's call them CT1 and CT2. When defining CT1 in RSCUR, in the Time Ref tab make it based on 0CALDAY. For CT2, make it based on the "Time Reference variable".

Then in your output, create CKF1 that uses CT1 and another CKF2 that uses CT2. Hide both of them. Create another CKF, which chooses from CKF1 or CKF2 based on the comparison of the dates. It would be something like (Time Ref Var > 0CALDAY )*( CKF2 ) + (Time Ref Var <= 0CALDAY )*( CKF1 )

Regards,

Suhas