Skip to Content
0
Former Member
May 04, 2009 at 12:03 PM

currency value moving one decimal when uploading

22 Views

Hello Experts,

Please see the following code.

*{Begin of changes XPAVGAN_6994163

CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'

EXPORTING

  • CLIENT = SY-MANDT

DATE = SY-DATUM

FOREIGN_CURRENCY = VBAK-WAERK

LOCAL_AMOUNT = ls_titems-price

LOCAL_CURRENCY = 'SEK'

  • RATE = 0

  • TYPE_OF_RATE = 'M'

  • READ_TCURR = 'X'

IMPORTING

  • EXCHANGE_RATE =

FOREIGN_AMOUNT = gd_price1

  • FOREIGN_FACTOR =

  • LOCAL_FACTOR =

  • EXCHANGE_RATEX =

  • DERIVED_RATE_TYPE =

  • FIXED_RATE =

  • EXCEPTIONS

  • NO_RATE_FOUND = 1

  • OVERFLOW = 2

  • NO_FACTORS_FOUND = 3

  • NO_SPREAD_FOUND = 4

  • DERIVED_2_TIMES = 5

  • OTHERS = 6

.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

  • DESTINATION 'NONE'

EXPORTING

SALESDOCUMENTIN = LS_SALESDOCUMENTIN

ORDER_HEADER_IN = gs_ORDER_HEADER_IN

ORDER_HEADER_INX = LS_ORDER_HEADER_INX

SENDER = LS_SENDER

BINARY_RELATIONSHIPTYPE = LS_BINARY_RELATIONSHIPTYPE

INT_NUMBER_ASSIGNMENT = LS_INT_NUMBER_ASSIGNMENT

BEHAVE_WHEN_ERROR = LS_BEHAVE_WHEN_ERROR

LOGIC_SWITCH = LS_LOGIC_SWITCH

TESTRUN = LS_TESTRUN

CONVERT = ' '

IMPORTING

SALESDOCUMENT = LS_SALESDOCUMENT

TABLES

RETURN = GT_RETURN

ORDER_ITEMS_IN = gt_ORDER_ITEMS_IN

ORDER_ITEMS_INX = LT_ORDER_ITEMS_INX

ORDER_PARTNERS = gt_ORDER_PARTNERS

ORDER_SCHEDULES_IN = gt_ORDER_SCHEDULES_IN

ORDER_SCHEDULES_INX = LT_ORDER_SCHEDULES_INX

ORDER_CONDITIONS_IN = gt_ORDER_CONDITIONS_IN

ORDER_CFGS_REF = LT_ORDER_CFGS_REF

ORDER_CFGS_INST = LT_ORDER_CFGS_INST

ORDER_CFGS_PART_OF = LT_ORDER_CFGS_PART_OF

ORDER_CFGS_VALUE = LT_ORDER_CFGS_VALUE

ORDER_CFGS_BLOB = LT_ORDER_CFGS_BLOB

ORDER_CFGS_VK = LT_ORDER_CFGS_VK

ORDER_CFGS_REFINST = LT_ORDER_CFGS_REFINST

ORDER_CCARD = LT_ORDER_CCARD

ORDER_TEXT = gt_ORDER_TEXT

ORDER_KEYS = gt_ORDER_KEYS

EXTENSIONIN = gt_EXTENSIONIN.

Here im passing the value of gd_price1 obtained from the above FM in to bapi "BAPI_SALESORDER_CREATEFROMDAT2".This Bapi creates sales orders. After the sales order creation the value present in gd_price1 should be updated in NET VALUE tab in VA03 tcode.

For eg if The value of gd_price1 obtained is 2471.557,then after the sales order creation in the NET VALUE we have to get 2471.557.But im getting as 24715.57.

i,e it is taking one more decimal.

Please tell me how to resolve this issue.