cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Currency in Scripts.

Former Member
0 Kudos

Hi All,

I have a small problem with printing a variable which holds currency data.

The thing is in perticular requirment i have to print a currency value which

doesn't contain ( , Comas ) Eg:- 12223434

I want it to be 1,22,23,434...

I have taken it as charecter type and made some split and concatenate

operations and managed but , it is not behaving as per the jusification

that to be printed in the script.

Please help me ...It's a Production Issue.

Thanks,

Zia.

Message was edited by:

zakir ahmed

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Can you please try

<b> write <fieldname> currency <currencyvariable>.</b>

You need to get the currency depending on the country. Foreg: Japan doesnt require decimals in currency amount.

Thanks,

Rashmi.

Former Member
0 Kudos

Hi,

Can you try by creating one more variable of 'CURR' type. It would be better if you know any such field in any of the table in your system as in that case you won't need to mention currency reference.

Data : lv_curr type <table-fld_curr> .

lv_curr = your_variable

now print lv_curr.....hope it works....

Regards,

Shikha

Former Member
0 Kudos

check user settings of profile.

other wise use SET-COUNTRY = SPACE.

before printing the value

just check whether it works.

Former Member
0 Kudos

Hi,

Call a PERFORM from your SAPSCRIPT and pass the field to which the thousand separator needs to be added and add the following code in the FORM routine in your Z program.

CONSTANTS : lc_regex TYPE string VALUE '([0-9])(?=([0-9])+(?![0-9]))',

lc_new TYPE string VALUE '$1,'.

*

  • Insert thousand separator for the value

REPLACE

ALL OCCURRENCES OF

REGEX lc_regex

IN field_str WITH lc_new.

<b>Where field_str(of type c/string) is the field passed from the SAP SCRIPT</b>.

Even if its of currency type, move it to a field of type c and then use it as above.

Reward points if you find this useful.

Regards,

Kayal Priyadarshini

Message was edited by:

Kayal Priyadarshini

Former Member
0 Kudos

check this threads...

Former Member
0 Kudos

Hi,

Use this one to Leading Sign to the Left <b>&symbol(<)&</b>

Omitting the Separator for ‘Thousands’ use <b>&symbol(T)&</b>

Regards

Sudheer

Former Member
0 Kudos

here the problem is not ommiting the , but i need to add commas

Former Member
0 Kudos

If your problem is with the justification of the value instead of how to insert the comma's then try increasing the size of the cell you are putting the value in. The justification is often lost when the engine is unable to fit the amount in the cell width. Beware that the width of the amount being printed may contain some invisible part which you may limit by limiting the output length at time of print.