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: 

BAPI_MATERIAL_SAVEDATA - Unit of Measure

Former Member
0 Kudos

Hi All,

I have problem when created material using 'BAPI_MATERIAL_SAVEDATA'.

I put different value of unitsofmeasure-alt_unit againts clientdata-base_uom. When i executed the program, there is error 'The field MARA-BRGEW is defined as a required field; it does not contain an entry'. Because of in include program L1001UEBF01, there is coding as below.

read table tmarm_ueb with key meinh = tmara_ueb-meins.

if sy-subrc = 0.

move-corresponding tmarm_ueb to tmara_ueb.

modify tmara_ueb index 1.

endif.

It means field meinh and meins should have the same value. Then i changed value unitsofmeasure-al_unit = clientdata-base_uom. There is an error 'The alternative unit of measure is the same as the base unit of measure'

How to handle this problem.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

Hi

'The field MARA-BRGEW is defined as a required field; it does not contain an entry'.

The above error indicates about the WEIGHT parameter not about the UOM.

Hence, pls pass the right WEIGHT value, it may work

Regards

MD

0 Kudos

Hi MD,

Sorry, i haven't informed that weight value, i have filled in before.

any advise?

Former Member
0 Kudos

Hello Renne Octavianus,

in my recent, while creating entries in a table, i left the QUAN fields as blank. It was resulting in short dump. in debugging i found some garbage values in those fields.

Anyways, in general... For material we should give values like Gross Wt like that.

Coming to your second problem: It is not possible to give Same value in Base Unit of meassure and Alternative Unit of Meassure. No need to define Alt. Unit of measure same as Base Unit of measure, as it is already existing.

For ex: goto MM02 for a material and select Basicdata1 and press enter. Once you entered into details of the material, you can find a pushbutton Additional data. In additional data screen choose the tab Units of measure and try to give Alternative Unit of Measure same as the Base Unit of measure. It will not allow.

Because of this only, You are facing the same problem.

Best Regards

--

Sasidhar Reddy Matli.

0 Kudos

Hi Sashidar,

Thanks for your answer.

The first and second problem are related.

When i put the alternative unit as blank, there is an error "'The field MARA-BRGEW is defined as a required field; it does not contain an entry", even i have filled in gross weight in UNITSOFMEASURE and UNITSOFMEASUREX.

when i was debugging, i found that below coding in that FM are affected

read table tmarm_ueb with key meinh = tmara_ueb-meins.

if sy-subrc = 0.

move-corresponding tmarm_ueb to tmara_ueb.

modify tmara_ueb index 1.

endif.

FM tried to match MEINH and MEINS. when the value is not the same, so, the gross weight that i put in UNITSOFMEASURE (MARM) will not be copied to MARA.

That's why, i put the same value of alt_unit = uom. Now, that error is not coming again. because UNITSOFMEASURE (MARM) will be copied to MARA.

But, the next error that appear is "'The alternative unit of measure is the same as the base unit of measure". I know this one will not possible, because of alternative unit of measure, i put the same value with UOM.

May be the main problem is the first error. Can you advise of it? How to handle? Even i have put the gross weight but the error still come out.

Thanks.

Renne

0 Kudos

Hello Renne,

Let me try doing same sort of report in my system. Please check my m a i l i d in business card . Just mention what are all the fields you are trying to update using the BAPI. You can get my m a i l ID from my business card.

Thank you.

Best Regards

--

Sasidhar Reddy Matli.