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 in BDC

Former Member
0 Kudos

Hi,

when iam displaying report after uploading data using BDC , amount field iam not getting properly.

iam expecting 1,234 ( what iam getting 12.34), any one can help.

6 REPLIES 6

Former Member
0 Kudos

Check the user settings for currecny.

0 Kudos

Currency using is TWD.

Former Member
0 Kudos

hi ,

for all the currency fields in BDc it is better to use the stmt

WRITE <fval> TO <gs_bdc_tab-fval> LEFT-JUSTIFIED.

as currenecy field is right justified field and we want to fill in as left justified so we might get some error.

and one more thing is user settings will also effect the output plz also verify the same

Former Member
0 Kudos

Amount Field have 1,234.this value move to Char field than that Variable(V_CAHR) use for BDC ok

Data: v_Char(18),

V_AMOUNT = 1,234.

V_CHAR = V_AMOUNT.

Former Member
0 Kudos

u need to the decimal correction.

pls see the extract of the code below :

***********

SELECT currkey currdec FROM tcurx INTO TABLE tbl_tcurx

FOR ALL ENTRIES IN tbl_bsik1

WHERE currkey = tbl_bsik1-waers.

IF sy-subrc = 0.

SORT tbl_tcurx BY currkey.

ENDIF.

READ TABLE tbl_tcurx WITH KEY currkey = tbl_bsik-waers

BINARY SEARCH.

IF sy-subrc = 0.

  • currency corrections

IF tbl_tcurx-currdec = 0.

tbl_final-wrbtr = tbl_bsik-wrbtr * 100.

ELSEIF tbl_tcurx-currdec = 1.

tbl_final-wrbtr = tbl_bsik-wrbtr * 10.

ELSEIF tbl_tcurx-currdec = 3.

tbl_final-wrbtr = tbl_bsik-wrbtr / 10.

ELSEIF tbl_tcurx-currdec = 5.

tbl_final-wrbtr = tbl_bsik-wrbtr / 1000.

ENDIF.

      • start

ELSE.

tbl_final-wrbtr = tbl_bsik-wrbtr.

          • end

ENDIF.

if found useful reward with points

Former Member
0 Kudos

1)the ID which created BDC session & the ID which processed session must have the same settings for decimal point in user settings, otherwise you may see data inconsistencies.

2) when you create your BDC session and populate amounts, use write amt_field into char_field currency 'your currency', char_field should have proper length, then use this char_field in your BDC program.