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: 

Decimal places are not permitted & Formatting error in the field BSEG-WRBTR message no. 00011

Former Member
0 Kudos
1,381

Dear Experts,

I’m facing decimal places problem with the field BSEG-WRBTR for the currency
JPY as no decimals are allowed in standard system. Error: Formatting error in
the field BSEG-WRBTR & Decimal places are not permitted

Our client is posting accounting document through frontend system (interface).
It comes to SAP in xml format.

I have debugged and noticed that it’s taking 2 decimals even the amount in
the xml has no decimals.  I’m trying to restrict
decimal for JPY in the interface program.

I have checked in OY04, but for
JPY currency not maintained any decimals.

Kindly share your valuable suggestions.

Regards

Rajasekhar S

8 REPLIES 8

venkateswaran_k
Active Contributor
0 Kudos
199

Hi Rajasekhar

You convert the amount (after read from XML ) usng the following function.

DATA : w_tgt  type BAPICURR-BAPICURR. 

DATA : w_curr type TCURC-WAERS .

CALL FUNCTION 'CURRENCY_AMOUNT_BAPI_TO_SAP'
  EXPORTING
    currency                    = w_curr
    bapi_amount                 = w_tgt
IMPORTING
   SAP_AMOUNT                  = w_tgt
EXCEPTIONS
   BAPI_AMOUNT_INCORRECT       = 1
   OTHERS                      = 2
          .

IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

0 Kudos
199

Hi Venkateswaran,

Thanx for your reply,

I am trying to passing for given FM - 'CURRENCY_AMOUNT_BAPI_TO_SAP'

Import parameters               Value

CURRENCY                        JPY
BAPI_AMOUNT                                          544.0000

i am getting the value with decimals.


Export parameters               Value

SAP_AMOUNT                                             5.4400

But my requirement is for Currency JPY, it should not allow decimals.

Please suggest.

Regards

Rajasekhar S

0 Kudos
199

I think you need to use the FM CURRENCY_AMOUNT_SAP_TO_BAPI to correct the decimal places.



CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_BAPI'
    EXPORTING
      currency    = w_curr
      sap_amount  = w_tgt 
    IMPORTING
      bapi_amount = w_tgt  .

0 Kudos
199

Hi Susmitha,

Thanx for your reply,

I am trying to passing for given FM - CURRENCY_AMOUNT_SAP_TO_BAPI

Import parameters               Value

CURRENCY                        JPY
SAP_AMOUNT                    100

Export parameters               Value

BAPI_AMOUNT                 10000.0000

Regards

Rajasekhar S

0 Kudos
199

After reading from the xml table, convert the value to an integer field.

wa_amt type i.

wa_amt = lv_amount.

Since you are moving it to a currency field, it is automatically adding decimals , .00.

And this raises the error since JPY is configured in OY04 as without decimals.

Try moving to integer field and see if its coming fine.

0 Kudos
199

Hi Rajasekhar -

In your interface program after conevrting the amount to JPY, can you try taking the 'WRBTR' value to a CHAR16 variable. And remove the the decimals by string operation and pass it to BSEG-WRBTR. Let us know, if it helps.

Regards,

Atul Mohanty

0 Kudos
199

Hi Susmitha,

Thanx for your inputs.

DATA : lv_amt(13) TYPE p DECIMALS 0.

IF "currency" EQ 'JPY'.
            WRITE wa_field-wrbtr CURRENCY 'JPY'.
            MOVE wa_field-wrbtr TO lv_amt.

else.

   "For othe countries".

endif.

While i am testing above code in debugging it's working.

Is it suggestable.

Regards

Rajasekhar S

0 Kudos
199

Yes, its the same logic. Go ahead with it.. It would be fine.