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

MM02 insertion - Urgent

aaruljothi
Participant
0 Likes
722

hi,

I am tring to insert the unit of measure in mm02 for a given material through a BDC.

The place of insertion is mm02-> matnr-> select all->additional data-> Units of measure tab.

I cant insert an "Alternative Unit of Measure for Stockkeeping Unit" which is already there. So i must delete that entry and enter my new entry. In a BDC u can't read the index of the entry to be deleted. So i went to table MARM to get the unit of measures for a material. i ahve records for the material in MARM.

So in my program i check whether the entry exists or not, it it exists then i sort the records in some order and then find the index delete the record of that index in mm02 and the insert the new entry.

I want to know in which order the unit of measures are sorted in mm02. If i insert a new entry the entry doess'nt go as a last record but it inserts in between. I want to know under what criteria it is doing that.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
679

use bapi BAPI_MATERIAL_SAVEDATA.

it will change your life

4 REPLIES 4
Read only

Former Member
0 Likes
680

use bapi BAPI_MATERIAL_SAVEDATA.

it will change your life

Read only

Former Member
0 Likes
679

Looks like the unit of measure maintained in the basic data ( usually which will be EA ) will always appear on first tab, and then the unit of measures whichever are added are inserted in aplhabetical order. ( so 1" comes before ACR ).

All u have to do is from the records obtained from MARM first find the unit of measure maintained in basic data, which will be the first record. Sort the rest of the records in ascending order, I think this should solve ur problem.

Read only

0 Likes
679

hi Sharath kumar R,

sort on which field.

Read only

Former Member
0 Likes
679

First query MARA for the field MEINS. This will be the first unit of measure that will be displayed in the additional data tab.

Now get all the records from MARM, and delete the record which has field MEINH same as MEINS of MARA. ( for example EA ).

Now sort the table MARM by field MEINH ( character wise ).

u will get the order that is maintained in the transaction