cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Workflow Task Description field conversion

Former Member
0 Likes
957

Hello everyone,

I have strange problem here with my workflow.

We have workflow for approving incoming invoices. We extend standard BO BUS2081 and create new one ZBUS2081.

In ZBUS2081 we create new Database Field based on field RBKP-RMWWR.

Everything working fine until we extend this workflow for country like Chile - They don't allow to have decimal places in field Gross Invoice Amount, and right now when they insert amount for example : 4 890 CLP it is stored in table RBKP as 48,90 and this value is displayed in all notification from workflow.

Workflow Notification definition and displayed text

Is it possible somehow to convert this value to proper format before sending email in user decision step ?

Accepted Solutions (1)

Accepted Solutions (1)

SandySingh
Active Contributor
0 Likes

hi

you can create a container element and use a background step to change the currency format using following FM


CONVERT_AMOUNT_TO_CURRENCY

CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY'      EXPORTING           date             = sy-datum           foreign_currency = 'USD'           foreign_amount   = '2000.00'           local_currency   = 'EUR'      IMPORTING           local_amount     = amount.

you can write the current amount in required format to a 18 character field and use this character field in task description

Regards

sandy

Message was edited by: Sandy !

Former Member
0 Likes

Hello Sandy,

Thank you for quick answer.

I just want to confirm that your solution helps me to fix this issue.

Answers (3)

Answers (3)

Former Member
0 Likes

Hey Marcin,

You need to convert the amount by checking the current country and move it to TEXT field , which should be choosen as task description field. This is the only way i remember , which i did for multi-country workflow.

Thanks

Rakesh

SandySingh
Active Contributor
0 Likes

Hello ,

Try to use &AMOUNT(T)& in workflow task description. This should remove the commas.

&INCOMINGINVOICE.GROSSINVOICEAMOUNT(T)&

Regards

Sandy

pokrakam
Active Contributor
0 Likes

What you are seeing is the correct internal representation. However the WI text uses the SapScript engine, which is a little ancient.

My guess is that, because it is treating everything as an independent field, there is no currency field to reference, therefore it doesn't know how to convert it. I don't know if there are special mechanisms to make SapScript work with currencies.

Sandy's approach would work. Another quick thing to try is to bind the amount into a standalone text container element of the task and insert that into the text. Binding is more up to date technology than SapScript, and if that doesn't work and you have time I'd report it to SAP.

Let us know what works.

Former Member
0 Likes

Hello Mike,

Thank you for informations. I know that SapScript is a little old

I try your quick solution to bind amount into new text variable in container but value was still displayed incorrectly.