on 07-22-2007 4:06 PM
Hi experts,
I have problem in SAP SCRIPT , I want to display currency in the PO currnecy format, How it is possible?
we removed all comas and dots in the currency, now i want to display these values in the particular PO currency format.
hi,
Currency formatting is easy in reports, with the "currency" option in the statement.
But in SAPscript, when no currency reference is set for an amount field, default formatting of two decimal places will occur. This may sometimes be unacceptable -- especially with exceptional currencies like 'JPY', 'KRW', 'LUF', 'TND,' etc. The default formatting affects not only the number of decimal places, but also the position of decimal point, which results in wrong amounts being displayed on the output.
This can be prevented by setting the correct currency reference, using database structures that have amount fields with currency references. The amount has to be populated in a structure's amount field and proper currency key in the currency reference field and then using the structure's amount field in the layout set rather than using a global variable of type P.
(e.g. Use of KOMK-FKWRT for populating the amount and KOMK-WAERK for holding the corresponding currency key. This will use the currency reference relation defined in the structure KOMK.)
NOTE: This formatting works similarly even for the global variables defined with like reference to structure's amount field when the amount field's currency reference field is populated with the required currency key.
Code
Driver Program
* Data Declaration
DATA: NET_AMOUNT LIKE KOMK- FKWRT.
* Code:
KOMK- FKWRT = 234.50.
NET_AMOUNT = 987.65.
KOMK-WAERK = 'JPY'
Layout
&KOMVD-KERT& => The output will be 23450
&NET_AMOUNT& => The output will be 98765
&KOMVD-KERT& would have been printed as 234.50 if the currency key (KOMK-WAERK) were USD and as 23.450 if the currency key (KOMK-WAERK) were TND
regards,
Ashok Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Decalre a variable of type p and move the character format to it.
Ex: Data : amount type p decimals 2.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.