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: 

Deleting unit of measure data for mpn materials

Vijay
Active Contributor
0 Kudos

hi all,

we have a requirement to delete uom data for mpn materials. the problem is for mpn materials the mm02 don't show uom tab so we can't create bdc or lsmw for the same.

we tried with bapi 'BAPI_MATERIAL_SAVEDATA' by specifying the deletion flag in uom data table. but the uom data is not getting deleted and is still visible in table MARM.

Can anyone tell me how to delete uom data for mpn material using 'BAPI_MATERIAL_SAVEDATA' or is there any other bapi to perform this task.

thanks & regards

vijay

4 REPLIES 4

Former Member
0 Kudos

Can you copy paste your bapi call here ?

Mathews

Vijay
Active Contributor
0 Kudos

Hi Mathews,

This is how i am calling bapi.

data: headdata type BAPIMATHEAD,

UNITSOFMEASURE type table of BAPI_MARM,

wa_uom type BAPI_MARM,

RETURN TYPE BAPIRET2.

wa_uom-ALT_UNIT = 'J10'.

WA_UOM-DEL_FLAG = 'X'.

APPEND WA_UOM TO UNITSOFMEASURE.

headdata-MATERIAL = '919775_MPN1'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

IMPORTING

RETURN = RETURN

TABLES

UNITSOFMEASURE = UNITSOFMEASURE .

it is working fine for normal material but for mpn materials its not working.

regards

vijay

0 Kudos

Sorry for the delay , it was late into the night for me yesterday .

What I understand is usualy when you create a MPN material you associate that with another material of your own. For each each MPN material there is an associated material in your material master with type 'HERS'

So if you identify your material master record which corresponds to your MPN material and use that in your BAPI, may be that should help.

Mathews

Vijay
Active Contributor
0 Kudos

you mean to say i should pass parent material instead of mpn

material in header structure of bapi.... right ? or something else ?

but that would delete the uom for parent material and not of mpn material.

or there is any other way to pass parent material along with mpn material ?

regards

vijay