2012 Jun 07 7:09 AM
Hi Team,
I need to create the material for more than 10 sales organization presently i am using inside the loop
BAPI_MATERIAL_SAVEDATA function module its taking more time. So i need to create the material at single shot for all the sales organizations.\
Can anyone suggest me this BAPI -BAPI_MATERIAL_SAVEREPLICA will help to solve this issue.If anyone having sample code also give me..
Thanks in Advance,
Ramesh.
2012 Jun 07 7:21 AM
2012 Jun 07 7:30 AM
Hi,
You are correct, the bapi BAPI_MATERIAL_SAVEREPLICA can be used for mass upload of materials. Please go through the documentation provided for the function module, you will understand how to use it.
For more information on how to use the function module you can do a where used list for the function module and find some standard code where it is used. Hope it helps. Thank you.
Regards,
kartik
2012 Jun 07 7:32 AM
You can send all your Sales Org data in SALESDATA Internal table and it should extend the material for all the sales ORgs
2012 Jun 07 8:21 AM
Hello Ramesh,
I did a where-used list on FM BAPI_MATERIAL_SAVEREPLICA and found that there are occurrences wherein BAPI_MATERIAL_SAVEDATA has been commented to use the SAVEREPLICA FM.
Now the point is if the data is very huge, you could call FM BAPI_MATERIAL_SAVEREPLICA in chunks like let's say for every 500 no. of records. You may check the performance after doing the same.
Regards,
Kumud
2012 Jun 07 1:32 PM
Hi ,
Hope you found your answer.Few points may be worthwhile to observe.
1. BAPI_MATERIAL_SAVEDATA and BAPI_MATERIAL_SAVEREPLICA are not alternates in terms of just loops as the SAVEREPLICA corresponds to the IDOC MATMAS_MASS_BAPI01 and SAVEDATA corresponds to IDOC MATMAS_BAPI01 .If you observe the structure you can find out the difference so it really depends on your need whether you can replace one with another or not .
2. Help with the performance is not clear as finally the Underlying FM's which these BAPI's call are same with Minor difference in the way update occurs(Although this may result in performance gain as the database LUW consumes most resources) .
3. Rollback has to be handled very carefully for MASS update as If there is something wrong with the any one of the 999999999 (max no you can input)possible material .None of the Material will get updated and I think that you would not like that.
4. It may be worthwhile to check the real performance you will gain because of the reason explained in point 2.
5. Please check for Mass update T code MM17 or similar transaction to extend your parts to multiple Sales Organization After your part has been created.
6. The best bet is still Idocs' as it will handle the status commit/Rollback properly even in the case of Mass update but it depends whether you are in the implementation or just writing program to avoid User interaction.
Thanks,
Anjan .
.