Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to handle amount based on currency key and pass it to an internal table

Former Member
0 Kudos

Hi Experts,

I have a problem with currency key format.

In RBKP, a record/document is stored in USDN currency with value 600,00000 in the amount(RMWWR).

When I fetch this record in my program's internal table, the amount field, which is of type RMWWR, gets stored as 600000.00.

I am moving this value to my final table where the amount field is of type WRBTR( same as RMWWR)

but the value gets downloaded as 600000.00 instead of 600,00000.

So the amount gets mismatched as the decimal places are not properly handled.

I have to simply pass this value to a file to be downloaded to an application server.

I have tried using like this but it is not working:

wa_final-rmwwr = <fs_rbkp>-rmwwr.

WRITE: wa_final-rmwwr CURRENCY <fs_rbkp>-waers.

append wa_final to t_final

How to move an amount field to an work area and subsequently pass the work area in the internal table using currency key?

Regards,

Sangeeta.

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

Try with this FM - SD_CONVERT_CURRENCY_FORMAT

5 REPLIES 5

amit_khare
Active Contributor
0 Kudos

Try with this FM - SD_CONVERT_CURRENCY_FORMAT

0 Kudos

Hi Amit,

It is not working.

Regards,

Sangeeta.

Edited by: Sangeeta on Mar 6, 2009 10:49 AM

0 Kudos

Did you try by taking this field as CHAR type - wa_final-rmwwr. Comment WRITE when checking.

0 Kudos

Hello,

I think you need to replace this stmt:

" wa_final-rmwwr = <fs_rbkp>-rmwwr

WRITE <fs_rbkp>-rmwwr TO wa_final-rmwwr CURRENCY <fs_rbkp>-waers

Hope this helps.

BR,

Suhas

PS: If you check, both RMWWR & WRBTR have the same domain WERT7. Can you plz check both the internal table definitions?

Edited by: Suhas Saha on Mar 6, 2009 10:57 AM

0 Kudos

Hi Suhas and Amit,

Yeah..I did that using a character variable.

Please tell me if I want to do any manipulation in the amount field(adding the amounts of a document), should I convert the amount to its currency key type field first and then manipulate or should I add them and then convert the total amount.

I have to add the line item amounts and display them individually and also I have to display their total value. So should I convert first and then do the additions or first do the additions and then convert.

Regards,

Sangeeta.