on 09-27-2007 4:58 AM
hi all,
need advice from you guys.
my code in SCRIPT is as below
PERFORM AMOUNT_VALUE IN PROGRAM ZFI_CHEQUE
USING ®UH-VBLNR&
USING ®UP-BELNR&
USING ®UP-BUZEI&
USING ®UP-BUKRS&
USING ®UP-GJAHR&
CHANGING &VATAMT&
CHANGING &TAXAMT&
ENDPERFORM
amd my preform program is as below:
FORM amount_value TABLES pt_input STRUCTURE itcsy
pt_output STRUCTURE itcsy.
DATA : "own declaration
"select statement and manipulation
READ TABLE pt_output WITH KEY name = 'VATAMT'.
IF sy-subrc EQ 0.
pt_output-value = w_vatamt.
ENDIF.
MODIFY pt_output TRANSPORTING value WHERE name = 'VATAMT'.
READ TABLE pt_output WITH KEY name = 'TAXAMT'.
IF sy-subrc EQ 0.
pt_output-value = w_taxamt.
ENDIF.
MODIFY pt_output TRANSPORTING value WHERE name = 'TAXAMT'.
but, when i pass back the value to script, the value become character, which does not have the thousand separator with it. i want it to be in currency format( with thousand separator). how am i going to do so?
please help. thanks
Yes, value will store in character format as itcsy-VALUE is character type,
To over come this do it like this...
Example1:
data: amount type p decimals 2.
data: num1(15).
data: num2(15).
num1 = '1234567.43'.
MOVE num1 to amount.
<i><b>WRITE amount to num2.</b></i>
<b>output</b>
num1 = 1234567.43
amount = 1,234,567.43
<i><b>num2 = 1,234,567.43</b></i>
EXAMPLE 2:
num1 = '1234567.43'.
MOVE num1 to amount.
<i><b>MOVE amount to num2.</b></i>
<b>output</b>
num1 = 1234567.43
amount = 1,234,567.43
<b><i>num2 = 1234567.43</i></b>
Use WRITE- TO,
I guess you understood the concept, close the thread if your question is answered.
regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Country-Dependent Formatting: SET COUNTRY The formatting for certain field types depends on the country settings. These field types include, for example, date fields and number fields that include either a decimal point or the thousands separator character. The formatting options defined in the user master record are usually the ones used here. To choose a formatting option other than the one specified in the user master record, use the SET COUNTRY control command. The country-dependent formatting options are stored in the T005X table. Syntax: /: SET COUNTRY country_key You can enter the country key either as a literal value enclosed in quotes or as a symbol.
/: SET COUNTRY 'CAN' /: SET COUNTRY &country_key& Use a blank country name to revert to the setting found in the user master record: /: SET COUNTRY ' ' This SAPscript command actually calls the corresponding ABAP command internally. This guarantees the effect of the SAPscript command to be identical with that of the ABAP command.
If the formatting turns out not to be as required, then you should check the settings in table T005X.
in ur form delare like this ..
code it as the below in ur Form
/: SET COUNTRY 'US'
/: IF &LIPS-WERKS& = '1001'
/: DEFINE &CURRENCY& = 'USD'
/: ELSE
/: DEFINE &CURRENCY& = &SO_TEXT-CURRENCY&
/ ENDIF
ZX ,,
TOTAL FOR SHIPMENT &VBDKL-VBELN&:,,¤cy&,
,,&ci2-netwr(12.2)& <>
Im using type USD format or custom format based on the plant.
hope this helps ,
Cheers,
Simha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.