Application Development 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: 

Amount Conversion issue in sap script

sreekanth_n2
Active Participant
0 Kudos

Hi experts,

Im trying to print document in FBL1n transaction.

SAP Script is involved to show output.

In driver program, amount field is coming properly.

When the WRITE_FORM is executed, amount filed is change automatically with comma and pull stop.

for example, in one document of Singapore country, amount bseg-wrbtr is coming as 6.500,00   i.e., comma as decimal

other doc of France country, amount amount bseg-wrbtr is coming as  959,874,566.28   i.e., pull stop as decimal

   for the same user.

Please help in resolvnig the issue.

Let me know if you need addtional information.

Sree

1 ACCEPTED SOLUTION

sreekanth_n2
Active Participant
0 Kudos

Im getting unexpected dump and decimal issue(sometimes comma as decimal and sometimes pullstop as decimal).

Im doing calculation in subroutine that is called script. Hence Im getting the above issue.

So did the calculation part in Driver program and used that value in Script. This solution worked for me.

3 REPLIES 3

former_member809980
Participant
0 Kudos

hi,

solution 1 : Use like &bseg-wrbtr(K)& this is will bypass the conversion.

solution 2 :

The formatting for certain field types depends on the country settings.

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.

/: SET COUNTRY 'CAN'

/: SET COUNTRY &country_key&

solution 3 :

you can use this FM: CONVERT_TO_FOREIGN_CURRENCY

you have to write the fm code in your driver prgram

and get the correct value and then pass this value to sap script.

Code syntax:

FORM get_amount TABLES it_intab  STRUCTURE itcsy

                                            it_outtab  STRUCTURE itcsy.

And in your SAP Script call this subroutine as follows :

PERFORM get_amount  IN (program name)

CHANGING &V_AMOUNT((your variable name in which you have correct amt).)&

ENDPERFORM.

thanks!!

sreekanth_n2
Active Participant
0 Kudos

Im getting unexpected dump and decimal issue(sometimes comma as decimal and sometimes pullstop as decimal).

Im doing calculation in subroutine that is called script. Hence Im getting the above issue.

So did the calculation part in Driver program and used that value in Script. This solution worked for me.

former_member809980
Participant
0 Kudos

hi,

please share what you have done in your driver program.. as you marked it correct answer.

thanks!!