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

Decimal format conversion issue

Former Member
0 Likes
4,684

Hello Experts,

In our Cheque printing, the Decimal format of the Net Amount is not proper.

It is happening for only one country.

Instead of $3,357.50 ; it is displaying $3,36

And the amount is displayed as $3.357,50 (New Zealand format)

When the settings was made using OY01, it displays fine.

Since it cannot be changed for all the countries manually using OY01; is there any way to change the Decimal Format of the Amount using ABAP code?

I think it is not the Currency conversion issue. It is Decimal Format conversion issue.

Please help.

Thanks & Regards,

Sowmya

1 ACCEPTED SOLUTION
Read only

venkateswaran_k
Active Contributor
0 Likes
3,211

In ABAP there is an option to set the country before printing the Amount field.

I assume you use SAP script to print the Cheques.

USE the statement

/: SET COUNTRY <COUNTRY VARIABLE>  " Example  SET COUNTRY 'USA'.

Regards,

Venkat

10 REPLIES 10
Read only

NAeda
Contributor
0 Likes
3,211

As you said, Change the country settings in OY01, also check if Total amount variable TYPE in your code.

Read only

venkateswaran_k
Active Contributor
0 Likes
3,212

In ABAP there is an option to set the country before printing the Amount field.

I assume you use SAP script to print the Cheques.

USE the statement

/: SET COUNTRY <COUNTRY VARIABLE>  " Example  SET COUNTRY 'USA'.

Regards,

Venkat

Read only

0 Likes
3,211

Thank you so much Venkateswaran. It worked.

Best Regards,
Sowmya

Read only

Former Member
0 Likes
3,211

Hi Sowmya,

Also please check decimal notation in user setting in SU01 for user -> Default Tab.

Some times this will make these kind of issue's.

In the table TCURX is there any entry available for NZD?

Thanks

Viji.

Read only

0 Likes
3,211

Hi Vijay,

SU01 is fine.

There are no entries in the Table TCURX for NZD.

Thanks,

Sowmya

Read only

Former Member
0 Likes
3,211

Hi Sowmya,

As of my knowledge we have to change in oy01 , we have also faced same problem while printing billing document for other countries, at that time also finally we have changed in oy01.

-Ganesh

Read only

Former Member
0 Likes
3,211

Hi Sowmya,

Please check below options.

option 1:

If you use any custom program,pls remove this fixed point arithmetic.

SE38 --> click Attributes radio button---> click change button.

Option 2:

DATA  lv_result TYPE p DECIMALS 2.
DATA lv_amount TYPE p DECIMALS 2 VALUE '3357.50'.

lv_result = ABS( lv_amount ).   WRITE:   'ABS:  ', lv_result.

Option 3:

If you use adobe form for cheque printing...check options in field object tab(decimal data pattern).

Thanks,

Satya

Read only

Former Member
0 Likes
3,211

Hi you can use this code,

*      Converting Amount field formats
     SELECT SINGLE dcpfm INTO l_dcpfm
                         FROM usr01
                        WHERE bname EQ sy-uname.

     IF sy-subrc EQ 0.
       LOOP AT it_output .
         CONDENSE : it_output-kbetr,
                    it_output-kpein.
         IF l_dcpfm IS INITIAL.                            "134,50
*
           CONDENSE : it_output-kbetr,
                      it_output-kpein.

*         Converting amounts as per User's decimal settings
           REPLACE ALL OCCURRENCES OF '.' IN it_output-kbetr
                                 WITH ' '.
           REPLACE ALL OCCURRENCES OF '.' IN it_output-kpein
                                 WITH ' '.

           REPLACE ALL OCCURRENCES OF ',' IN it_output-kbetr
                                 WITH '.'.
           REPLACE ALL OCCURRENCES OF ',' IN it_output-kpein
                                 WITH '.'.

           CONDENSE : it_output-kbetr,
                      it_output-kpein.
         ELSEIF l_dcpfm EQ c_x.                            "134.50
*         Converting amounts as per User's decimal settings
           REPLACE ALL OCCURRENCES OF ',' IN it_output-kbetr
                                 WITH ' '.
           REPLACE ALL OCCURRENCES OF ',' IN it_output-kpein
                                 WITH ' '.

           CONDENSE : it_output-kbetr,
                      it_output-kpein.

         ENDIF" IF gd_dcpfm IS INITIAL.

Read only

Former Member
0 Likes
3,211

Hi Sowmya,

Please check your user settings parameter in OWN data. As per the setting amount will be displayed.

Path is Systems>User Profile->Own Data->Default->Decimal Notation.

Regards,

Sujit

Read only

0 Likes
3,211

Kind attention   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I do had this scenario.

The cheque was coming correctly in local currency but not in foreign currency.

There are 2 solutions for this problems

1. Manually via ABAP.

2. FI - Configuration To maintain decimal notation and date format in OY07.

In addition to local country key( suppose - IN(India)), find vendor country key( suppose - CN(China)). Then you have to check and correct the date format and decimal notation for china in OY07. It will show you usual results.

Regards,

Navneesh