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

Help BAPI_MATERIAL_SAVEDATA

0 Likes
1,114

Folks I am trying to use BAPI_MATERIAL_SAVEDATA for creating a material. In MARA i have append a field using a ZEMARA structure. How do i pass data to this non standard field in MARA? Please provide some sample code.

Sudhakar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
986

Hi,

I got this information from the FM documentation

Only external number assignment is supported for the material number

(MATERIAL). If you want the material number to be assigned

internally, the method BAPI_MATERIAL_GETINTNUMBER must first be

called. This method determines an internal number for the material

to be created. You must enter this internal number in field

HEADDATA-MATERIAL.

You have call the FM BAPI_MATERIAL_GETINTNUMBER before calling the BAPI_MATERIAL_SAVEDATA FM.

Thanks,

Naren

7 REPLIES 7
Read only

Former Member
0 Likes
986

Hi,

Use the EXTENSIONIN tables parameter to populate the values..

Check the EXTENSIONIN parameter documentation for more details..you will have to extend the structure BAPI_TE_MARA with the fields that you added in ZEMARA...

THanks,

Naren

Read only

0 Likes
986

Strange I just realized the this function/bapi cannot be used for creating a material. Is there a function that someone know?

Sudhakar

Read only

Former Member
0 Likes
986

Hi,

You can create a material master data using this BAPI...

Check the FM documentation...

Thanks,

Naren

Read only

0 Likes
986

Caution: SAP's documentation is misleading. Open the source code and see the first few lines. You will find:

IF HEADDATA-MATERIAL = SPACE.

CLEAR TMERRDAT.

SY-MSGID = MESSAGE_ID_M3.

SY-MSGTY = MESSAGE_ERROR.

SY-MSGNO = '262'.

BAPI_ERROR = 'X'.

ENDIF.

Errors if material number is not passed for this BAPI, so this BAPI is actually for Changing a material

Read only

Former Member
0 Likes
986

Hi,

For a new material or changing a material we will be entering a material number correct in MM01/MM02...

That is the reason SAP is expecting a material number....

Thanks,

Naren

Read only

0 Likes
986

Trying testing it, didnt work for me. I want to create a material as we do in MM01 with internal number range.

Sudhakar

Read only

Former Member
0 Likes
987

Hi,

I got this information from the FM documentation

Only external number assignment is supported for the material number

(MATERIAL). If you want the material number to be assigned

internally, the method BAPI_MATERIAL_GETINTNUMBER must first be

called. This method determines an internal number for the material

to be created. You must enter this internal number in field

HEADDATA-MATERIAL.

You have call the FM BAPI_MATERIAL_GETINTNUMBER before calling the BAPI_MATERIAL_SAVEDATA FM.

Thanks,

Naren