BAPI to extend material
Guys,
What is appropriate BAPI to extend a material to another plant?
Thanks.
regadrs Marisol
Hi,
Check the BAPI'S
BAPI_MATERIAL_SAVEDATA
BAPI_MATERIAL_GET_ALL
see the sample code
http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm
Regards
Kiran Sure
Similar Messages
-
BAPI to extend material to multiple sales organisation
Hi Experts,
I need to know a BAPI for extending a material to multiple sales org. at one go. My requirement is detailed below:
Suppose an user is providing the details as below:
Material: 90000038
Sales Org: 0011, 0022, 0033.
I need a BAPI where I will pass these values at one go and the material will be extended to sales org. 0011, 0022, 0033. I have used BAPI_MATERIAL_SAVEDATA but of no use. I am not willing to use a BDC in this case where I will loop through the Sales Org. and extending the source material.
Please help me its urgent.....I will reward points for helpful answers.Hi Mylene Euridice,
Thanks a lot for your valuable response. But I want to implement this in ABAP. So can you or anyone else in the forum help me with a BAPI to do the needful as mentioned in my query.
Thanks Abir. -
BAPI - To extend material to other plants (z program).
Dear Friends,
Please help to know the relevant BAPI can be used for below requirement:
Material created one plant (Plant1).
Same has to be extended to other plants (Plant2 & Plant3). Including price and all other data as is needs to be extended. I need to create u2018zu2019 transaction. Please help to know the correct BAPI that I can use.
Thanks in advance for your help.
Best regards,
Lainel.Dear Wolfgang Valtin,
You are right.
Tested, Working fine.
Thank you verymuch for your help.
Resolved my query. Given points- 10.
Thanks & Regards,
Lainel. -
How to extend material cross many plants using BAPI?
Hi.
when i use BAPI 'BAPI_MATERIAL_SAVEDATA' to extend material cross plants, i can not extent accounting view.
code as below:
BAPI_MARC-PLANT = IT_GOUJIAN-WERKS.
BAPI_MARCX-PLANT = IT_GOUJIAN-WERKS.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = BAPIMATHEAD
CLIENTDATA = BAPI_MARA
CLIENTDATAX = BAPI_MARAx
PLANTDATA = BAPI_MARc
PLANTDATAX = BAPI_MARcx
VALUATIONDATA = BAPI_MBEW
VALUATIONDATAX = BAPI_MBEWX
IMPORTING
RETURN = IT_RETURN.
TABLES
MATERIALDESCRIPTION = IT_MATERIALDESC.
i just change the plant data.
any advice?You can extend the material in several plants using
BAPI_MATERIAL_SAVEDATA
All you need to do is populate the import parameter
WA_HEADDATA-MATERIAL
WA_HEADDATA-IND_SECTOR
WA_HEADDATA-MATL_TYPE
and check the views that you want to maintain in the new plant.
Suppose you want to maintain only Basic view than..
WA_HEADDATA-BASIC_VIEW = 'X'.
And based on selected views , you need to populate other
parameters.
like I want to maintain basic view in another plant than
I need to populate the plant data.
WA_PLANTDATA-PLANT = <PLANT>.
populate other fields, if required.
WA_PLANTDATAX-PLANT = <PLANT>.
populate flags, if required.
and pass these parameters to the Function module.
It should work.
Please reward, if you find the answer useful. -
Extend Material Master - Sales Org.
Hi,
I want to copy the material from one sales org. distribution channel to another sales org. distribution channel. My doubt is I want to use BAPI_MATERIAL_SAVEDATA. But how to use this??
Because that material is not present in the target sales org. distribution channel, so for that I have to copy all the views except sales view using BAPI_MATERIAL_GETALL then pass to BAPI_MATERIAL_SAVEDATA.
In this the problem is.. I have to map all the fields between these BAPI. So is there any easy way to do this?
Can anyone have similar requirement like this which can share??
Thanks,
Regards,
Jhings.
Edited by: Jhings on Mar 7, 2012 7:26 PMCheck these threads about the mandatory fields for your requirement:
BAPI_MATERIAL_SAVEDATA extend for new plant whats necessary
Extend material using bapi_material_savedata
About transfer the material data from BAPI_MATERIAL_GETALL to structures to be used on BAPI_MATERIAL_SAVEDATA, i think that MOVE field by field is the better way once there won't many fields to be populated.
Felipe -
Extend material by 'BAPI_MATERIAL_SAVEDATA'
Hi,
the code is as below(it is failed):
BAPIMATHEAD-MATERIAL = it_error-MATNR.
BAPIMATHEAD-BASIC_VIEW = 'X'.
BAPI_MARC-PLANT = IT_GOUJIAN-WERKS.
BAPI_MARCX-PLANT = 'X'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = BAPIMATHEAD
PLANTDATA = BAPI_MARc
PLANTDATAX = BAPI_MARcx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
i just want to extend material created to more plants .
any advice?Hello,
DATA: BEGIN OF GT_TAR_ORG OCCURS 0,
WERKS TYPE WERKS,
WEART TYPE /RB04/OES_YL3_WERKT,
MTART TYPE MTART,
END OF GT_TAR_ORG.
LOOP AT GT_TAR_ORG.
HEADDATA-MATL_TYPE = GT_TAR_ORG-MTART.
GR_PLANTDATA-PLANT = GT_TAR_ORG-WERKS.
GR_PLANTDATAX-PLANT = GT_TAR_ORG-WERKS.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = HEADDATA
CLIENTDATA = GR_CLIENTDATA
CLIENTDATAX = GR_CLIENTDATAX
PLANTDATA = GR_PLANTDATA
PLANTDATAX = GR_PLANTDATAX
IMPORTING
RETURN = GR_RETURN
TABLES
MATERIALDESCRIPTION = MATERIALDESCRIPTION
UNITSOFMEASURE = UNITSOFMEASURE
UNITSOFMEASUREX = UNITSOFMEASUREX
RETURNMESSAGES = GT_RETURNMESSAGES
MATERIALLONGTEXT = GT_MATERIALLONGTEXT
EXTENSIONIN = GT_EXTENSIONIN
EXTENSIONINX = GT_EXTENSIONINX.
Append the return messages to the return table.
APPEND GR_RETURN TO RETURNMESSAGES.
APPEND LINES OF GT_RETURNMESSAGES TO RETURNMESSAGES.
RETURN = GR_RETURN.
ENDLOOP.
If the BAPI is unsuccessful the error flag is X.
IF GR_RETURN-TYPE CA 'AEX'.
GF_ERROR = 'X'.
ENDIF.
LOOP AT GT_RETURNMESSAGES.
IF GT_RETURNMESSAGES-TYPE CA 'AEX'.
GF_ERROR = 'X'.
ENDIF.
ENDLOOP.
Commit only if the updations were successfull
Commit only if the updations were successfull
IF GF_ERROR IS INITIAL.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
If useful reward.
Regards,
Vasanth -
Extend material to another plant
hi all,
I want to extend materials to another plant using copy from... Someone knows which BAPI Can I use
to do this?
thanks.
marisolu can use "BAPI_MATERIAL_SAVEDATA".
Suppose u have to Extend material from 1000 to 1100 plant.
so ur template will be like this:
Material Number,Current_Plant,extend_plant,valuation area ,Type
Using Material Number,Current_Plant , valuation arear , Type and pass it to
BAPI_MATERIAL_GET_DETAIL
u will get all data 4 , BAPI_MATERIAL_SAVEDATA. -
Error during BAPI while uploading Material data through MM01
Hi all,
i am facing one problem when uploading Material data thorough BAPI in MM01.i am attaching the code below and the error given.
but in the debugger all the value is being stored.
REPORT ZFINISHED_MAT.
Data: Begin of legacy_data occurs 0,
MATNR LIKE MARA-MATNR,
MBRSH LIKE MARA-MBRSH, "Industry Sector
MTART LIKE MARA-MTART, "Matl Type
WERKS LIKE MARD-WERKS, "Plant
LGORT LIKE MARD-LGORT, "Storage location
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
MAKTX LIKE MAKT-MAKTX, "Matl Desc.
MEINS LIKE MARA-MEINS, "Base UOM
MATKL LIKE MARA-MATKL, "Matl.Grp
* BISMT LIKE MARA-BISMT,
SPART LIKE MARA-SPART, "Division
* BRGEW LIKE MARA-BRGEW, "Gross weight
GROES LIKE MARA-GROES,
FERTH LIKE MARA-FERTH,
ZEINR LIKE MARA-ZEINR,
TAXKM1 LIKE MLAN-TAXM1,
TAXKM2 LIKE MLAN-TAXM2,
TAXKM3 LIKE MLAN-TAXM3,
TAXKM4 LIKE MLAN-TAXM4,
KTGRM LIKE MVKE-KTGRM,
* GEWEI LIKE MARA-GEWEI, "Weight unit
* NTGEW LIKE MARA-NTGEW, "Net weight
* KLART LIKE RMCLF-KLART,
MTVFP LIKE MARC-MTVFP, "Availibility Check
* XGCHP LIKE MARA-XGCHP,
XCHPF LIKE MARA-XCHPF, "Batch Management
TRAGR LIKE MARA-TRAGR,
LADGR TYPE MARC-LADGR,
VPRSV LIKE MBEW-VPRSV, "Price Control
VERPR LIKE MBEW-VERPR,
* SPRAS LIKE MAKT-SPRAS,
END OF LEGACY_DATA.
DATA: BEGIN OF IT_MAKT OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- 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_MARD1 LIKE BAPI_MARD,
BAPI_MARDX1 LIKE BAPI_MARDX, " Checkbox Structure for BAPI_MARD
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MVKE1 LIKE BAPI_MVKE,
BAPI_MVKEX1 LIKE BAPI_MVKEX, " Checkbox Structure for BAPI_MVKE
BAPI_MLAN1 LIKE BAPI_MLAN,
BAPI_MLANX1 LIKE bapi_mlan1, " Checkbox Structure for BAPI_MLAN
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
* $PARAMETERS DECLARATION$
SELECTION-SCREEN BEGIN OF BLOCK B11
WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. " DEFAULT 'C:\TEST1.XLS'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN END OF BLOCK B11 .
* $DATA DECLARATION$
*DATA : BDC_DATA LIKE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
DATA : IT_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE INITIAL SIZE 0 WITH HEADER LINE,
IT_EXCEL_DUMMY TYPE ALSMEX_TABLINE.
DATA : MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : L_MSTRING(480).
DATA :L_SUBRC LIKE SY-SUBRC.
DATA: V_FILE TYPE STRING.
* $AT-SELECTON SCREEN DECLARATION$
AT SELECTION-SCREEN ON P_FILE.
IF P_FILE IS INITIAL.
MESSAGE E398(00) WITH 'FILE NAME NEEDS TO BE SPECIFIED'.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE
start-of-selection.
perform data_fetch_to_xls.
perform insertion.
*& Form data_fetch_to_xls
* text
* --> p1 text
* <-- p2 text
FORM data_fetch_to_xls .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = 25
I_END_ROW = 2
TABLES
INTERN = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
WRITE: /'ERROR UPLOADING XLS FILE FROM PRESENTATION SERVER !' ,
/'RETURN CODE : ', SY-SUBRC.
ELSE.
*************NOW FILL DATA FROM EXCEL INTO FINAL LEGACY DATA ITAB----LEGACY_DATA***************
IF NOT IT_EXCEL[] IS INITIAL.
CLEAR LEGACY_DATA.
REFRESH LEGACY_DATA[].
LOOP AT IT_EXCEL.
IT_EXCEL_DUMMY = IT_EXCEL.
AT NEW COL.
CASE IT_EXCEL_DUMMY-COL.
WHEN 1.
LEGACY_DATA-MATNR = IT_EXCEL_DUMMY-VALUE(18).
WHEN 2.
LEGACY_DATA-MBRSH = IT_EXCEL_DUMMY-VALUE(1).
WHEN 3.
LEGACY_DATA-MTART = IT_EXCEL_DUMMY-VALUE(4).
WHEN 4.
LEGACY_DATA-WERKS = IT_EXCEL_DUMMY-VALUE(4).
WHEN 5.
LEGACY_DATA-LGORT = IT_EXCEL_DUMMY-VALUE(4).
WHEN 6.
LEGACY_DATA-VKORG = IT_EXCEL_DUMMY-VALUE(4).
WHEN 7.
LEGACY_DATA-VTWEG = IT_EXCEL_DUMMY-VALUE(2).
WHEN 8.
LEGACY_DATA-MAKTX = IT_EXCEL_DUMMY-VALUE(40).
WHEN 9.
LEGACY_DATA-MEINS = IT_EXCEL_DUMMY-VALUE(3).
WHEN 10.
LEGACY_DATA-MATKL = IT_EXCEL_DUMMY-VALUE(9).
WHEN 11.
LEGACY_DATA-SPART = IT_EXCEL_DUMMY-VALUE(2).
WHEN 12.
LEGACY_DATA-GROES = IT_EXCEL_DUMMY-VALUE(32).
WHEN 13.
LEGACY_DATA-FERTH = IT_EXCEL_DUMMY-VALUE(18).
WHEN 14.
LEGACY_DATA-ZEINR = IT_EXCEL_DUMMY-VALUE(22).
WHEN 15.
LEGACY_DATA-TAXKM1 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 16.
LEGACY_DATA-TAXKM2 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 17.
LEGACY_DATA-TAXKM3 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 18.
LEGACY_DATA-TAXKM4 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 19.
LEGACY_DATA-KTGRM = IT_EXCEL_DUMMY-VALUE(2).
WHEN 20.
LEGACY_DATA-MTVFP = IT_EXCEL_DUMMY-VALUE(2).
WHEN 21.
LEGACY_DATA-XCHPF = IT_EXCEL_DUMMY-VALUE(1).
WHEN 22.
LEGACY_DATA-TRAGR = IT_EXCEL_DUMMY-VALUE(4).
WHEN 23.
LEGACY_DATA-LADGR = IT_EXCEL_DUMMY-VALUE(4).
WHEN 24.
LEGACY_DATA-VPRSV = IT_EXCEL_DUMMY-VALUE(1).
WHEN 25.
LEGACY_DATA-VERPR = IT_EXCEL_DUMMY-VALUE(14).
APPEND LEGACY_DATA.
CLEAR LEGACY_DATA.
ENDCASE.
ENDAT.
AT END OF ROW.
ENDAT.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " data_fetch_to_xls
*& Form insertion
* text
* --> p1 text
* <-- p2 text
FORM insertion .
LOOP AT legacy_data.
* Header
BAPI_HEAD-MATERIAL = legacy_data-MATNR.
BAPI_HEAD-IND_SECTOR = legacy_data-MBRSH.
BAPI_HEAD-MATL_TYPE = legacy_data-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-SALES_VIEW = 'X'.
BAPI_HEAD-STORAGE_VIEW = 'X'.
*BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
* Material Description
REFRESH IT_MAKT.
*IT_MAKT-LANGU = legacy_data-SPRAS.
IT_MAKT-MATL_DESC = legacy_data-MAKTX.
APPEND IT_MAKT.
BAPI_MARD1-PLANT = legacy_data-WERKS.
BAPI_MARD1-STGE_LOC = legacy_data-LGORT.
BAPI_MARDX1-PLANT = legacy_data-WERKS.
BAPI_MARDX1-STGE_LOC = legacy_data-LGORT.
** Client Data - Basic
BAPI_MARA1-MATL_GROUP = legacy_data-MATKL.
*bapi_mara1-OLD_MAT_NO = legacy_data-bismt.
BAPI_MARA1-BASE_UOM = legacy_data-MEINS.
BAPI_MARA1-PROD_MEMO = LEGACY_DATA-FERTH.
BAPI_MARA1-SIZE_DIM = LEGACY_DATA-GROES.
BAPI_MARA1-DOCUMENT = LEGACY_DATA-ZEINR.
BAPI_MARA1-BATCH_MGMT = LEGACY_DATA-XCHPF.
*BAPI_MARA1-UNIT_OF_WT = legacy_data-GEWEI.
BAPI_MARA1-TRANS_GRP = legacy_data-TRAGR.
BAPI_MARA1-DIVISION = legacy_data-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
*BAPI_MARAX-OLD_MAT_NO = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-PROD_MEMO = 'X'.
BAPI_MARAX-SIZE_DIM = 'X'.
BAPI_MARAX-DOCUMENT = 'X'.
BAPI_MARAX-BATCH_MGMT = 'X'.
*BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-TRANS_GRP = 'X'.
BAPI_MARAX-DIVISION = 'X'.
*SALES
BAPI_MVKE1-SALES_ORG = legacy_data-VKORG.
BAPI_MVKE1-DISTR_CHAN = legacy_data-VTWEG.
*BAPI_MVKE1-DELYG_PLNT = legacy_data-DWERK.
BAPI_MVKE1-ACCT_ASSGT = legacy_data-KTGRM.
BAPI_MVKEX1-SALES_ORG = legacy_data-VKORG.
BAPI_MVKEX1-DISTR_CHAN = legacy_data-VTWEG.
*BAPI_MVKEX1-DELYG_PLNT = 'X'.
BAPI_MVKEX1-ACCT_ASSGT = 'X'.
** Plant - Purchasing
BAPI_MARC1-PLANT = legacy_data-WERKS.
BAPI_MARC1-LOADINGGRP = legacy_data-LADGR.
BAPI_MARC1-AVAILCHECK = legacy_data-MTVFP.
*BAPI_MARC1-MRP_GROUP = legacy_data-disgr.
BAPI_MARCX-PLANT = legacy_data-WERKS.
BAPI_MARCX-LOADINGGRP = 'X'.
BAPI_MARCX-AVAILCHECK = 'X'.
*BAPI_MARCX-MRP_GROUP = 'X'.
* Accounting
BAPI_MBEW1-VAL_AREA = legacy_data-WERKS.
BAPI_MBEW1-PRICE_CTRL = legacy_data-VPRSV.
BAPI_MBEW1-STD_PRICE = legacy_data-VERPR.
*BAPI_MBEW1-VAL_CLASS = legacy_data-BKLAS.
*BAPI_MBEW1-STD_PRICE = legacy_data-STPRS.
*BAPI_MBEW1-PRICE_UNIT = legacy_data-PEINH.
BAPI_MBEWX-VAL_AREA = legacy_data-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
*BAPI_MBEWX-VAL_CLASS = 'X'.
* TAX JURISDICTION CODE
BAPI_MLAN1-TAXCLASS_1 = LEGACY_DATA-TAXKM1.
BAPI_MLAN1-TAXCLASS_2 = LEGACY_DATA-TAXKM2.
BAPI_MLAN1-TAXCLASS_3 = LEGACY_DATA-TAXKM3.
BAPI_MLAN1-TAXCLASS_4 = LEGACY_DATA-TAXKM4.
BAPI_MLAN1-TAXCLASS_1 = 'X'.
BAPI_MLAN1-TAXCLASS_2 = 'X'.
BAPI_MLAN1-TAXCLASS_3 = 'X'.
BAPI_MLAN1-TAXCLASS_4 = '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:' ,legacy_data-maTNR.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,legacy_data-maTNR.
ENDIF.
ENDLOOP.
ENDFORM. " insertion
The error: The field MARC-MTVFP/BAPI_MARC-AVAILCHECK is defined as a required field; it does not contain an entr
suggestion will be vry helpful,
Kind Regards,
Edited by: Prasenjit Sengupta on Nov 16, 2009 9:11 AMHi Prasenjit,
Did you get any solution for this as I am getting same error from BAPI to update MRP controller in MARC table.
Regards,
Suruchi -
To Extend material to plant using MATERIAL_MAINTAIN_DARK .
I am tryin to extend material into plants using MATERIAL_MAINTAIN_DARK function module.Can someone please check the code below and tell me how i should modify it to work.Is BDC a better option?
DATA: t_amara_ueb LIKE mara_ueb OCCURS 0 WITH HEADER LINE.
DATA: t_amarc_ueb LIKE marc_ueb OCCURS 0 WITH HEADER LINE.
t_amara_ueb-mandt = sy-mandt.
t_amara_ueb-matnr = it_reqdata-material.
t_amara_ueb-tcode = 'MM01'.
t_amara_ueb-tranc = 1.
APPEND t_amara_ueb.
CLEAR t_amara_ueb.
t_amarc_ueb-mandt = sy-mandt.
t_amarc_ueb-matnr = it_reqdata-material.
t_amarc_ueb-werks = it_reqdata-plant.
t_amarc_ueb-tranc = 1.
t_amarc_ueb-KZKRI = 'X'.
APPEND t_amarc_ueb.
CLEAR t_amarc_ueb.
call function 'MATERIAL_MAINTAIN_DARK'
exporting
flag_muss_pruefen = 'X'
p_kz_no_warn = 'N'
kz_prf = space
kz_verw = 'X'
kz_aend = 'X'
kz_dispo = 'X'
tables
amara_ueb = t_amara_ueb
AMARC_UEB = t_AMARC_UEB
EXCEPTIONS
KSTATUS_EMPTY = 1
TKSTATUS_EMPTY = 2
T130M_ERROR = 3
INTERNAL_ERROR = 4
TOO_MANY_ERRORS = 5
UPDATE_ERROR = 6
OTHERS = 7
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
ENDIF.
Thanks and Regards,
Pratima.Hi ,
Use the below code.
DATA : lt_mara_ueb TYPE TABLE OF mara_ueb INITIAL SIZE 0,
lt_marc_ueb TYPE TABLE OF marc_ueb INITIAL SIZE 0,
lt_errors TYPE TABLE OF merrdat INITIAL SIZE 0.
DATA : wa_mara_ueb TYPE mara_ueb,
wa_marc_ueb TYPE marc_ueb,
wa_messtab TYPE merrdat.
DATA : l_mstring(480).
parameters: l_matnr like mara-matnr.
* Set up I_MARA
REFRESH lt_mara_ueb.
wa_mara_ueb-mandt = sy-mandt.
wa_mara_ueb-tcode = 'MM01'.
wa_mara_ueb-matnr = l_matnr.
wa_mara_ueb-tranc = '0000000001'.
APPEND wa_mara_ueb TO lt_mara_ueb.
CLEAR wa_mara_ueb.
SELECT SINGLE * FROM marc INTO CORRESPONDING FIELDS OF wa_marc_ueb
WHERE matnr EQ l_matnr AND werks EQ '01FC'.
IF sy-subrc EQ 0.
MOVE '01BV' TO wa_marc_ueb-werks.
wa_marC_ueb-tranc = '0000000001'.
WA_MARC_UEB-PSTAT = SPACE.
APPEND wa_marc_ueb TO lt_marc_ueb.
ENDIF.
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
* FLAG_MUSS_PRUEFEN = 'X'
* SPERRMODUS = 'E'
* MAX_ERRORS = 0
p_kz_no_warn = 'N'
kz_prf = 'W'
* KZ_VERW = 'X'
* KZ_AEND = 'X'
* KZ_DISPO = 'X'
* KZ_TEST = ' '
* NO_DATABASE_UPDATE = ' '
* CALL_MODE = ' '
* CALL_MODE2 = ' '
* USER = SY-UNAME
* SUPPRESS_ARRAY_READ = ' '
* FLG_MASS = ' '
* IMPORTING
* MATNR_LAST =
* NUMBER_ERRORS_TRANSACTION =
TABLES
amara_ueb = lt_mara_ueb
* AMAKT_UEB =
amarc_ueb = lt_marc_ueb
* AMARD_UEB =
* AMFHM_UEB =
* AMARM_UEB =
* AMEA1_UEB =
* AMBEW_UEB =
* ASTEU_UEB =
* ASTMM_UEB =
* AMLGN_UEB =
* AMLGT_UEB =
* AMPGD_UEB =
* AMPOP_UEB =
* AMVEG_UEB =
* AMVEU_UEB =
* AMVKE_UEB =
* ALTX1_UEB =
* AMPRW_UEB =
* AMFIELDRES =
* AMERRDAT =
EXCEPTIONS
KSTATUS_EMPTY = 1
TKSTATUS_EMPTY = 2
T130M_ERROR = 3
INTERNAL_ERROR = 4
TOO_MANY_ERRORS = 5
UPDATE_ERROR = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK.
Regards,
Raghav -
To extend material master in condition that split valuation.
I want to valuate the material at two different valuation class
if the material is produced internally and procured externally.
So I use split valuation function.
I created accounting view using valuation category at plant level and
I extended accounting view using valuation type.
I tried to extend material master for other plant in condition that
I didnu2019t check batch management in purchasing view
but I mat error message u201CIndividual batch valuation not possible hereu201D(M3184).
To extend material master for other plant, Should I check batch management
in purchasing view ?Hi,
Select the batch management indicator on purchasing view, press F1 button and check technical details. If the field is:
MARA-XCHPF --> batch management is active at client.
MARC-XCHPF --> batch management is active at plant level
Please check SAP online help on batch level:
http://help.sap.com/erp2005_ehp_04/helpdata/EN/25/2838714f7811d18a150000e816ae6e/frameset.htm
Batch Levels
Plant level
The batch number is unique in connection with the plant and material.
The batch number is only known in the plant in which it was created if the stock is transferred to another plant, the batch is unknown in the recipient plant and the system does not adopt any data. You have to recreate and specify the batch in the receiving plant; that is, the same batch number may have different specifications in several plants.
Material level:
The batch number is unique in all plants in connection with the material.
The same batch number has the same meaning for the material in all plants. One batch number cannot have different specifications in different plants. During stock transfer to another plant, the specification of the batch is known in the destination plant even if the batch is placed into storage in that plant for the first time.
Client level:
The batch number is unique in the whole client. A batch number can only be assigned once in the client. You cannot assign the same batch number for different materials.
The batch number is only unique at the chosen level.
If your batch maagement is valid at client / material level you defined it once in table MARA and it is valid for all your plants - that's why you get it automatically (if this is the reason in real).
Regards,
Csaba
Edited by: Csaba Szommer on Nov 7, 2009 5:13 PM -
Function Module / BAPI for Creating Material freight Group
Hi All,
Can anyone tell me the Function Module / Bapi for creating material freight group.
Regards,
Raj.Bapi for creating material freight group. :: You actually use mm01 or mm02 to change data for material flight.
So you can use BAPI for mm02 and mm01
For Ex:
BAPI_MATERIAL_SAVEDATA
Hope this helps -
BAPI to change material assignment with serial number (IQ02)
Hi Experts,
Please let me know the BAPI to change material assignment with serial number in IQ02. I am using BAPI_EQUI_CHANGE, but this does not work. Waiting for Your valuable inputs...
Thanks in advance,
BirendraHello Birendra,
Honestly, I do not have good experience with the BAPI for serialnumber change...
would suggest to explore function module:
SERIALNUMBER_LIST_UPDATE
or
SERIALNUMBER_LIST_SAVE
Also run ST05 to trace what kind of data it passed to these function modules by running IQ02!
Cheers
Krish -
BAPI needed for Material Planning T-code MD20
Hi,
BAPI needed for Material Planning T-code MD20.
Thank You.Hi,
I looked as I needed one too - no BAPI for this - I guess you need to go with batch input for MD20 (worked fine in my LSMW so I guess in ABAP it should be also good)
BR,
Tomek -
How to extend material/customer
Hello Experts
If I want to extend one material for different plant/sales org/storage location then how can i do this . Same for the customer , if i want to extend that customer for other sales areas then how can i do that ?
Regards-
AbhiHi,
You can extend material to different plant and sales organisation by using the T.Code "MM01".
Enter the material number you want to extend and enter the same under copy from.Press Enter.
Select the required views and enter new the plant and Sales organisation you want to extend.
In a similar way,you can extend customer data as well.
Regards,
Krishna. -
How to extend material to new sto loc
Hi All
Let me know how to extend material to new storage location
Tks
ManjuDear,
You can extend material for new storage location via MMSC.
Ans if you want to extend list of material for storage location you can use MMSC_MASS.
If you want to extend material for plant you can use MM01 - for single material and MM50 - For multiple materials.
Regards,
Mahesh Wagh
Maybe you are looking for
-
F4 help for a single field in interactive form
Hi Experts, I am working in HRAS process.I created a Form Scenario and an Adobe Form. I linked my interactive form in portal using standard Start Processes iView . Now I have to create a value help(F4 help) for 'STATE' field based on 'COUNTRY' field
-
Unwanted line in DW when adding a Flash item...Help!
Guys/Gals When I try to put a movie item in my Dreamweaver page, an additional line appears underneath - that I do not want. See this page: http://perryautolaval.com/autoaboutfr.php right under the flash banner, a grey lines appears. It should look l
-
Premiere CC italian and correct US FPS bug
I'm using a trial version of Premiere Pro cc in Italian but the same bug is present on the 7.1 version in Italian of a friend of mine. When I import a clip recorded in the U.S. at 29.97 fps Premiere always automatically assigns a value of 25 fps. Sin
-
IPhoto won't import JPEG pics from iPhone4
I'm not able to import photos taken with my new iPhone 4 into iPhoto; I get the warning 'unrecognized file format' and a list of files, and they're all in JPG format. Any suggestions how to solve this problem?
-
How do i export and import Contacts from and to to Iphone4 and Windows PC
How do I export Contacts from Iphone to windows XP pc and import already exported contacts to Iphone 4