‎2013 Jun 28 5:46 AM
Hi,
I am writing the code to upload the Materials Master. I know of a fe methodology.
1. LSMW.
2. Custom Program.
3. BAPI.
Recording/BDC might be used. But I want to Evaluate the Pros and cons, Because depending upon the material type ( MTART ) the views will be different and I may not be able to record the screens in BDC since it changes based on the Material type. I alos have the requirement for QM View and also the Altrenate UOM Screen.
I tried checking the BAPI but there is none for the MM upload. What reamains is the Custom program again in which I will have to write the BDC only.
The BAPI I tried finsing out are 'BAPI_STANDARDMATERIAL_CREATE' and BAPI_RETAILMATERIAL_CREATE but they do not have enough parameters to put in the data for all the view. Also it uses the CALL TRANSACTION MM01 Internally.
We fianlly decided to write a custom program.
Can any one tell me the best Method for the uplaod of the MM master and also how should I select the views based on the Material type.
Regards,
Deepak.
‎2013 Jun 28 6:01 AM
Hi Deepak,
You have to do BDC recording for each Material type and handle the screen sequence in your program accordingly.
Regards
Praveen
‎2013 Jun 28 6:01 AM
Hi Deepak,
You have to do BDC recording for each Material type and handle the screen sequence in your program accordingly.
Regards
Praveen
‎2013 Jun 28 6:44 AM
BDC is the last alternative when nothing else works. As it is reliant on the screen's not changing, it is not a stable solution. I've been using MAINTAIN_MATERIAL_DARK and the BAPIs for material maintenance for over 10 years.
If you are doing a data migration program, then use LMSW, and the material direct input procedure. To use anything else is re-inventing the wheel and a waste of time.
I repeat. Do not use BDC.
‎2013 Jun 28 6:07 AM
‎2013 Jun 28 6:44 AM
‎2013 Jun 28 6:37 AM
‎2013 Jun 28 7:16 AM
‎2013 Jun 28 7:16 AM
In recent years I usually use BAPI_MATERIAL_SAVEDATA (with BAPI_STDMATERIAL_GETINTNUMBER).
Before I used report RMDATIND (LSWM 0020 Material Master, Direct Input) but only for initial loading or big batches of material.
Since 4.6C I don't use BDC when I can, I dislike upgrade projects with BDC to rewrite...
Regards,
Raymond
‎2013 Jun 28 7:53 AM
Hi Deepak,
Material Master Upload is very basic requirement and you should never ever go for BDC.
SAP has given amazing BAPIs for it.
I will give you two BAPIs/Cases
Case 1 :- Upload 1 material at a time
BAPI_MATERIAL_SAVEDATA
Pros - Good Error handling.
Cons - Comparatively poor performance
Case 2 :- Upload multiple materials at a time
BAPI_MATERIAL_SAVEREPLICA
Pros - Better Performance
Cons - For error handling you need to loop at the return table and segregate the error causes for every material.
Eg :-
Sample Snippet
*-- Head data
ls_headdata_s-function = 'INS'/'UPD' " use INS for new record, UPD for changing record.
ls_headdata_s-material = <uploaded file work area>-matnr.
ls_headdata_s-matl_type = <uploaded file work area>-mtart.
ls_headdata_s-ind_sector = <uploaded file work area>-mbrsh.
.......
APPEND ls_headdata_s TO lt_headdata_s.
*-- Client Data
ls_clientdata_s-function = 'INS'/'UPD' " use INS for new record, UPD for changing record.
ls_clientdata_s-material = <uploaded file work area>-matnr.
ls_clientdata_s-base_uom = <uploaded file work area>-meins.
.......
append ls_clientdata_s to lt_clientdata_s
*-- Similarly form all tables and pass.
CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
EXPORTING
noappllog = gc_check
nochangedoc = gc_check
testrun = p_test
inpfldcheck = 'W'
IMPORTING
return = ls_ret
TABLES
headdata = lt_headdata_s
clientdata = lt_clientdata_s
clientdatax = lt_clientdatax_s
plantdata = lt_plantdata_s
plantdatax = lt_plantdatax_s
storagelocationdata = lt_storagelocationdata_s
storagelocationdatax = lt_storagelocationdatax_s
valuationdata = lt_valuationdata_s
valuationdatax = lt_valuationdatax_s
salesdata = lt_salesdata_s
salesdatax = lt_salesdatax_s
materialdescription = lt_materialdescription_s
unitsofmeasure = lt_unitsofmeasure_s
unitsofmeasurex = lt_unitsofmeasurex_s
internationalartnos = lt_internationalartnos_s
materiallongtext = lt_materiallongtext_s
taxclassifications = lt_taxclassifications_s
extensionin = lt_extensionsin_s
extensioninx = lt_extensionsinx_s
returnmessages = lt_return2.
Call BAPI_TRANSACTION_COMMIT.
Please revert if you do not understand. I have my code also which you need i can mail you.
BR.
‎2013 Sep 24 8:51 AM
Hello Ankit,
Will you be be able to share the codes for uploading mass material master. I want to extend material master from storage location to storage location managed warehouse and WH views.
We have huge list of material master so we want the fastest way to upload material master. Which will be a faster way to extend material master for storage location and WH views:
1. Bapi - BAPI_MATERIAL_SAVEREPLICA
2. LSMW Standard batch input method
Faster reply will be really helpful
regards
Anand
Message was edited by: Suhas Saha
‎2013 Jun 28 8:04 AM
I generally use '
BAPI_MATERIAL_SAVEDATA
It is a working solution for me for many implementations....
Yes, It is comparitively slow, but considering the case as a one time job during materdata upload phase, we generally go with this BAPI...
Do not use BDC in this case....
Regards,
Venkat
‎2013 Jun 28 8:49 AM
Hey there,
The last weeks i imported material with LSMW. Therefore you can use the BMV0 where you got a quit good logging function.
Cons:
If you customize the transaction mm01 that some field are not showen for specific material you will run into trouble. The filed PRDHA wasn't displayed in mm01 for some types of material, so i got the error:
The field MARA-PRDHA is not ready for input and was therefore not initialized
Haven't tried the bapis right now.
Regards,
Nikolaus
‎2013 Jun 28 10:15 AM
Hi Nikolaus,
please map the source structure with the target structure and target structure is BMMH1 - Material Master: Transfer of Main Data, in this structure the filed is present (PRDHA-Product hierarchy- Type:CHAR, Length: 018)
Please let me know for any clarification.
Regards,
Santosh.
‎2013 Jun 28 12:23 PM
Hello Santosh,
Thanks for help, but I already "solved" this problem. I displayed the field again and was able to map it and transfere the data.
But before i done this, i tried to map the field with the value of the *.csv i used, with an empty sting ('') or with the NODATA sign, but everything without success.
Best regards,
Nikolaus
‎2013 Jun 28 10:07 AM
Hi Deepak,
for uploading the MM records, you can use the LSMW, in that use direct input method (Object:0020), you can get lot of option and it will give you the structure for all the views and you can select the required fields and one important thing is only map the required source structure to target structure (if you map all the source structure to target structure then it will ask to input data which you may not required).
Please let me know for any clarification.
Regards,
Santosh.
‎2013 Sep 24 8:51 AM
Hello Ankit,
Will you be be able to share the codes for uploading mass material master. I want to extend material master from storage location to storage location managed warehouse and WH views.
We have huge list of material master so we want the fastest way to upload material master. Which will be a faster way to extend material master for storage location and WH views:
1. Bapi - BAPI_MATERIAL_SAVEREPLICA
2. LSMW Standard batch input method
Faster reply will be really helpful
regards
Anand
Message was edited by: Suhas Saha
‎2013 Sep 24 10:00 AM
Hi Anand,
Please open a new thread since it will get your query more visibility. As far as code i concerned, mention your email id and i will send my code.
BR.
‎2013 Sep 24 10:14 AM
Hi Anand,
Lsmw Standard batch\Direct input methods is really good. I used this one to upload more than 50 k materials with one by one views.You can get all most all the fields which we can see in material master .
Regards,
Madhu.
‎2013 Sep 24 10:46 AM
Hello Madhu,
I want to extend the material master not create a new material master so I am wondering if we can use standard batch\Direct input method or not, as i only want to extend sloc and WH views.
Hello Ankit,
I want to upload more than 500,000 material master in background. Using BAPI how to upload so many materials in background as I think BAPI don't execute in background and then we also need log to analyse in case of any errors.
regards
Anand
Message was edited by: Matthew Billingham - email address removed
‎2013 Sep 24 11:09 AM
Hi Anand,
As requested please open a new thread. BAPIs(just another function module) are used in programsand can be run in both foreground/online or background mode.
BR.
‎2013 Sep 24 11:13 AM
HI,
By direct input you can update the materials with the views you want.
Also you can use BAPI. Regarding tracking the errors, in direct method we get a error log when we update the materials.
In BAPI, IDOC's will be generated. To get the error log in BAPI method, use WE02 transaction and give your IDOC numbers. filter with IDOC status as 51(error) and take the error messages.
‎2013 Sep 24 11:36 AM
Hi,
Created new thread.
@Ankit - My abap guy says they cant do upload in background using bapi. Not sure how you saying we can run in background. How do you upload in background.
regards
‎2013 Sep 24 6:00 PM
Revanth,
Do you mean to say we won't be able to get a error log using LSMW standard batch/table input and it will be slower than the LSMW-BAPI method?
how much time it will take to do LSMW-BAPI method.
regards
‎2013 Sep 30 11:40 AM
Hello,
I am unable to use BAPI_MATERIAL_SAVEREPLICA bapi to update storage bin. I am able to extend material to storage location, warehouse, storage type but not able to update bin.The field remains blank.
Please advise.
regards
Anand