Skip to Content

Amount Conversion issue in sap script

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 16, 2015 at 03:04 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2015 at 03:21 AM

    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!!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2015 at 03:17 AM

    hi,

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

    thanks!!

    Add comment
    10|10000 characters needed characters exceeded