Application Development and Automation 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: 
Read only

Write amount in smartform

Former Member
0 Likes
2,956

Hi,

I need to print an amount in an smartform this way:

Which would be the best way to do this?

I think I could use something like this http://help.sap.com/erp2005_ehp_04/helpdata/en/1c/f40c6fddf311d3b574006094192fe3/content.htm

What do you think? I have not found to much about this..

Thanks in advance,

Regards,

Karina Hurtado

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,304

Thanks to all, I already have the amount in that format, what I want is to put one number in each column of tha grid.. the , $ and . already is gonna be there in the table, I think I should try with offset, right?

10 REPLIES 10
Read only

Former Member
0 Likes
2,304

Preceding dollar sign should not be an issue. To set separators you can use either user profile (SU01) or transaction OY01. Hope i understood it well.

Rgds

Read only

Former Member
0 Likes
2,304

Hi,

Do u want to display the amount value as 123,456,78.345 ?

In that case , use SET COUNTRY  XYZ (Choose country XYZ which has a decimal notation as mentioned above) in the initialization part of smartforms.

U can find country specific decimal notations in OY01 tcode.

Read only

sivaganesh_krishnan
Contributor
0 Likes
2,304

Hi Karina,

I have tried with this code and it works,

DATA l_netpr type char20.

DATA: a TYPE i VALUE '100000.00'.

WRITE a TO l_netpr

        CURRENCY z02sflight-CURRENCY--> (Table Field).

  CONDENSE l_netpr.

WRITE l_netpr .

You can also refer the following ,

http://scn.sap.com/thread/1091638

Regards,

Sivaganesh

Read only

0 Likes
2,304

Hi Karina,

Go through the link below , i hope it would solve your problem.

http://help.sap.com/erp2005_ehp_04/helpdata/en/0b/5da4e42cf511d5b692006094192fe3/content.htm?framese...

once you done that , you can just attach  a '$' sign in the text element of the same.

eg: $ &GV_QUANTITY&

regards,

Francy.

Read only

Former Member
0 Likes
2,304

Hey,

Dollar sign you can put normally whereas setting the decimal notation as above depends on the requirement. If you want to set it for a particular user, you can use su01 but better would be to use oy01 and change the decimal notation there. Hope it solves your issue. Please do let us know if have further.

Regards

Purnand

Read only

arindam_m
Active Contributor
0 Likes
2,304

Hi,

You will have to convert the amount with statement like:

WRITE v_cash_tot TO v_output CURRENCY 'USD'.  "v_output is teh variable used for printing in form

This would take the currency format for comma separators. Best is to get the currency as per the currency maintained for the amount. The symbols are not available and you might want to maintain a separate look-up table to get the same.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,304

Well Karina,

The help link you suggested is for output option for value already ready.

here you will need to prepare the value for country specific and currency specific format please check

the below link of SAP Help.

http://help.sap.com/erp2005_ehp_04/helpdata/en/9f/dba1ef35c111d1829f0000e829fbfe/content.htm

Regards

Read only

Former Member
0 Likes
2,305

Thanks to all, I already have the amount in that format, what I want is to put one number in each column of tha grid.. the , $ and . already is gonna be there in the table, I think I should try with offset, right?

Read only

0 Likes
2,304

Yes,

Do a length check of the char field you are moving the value in.

Then use offset with length minus 1 each time till you reach 0.

Put the digits in the boxes from right to left.

Regards

Read only

0 Likes
2,304

if this going to be in a table then you can have each digit of amount along with dollar symbol in different cells of table. this table would have one row with multiple columns. of course each digit will be identify by using offset only.

Rgds