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

BAPI_MATERIAL_SAVEDATA - gross weight?

Former Member
0 Likes
3,392

Hi,

I've read very carefully the whole documentation to BAPI_MATERIAL_SAVEDATA.

I am passing gross weight to MARM and it is saved correctly, but Gross Weight is still empty when I check my material in MM03 in tap Basic Data 1. Saved data is shown only in "Additional Data"->"Units of measure".

I wondered whether some other hidden field for Gross Weight exists in other table or structure, so that I can fill in the textfield in tap Basic Data 1. At least it is not mentioned in the description.

Perhaps somebody else knows the solution? Please help.

Looking forward your answer.

BR,

Rafal

Hi,

I've read very carefully the whole documentation to BAPI_MATERIAL_SAVEDATA.

I am passing gross weight to MARM and it is saved correctly, but Gross Weight is still empty when I check my material in MM03 in tap Basic Data 1. Saved data is shown only in "Additional Data"->"Units of measure".

I wondered whether some other hidden field for Gross Weight exists in other table or structure, so that I can fill in the textfield in tap Basic Data 1. At least it is not mentioned in the description.

Perhaps somebody else knows the solution? Please help.

Looking forward your answer.

BR,

Rafal

13 REPLIES 13
Read only

Former Member
0 Likes
2,501

The weight related info should be passed to the structure CLIENTDATA . I have seen some field with naem NET_WEIGHT did you try that field?

Regards,

Ravi

Read only

0 Likes
2,501

Thanks.... I've passed NET_WEIGHT before, but it is sth different.

I am developing a method which is able to create material, so that it can be used later on as an item to sales order. Therefore I need both NET_WEIGHT and gross weight, but I can't find the latter. SAP still asks me for gross weight when I'm creating Sales Order, even though it is saved in MARM. It seems that somewhere is the gross weight field, but it is hidden (maybe in MARA).

Moreover SAP asks me for pricing and net value of material, but I suppose that this data must be entered somewhere else and therefore I didn't add this problem to this question.

Do you know anything more about that?

Any helpful answer will be properly rewarded. Any positive attitude too.

BR,

Rafal

Read only

0 Likes
2,501

Hi Rafal,

Please check the link

Hope this helps,

Caglar

Read only

0 Likes
2,501

Hi,

Thanks a lot for this link. It is helpful and therefore I'll reward you, but still my problem in not solved. The source code on this site is given in ABAP. I understand it but I can't figure out the name for the field which I'll be able to use to pass gross weight from remote (in my case Java and JCo).

If you have any idea pls let me know.

BR,

Rafal

Read only

0 Likes
2,501

Hi Rafal

Sorry for the delayed answer,

I think you have to set the value for

measurex.setValue("X", "GROSS_WT");

Hope this helps ,

Regards.

Caglar

Read only

0 Likes
2,501

Hi Caglar

Do u mean to set the value to X for GROSS_WT in table MARMX (Unitsofmeasurex)? If so, I must say I've already done it before. It doesn't help.

Otherwise pls explain me what is for you "measurex"?

If you have any other idea, let me know.

Thanks for an answer and positive attitude.

I'll reward posts later on.

BR,

Rafal

Read only

0 Likes
2,501

Hi Rafal ,

Yes , unfortunately I was talking about Unitofmeasurex

If it is possible could you paste your code or send with a mail .

Regards

Caglar

Read only

0 Likes
2,501

Hi,

That my source code related to CLIENTDATA:

/*
			 * CLIENTDATAX FOR BASIC VIEW
			 */
			Structure clientDatax = input.getStructure("CLIENTDATAX");
			clientDatax.setValue("X", "MATL_GROUP");
			clientDatax.setValue("X", "OLD_MAT_NO");
			// clientdatax.setValue("X", "PROD_HIER");
			clientDatax.setValue("X", "BASE_UOM");
			clientDatax.setValue("X", "BASE_UOM_ISO");
			clientDatax.setValue("X", "TRANS_GRP");
			clientDatax.setValue("X", "NET_WEIGHT");
			clientDatax.setValue("X", "UNIT_OF_WT");
			clientDatax.setValue("X", "UNIT_OF_WT_ISO");
			clientDatax.setValue("X", "ITEM_CAT");
			clientDatax.setValue("X", "PUR_VALKEY");
			clientDatax.setValue("X", "LABEL_TYPE");
			clientDatax.setValue("X", "LABEL_FORM");
			clientDatax.setValue("X", "DIVISION");

			/*
			 * CLIENTDATA FOR BASIC VIEW
			 */
			Structure clientData = input.getStructure("CLIENTDATA");
			clientData.setValue("02", "MATL_GROUP");
			clientData.setValue("testmaterial", "OLD_MAT_NO");
			// clientdata.setValue("1000000790","PROD_HIER");
			clientData.setValue("PC", "BASE_UOM");
			clientData.setValue("PCE", "BASE_UOM_ISO");
			clientData.setValue("0001", "TRANS_GRP");
			clientData.setValue(0.111, "NET_WEIGHT");
			clientData.setValue("KGM", "UNIT_OF_WT");
			clientData.setValue("KGM", "UNIT_OF_WT_ISO");
			clientData.setValue("NORM", "ITEM_CAT");
			clientData.setValue("UV03", "PUR_VALKEY");
			clientData.setValue("1", "LABEL_TYPE");
			clientData.setValue("E1", "LABEL_FORM");
			clientData.setValue("01", "DIVISION");

