Hi Divakar,
This is very FAQ .
From parameter header data documentation, it is saying.
When you create material master data, the following fields must always contain a value in the structure:
- MATERIAL
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 can check this thread for more idea.
Internal number assignment with BAPI_MATERIAL_SAVEDATA
Thanks
Gourav.