‎2010 Jan 06 8:52 AM
Hello experts
I am using BAPI_MATERIAL_GETINTNUMBER to generate the material number and then calling the
BAPI_MATERIAL_SAVEDATA Bapi for the creation but after the exectuion i am getting the return value as follows although i have given the newly generated matnr in the MATERIAL filed of HEADDATA passing structre of BAPI_MATERIAL_SAVEDATA
please suggest some solution...
TYPE E
ID MG
NUMBER 046
MESSAGE Field MATNR has been transferred inconsistently or is blank
LOG_NO
LOG_MSG_NO 000000
MESSAGE_V1 MATNR
MESSAGE_V2
MESSAGE_V3
MESSAGE_V4
PARAMETER
ROW 0
FIELD
SYSTEM TEST
___________________________________
‎2010 Jan 06 8:59 AM
Try clearing the header data.
Read the documentation and pass all the mandatory fields.
‎2010 Jan 06 9:10 AM
below is my code.....
CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
EXPORTING
MATERIAL_TYPE = HEADDATA-MATL_TYPE
INDUSTRY_SECTOR = 'A'
REQUIRED_NUMBERS = '1'
IMPORTING
RETURN = RETURN_2
TABLES
MATERIAL_NUMBER = GT_MATERIAL_NUMBER
.
COMMIT WORK.
READ TABLE GT_MATERIAL_NUMBER INTO WA_MATERIAL_NUMBER INDEX 1.
MOVE WA_MATERIAL_NUMBER-MATERIAL TO HEADDATA-MATERIAL.
move 'A' to HEADDATA-ind_sector.
move 'X' to HEADDATA-BASIC_VIEW.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = HEADDATA
CLIENTDATA = CLIENTDATA
CLIENTDATAX = CLIENTDATAX
PLANTDATA = PLANTDATA
PLANTDATAX = PLANTDATAX
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = ' '
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
RETURN = RETURN
TABLES
MATERIALDESCRIPTION = GT_MATERIALDESCRIPTION
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
MATERIALLONGTEXT = GT_MATERIALLONGTEXT
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
‎2010 Jan 06 9:10 AM
Hi,
In the table headdata, there is a flag for external number range.
Since you are using internal number range, please make sure that this flag is initiall.
Also, please dont use commit before creating the material. The commit statement clears all buffer tables.
Hope this helps,
Raj
‎2010 Jan 06 9:11 AM
You can directly use BAPI_MATERIAL_SAVEDATA to create material...
From where your are getting the material number .....?
if you have material number in afile, take those it into internal table and pass that to the bapi BAPI_MATERIAL_SAVEDATA it wil create the material in your sap system.
Please let me know if you need further info..
Regards
Satish Boguda
‎2010 Jan 06 9:16 AM
Hi ,
In BAPI_MATERIAL_SAVEDATA , the HEADDATA parameter should be filled with all the mandatory field values to create a material . For example , only passing the Mat. no would not do , along with that you need to pass the material type value , Industry sector and few more .
Please check the basic mandatory entries needed to create a material and pass the corresponding values to the BAPI .
The material creation should be done .
Regards,
Ranjita
‎2010 Dec 30 7:36 AM
‎2011 Oct 05 7:49 AM
Hi Anup,
I am also getting the same error. My material number is a external material number, I am passing that to HEADERDATA. Can you please let me know how to solve this issue?
Thank you in advance.
Regards,
Isuru