and the following to unitsofmeasure:

// MeasureX
			Table measurex = tables.getTable("UNITSOFMEASUREX");
			measurex.appendRow();
			measurex.setValue("PC", "ALT_UNIT");
			measurex.setValue("PCE", "ALT_UNIT_ISO");
			measurex.setValue("X", "NUMERATOR");
			measurex.setValue("X", "DENOMINATR");
			measurex.setValue("X", "UNIT_DIM");
			measurex.setValue("X", "UNIT_DIM_ISO");
			measurex.setValue("X", "LENGTH");
			measurex.setValue("X", "WIDTH");
			measurex.setValue("X", "HEIGHT");
			measurex.setValue("X", "VOLUME");
			measurex.setValue("X", "VOLUMEUNIT");
			measurex.setValue("X", "VOLUMEUNIT_ISO");
			measurex.setValue("X", "GROSS_WT");
			measurex.setValue("X", "UNIT_OF_WT");
			measurex.setValue("X", "UNIT_OF_WT_ISO");
			// measurex.insertRow(0);

			// Measure
			Table measure = tables.getTable("UNITSOFMEASURE");
			measure.appendRow();
			measure.setValue("PC", "ALT_UNIT");
			measure.setValue("PCE", "ALT_UNIT_ISO");
			measure.setValue("1", "NUMERATOR");
			measure.setValue("1", "DENOMINATR");
			// measure.setValue("X","DEL_FLAG");
			measure.setValue("CM", "UNIT_DIM");
			measure.setValue("CMT", "UNIT_DIM_ISO");
			measure.setValue(0.111, "LENGTH");
			measure.setValue(0.111, "WIDTH");
			measure.setValue(0.111, "HEIGHT");
			measure.setValue(0.3, "VOLUME");
			measure.setValue("CDM", "VOLUMEUNIT");
			measure.setValue("CDM", "VOLUMEUNIT_ISO");
			measure.setValue(1, "GROSS_WT");
			measure.setValue("KG", "UNIT_OF_WT");
			measure.setValue("KGM", "UNIT_OF_WT_ISO");

Check this out please and let me know if you find sth.

BR,

Rafal

Read only

0 Likes
2,501

Hi Rafal,

Actually I couldn't figure it out , It seems ok to me . I' m not sure this will work

but could you please try this one also.


measurex.setValue("X", "UNIT_OF_WT_ISO");
// measurex.insertRow(0);

measurex.insertRow(1);

...
measure.setValue("KG", "UNIT_OF_WT");
measure.setValue("KGM", "UNIT_OF_WT_ISO");

measure.insertRow(1);

I think you' ve already tried to insert row but I hope it' ll work if you change the index.

Hope this helps.

Regards

Caglar

Read only

0 Likes
2,501

Hi,

Method insertRow(1) creates only the row in the table. It doesn't help. moreover the row must be populated to execute the function.

Anyway I've finally solved the problem.

The solution in my case was:

- the data in both ClientData and Unitsofmeasure must be correct, even though SAP doesn't throw an error.

-BASE_UOM from clientdata must be the same as ALT_UNIT from unitsofmeasure.

If everything is correct BAPI automatically saves the data.

Anyway u r rewarded.

Thank for all.

BR,

Rafal

Read only

0 Likes
2,501

Hello Rafal Kokoszka

Thank you for post the answer. It was exactly what I was looking for. Gross weight will not be a problem any more (UNITSOFMEASURE>GROSS_WT ). And NET_WEIGHT in CLIENTDATA>NET_WEIGHT.

Thank you.

Read only

Former Member
0 Likes
2,501

solved

Read only

Former Member
0 Likes
2,501

Hi Rafal Kokoszka ,

I am working on the same BAPI.

When i am trying to execute the BAPI it is showing the following error.

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

Message no. MG144"

Can you pls suggest something which i can try.....

Thanks in advance.