Application Development and Automation 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: 
Read only

issue with conversion factor while changing the unit of issue

Former Member
0 Likes
1,504

Hi all,

iam trying to change the basic unit of issue.

iam getting an error saying

MAINTAIN THE CONVERSION FACTOR FOR THE ALTERNATIVE UNIT EA.

Orginally i have a basic unit of meassure as BX (BOX) AND UNIT OF ISSUE AS BLANK.

NOW I WANT TO KEEP THE basic unit of meassure as BX (BOX) AND CHANGE THE UNIT OF ISSUE FROM BLANK TO EA.

CAN ANYONE TELL ME HOW TO PASS THE CONVERSION FACTOR TO BAPI

I KNOW THE CONVERSION FACTOR AS 1 BOX TO 100 EA.

LET ME KNOW HOW TO PASS THIS TO BAPIBAPI_MATERIAL_SAVEDATA

Thanks

Hi all,

iam trying to change the basic unit of issue.

iam getting an error saying

MAINTAIN THE CONVERSION FACTOR FOR THE ALTERNATIVE UNIT EA.

Orginally i have a basic unit of meassure as BX (BOX) AND UNIT OF ISSUE AS BLANK.

NOW I WANT TO KEEP THE basic unit of meassure as BX (BOX) AND CHANGE THE UNIT OF ISSUE FROM BLANK TO EA.

CAN ANYONE TELL ME HOW TO PASS THE CONVERSION FACTOR TO BAPI

I KNOW THE CONVERSION FACTOR AS 1 BOX TO 100 EA.

LET ME KNOW HOW TO PASS THIS TO BAPIBAPI_MATERIAL_SAVEDATA

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
999

You have to pass all the units in the UNITSOFMEASURE tables parameter along with the conversion factors. Even if you specify the base unit of measurement in CLIENTDATA, you still have to maintain all others in this tables parameter.

Read only

0 Likes
999

Hi Srinivas,

can you tell me the bapi struture that i need to use and how should i need to pass to the bapi

Thanks

deepthi

Read only

0 Likes
999

If you look at the BAPI in SE37, under the tables parameter tab, you will see that it is referring to BAPI_MARM structure. That is the type for your internal table.

Read only

0 Likes
999

Hi ,

can you check this code

when i execute it iam getting an

MAINTAIN THE CONVERSION FACTOR FOR THE ALTERNATIVE UNIT EA.

DATA: headdata TYPE bapimathead.

DATA: bapi_marc1 LIKE bapi_marc,

bapi_marcx LIKE bapi_marcx.

DATA: return TYPE bapiret2 .

DATA: returnm TYPE TABLE OF bapi_matreturn2 WITH HEADER LINE.

DATA: it_unitsofmeasure TYPE STANDARD TABLE OF bapi_marm.

DATA: it_unitsofmeasurex TYPE STANDARD TABLE OF bapi_marmx.

DATA: wa_unitsofmeasure TYPE bapi_marm.

DATA: wa_unitsofmeasurex TYPE bapi_marmx.

headdata-material = '00123'.

headdata-storage_view = 'X'.

headdata-basic_view = 'X'.

bapi_marc1-plant = 'ABC'.

bapi_marcx-plant = 'ABC'.

bapi_marcx-issue_unit = 'X'.

SELECT SINGLE meins FROM mara INTO bASIC

WHERE matnr = i_zoritem-matnr.

IF bASIC NE 'EA'.

bapi_marc1-issue_unit = 'EA'.

wa_unitsofmeasure-alt_unit = bASIC.

wa_unitsofmeasure-denominatr = '1'.

wa_unitsofmeasure-numerator = '6'.

APPEND wa_unitsofmeasure TO it_unitsofmeasure.

  • wa_unitsofmeasure-alt_unit = buom

*wa_unitsofmeasure-denominatr = wa_datatab-umren.

*wa_unitsofmeasure-numerator = wa_datatab-umrez.

*APPEND wa_unitsofmeasure TO it_unitsofmeasure.

wa_unitsofmeasurex-alt_unit = bASIC.

wa_unitsofmeasurex-denominatr = 'X'.

wa_unitsofmeasurex-numerator = 'X'.

APPEND wa_unitsofmeasurex TO it_unitsofmeasurex.

*bapi_marc1-ISSUE_UNIT_ISO = 'BX'.

*bapi_marcx-ISSUE_UNIT_ISO = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

  • CLIENTDATA =

  • CLIENTDATAX =

plantdata = bapi_marc1

plantdatax = bapi_marcx

  • FORECASTPARAMETERS =

  • FORECASTPARAMETERSX =

  • PLANNINGDATA =

  • PLANNINGDATAX =

  • STORAGELOCATIONDATA =

  • STORAGELOCATIONDATAX =

  • VALUATIONDATA =

  • VALUATIONDATAX =

  • WAREHOUSENUMBERDATA =

  • WAREHOUSENUMBERDATAX =

  • SALESDATA =

  • SALESDATAX =

  • STORAGETYPEDATA =

  • STORAGETYPEDATAX =

IMPORTING

return = return

TABLES

  • MATERIALDESCRIPTION =

  • UNITSOFMEASURE =

  • UNITSOFMEASUREX =

unitsofmeasure = it_unitsofmeasure

unitsofmeasurex = it_unitsofmeasurex

  • INTERNATIONALARTNOS =

  • MATERIALLONGTEXT =

  • TAXCLASSIFICATIONS =

returnmessages = returnm

  • PRTDATA =

  • PRTDATAX =

  • EXTENSIONIN =

  • EXTENSIONINX =

.

IF return-type = 'E'.

WRITE : return-message.

ELSE.

COMMIT WORK.

ENDIF.

ENDIF.

let me know

Thanks

Read only

0 Likes
999

Looks ok but why are you selecting from MARA? Is this material already created? Also, what value do you have in "i_zoritem-matnr"?