Changing Material Type using BAPI
Hi All,
I am trying to change a material. I able to change many fields of the material except 'Material Type' using BAPI_MATERIAL_SAVEDATA.
Did any one used BAPI_MATERIAL_SAVEDATA or any other BAPIs to change the material type of a material? I do not want to develop BDC for the same as of now.
Thanks in advance.
Regards,
Rama
Did you use BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE.
Look also at this <a href="http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm">Sample Abap code on BAPI_PO_CHANGE</a>
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = T_POHEADER-PO
POHEADER = T_BAPI_POHEADER
POHEADERX = T_BAPI_POHEADERX
TABLES
RETURN = T_BAPIRETURN
POITEM = T_BAPI_POITEM
POITEMX = T_BAPI_POITEMX.
READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = c_x.
ENDIF.
Regards
Similar Messages
-
Issue in transporting changed material type using ALE-IDOC
Hi All,
I am sending the material master data from one system to another using ALE-IDOC.The issue is that teh material type is not getting sent from one system to another after changing the material type.I mean the changes in material type are not getting updated.I will be indeed thankful if anyone can guide me resolve this issue.
Thanks.Hi,
Not all the fields that are changed in material master are sent in the Idoc. Material type is one such field.
Create change pointer on some other field ex. net value or material desc. and transfer the material type changes under it.
KR Jaideep, -
I am trying to Change Material Type using T-code - 'MMAM'.But Message is coming PO already exist.
Problem is tat we have already created GIN for the PO & Reversed the GIN also,but still PO is not getting release to Change any data.It is giving error,that GIN already exist.
I want to Change the MAterial Type.How can i do that.??
Viru.Please note that both the new material type and the old material type must have the
same characteristics eg. quantity based material management is one of
the characteristic. The R/3 Online Help provides a very good explanation
on all the pre-requisites before you can change a material type.
(Logistics Gen>Logistics Basic Data > LO Managing Material Master Data >
Material Master Record > Material Type > Change Material Type)
Please check if you have set the deletion flag for any PO's as
these need to be physically deleted for MMAM to work. You will also
need to check if there are ANY open items for this order. The purchase
orders need to be ARCHIVED. You should complete the invoice receipt for
this position BEFORE you set the deletion flag in the purchase order.
Also, if the material is already in stock, or if reservations or
purchasing documents exist for it, the following conditions must also be
met:
>The stock values of the material of the new material type must be
updated in the same G/L account as the stock values of the material of
the old material type.
>Quantities and values of the material of the new material type must be
updated in exactly the same way in all plants as quantities and values
of the material of the old material type.
>If there is a transfer requirement for the material and if quantities
of the material exist, the new material type must also allow the
material data to be maintained from the Warehouse Management view. -
Please provide me how change the Materil using BAPI...?
Hi Guru's,
could please provide me how change the Materil using BAPI...
please provide the BPAI name and step by step process...
if ou provide any program logic that would be helpfull to me...
thanks in advance
Srinivas....Hi,
THis is code .
*& Report Zs_MATMAS_BAPI
*& This program demonstrates how easy it is to create Material master
*& data using BAPI_MATERIAL_SAVEDATA
*& The program also generates a report post-execution displaying errors
*& as well as successful uploads
REPORT Zs_MATMAS_BAPI.
TABLES
FLAGS *
DATA: F_STOP. " Flag used to stop processing
DATA DECLARATIONS *
DATA : V_EMPTY TYPE I, " No. of empty records
V_TOTAL TYPE I. " Total no. of records.
STRUCTURES & INTERNAL TABLES
*BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
*--- Internal table to hold excel file data
DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*--- Internal table to hold Matetrial descriptions
DATA: BEGIN OF IT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 100,
WERKS(4), " Plant
MTART(4), " Material type
MATNR(18), " Material number
MATKL(9) , " Material group
MBRSH(1), " Industry sector
MEINS(3), " Base unit of measure
GEWEI(3), " Weight Unit
SPART(2), " Division
EKGRP(3), " Purchasing group
VPRSV(1), " Price control indicator
STPRS(12), " Standard price
PEINH(3), " Price unit
SPRAS(2), " Language key
MAKTX(40), " Material description
END OF IT_DATA.
SELECTION SCREEN. *
SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
'C:\Material_master.XLS'.
PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK SCR1.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*--- Validating file
PERFORM VALIDATE_FILE USING P_FILE.
START-OF-SELECTION
START-OF-SELECTION.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
IF NOT IT_DATA[] IS INITIAL.
*--- Perform to delete Header lines
PERFORM DELETE_HEADER_EMPTY_RECS.
ENDIF.
END OF SELECTION. *
END-OF-SELECTION.
*--- Perform to upload Material Master data
PERFORM UPLOAD_MATMAS.
Form : validate_input_file
Description : To provide F4 help for file if read from PC
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC 0.
MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
ENDIF.
ENDFORM. " validate_input_file
*& Form CONVER_XLS_ITAB
text
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ENDFORM. " CONVERT_XLS_ITAB
*& Form MOVE_DATA
text
FORM MOVE_DATA.
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS <FS>.
*--- Sorting the internal table
SORT IT_INTERN BY ROW COL.
CLEAR IT_INTERN.
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS>.
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO <FS>.
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form DELETE_HEADER_EMPTY_RECS
To delete the Header and empty records
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX.
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
P_HEADER = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
V_EMPTY = V_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES V_TOTAL.
IF V_TOTAL = 0.
MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
F_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*& Form UPLOAD_MATMAS
to upload Material Master data
FORM UPLOAD_MATMAS .
LOOP AT IT_DATA.
Header
UNPACK IT_DATA-MATNR TO IT_DATA-MATNR.
BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
Material Description
REFRESH IT_MAKT.
IT_MAKT-LANGU = IT_DATA-SPRAS.
IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
APPEND IT_MAKT.
Client Data - Basic
BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
BAPI_MARA1-DIVISION = IT_DATA-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
Plant - Purchasing
BAPI_MARC1-PLANT = IT_DATA-WERKS.
BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
BAPI_MARCX-PLANT = IT_DATA-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
Accounting
BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
*--- BAPI to create material
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = BAPI_MVKE1
SALESDATAX = BAPI_MVKEX
STORAGETYPEDATA =
STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-MATNR.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,IT_DATA-MATNR.
ENDIF.
ENDLOOP.
ENDFORM. " UPLOAD_MATMAS
Thanks
Sarada -
I want to change Material Type for mass upload.(MMAM)
hi all,
I want to change Material Type for mass upload.(MMAM)
Suggestion pls? or Any BAPI is availablre?
Edited by: abap_friends on Jan 6, 2011 7:12 AM
Moderator message: please do your own research before asking.
Edited by: Thomas Zloch on Jan 6, 2011 11:27 AMThis may be little tough for 10000 sales orders.
1. You have to remove the output record for the irrelevant output record using tcode VV12 for the relevant document type. So now for the document type, the old output wont be triggered.
2. Now, create output records for hte correct output type in VV11 tcode(for the output type BA03) for the document type. Now this output will be triggered for all the document types you are creating from now onwards.
3. To trigger the output type BA03, in all the old orders, you just have to open these sales orders in change mode (VA02), and just save it. When u open it the output type BA03 will be automatically triggered as the master data is maintained in VV11. But because just opening all the 10000 sales orders in VA02 one by one be a mechanical task, you have to think of some tool for this.
May be a CATT procedure can do the trick. Else, you can just create a small program, where you can upload these sales orders and the program will just open these orders in change mode and just saves it (without making any changes). Then the output will be retriggered.
Here again, if you are printing the output directly, it is advisable to trigger the output in batch mode(Date/Time field is 1 in VV11), and then you can again trigger the printing again using the program RSNAST00 after office hours for these 10k orders.
I hope I answered ur query.
Pls lemme know if you need some more info. (You can reward me too...) -
Change material type - any warnings?
A material with very little history exists in the system as a semi-finished item with 1220 valuation class. One purchase order exists that is due in, in two days. No inventory exists. The problem is that the system is not configured to post goods against 1220 valuation class items. So it needs converted to a finished good since the plan is to sell it after it is received from a vendor.
No open orders or other movements exist in the system. Just one new open po that was created today, and could easily be deleted.
So, delete the po then change the material type using MMAM.
Are there any recommendations/warnings someone can offer before this is done?Hi,
Pre requisites for changing a material types:
1. If you use a material ledger the material ledger must be settled in it.
2.If the old material type did not require you to specify a price control for the material the new material type must not be configured such that it allows only
standard price as price control.
3.If the material is already in stock or reservations exists or purchase orders exists the following conditions must exist.
1. The stock values of the new material types must be updated in the same
G/L Account as the stock values of the old material types
2. Quantities and values of the new material types must be updated exactly as were by the old material types.
Regards,
nandha -
When i am changing the material type i am getting this msg. In Po items were deleted.
Change Material Type
The material type cannot be changed.
The reasons for this are:
Valuated stock exists (see valuation areas below).
However, account determination for the two material types differs.
(different account category reference or no valuation data defined)
Valuation area
1030
No open purchase order are there.hi
plz check mmbe for the stock
check for the open PR and PO in ME5A and me2m
then try Change material type
Material Type can be changed using transaction MMAM
Menu: - Logistics > Material Management > Material Master > Material > Change Material Type
u can also use MMZ2 to change material type and ind sec
Refer following link for the same;
http://www.sap123.com/showthread.php?t=21
regards
kunal -
How to change material type and industrial sector of the exsisting material
Hi,
There is an issue where user wants to change material type and industrial sector of the exsisting material .Is it posible to do so??
IF not ,how can we delete that material from material master so that another material with same number and required material type and industrial sector can be created.
Points will be definitely rewarded.
Thanks
RohitHi Rohit,
You can change the material type in MMAM trxn code if the material dosenot conatain any open purchase requisitions, open reservations & open purchase orders. Also material stock should be zero.
Remember the new material type should have same attributes same as old material type.
OLD Material New Material
1) Standard Price 1) Standard Price
2) Manufacture part 2) Manufacture part
profile actvated profile actvated
3) Quantity & Value 3) Quantity & Value
Updation in all areas Updation in all areas
4) should have same GL 4) Should have same GL acs
acs
It is not possible to change Industry sector once created.
If you want to delete the Material, you can flag it in MM06 trxn code.
Reg,
Ashok
Dont forget to Assign points if useful. -
How to create material doc using bapi
hi all,
pls tell me how to create material doc using bapi ,
if i give po no , it will create material doc no .
advance thanks ,Hi venu,
Please go thru this example, it will help u.
REPORT ZBAPIMM01 LINE-SIZE 255 NO STANDARD PAGE HEADING
LINE-COUNT 065(001).
TABLES: T001L, "Storage Locations
MARA, "General Material Data
MAKT, "Material Descriptions
MBEW, "Material Valuation
MARC. "Plant Data for Material
DATA: BAPI_HEAD LIKE BAPIMATHEAD,
BAPI_MAKT LIKE BAPI_MAKT, "Material Description
BAPI_MARA1 LIKE BAPI_MARA, "Client Data
BAPI_MARAX LIKE BAPI_MARAX,
BAPI_MARC1 LIKE BAPI_MARC, "Plant View
BAPI_MARCX LIKE BAPI_MARCX,
BAPI_MBEW1 LIKE BAPI_MBEW, "Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX,
BAPI_RETURN LIKE BAPIRET2.
DATA: BEGIN OF INT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF INT_MAKT.
DATA: BEGIN OF INT_MAT OCCURS 100,
WERKS(4), "Plant
MTART(4), "Material type
MATNR(18), "Material number
MATKL(9) , "Material group
MBRSH(1), "Industry sector
MEINS(3), "Base unit of measure
GEWEI(3), "Weight Unit
SPART(2), "Division
EKGRP(3), "Purchasing group
VPRSV(1), "Price control indicator
STPRS(12), "Standard price
PEINH(3), "Price unit
SPRAS(2), "Language key
MAKTX(40), "Material description
END OF INT_MAT.
SELECT-OPTIONS:
PLANT FOR MARC-WERKS OBLIGATORY MEMORY ID PLT,
MATERIAL FOR MARA-MATNR MEMORY ID MAT,
MATLTYPE FOR MARA-MTART MEMORY ID MTY,
DIVISION FOR MARA-SPART MEMORY ID DIV.
PARAMETERS: F_FILE LIKE RLGRAP-FILENAME
DEFAULT 'C:\DATA\ZMATERIAL.XLS' MEMORY ID F_FILE,
GETDATA AS CHECKBOX, "Tick to download materials data to local harddisk
UPDDATA AS CHECKBOX. "Tick to update date to Materials Master
IF GETDATA = 'X'.
PERFORM DOWNLOAD_DATA.
PERFORM DOWNLOAD_FILE.
ENDIF.
IF UPDDATA = 'X'.
PERFORM UPLOAD_FILE.
PERFORM UPDATE_MM.
ENDIF.
FORM DOWNLOAD_DATA.
SELECT * FROM MARC WHERE LVORM EQ ' '
AND WERKS IN PLANT
AND MATNR IN MATERIAL.
CLEAR MARA.
SELECT SINGLE * FROM MARA WHERE MATNR = MARC-MATNR.
CHECK MATLTYPE.
CHECK DIVISION.
CLEAR MBEW.
SELECT SINGLE * FROM MBEW WHERE MATNR = MARC-MATNR
AND BWKEY = MARC-WERKS.
CLEAR MAKT.
SELECT SINGLE * FROM MAKT WHERE SPRAS = 'EN'
AND MATNR = MARC-MATNR.
WRITE:/ MARC-WERKS, "Plant
MARA-MTART, "Material type
MARA-MATNR, "Material number
MARA-MATKL, "Material group
MARA-MBRSH, "Industry sector
MARA-MEINS, "Base unit of measure
MARA-GEWEI, "Weight Unit
MARA-SPART, "Division
MARC-EKGRP, "Purchasing group
MBEW-VPRSV, "Price control indicator
MBEW-STPRS, "Standard price
MBEW-PEINH, "Price unit
MAKT-SPRAS, "Language key
MAKT-MAKTX. "Material description
INT_MAT-WERKS = MARC-WERKS. "Plant
INT_MAT-MTART = MARA-MTART. "Material type
INT_MAT-MATNR = MARA-MATNR. "Material number
INT_MAT-MATKL = MARA-MATKL. "Material group
INT_MAT-MBRSH = MARA-MBRSH. "Industry sector
INT_MAT-MEINS = MARA-MEINS. "Base unit of measure
INT_MAT-GEWEI = MARA-GEWEI. "Weight Unit
INT_MAT-SPART = MARA-SPART. "Division
INT_MAT-EKGRP = MARC-EKGRP. "Purchasing group
INT_MAT-VPRSV = MBEW-VPRSV. "Price control indicator
INT_MAT-STPRS = MBEW-STPRS. "Standard price
INT_MAT-PEINH = MBEW-PEINH. "Price unit
INT_MAT-SPRAS = MAKT-SPRAS. "Language key
INT_MAT-MAKTX = MAKT-MAKTX. "Material description
APPEND INT_MAT.
CLEAR INT_MAT.
ENDSELECT.
ENDFORM.
FORM DOWNLOAD_FILE.
call function 'WS_DOWNLOAD'
EXPORTING
FILENAME = F_FILE
FILETYPE = 'DAT'
FILETYPE = 'WK1'
tables
data_tab = INT_MAT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
FORMAT COLOR COL_GROUP.
WRITE:/ 'Data Download Successfully to your local harddisk'.
SKIP.
ENDIF.
ENDFORM.
FORM UPLOAD_FILE.
call function 'WS_UPLOAD'
EXPORTING
FILENAME = F_FILE
FILETYPE = 'DAT'
FILETYPE = 'WK1'
tables
data_tab = INT_MAT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC = 0.
FORMAT COLOR COL_GROUP.
WRITE:/ 'Data Upload Successfully from your local harddisk'.
SKIP.
ENDIF.
ENDFORM.
FORM UPDATE_MM.
LOOP AT INT_MAT.
Header
BAPI_HEAD-MATERIAL = INT_MAT-MATNR.
BAPI_HEAD-IND_SECTOR = INT_MAT-MBRSH.
BAPI_HEAD-MATL_TYPE = INT_MAT-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
Material Description
REFRESH INT_MAKT.
INT_MAKT-LANGU = INT_MAT-SPRAS.
INT_MAKT-MATL_DESC = INT_MAT-MAKTX.
APPEND INT_MAKT.
Client Data - Basic
BAPI_MARA1-MATL_GROUP = INT_MAT-MATKL.
BAPI_MARA1-BASE_UOM = INT_MAT-MEINS.
BAPI_MARA1-UNIT_OF_WT = INT_MAT-GEWEI.
BAPI_MARA1-DIVISION = INT_MAT-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
Plant - Purchasing
BAPI_MARC1-PLANT = INT_MAT-WERKS.
BAPI_MARC1-PUR_GROUP = INT_MAT-EKGRP.
BAPI_MARCX-PLANT = INT_MAT-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
Accounting
BAPI_MBEW1-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEW1-PRICE_CTRL = INT_MAT-VPRSV.
BAPI_MBEW1-STD_PRICE = INT_MAT-STPRS.
BAPI_MBEW1-PRICE_UNIT = INT_MAT-PEINH.
BAPI_MBEWX-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
WRITE:/ BAPI_HEAD, BAPI_MARC1.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = BAPI_MVKE1
SALESDATAX = BAPI_MVKEX
STORAGETYPEDATA =
STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = INT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error Message ', BAPI_RETURN.
ENDIF.
ENDLOOP.
ENDFORM.
*---End of Program
Reagrds,
Kumar -
How to avoid changing material type in MIGO & J1IEX ?
Dear all,
How to avoid changing material type in MIGO & J1IEX ?hii
i think u asking about the , if the material is excisable , then it will ask for material type , not all material type , onle like asset , raw material, consumable, non cenvatable , finished oods and tools.
There i hope its standard SAP system setting , because some time the if do consumable procurement with excisable material .
While doing Gr or J1IEX system will consider that material is capital item, that we cancahge to raw material and we can utilize the cenvate credit in the same year .
so it cannot be hide or making gray mode is difficult in practical.
So revert any clarification
Thanks -
Transaction MMAM - Change material type
Does anybody have documentation on transaction MMAM - Change Material type?
Many thanks,
stefano MAzzarelliHi Stefano
Kindly go thru the below link, this might help you.
<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/ff/515b2449d811d182b80000e829fbfe/frameset.htm">Change Material Type</a>
Thanks,
Alexander -
Change material type and valuation class
hi
my client want to change material type and valuation class in their production system. but the material no. and some transaction had done by this material. anything i need to concern? especially, in FI part. thankHey Changing of Material Type is one step
Changing of valuation class is other
and underneth that changing of account is another attached to the valuation class.
The basic requiremnt will be that client want to change the G/L code attached to the valuation class.
If you have already done some transaction it is not fininacialy right to move valuation classes.
Tell in detail what is the requiremnt. -
Hi All,
I have created new material type as ZINS ( Insurance spares ).
Now,I have to change ZSPR ( Spares) material to ZINS material type.
In system there are no liabilities for this material.But ,I am getting following error while executing T-code :-MMAM.
Error :- " Change Material Type
The material type cannot be changed.
The reasons for this are:
QM inspection data exists for the material. In this inspection data,
it is defined that a plan is required for the inspection. However,
inspection plans are not allowed for the new material type.
Plant
1100
6001
Task lists already exist for specific TL types for the material
The new material type does not allow assignment of task lists for these TL types "
I want to know is there any settings required while creating new material type in quality module,as this error seems to be related to Quality module.
Please help,as this is very much urgent.
Thanks.
With Best Regards,
RajeshHi Vivek and Murali,
Thanks for your answers.
In my question ,I mentioned that,
In system there are no liabilities for this material.I want to know is there any settings required while creating new material type in quality module,as this error seems to be related to Quality module.
I got answer,while creating new material type it was not assigned to in quality module.I need to assign the task list type Q to the new Material type.
I have done configuartion as follows, ( Path: SPRO -> Quality management -> Quality Planning -> Inspection planning -> Assign Task List Type to Material types).
Once again thanks for your help and support.
Regards,
Rajesh -
Change vendor address using bapi
Hi all,
How to change vendor address using bapi.
The address,and vendornumber coming from XL file.
Based on the vendor number I want to change the address.
Please give me the example.
regards,
rakesh.Hi Vijay,
Please help me in the following.
As Vendor/Customer Master dont have all the address fields ( like Street4-5), we use FM BAPI_ADDRESSORG_SAVEREPLICA to overcome this problem.
In my case i have created one Custom load program to upload address data using
BAPI_ADDRESSORG_SAVEREPLICA and then LSMW project to upload rest of the data.
In this case when i upload rest of the data by LSMW using BI standard program ( having NODATA indicator "/" in my source file for the fields already uploaded using BAPI above) , address data which uploaded through FM should get populate automatically (by concept of Central Address management) but in my case <b>for some of the Account Group it is not getting populated,</b> please suggest.
regards
Sonal -
Material Movement using BAPI with serial number.
Hello,
I am currently doing material movement using BAPI with serial number management, however in some case it works fine and in some cases it given and error message E213(IO). Unable to find the reason, when simulated the same it works fine for 200 serial numbers and gives error when going above 200 serial number. The confusion is some times it works fine for 3000 serial number as well.
Tried finding the reasion on every possible site. No results.
Thanks in advance for some solution.Hello,
I am currently doing material movement using BAPI with serial number management, however in some case it works fine and in some cases it given and error message E213(IO). Unable to find the reason, when simulated the same it works fine for 200 serial numbers and gives error when going above 200 serial number. The confusion is some times it works fine for 3000 serial number as well.
Tried finding the reasion on every possible site. No results.
Thanks in advance for some solution.
Maybe you are looking for
-
FR Report Print Layout Setup for Excel
Hello All, Is there any way to setup the Page Layout for Excel export of the report.The user will export the report from HTML view on Workspace to Excel from File Menu options.After viewing the report in excel the user should be able to directly prin
-
Firefox is giving me a JavaScript error when I click on a video. Help?
OK, so I am using FireFox 5.0. And every time I click a Youtube video, I get this error message: [Javascript Application] error.BVDCORE.videoFormats is undefined Can anyone tell me how to fix it? The video works fine, it's just extremely annoying to
-
Start up with external Drive connected and switched on
When starting up with my external USB2 drive connected, it takes ages, I usually resort to switching it off and then back on when my Mac has started. Has anyone got any tips on how to speed up the start up process? Cheers
-
Hi folks, I'm having a problem connecting to the internet using a wired connection from my desktop computer (w/ Vista) to my new Linksys WRT54G2 router. The purpose of the router is to set up a simple home network, with a wired connection to my desk
-
Work flow template download error
Hi Folks, I am trying to down load work flow template but its giving me this error please help me out " No Import Filter Was Found To Import the XML Document Chosen. Do You Want to Display the XML Document? " what need to be done. Thanks in advance