cancel
Showing results for 
Search instead for 
Did you mean: 

Class to Create Material data - CL_MASS_SAVE_MAT_PARALLEL

UdeshiWithanage
Explorer
0 Kudos
307

Hi Experts,

I have a requirement of creating program which is being used to create material data. We have tried using the BAPI 'BAPI_MATERIAL_SAVEDATA'. But since we have customized fields in MARA table and few other relevant tables we are not able to use the BAPI 'BAPI_MATERIAL_SAVEDATA'.

Therefore, we decided to go ahead with the class 'CL_MASS_SAVE_MAT_PARALLEL'. Now when trying to use the class got to know it is mandatory to pass data to below parameters in the method 'PROCESS'

  • IT_SELDATA
  • IS_PARALLEL_CTRL
  • IT_MASSSAVEINFOS

Can anyone please mention what are the data we should pass to these parameters? Also, it would be great help if I can know what are the exact data to be passed in order to get a material created.

View Entire Topic
raymond_giuseppi
Active Contributor
0 Kudos

IMHO Your assertion 'But since we have customized fields in MARA table and few other relevant tables we are not able to use the BAPI BAPI_MATERIAL_SAVEDATA' is wrong, you could have used EXTENSIONIN parameter for this, basically for customer fields (read parameter documentation) and with BAdI STANDARDMATERIAL_SAVE_DATA for any customer table (or too many customer fields for BAPIPAREX structure) the BAdI is called when the structure name isn't one standard extension structure name (BAPI_TE_MARA, BAPI_TE_MARM, BAPI_TE_MAKT, etc.)

The class you are looking at is used by MM17, so you could perform some search from there, but better try with BAPI (or use MM17, MASS or MASSD)

 

UdeshiWithanage
Explorer
0 Kudos
So your recommendation is to use ‘BAPI_MATERIAL_SAVEDATA’ and not the class right?
raymond_giuseppi
Active Contributor
0 Kudos
Yes
UdeshiWithanage
Explorer
0 Kudos

Hi raymond_giuseppi,

I have tried your suggestion which is to maintain the custom fields using the parameters EXTENSIONIN and EXTENSIONINX. But the problem is with these parameters it allows me to maintain the structures BAPI_TE_MARA or BAPI_TE_MARC such as. But in my case our customized fields are appended using a custom structure (ZMAT_IDEN). 

So is there another way which I can maintain those fields? 

raymond_giuseppi
Active Contributor
0 Kudos

Use the already suggested BAdI (pass your Z structure name and data in EXTENSIONIN and handle it in the BAdI implementation)

UdeshiWithanage
Explorer
0 Kudos
Tried that way
UdeshiWithanage
Explorer
0 Kudos

I tried that also. But didn't get updated. Not sure whether I am passing wrong values. Please mention me what am I doing wrong.

Below is my sample code. 

UdeshiWithanage_0-1737024291926.png

UdeshiWithanage_1-1737024356187.png

 

raymond_giuseppi
Active Contributor
0 Kudos
Look at a standard implementing class such as CL_DFS_MM_MATERIAL