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

former_member599326
Participant
0 Kudos

hi,

I am using the function "BAPI_MATERIAL_SAVEDATA" to create a material.. i have declared below tables..

TABLES:BAPIMATHEAD,

          BAPI_MAKT,

          BAPI_MARA,

          BAPI_MARAX,

          BAPI_MARC,

          BAPI_MARCX,

          BAPI_MBEW,

          BAPI_MBEWX,

          BAPI_MARM,

          BAPI_MARMX,

          BAPI_MEAN,

          BAPIPAREX,

          BAPIPAREXX,

          BAPIRET2.

now I have additional requirement to pass the values for below fields..

ERNAMCreator
AENAMChange Id
KZKFGConfig Mat
TDOBJECTLong Text Object
TDNAMEText Name
SPRAS_ISOLanguage Key
TDLINELong Description (in English)
CLASSTYPEClass Number

i am not getting the above fields in the bapi structures of BAPI_MATERIAL_SAVEDATA.. so how can I pass these field values to BAPI while creating the material ??

Regards,


1 ACCEPTED SOLUTION

laurent_fournier2
Contributor
0 Kudos

Hello,

For configuration if any use MATERIAL_SAVE_CONFIGURATION. ( see note 736873 )

For classification use BAPI_OBJCL_CHANGE.

For all the others, BAPI_MATERIAL_SAVEDATA.

Regards.

12 REPLIES 12

former_member200345
Contributor
0 Kudos

Hi, It looks like you are trying to update the material long texts. If yes, you can go for the tables parameter 'MATERIALLONGTEXT' of BAPI_MATERIAL_SAVEDATA.

Former Member
0 Kudos

Hi santosh ,

                             Follow this thread http://scn.sap.com/thread/172752........

laurent_fournier2
Contributor
0 Kudos

Hello,

For configuration if any use MATERIAL_SAVE_CONFIGURATION. ( see note 736873 )

For classification use BAPI_OBJCL_CHANGE.

For all the others, BAPI_MATERIAL_SAVEDATA.

Regards.

0 Kudos

I have successfully passed fields TDOBJECT & TDLINE through table MATERIALLONGTEXT to bapi "BAPI_MATERIAL_SAVEDATA".

But still not able to find out how to pass below fileds  bapi "BAPI_MATERIAL_SAVEDATA".

1)

ERNAMCreator
AENAMChange Id

2)

KZKFGConfig Mat

3)

TDNAMEText Name
SPRAS_ISOLanguage Key

4)

CLASSTYPEClass Number

pls help.

0 Kudos

ERNAM Is being filled with the user who executes the program. ( You cannot chage it )

AENAM will be filled when a user or a program changes the material. ( you cannot change it )

For KZKFG use MATERIAL_SAVE_CONFIGURATION. ( see note 736873 ).

For CLASSTYPE see BAPI_OBJCL_*

TDNAME will be updated automatically. Is the long text name and it will contain the material number and SPRAS_ISO I think you can fill it in LONGTEXTS Table.

Regards.

Message was edited by: Laurent Fournier

0 Kudos

Hi,

i m still confuse about the KZKFG & CLASSTYPE..

i dont have function "MATERIAL_SAVE_CONFIGURATION" in my system and not having access to note..

further i am not getting the point "For CLASSTYPE see BAPI_OBJCL_*"...

0 Kudos

If you don't have FM "MATERIAL_SAVE_CONFIGURATION", you will need access to the note in order to create it in your system. With this FM you can update field KZKFG AFTER you create the material. ( First BAPI_MATERIAL_SAVEDATA And Then "MATERIAL_SAVE_CONFIGURATION".

As for the class you will need BAPI_OBJCL_CREATE again after BAPI_MATERIAL_SAVEDATA.

Regards.

0 Kudos

i have applied the note and created FM "MATERIAL_SAVE_CONFIGURATION", but field KZKFG is not found in any import / export or table parameters...

in import it has below fileds :

MATERIAL

CONF_MATL

PLANT

CONF_MATL_PLANT

and in table it has below fields...

E1CUCFG

E1CUINS

E1CUVAL

E1CUCOM

E1CUCFG_W

E1CUINS_W

E1CUVAL_W

E1CUCOM_W

E1CUCFG_V

E1CUINS_V

E1CUVAL_V

E1CUCOM_V

RETURNMESSAGES

i m not getting how to update field KZKFG thru this function ???

0 Kudos

The indicator will be set automatically when you configure the material.

0 Kudos

If you execute the function with MATERIAL = The material you have created and CONF_MATL the Basic Material in a specific plant probably without any other values entered, the link will be created and the indicator will be set.

0 Kudos

i am not able to check this.. since i m getting below error..

Field MATNR has been transferred inconsistently or is blank

i have tried most of the suggessions given on sdn through blogs.. but not able to resolve this error..

i am basically passing data through IDOCS.. and when in testing the idoc through we19 and filling all the fields.. i m getting this error.. and material is not getting created..

Regards,

0 Kudos

Hi Again,

About the material error, check whether or not you are passing a material number that it's compatible with the external number range. I suppose that the material you are trying to create uses external number range so you must specify also the material number to be created.

Regards.