cancel
Showing results for 
Search instead for 
Did you mean: 

Currency conversion in PFTC Mail Task

former_member313782
Active Participant
0 Kudos

Hi all,

We have a scenario where we are printing the amount and currency in a mail.

This is being done through the PFTC task.

We are using the variables &BUS2089.PAYOUT& and &BUS2089.CURRENCY&

to print the ampunt and currency. But in case of Hungary currency HUF, the opuput is not coming correctly.

Eg: 10.000 is getting printed as 100.00. Hungary has 3 decimals after the amount.

How to print amount correctly?

Kindly provide your inputs.

Regards,

Jose

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member313782
Active Participant
0 Kudos

I do not have idea how to wrtie code in PFTC task..

I am in change editor of course.. and using the '/:' symbol..

but i am not able to assign values in to the variables declared there.

fo eg: Select single currdec into (variable defined in task) where currkey = &bus2089.currency&.

the variable declared here is not accepting value from select query.

former_member554978
Active Contributor
0 Kudos

Please do a search on how to write code for attributes...

There are lot of threads available..

former_member185167
Active Contributor
0 Kudos

Hello,

Create a new virtual attribute for (Z)BUS2089, call it something like PAYOUT_TEXT.

That's where you have to put the ABAP code to output whatever you want (click on the

"Program" button).

Then you reference &BUS2089.PAYOUT_TEXT& in the Task text.

regards

Rick Bakker

Hanabi Technology

former_member313782
Active Participant
0 Kudos

The value which i have to modify for displaying correctly is this variable right.

So i created a new attribute &zetrvl.amount&. Now i am writing a select query to fetch the decimals from tcurx for which i need to access &BUS2089.currency&. and afte this i need to use the formula as suggested by you.

Correct me if my understanding of your solution in not correct.

Regards,

Jose

former_member554978
Active Contributor
0 Kudos

You ned to modify the value of &BUS2089.PAYOUT&...

So write the custom code before setting the value for &BUS2089.PAYOUT&

former_member313782
Active Participant
0 Kudos

Hi Guys,

The BO is already delegated.

I had created a new attribute for this case as suggested by you.

Now i need to access variables &BUS2089.PAYOUT& and &BUS2089.CURRENCY& in the attribute program code

in order to write the select query on tcurx.

How to achieve this?

Regards,

Jose

former_member554978
Active Contributor
0 Kudos

i think you dont need to create new attribute..

You can write the custom code in the place of std code of &BUS2089.PAYOUT&

Former Member
0 Kudos

You have to write code in your custom Business object which is a subtype of BUS2089 and which ixs delegated to standard Business object BUS2089.

SWO1->Settings->Delegate

Thanks

Arghadip

former_member554978
Active Contributor
0 Kudos

Yes..you can follow what Arghadip has said.....

former_member554978
Active Contributor
0 Kudos

As far as i know..hugary does not have decimals...(Zero decimal place)

You can include the below logic in your attribute for zero decimal places currencies...

1.Read the decimal places from TCURX table for the required currency..

2. if you have an entry in TCURX,multiply the value with 10**(2-TCURX entry).

Then you will get the correct value printed....

former_member313782
Active Participant
0 Kudos

Hi Swaminathan,

Hungary has decimals.

for 100 rs.. we denote as 100.00 right.. but for HUF currency, it is denoted as 100.000.

So the problem i am facing is that in case of the HUF currency.. 10.000 is being printed as 100.00.

Regards,

Jose

former_member554978
Active Contributor
0 Kudos

Check for the decimal places fro HUF in TCURX table...

there it will be 0

Jus implement the logic which i given...it will work

former_member313782
Active Participant
0 Kudos

Hi Swaminathan,,

Please guide me how to write code in the PFTC task.

Regards,

Jose