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: 

1:N relation between MARA and MARM using SAVEDATA with LSMW

Former Member
0 Kudos
777

Hi,

I wanna use LSMW for a data migration. Therefore I'm using the BAPI 'SAVEDATA' to transfer material data.

So far I can transfer one material entity with just one unit of measure (UOM) for table MARM.

However, I do have more than one UOM for a material entity. When I look in 'maintain structure relations', there the IDOC segement 'E1BP_MARM' is in the same hierarchy with the head data although N UOM's are requiered for one material entity. How can this work with the BAPI 'BAPI_MATERIAL_SAVEDATA' if I wanna use more than one UOM's?

2 REPLIES 2

Former Member
0 Kudos
201

Take the data in an internal table and call the BAPI multiple times..

Loop at itab.

call BAPI_MATERIAL_SAVEDATA FM.

Also, call BAPI_COMMIT to commit the data.

endloop.

Former Member
0 Kudos
201

Hi,

You can define multiple source structure in step no 2 of LSMW.In upper level structure provide header data fields and in lower level structure you can provide fields related to your UOM.

While defining fields for both source structure provide an identifier for the starting field of both structure.

Now in step no 3 assign header structure to header data segment and lower level structure to segment containing UOM.

In step number 7 select radio button which says for multiple source structure and in next step assign the file to both structure.

In this way you can upload N UOM for a particular material.

Hope this solves your problem.

Regards,

Brajvir