Uploading of material master data using bapi BAPI_MATERIAL_SAVEDATA
hi guys,
i am uploading data from a flatfile (say notepad file).
the value for the field BRGEW(gross_wt) is displayed as 0.0000 WHEN i run the transaction MM03 where as in the flat file its value is 0000000000003
the data type of BRGEW is P
what should i do to solve this issue.
my flat file looks like this
000000000000010760FERTRNY01test material KG 005 NY010KG 0000000000003
My structure is
DATA:
BEGIN OF MATERIAL_MASTER,
MATNR(018) TYPE C, "Material number
MTART(004) TYPE C, "Material type
MBRSH(001) TYPE C, "Industry sector
WERKS LIKE MARC-WERKS, "TYPE C Plant
MAKTX(040) TYPE C, "Material description
MEINS(3) TYPE C, "base unit of measure
MATKL(009) TYPE C, "Material group
SPART(002) TYPE C, "Division
WEBAZ(03) TYPE C, "GR processing time
GEWEI LIKE MARA-GEWEI, "Weight unit
BRGEW(13) type c, "Gross weight
end of MATERIAL_MASTER.
thanks
Edited by: nishant patel on Aug 7, 2008 11:16 AM
Hi,
try to fill the BAPI structure
WRITE ds_output1-brgew
TO <bapi_structure>
UNIT 'Pass the unit here'
NO-GROUPING.
Hope it will work.
Thanks,
Kamesh Bathla
Edited by: Kamesh Bathla on Aug 7, 2008 6:51 PM
Similar Messages
-
I am unable to upload the customer master data using BAPI.?
Hi Guru's,
i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1)
Please guide me how upload the data...
Thanks in iadvance
Srinivas...Hello Srinivas
This BAPI does not allow to create a new customer from scratch but only to copy an existing customer to a new one and change its address data.
The reference customer has to be provided using IMPORTING parameter PI_COPYREFERENCE. See also the BAPI documentation for more details.
The BAPI does the same like transaction XD01 with Reference.
Regards
Uwe -
Zprogram to create material master data using bapi
can anyone send me a zprogram which uses a
bapi to create\update material master data .
thanks ,
Amithi,
here below a code sample that will help you
FORM execution .
DATA: is_headdata TYPE bapimathead.
DATA: is_clientdata TYPE bapi_mara.
DATA: is_clientdatax TYPE bapi_marax.
DATA: is_plantdata TYPE bapi_marc.
DATA: is_plantdatax TYPE bapi_marcx.
DATA: is_valuationdata TYPE bapi_mbew.
DATA: is_valuationdatax TYPE bapi_mbewx.
DATA: it_materialdescription TYPE bapi_makt OCCURS 0 WITH HEADER LINE.
DATA : is_storagelocationdata TYPE bapi_mard,
is_storagelocationdatax TYPE bapi_mardx.
*... views
is_headdata-material = mara-matnr.
is_headdata-ind_sector = 'M'.
is_headdata-matl_type = 'ROH'.
is_headdata-basic_view = 'X'.
is_headdata-purchase_view = 'X'.
is_headdata-mrp_view = 'X'.
is_headdata-account_view = 'X'.
is_headdata-cost_view = 'X'.
is_headdata-storage_view = 'X'.
*... constants
is_clientdata-pur_valkey = '3'.
is_clientdatax-pur_valkey = 'X'.
*... Données article générales (de l'écran)
is_clientdata-base_uom = mara-meins.
is_clientdata-matl_group = mara-matkl.
is_clientdata-mfr_no = mara-mfrnr.
is_clientdata-manu_mat = mara-mfrpn.
is_clientdata-pur_status = mara-mstae.
is_clientdata-old_mat_no = mara-bismt.
is_clientdatax-base_uom = 'X'.
is_clientdatax-matl_group = 'X'.
is_clientdatax-mfr_no = 'X'.
is_clientdatax-manu_mat = 'X'.
is_clientdatax-pur_status = 'X'.
is_clientdatax-old_mat_no = 'X'.
*... Description
it_materialdescription-langu = sy-langu.
it_materialdescription-matl_desc = makt-maktx.
APPEND it_materialdescription.
is_plantdata-sm_key = '000'.
is_plantdata-dep_req_id = '2'.
is_plantdata-availcheck = '02'.
is_plantdata-auto_p_ord = 'X'.
is_plantdatax-sm_key = 'X'.
is_plantdatax-dep_req_id = 'X'.
is_plantdatax-availcheck = 'X'.
is_plantdatax-auto_p_ord = 'X'.
is_plantdata-pur_status = mara-mstae.
is_plantdatax-pur_status = 'X'.
is_plantdata-profit_ctr = '100012'.
is_plantdata-proc_type = 'F'.
is_plantdata-determ_grp = 'Z001'.
is_plantdata-deploy_horiz = '000'.
is_plantdatax-proc_type = 'X'.
is_plantdatax-determ_grp = 'X'.
is_plantdatax-deploy_horiz = 'X'.
*... Plant data
is_plantdata-plant = marc-werks.
is_plantdata-pur_group = marc-ekgrp.
is_plantdata-abc_id = marc-maabc.
is_plantdata-mrp_type = marc-dismm.
is_plantdata-plnd_delry = marc-plifz.
is_plantdata-lotsizekey = marc-disls.
is_plantdata-safety_stk = marc-eisbe.
is_plantdata-mrp_ctrler = marc-dispo.
is_plantdata-iss_st_loc = marc-lgpro.
is_plantdata-sloc_exprc = marc-lgfsb.
is_plantdata-round_prof = marc-rdprf.
is_plantdatax-plant = marc-werks.
is_plantdatax-pur_group = 'X'.
is_plantdatax-abc_id = 'X'.
is_plantdatax-mrp_type = 'X'.
is_plantdatax-plnd_delry = 'X'.
is_plantdatax-lotsizekey = 'X'.
is_plantdatax-safety_stk = 'X'.
is_plantdatax-mrp_ctrler = 'X'.
is_plantdatax-iss_st_loc = 'X'.
is_plantdatax-sloc_exprc = 'X'.
is_plantdatax-round_prof = 'X'.
*... Valuation
is_valuationdata-val_area = marc-werks.
is_valuationdatax-val_area = marc-werks.
is_valuationdata-price_ctrl = 'V'.
is_valuationdata-price_unit = '1'.
is_valuationdata-val_class = '3000'.
is_valuationdata-qty_struct = 'X'.
is_valuationdata-orig_mat = 'X'.
is_valuationdata-price_unit = mbew-peinh.
is_plantdata-lot_size = mbew-peinh.
is_valuationdatax-price_ctrl = 'X'.
is_valuationdatax-price_unit = 'X'.
is_valuationdatax-val_class = 'X'.
is_valuationdatax-qty_struct = 'X'.
is_valuationdatax-orig_mat = 'X'.
is_valuationdatax-price_unit = 'X'.
is_plantdatax-lot_size = 'X'.
Storage
IF NOT marc-lgpro IS INITIAL.
is_storagelocationdata-plant = marc-werks.
is_storagelocationdata-stge_loc = marc-lgpro.
is_storagelocationdata-stge_bin = mard-lgpbe.
is_storagelocationdatax-plant = is_storagelocationdata-plant.
is_storagelocationdatax-stge_loc = is_storagelocationdata-stge_loc.
is_storagelocationdatax-stge_bin = 'X'.
ENDIF.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = is_headdata
clientdata = is_clientdata
clientdatax = is_clientdatax
plantdata = is_plantdata
plantdatax = is_plantdatax
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
storagelocationdata = is_storagelocationdata
storagelocationdatax = is_storagelocationdatax
valuationdata = is_valuationdata
valuationdatax = is_valuationdatax
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA =
SALESDATAX =
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
IMPORTING
return = return
TABLES
materialdescription = it_materialdescription
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
returnmessages = it_returnmessages
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
endform.
Regards.
David -
Error while updating AFS weights & measures material master data using BAPI
Hello ABAP experts,
Please help me in finding the right way in updating AFS weights & measures data (/AFS/MARM) data using BAPI /AFS/BAPI_MATERIAL_SAVE_DATA.
I'm populating the following table parameters of the BAPI,
1. SKUUNITSOFMEASURE with /AFS/MARM records
s_bapi_marm-ALT_UNIT = 'EA'.
s_bapi_marm-ALT_UNIT_ISO = 'EA'.
s_bapi_marm-grid_value = 'XXXXS'.
*s_bapi_marm-STOCK_CATEGORY = '01000'.
s_bapi_marm-volume = '10'.
s_bapi_marm-GROSS_WT = '10'.
s_bapi_marm-NET_WEIGHT = '10'.
append s_bapi_marm to t_bapi_marm.
2. UNITSOFMEASURE with MARM records
s_bapi_uom-ALT_UNIT = 'EA'.
s_bapi_uom-ALT_UNIT_ISO = 'EA'.
s_bapi_uom-NUMERATOR = '1'.
s_bapi_uom-DENOMINATR = '1'.
s_bapi_uom-UNIT_OF_WT = 'KG'.
s_bapi_uom-VOLUMEUNIT = 'CCM'.
append s_bapi_uom to t_bapi_uom.
But the BAPI returns me an error "Stock Category & is not valid in Category structure &"
Let me know if you have any inputs on this one.
Thanks,
Partha.Hi VAMSHI,
I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
Please, let me know.
Thanks in advance.
GB -
Problem in uploading material master data using BAPI?
Hi all,
I am using BAPI_MATERIAL_SAVEDATA to upload materail master data. Here i have to pass moving average price values in two currenices(using account_view and valuationdata in BAPI). But i found only one field for moving average price i.e moving_pr in valuationdata.
Please help me on how to upload the moving average price in two currencies?
Thanks,
Aravind.Hi
There is function module BAPI_MATERIAL_SAVEREPLICA where
VALUATIONDATA parameter is in the tables tab.
But I didn't test it. Try, may be it works as you need. -
Problem in extending material master data using BAPI?
Hi all,
I have created a program to upload material master using BAPI_MATERIAL_SAVEDATA WITH VIEWS
Basic view, purchase view, account view , storage view and MRP view. I am successful while uploading this data while not taking the valuation type field to account view(passing only valuation area,valuation class and moving price).
But when i am trying to pass valuation type field also then it is giving error as 'First create the valuation-type-independent data' .
So i have written another program to extend this material to enter valuation type , then it is giving the error as 'Valuation category does not allow split valuation'.
Please help me to solve this problem and while modifying what are the mandatory values to pass to BAPI?
Thanks,
Vamshi.Hi VAMSHI,
I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
Please, let me know.
Thanks in advance.
GB -
Re:Uploading of material master data using lsmw-idoc method
Hi friends,
While processing each idoc one log on window is opening,and status of idoc is 51,eventhough i am passing material description to maktx of e1maktm,it is showing an 'No description is passed'.
Colud you please tell me how to correct these errors,i am new to this lsmw-idoc method.
Thanks in advance,
Anusha.Thank you for reply.
Actually I am uploading the data in flat file from file port to sap.
In idoc inbound processing of lsmw i have created a file port and iam giving the logical system name of the same client.
is this the correct procedure.
Every time when i process each idoc one new logon window is opening and it is showing idoc status as 51.
could you please tell me how to correct this one. -
Problem in uploading material master data using BDC?
Hi all,
I am using BDC call transaction method to upload material data. Here i am facing a problem that a value in the flat file is going to the wrong screen field . But my recording done properly.
In recording, after entering the data in the view BASIC DATA1 and trying to enter the text . For this i need to scroll down the scroll bar and after that i am clicking on basic data text and entering the text. Here i am not touching the languge field.
But the problem is the text to be entered into the basic data text is storing in language and giving error.
Please help me by specifying the reason and solution for this problem? Whether i did any mistake in recording in scrolling?
Thanks,
Vamshi.Hi
Go with BAPI for such huge transactions and screens. Use BAPI: BAPI_MATERIAL_SAVEDATA.
Regards,
Vishwa. -
Create Material Master Data with BAPI
Hi,
I don't know using of BAPI. I want using BAPI_MATERIAL_SAVEDATA bapi for creating material master data for Basic Data1, Basic Data2, Purchasing and MRP views. Does anybody can help me ?
Thank you
Good nightHi,
Please refer to the documentation below:
BAPI_MATERIAL_SAVEDATA
Short Text
Create and Change Article Master Data
Functionality
You use this method to create new material master data or to change existing material master data. The data on a material can be transferred for each call.
When creating material master data, you must transfer the material number, the material type, and the industry sector to the method. You must also enter a material description and its language.
When changing material master data, you need enter only the material number.
In the header data, you must select at least one view for which data is to be created. Depending on the view selected, you must maintain other required parameters. If you do not enter values for all of the required parameters, the method is ended with an error message.
The corresponding fields in the tables (such as CLIENTDATA) must first be supplied with data by the calling program. An indicator must also be set for each of these fields so that the data is written to the database by the method. This requires the calling program to supply the corresponding field with the indicator in a checkbox table (for example, CLIENTDATAX). Checkbox tables exist for tables that do not contain any language-dependent texts (MAKT, MLTX), International Article Numbers (MEAN), or tax classifications (MLAN). Several data records for a material can be created in these tables.
If a structure contains fields for units of measurement (such as structure CLIENTDATA, field BASE_UOM), language indicators (such as structure MATERIALDESCRIPTION, field LANGU), or country indicators (such as structure TAXCLASSIFICATIONS, field DEPCOUNTRY), there is always a field of the same name with the ending _ISO. This makes it possible to transfer either the internally used SAP code or a standardized ISO code for the units of measurement, language indicators, or country indicators. ISO codes are converted to an SAP code internally for further processing. The ISO code is used only if the SAP code is not transferred. If you use ISO codes, there must be a unique assignment of the ISO code to the SAP code in the following activities in Customizing for Global Parameters:
Check Units of Measurement
Define Countries
If you want to maintain long texts (basic data texts, internal comments, purchase order texts, material memos, or sales texts) or customer-defined fields for a material, some special conditions have to be observed. They are described in the documentation for parameters MATERIALLONGTEXT and EXTENSIONIN.
Parameters
HEADDATA
CLIENTDATA
CLIENTDATAX
PLANTDATA
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
RETURN
MATERIALDESCRIPTION
UNITSOFMEASURE
UNITSOFMEASUREX
INTERNATIONALARTNOS
MATERIALLONGTEXT
TAXCLASSIFICATIONS
RETURNMESSAGES
PRTDATA
PRTDATAX
EXTENSIONIN
EXTENSIONINX
Exceptions
Function Group
1001UEB
Thanks,
Sandeep. -
Transferring MATERIAL MASTER DATA USING lsmw
I am using LSMW to transfer material master data from text file using direct input program RMDATIND. The problem is that the field WRKST in screen is of 48 characters while the batch data structure BMMH1 of field WRKST contains 14 characters. How can we transfer the full 48 characters in text file to THE FIELD BMMH1 IN DIRECT INPUT PROGRAM. Can we write any translation or routines . If yes, how is it possible. I can do the same using BDC but our client is already using the LSMW , only the new field WRKST for material has to be inserted. It is picking only 14 characters.
Regards
DebopriyoHi
Kindly use the sap note 351557 it is applicable for your release
if you have any further clarifications let me know
Regards
Damu -
Error in uploading the material master data
HI friends,
I have trasferred the material master data through idocs from one server to another server(with in SAP only).
Outbound side the status of idoc is 3 which is OK.But inbound side ,the status is 51 and the error is 'Function module not allowed IDOC_INPUT_MATMAS01'.I debugged the function module in which the control records , data records are getting transferred correctly and also the segments data is also fine.But , i am not able to rectify the error.
Can anybody give the solutHi mahesh,
check the proces code may be having the FM module 'IDOC_INPUT_MATMAS01'. change with some other FM for processing the IDOC. you need check with different ways what is the problem. better dont stick on one thought.
~linganna -
Material Master Creation Using BAPI
Hi,
I m using BAPI_MATERIAL_SAVEDATA for Material creation using BAPI.
Now the problem is , i have created a Screen exit long back in Purchasing view.. the corresponding Z field is created in table MARC..
How can i pass value to this Z field using BAPI.
i tried with BAPI_MARC.. my Z field is not coming in that structure.
Can anyone guide me how can this be achieved.
Thanks in Advance
Aravindh ManiHi,
The Function Module BAPI_MATERIAL_SAVEDATA has the options to pass the Z fields. There exits a structure parameters
EXTENSIONIN
EXTENSIONINX
in BPAI. In EXTENSIONIN pass the data and value part you can pass in EXTENSIONINX. So this will update the Z fileds in material
master . -
Uploading the pricing master records using bapi
Hi I have to transfer the pricing database from legacy to SAP using bapi but I am not able to find a bapi for that. Pls guide.
Check BAPI: BAPI_PRICES_CONDITIONS. You can also find sample codes in SDN for the BAPI.
Check this link [Example for Price Conditions|Re: Sample code for BAPI_PRICES_CONDITIONS]
Regards
Eswar
Edited by: Eswar Rao Boddeti on Sep 22, 2008 3:52 PM -
Upload the data using BAPI in LSMW
Hi
I want to upload the data using the BAPI in LSMW,but i dont know what value should be passed in
1- Business Object
2- Method
fields.
Ex- Suppose i want to upload the Material Master Data then what should be the value of these two fields.
Thanks
Mrutyunjaya TripathyHi
Sorry to say that i am little bit confuse with your answer
1-The business object already contains some object name wheather i have to give object names or different,As you have mentioned to give the tcode than what tcode that would be
2-If i am giving any internal table name in the method field it is giving me error because this field is related to the business object field
Thanks
Tripathy m -
MATERIAL MASTER DATA UPLOADING THROUGH LSMW
Hi.
I am new to lsmw.
we have a requirement to upload the material master data through LSMW,.
the data is on Excel sheet on the Desktop of the system.
Can any body help me to upload the Material Master data, procedure in step wise.
Thanks in advance,
regards,
Eswar.MHi Venkat,
Go through the following Steps
Using Tcode MM01 -- Maintain the source fields are
1) mara-amtnr char(18)
2) mara-mbrsh char(1)
3) mara-mtart char(4)
4) makt-maktx char(40)
5) mara-meins char(3)
the flate file format is like this as follows
MAT991,C,COUP,Srinivas material01,Kg
MAT992,C,COUP,Srinivas material02,Kg
AMT993,C,COUP,Srinivas material03,Kg
MAT994,C,COUP,Srinivas material04,Kg
MAT995,C,COUP,Srinivas material05,Kg
goto Tcode LSMW
give Project Name
Subproject Name
object Name
Press Enter -
Press Execute Button
It gives 13 radio-Button Options
do the following 13 steps as follows
1) select radio-Button 1 and execute
Maintain Object Attributes
select Standard Batch/Direct Input
give Object -- 0020
Method -- 0000
save & Come Back
2) select radio-Button 2 and execute
Maintain Source Structures
select the source structure and got to click on create button
give source structure name & Description
save & Come Back
3) select radio-Button 3 and execute
Maintain Source Fields
select the source structure and click on create button
give
first field
field name matnr
Field Label material Number
Field Length 18
Field Type C
Second field
field name mbrsh
Field Label Industrial Sector
Field Length 1
Field Type C
Third field
field name mtart
Field Label material type
Field Length 4
Field Type C
fourth field
field name maktx
Field Label material description
Field Length 40
Field Type C
fifth field
field name meins
Field Label base unit of measurement
Field Length 3
Field Type C
save & come back
4) select radio-Button 4 and execute
Maintain Structure Relations
go to blue lines
select first blue line and click on create relationship button
select Second blue line and click on create relationship button
select Third blue line and click on create relationship button
save & come back
5) select radio-Button 5 and execute
Maintain Field Mapping and Conversion Rules
Select the Tcode and click on Rule button there you will select constant
and press continue button
give Transaction Code : MM01 and press Enter
after that
1) select MATNR field click on Source filed(this is the field mapping) select MATNR and press Enter
2) select MBRSH field click on Source filed(this is the field mapping) select MBRSH and press Enter
3) select MTART field click on Source filed(this is the field mapping) select MTART and press Enter
4) select MAKTX field click on Source filed(this is the field mapping) select MAKTX and press Enter
5) select MEINS field click on Source filed(this is the field mapping) select MEINS and press Enter
finally
save & come back
6) select radio-Button 6 and execute
Maintain Fixed Values, Translations, User-Defined Routines
Create FIXED VALUE Name & Description as MM01
Create Translations Name & Description as MM01
Create User-Defined Routines Name & Description as MM01
after that delete all the above three just created in the 6th step
FIXED VALUE --MM01
Translations --MM01
User-Defined Routines --MM01
come back
7) select radio-Button 7 and execute
Specify Files
select On the PC (Frontend) -- and click on Create button(f5)
give the path of the file like "c:\material_data.xls"
description : -
separators as select tab radiao- button
and press enter save & come back
8) select radio-Button 8 and execute
Assign Files
Save & come back
9) select radio-Button 9 and execute
Read Files
Execute
come back
come back
10) select radio-Button 10 and execute
Display Imported Data
Execute and press enter
come back
Come back
11) select radio-Button 11 and execute
Convert Data
Execute
come back
Come back
12) select radio-Button 12 and execute
Display Converted Data
Execute & come back
13) select radio-Button 13 and execute
Start Direct Input Program
select the Program
select continue button
go with via physical file
give the lock mode as 'E'
and execute
Regards
Sreeni
Maybe you are looking for
-
How do I move Photos from old PC to new PC (All in PHS7) ???
I have an old PC with Vista and PHS 7 and about 8 000 photos. I have now bought a new PC with windows 7. How do I move the 8 000 photos into the new PC and a newly installed PHS 7 and have them in the same order???
-
External hard drive is mounting incorrectly
I have an external hard drive (actually I have lots of them) connected to my iMac. One, which is connected via USB3, somehow is behaving funny in 10.8.5. I have tried unplugging the external and reconnecting it. Through disk utility I have also tr
-
When I execute a shell script (which executes a Java/EJB program), I am getting OutofMemoryError. How to overcome this error...? The Java/EJB program is deployed in EAServer 3.5 application server installed in Solaris 2.8. We are connecting to Sybase
-
Customize flag labels in Lion Mail?
Is there a way to customize the names of labels in Lion mail, for example changing "Red" to "Urgent," etc. Thanks in advance for any help! -Robert
-
L_TO_CREATE_MULTIPLE storage Units
hi, I'm trying to create a transfer order using function module L_TO_CREATE_MULTIPLE but on certain cases I am getting error "Requested amount could not be supplied". I implemented the user exit MWMTO004- Function module EXIT_SAPLL03A_005 to ass