Material Master Update through BAPI - Follow up material not updated
Hi Experts,
I am updating the material master through a custom transaction using the BAPI 'BAPI_MATERIAL_SAVEDATA'. Rest of the fields are updating correctly except for discontinuation ind., effective out date & follow-up material.
When I try to update it through MM02 it is working fine. However, when I pass the same data through BAPI it is throwing an error message that 'the material XXXXXX does not exist or is not activated'.
Please advice.
Thanks & Regards,
Ashu Arora
Some more fields need to be updated along with the discont. indicator. Now working fine.
Similar Messages
-
Update EKKO table for the custom field through BAPI
Hi Experts,
I need to create an Custom field in EKKO table through Include Structure.
Now I have to update that custom field in my program.
I have gone through the following but could not solve my question.
Update EKKO table
User Exit for ME21 PO Creation at the time of saving--Urgent
I don't need to update when I hit the save button or any thing
I have the PO's which needs to be updated with that field...
Any suggestions would be greatly helpful.
Thanks,
Chaithanya...
<removed_by_moderator>
Edited by: Julius Bussche on Jul 7, 2008 10:47 PMHi Patrick,
Sorry Patrick you are right.. The structure is at header level.
I have made the changes still I could not achieve it.
I have made the following
In EKKO table I have append the structure with a custom field ZZBUY.
Now I have also appended BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERX with the custom field
ZZBUY.
Here is my program
Data: wa_bapi_poheader type BAPIMEPOHEADER,
wa_bapi_poheaderx type BAPIMEPOHEADERX.
Data: it1_bapi_poheader like BAPI_TE_MEPOHEADER,
it1_bapi_poheaderx like BAPI_TE_MEPOHEADERX.
CALL FUNCTION 'BAPI_PO_GETDETAIL1'
EXPORTING
PURCHASEORDER = wa_DATA-ebeln
* ACCOUNT_ASSIGNMENT = ' '
* ITEM_TEXT = ' '
* HEADER_TEXT = ' '
* DELIVERY_ADDRESS = ' '
* VERSION = ' '
* SERVICES = ' '
IMPORTING
POHEADER = wa_bapi_poheader
* POEXPIMPHEADER =
TABLES
RETURN = it_bapireturn
it1_bapi_poheader-ZZBUY = 'X'.
it1_bapi_poheaderx-ZZBUY = 'X'.
it_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
it_extensionin-valuepart1 = it1_bapi_poheader.
append it_extensionin.
Clear it_extensionin.
it_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
it_extensionin-valuepart1 = it1_bapi_poheaderx.
append it_extensionin.
Clear it_extensionin.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = wa_data-ebeln
POHEADER = wa_bapi_poheader
POHEADERX = wa_bapi_poheaderx
* POADDRVENDOR =
* TESTRUN =
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* POEXPIMPHEADER =
* POEXPIMPHEADERX =
* VERSIONS =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
* NO_PRICE_FROM_PO =
* IMPORTING
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
RETURN = it_bapireturn
* POITEM =
* POITEMX =
* POADDRDELIVERY =
* POSCHEDULE =
* POSCHEDULEX =
* POACCOUNT =
* POACCOUNTPROFITSEGMENT =
* POACCOUNTX =
* POCONDHEADER =
* POCONDHEADERX =
* POCOND =
* POCONDX =
* POLIMITS =
* POCONTRACTLIMITS =
* POSERVICES =
* POSRVACCESSVALUES =
* POSERVICESTEXT =
EXTENSIONIN = it_extensionin
* EXTENSIONOUT =
* POEXPIMPITEM =
* POEXPIMPITEMX =
* POTEXTHEADER =
* POTEXTITEM =
* ALLVERSIONS =
* POPARTNER =
* POCOMPONENTS =
* POCOMPONENTSX =
* POSHIPPING =
* POSHIPPINGX =
* POSHIPPINGEXP =
* POHISTORY =
* POHISTORY_TOTALS =
* POCONFIRMATION =
It gives me messages saying that
Please also populate interface parameter POHEADERX
No data changed
Where am I going wrong..
Waiting for your replies....
Thanks,
Chaitanya -
Setting the custom master page through powershell is NOT working
Hi,
I am writing the below code to set the custom master page through powershell.
But its not working .when i went to site settings-->master page --> in the drodown , the maste page set is seattle.master ONLY, though my current master page is available in the dropdown.
Can anyone pls help, whether i am missing in the below :
Add-PSSnapin Microsoft.SharePoint.Powershell
$SiteURL = "http://srvr1:22307/sites/SPW5"
$weburl= $SiteURL
$Site= Get-SPSite $SiteURL
$web = $Site.OpenWeb()
$web.CustomMasterUrl = "/_catalogs/masterpage/myMasterpage.master"
$web.MasterUrl = "/_catalogs/masterpage/myMasterpage.master"
$web.Update()
DasHi,
Is it a publishing page? If yes can you try the PowerShell scripts corresponding to the following code snippet?
var publishingWeb = PublishingWeb.GetPublishingWeb(web);
publishingWeb.CustomMasterUrl.SetInherit(inheritFromParent, false);
publishingWeb.CustomMasterUrl.SetValue(masterPageUrl, false);
publishingWeb.MasterUrl.SetInherit(inheritFromParent, false);
publishingWeb.MasterUrl.SetValue(masterPageUrl, false);
I've noticed sometime (not sure though) that Master page doesn't get updated if the inherit property is not updated first.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
Sales order change through bapi
iam uploading va02 changes through bapi..but its not changing the sales order
details in bapi_change function module item number its taking as zero. plz can any one
say where iam going wrong.this is my code
*______BAPI STRUCTURES
data : bapi_header type BAPISDH1 occurs 0 with header line,
bapi_item type BAPISDITM occurs 0 with header line,
bapi_header_x like BAPISDH1X occurs 0 with header line,
bapi_item_x type BAPISDITMX occurs 0 with header line,
it_return type BAPIRET2 occurs 0 with header line.
data: v_vbeln like BAPIVBELN-VBELN,
v_bstkd like bapisdh1-purch_no_c,
v_zterm like bapisdh1-pmnttrms,
v_inco1 like bapisdh1-incoterms1,
v_inco2 like bapisdh1-incoterms2,
v_arktx like bapisditm-short_text,
v_koe1n like bapisditm-currency.
*_____ Internal to hold the records in the text file
DATA : BEGIN OF it_header OCCURS 100,
VBELN(10) ,
BSTKD(35) ,
ZTERM(4) ,
INCO1(3) ,
INCO2(28) ,
POSNR(6) ,
matnr(18) ,
ARKTX(40) ,
END OF it_header.
*_____ Internal table to hold excel file data
DATA : it_intern TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK scr1 WITH FRAME TITLE text-111.
PARAMETER : p_file TYPE rlgrap-filename OBLIGATORY .
*paRAMETERS : p_header TYPE i DEFAULT 0.
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.
___________START-OF-SELECTION________________
START-OF-SELECTION.
PERFORM convert_xls_itab. "to convert excel data into internal table
___________END-OF-SELECTION________________
END-OF-SELECTION.
*& Form convert_xls_itab
text
--> p1 text
<-- p2 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.
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.
ENDIF.
PERFORM move_data. " to move the data into an internal table
ENDFORM. " convert_xls_itab
___________END-OF-SELECTION________________
END-OF-SELECTION.
PERFORM upload_so. "to upload salesorder changes
*& Form upload_so
text
--> p1 text
<-- p2 text
*& Form move_data
text
--> p1 text
<-- p2 text
FORM move_data .
DATA : lv_index TYPE i.
FIELD-SYMBOLS <fs>.
SORT it_intern BY row col. "Sorting Internal Table
CLEAR it_intern.
LOOP AT it_intern.
MOVE it_intern-col TO lv_index.
ASSIGN COMPONENT lv_index OF STRUCTURE it_header TO <fs>. " assigning each record to internal table row
MOVE it_intern-value TO <fs>.
AT END OF row.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
" move_data
*& Form upload_so
text
--> p1 text
<-- p2 text
FORM upload_so .
LOOP AT it_header.
Header
v_vbeln = it_header-VBELN.
bapi_header-purch_no_c = it_header-BSTKD.
bapi_header-pmnttrms = it_header-ZTERM.
bapi_header-incoterms1 = it_header-INCO1.
bapi_header-incoterms2 = it_header-INCO2.
APPEND BAPI_header.
bapi_header_x-updateflag = 'U'.
bapi_header_x-purch_no_c = 'X'.
bapi_header_x-pmnttrms = 'X'.
bapi_header_x-incoterms1 = 'X'.
bapi_header_x-incoterms2 = 'X'.
APPEND BAPI_header_x.
item
REFRESH BAPI_item.
bapi_item-ITM_NUMBER = it_header-POSNR.
bapi_item-material = it_header-matnr.
bapi_item-short_text = it_header-arktx.
bapi_item-currency = it_item-koein.
APPEND BAPI_item.
bapi_item_x-updateflag = 'U'.
bapi_item_x-ITM_NUMBER = it_header-POSNR.
bapi_item_x-MATERIAL = 'X'.
bapi_item_x-short_text = 'X'.
bapi_item_x-currency = 'X'.
APPEND bapi_item_x.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = V_VBELN
IMPORTING
OUTPUT = V_VBELN.
BAPI to change sales order
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = v_vbeln
ORDER_HEADER_IN = bapi_header
ORDER_HEADER_INX = bapi_header_x
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
NO_STATUS_BUF_INIT = ' '
TABLES
RETURN = it_return
ORDER_ITEM_IN = bapi_item
ORDER_ITEM_INX = bapi_item_x
PARTNERS =
PARTNERCHANGES =
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
SCHEDULE_LINES =
SCHEDULE_LINESX =
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
COMMIT WORK.
ENDLOOP.
IF IT_return-type = 'E'.
WRITE: / 'Error :', IT_return-message, / 'for VBELN:',it_HEADER-VBELN.
ELSEIF IT_return-type = 'S'.
WRITE: / 'Successfully CHANGED', it_HEADER-VBELN.
ENDIF.
ENDFORM. " upload_so
thankshi
You can use ORDER_ITEMS_IN. For further details use the documentation of the function module.This must help you in your requirement.
regards
Aakash Banga -
Material master upload through flat file using the BAPI_MATERIAL_SAVEDATA
Hi Guys,
I need to upload the material master using the BAPI, I need to update the all the views in the material master, Could any one can help please?
I using EXCEL file is input file and suggest me the, excel file format, if could you suggest it would be very help to me.
Thanks,
Gourisankar.please go through this code
*& Report ZBAPI_MATERIAL_SAVEDATA
*& AUTHOR
*& PURPOSE : THIS REPORT USES BAPI MATERIAL SAVE DATA TO UPDATE AND CREATE
*& THE MATERIAL
REPORT ZBAPI_MATERIAL_SAVEDATA NO STANDARD PAGE HEADING MESSAGE-ID (ZHNC).
TYPES:BEGIN OF TY_MAT,
MATERIAL(4),
IND_SECTOR(1),
MATL_TYPE(4),
BASIC_VIEW(1),
SALES_VIEW(1),
PURCHASE_VIEW(1),
STORAGE_VIEW(1),
MATL_GROUP(9),
BASE_UOM(3),
BASE_UOM_ISO(3),
MATL_GROUP1(1),
BASE_UOM1(1),
BASE_UOM_ISO1(1),
PLANT(4),
DEL_FLAG(1),
PUR_GROUP(3),
BASE_QTY(13),
PLANT2(4),
DEL_FLAG5(1),
PUR_GROUP1(1),
BASE_QTY1(1),
PLANT3(4),
STGE_LOC(4),
MRP_IND(1),
PLANT4(4),
STGE_LOC1(4),
MRP_IND1(1),
SALES_ORG(4),
DISTR_CHAN(2),
DEL_FLAG1(1),
MIN_ORDER(13),
SALES_ORG1(4),
DISTR_CHAN1(2),
DEL_FLAG2(1),
MIN_ORDER1(1),
LANGU(2),
MATL_DESC(40),
END OF TY_MAT.
DATA: IT_DATA TYPE TABLE OF TY_MAT,
WA_DATA LIKE LINE OF IT_DATA.
*decalraing flag
data: v_flag value ''.
*DECLARING WORK AREAs TO BE PASSED TO THE FUNCTION MODULE.
DATA: BAPI_HEAD LIKE BAPIMATHEAD,
BAPI_CLIENTDATA LIKE BAPI_MARA,
BAPI_CLIENTDATAX LIKE BAPI_MARAX,
BAPI_PLANTDATA LIKE BAPI_MARC,
BAPI_PLANTDATAX LIKE BAPI_MARCX,
BAPI_STORAGELOCATIONDATA LIKE BAPI_MARD,
BAPI_STORAGELOCATIONDATAX LIKE BAPI_MARDX,
BAPI_SALESDATA LIKE BAPI_MVKE,
BAPI_SALESDATAX LIKE BAPI_MVKEX,
BAPI_MAKT LIKE BAPI_MAKT,
BAPI_RETURN LIKE BAPIRET2.
*INTERNAL TABLE TO HOLD THE MATERIAL DESCRIPTION
DATA: BEGIN OF IT_MAKT OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT.
DATA END OF IT_MAKT.
DATA:BEGIN OF IT_RET OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA END OF IT_RET.
*INTERNAL TABLE TO HOLD HEADER DATA
DATA: IT_EXCEL TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*SELECTION-SCREEN ELEMENTS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: FNAME TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT 'C:\Documents and Settings\Administrator\Desktop\MATMAS.XLS' .
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 B1.
*DECLARATION OF EXCELAL TABLE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FNAME.
PERFORM F_GET_FILE USING FNAME.
START-OF-SELECTION.
PERFORM F_XLS_ITAB USING FNAME
CHANGING IT_EXCEL.
PERFORM F_MOVE_DATA.
perform F_GET_DATA.
*& Form F_GET_FILE
text
-->P_FNAME text
<--P_SY_SUBRC text
FORM F_GET_FILE USING P_FNAME LIKE FNAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = ' '
MASK = ' '
CHANGING
FILE_NAME = P_FNAME
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE E006(ZHNC).
ENDIF.
ENDFORM. " F_GET_FILE
*& Form F_XLS_ITAB
text
-->P_FNAME text
<--P_IT_EXCEL text
FORM F_XLS_ITAB USING P_FNAME
CHANGING P_IT_EXCEL.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = FNAME
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
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.
ENDIF.
ENDFORM. " F_XLS_ITAB
*& Form F_MOVE_DATA
text
--> p1 text
<-- p2 text
FORM F_MOVE_DATA .
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS <FS>.
*--- Sorting the internal table
SORT IT_EXCEL BY ROW COL.
CLEAR IT_EXCEL.
LOOP AT IT_EXCEL.
MOVE IT_EXCEL-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE WA_DATA TO <FS>.
*--- Asigning the field value to a field symbol
MOVE IT_EXCEL-VALUE TO <FS>.
AT END OF ROW.
APPEND WA_DATA TO IT_DATA.
CLEAR WA_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " F_MOVE_DATA
*& Form F_GET_DATA
text
--> p1 text
<-- p2 text
FORM F_GET_DATA .
LOOP AT IT_DATA INTO WA_DATA.
MOVE-CORRESPONDING WA_DATA TO BAPI_HEAD.
BAPI_HEAD-BASIC_VIEW ='X'.
BAPI_HEAD-SALES_VIEW ='X'.
BAPI_HEAD-PURCHASE_VIEW ='X'.
BAPI_HEAD-STORAGE_VIEW ='X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_CLIENTDATA.
BAPI_CLIENTDATAX-MATL_GROUP = 'X'.
BAPI_CLIENTDATAX-BASE_UOM = 'X'.
BAPI_CLIENTDATAX-BASE_UOM_ISO = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_PLANTDATA.
BAPI_PLANTDATAX-PLANT = BAPI_PLANTDATA-PLANT.
BAPI_PLANTDATAX-DEL_FLAG = 'X'.
BAPI_PLANTDATAX-PUR_GROUP = 'X'.
BAPI_PLANTDATAX-BASE_QTY = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_STORAGELOCATIONDATA.
BAPI_STORAGELOCATIONDATA-PLANT = BAPI_PLANTDATA-PLANT.
BAPI_STORAGELOCATIONDATAX-PLANT = BAPI_STORAGELOCATIONDATA-PLANT.
BAPI_STORAGELOCATIONDATAX-STGE_LOC = BAPI_STORAGELOCATIONDATA-STGE_LOC.
BAPI_STORAGELOCATIONDATAX-MRP_IND = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_SALESDATA.
BAPI_SALESDATAX-SALES_ORG = BAPI_SALESDATA-SALES_ORG.
BAPI_SALESDATAX-DISTR_CHAN = BAPI_SALESDATA-DISTR_CHAN.
BAPI_SALESDATAX-DEL_FLAG = BAPI_SALESDATA-DEL_FLAG.
BAPI_SALESDATAX-MIN_ORDER = 'X'.
REFRESH IT_MAKT.
IT_MAKT-LANGU = WA_DATA-LANGU.
IT_MAKT-MATL_DESC = WA_DATA-MATL_DESC.
APPEND IT_MAKT.
CLEAR IT_RET.
REFRESH IT_RET.
PERFORM F_CALL_BAPI.
READ TABLE IT_RET WITH KEY TYPE = 'S'.
IF SY-SUBRC EQ 0.
PERFORM F_BAPI_COMMIT.
WRITE:/ 'MATERIAL CREATED OR UPDATED SUCESSFULLY WITH MATERIAL NO',WA_DATA-MATERIAL.
ELSE.
MESSAGE E000(ZHNC) WITH 'ERROR IN CREATING THE MATERIAL'.
*WRITE: / 'ERROR IN CREATIN MATERIAL',IT_RET-MESSAGE.
*PERFORM F_DOWNLOAD.
ENDIF.
*ENDIF.
ENDLOOP.
ENDFORM. " F_GET_DATA
*& Form F_CALL_BAPI
text
--> p1 text
<-- p2 text
FORM F_CALL_BAPI .
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_CLIENTDATA
CLIENTDATAX = BAPI_CLIENTDATAX
PLANTDATA = BAPI_PLANTDATA
PLANTDATAX = BAPI_PLANTDATAX
STORAGELOCATIONDATA = BAPI_STORAGELOCATIONDATA
STORAGELOCATIONDATAX = BAPI_STORAGELOCATIONDATAX
SALESDATA = BAPI_SALESDATA
SALESDATAX = BAPI_SALESDATAX
IMPORTING
RETURN = IT_RET
TABLES
MATERIALDESCRIPTION = IT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
APPEND IT_RET.
ENDFORM. " F_CALL_BAPI
*& Form F_BAPI_COMMIT
text
--> p1 text
<-- p2 text
FORM F_BAPI_COMMIT .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
ENDFORM. " F_BAPI_COMMIT -
Problem in Material create through BAPI
Hi All,
For creating MATERIAL first used BAPI_MATERIAL_GETINTNUMBER for material no generation and for creation material master BAPI_MATERIAL_SAVEDATA.
<garbled code removed>
Moderator message: Post relevant portions of the code only!
My problem is material no is not created and passing into second bapi.
Help me out of this
Edited by: Suhas Saha on Jun 17, 2011 8:01 PMHi Venkatesh,
*Use This Bapi :BAPI_MATERIAL_SAVEREPLICA and pass values as mentioned below.*
Use this method to create new material master data or change existing material master data. Every time this method is called, data for one or more materials can be transferred.
When new material master data is created, the material number, the material type and the sector must be sent to the method. Furthermore, a short text and the language in which the short text has been created, have to be entered. When data is being changed, only the material number need be entered.
In the header data, at least one view has to be selected for which the data is to be created. Depending on the selected view, additional mandatory parameters that have been defined as such in Customizing have to be created. If not all mandatory fields are field with data, the method ends with an error message being displayed.
First, the appropriate fields in the tables (for example, CLIENTDATA) have to be filled with data by the user. These fields must also be flagged as the method data can only be written to the database if this is the case. The user must also provide data for the appropriate fields that have been selected in a checkbox table (for example, CLIENTDATAX). Checkbox tables exist for tables that do not contain language-dependent texts (MAKT, MLTX), European article numbers (MEAN) and tax classifications (MLAN). More than one data record can be created for a material in these tables (for all materials transferred to the method).
If a structure contains fields for a unit of measure (for example, structure CLIENTDATA, field BASE_UOM), language indicator (for example, structure MATERIALDESCRIPTION, field LANGU) or country identifier (for example, structure TAXCLASSIFICATIONS, field DEPCOUNTRY) then a similarly-named field ending with _ISO also exists. In doing so, the user has the option of using the internal SAP code or the ISO code for units of measure, language indicators or country identifiers. ISO codes are converted into an SAP code for further processing. The ISO code is only used if the SAP code is not displayed. In Customizing under "General Settings", a clear assignment has to be made between the ISO codes and the SAP codes for the following activities, if you want to use ISO codes:
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 long texts (for example, basic data texts, internal notes, purchasing info texts, material notes or sales and distribution texts) or customer-specific fields have to be created for a material, some specific characteristics have to be taken into consideration. These characteristics are detailed in the documentation for parameters MATERIALLONGTEXT and EXTENSIONIN. -
Material Master Update from group routing.
Dear All,
When we make material routing. in CA02>scheduling>Results--->Update material master (marking). can be done for the lead time scheduling Purpose. and update in CA96.
But when we use Group Routing, and assign multiple materials in routing header, and then go for
CA02>scheduling>Results--->** (no Material Master Update tab Appeared)
Do we have a solution for this?
Thanks & regards
RaghuDear,
Follow these steps,
Scheduling in routing (CA02 ) as :
Call up the operation overview for the routing.
Choose Extras-- Scheduling -- Schedule.
You reach the Scheduling dialog box.
Maintain the data on the dialog box. The system proposes Backward scheduling for the scheduling type.
Choose Continue.
You reach the Enter overview variant dialog box 00000001.
Enter the overview variant you want to use to display the scheduling results. Choose Continue.
The routing is scheduled. You reach the Schedule Overview screen containing the scheduling data.
After the scheduling run has been carried out, click on scheduling Result-- update material master
You use this function to update material master. Go to the CA96 and update material master.
Please try and come back.
Regards,
R.Brahmankar -
Exit for Material Master UPdate
Hi Friends,
could anyone let me know any user exit for Material Master UPdate.
Thanks in Advance
Regardshi
good
MGA00001 Material Master (Industry): Checks and Enhancements
MGA00002 Material Master (Industry): Number Assignment
MGA00003 Material Master (Industry and Retail): Number Display
thanks
mrutyun^ -
Updating values in mara table through bapi
Hi friends,
I am very new to ABAP , just now i have started my carrier in SAP-ABAP.
I have to update these three fields MSTAE, EXTWG, MTPOS_MARA in MARA table through bapi. I need to give these values from selection screen followed by Material no.
I already found some program in the forum but that programs are very lenthy , i am not able to understand.
Can anyone help me by giving some idea or sample program so that i can learn how to do this thing.
Thankx in advance...Hi Ritesh,
Use BAPI_MATERIAL_SAVEDATA to update the entries MSTAE, EXTWG and MTPOS_MARA by passing the following fields:
DATA: ls_headdata TYPE bapimathead,
ls_clientdata TYPE bapi_mara,
ls_clientdatax TYPE bapi_marax,
ls_return TYPE bapiret2.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = ls_material-matnr
IMPORTING
output = ls_headdata-material
EXCEPTIONS
length_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR: ls_headdata-material.
ENDIF.
ls_clientdata-extmatlgrp = ls_material-extwg.
ls_clientdata-pur_status = ls_material-mstae.
ls_clientdata-item_cat = ls_material-mtpos_mara.
ls_clientdatax-extmatlgrp = 'X'.
ls_clientdatax-pur_status = 'X'.
ls_clientdatax-item_cat = 'X'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = ls_headdata
clientdata = ls_clientdata
clientdatax = ls_clientdatax
IMPORTING
return = ls_return.
IF ls_return-type = 'E' OR ls_return-type = 'A'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
Thanks & Regards,
Prasanna -
Freight vendor updation in GR document through BAPI
Dear All
In my system we are creating Goods Receipt in background through *BAPI BAPI_GOODSMVT_CREATE*. In my PO we have entered freight condition FRB1 for that PO line item and assigned a vendor code different from material vendor. For this freight condition FRB1 in the configuration we have maintained in Control Data 2 field Vendor in GR as 2 ( i.e. Entry always possible). This will help us to change freight vendor different from freight vendor maintained in PO line item.
Now my query is that how can I achieve this through BAPI BAPI BAPI_GOODSMVT_CREATE when I am creating GR in background. In which field of BAPI should we pass the freight vendor at the time of GR creation.
Regards
Satish KumarHi Satish,
With standard SAP this is not Possible
As indicated in the attached note 356665, the field SUPPL_VEND has no
function. Please, have a look at this note for further information.
In dialog (with MB01 or MIGO) you have the possibility to enter another
freight vendor different than the vendor in your purchase order (or your
scheduling agreement) as long as you have, in your purchasing condition
type, "Vendor in GR" (V_T685A-BNKWE) maintained with the appropiate
value. Then, by posting the Goods Receipt, you will update EKBZ with
this new freight vendor.
Unfortunately in the standard system this functionality is not available
when working with the BAPI BAPI_GOODSMVT_CREATE or with the Idoc
WMMBID02.
There is no customizing setting or tool that you could use inside the
standard system to change it. -
Quantity field KWMENG not updating in Salesorder created through BAPI
Hi ,
I created sales order through BAPI - BAPI_SALESORDER_CREATEFROMDAT2.Here, I passed material , quantity , unit of measure etc..
But, when the sales order is created the value in the quantity filed is missing.
I passed values as :--
wa_itemx-updateflag = 'I'.
wa_item-itm_number = '10'.
wa_itemx-itm_number = 'X'.
wa_item-material = wa_alv-matnr.
wa_itemx-material = 'X'.
wa_item-rnddlv_qty = wa_alv-kwmeng.
wa_itemx-rnddlv_qty = 'X'.
wa_item-target_qu = wa_alv-kmein.
wa_itemx-target_qu = 'X'.
wa_itemx-ITEM_CATEG = 'X'.
append wa_item to it_item.
append wa_itemx to it_itemx.
What possibly could be the error?
Thanks,
Shivaa......Hi,
You have to pass the quantity in the schedule lines parameter ORDER_SCHEDULES_IN..
Thanks
Naren -
Restricting Creation/Update of Profit Center Master Data through KE51/KE52
Hi,
I have a scenario where profit center master data is maintained in MDM which acts as central repository and the master data is syndicated from MDM to ECC through PRCMAS IDoc. Business requirement is that since MDM is acting as central repository creation/update for profit center through transactions KE51/KE52 should be restricted in ECC. I know that through roles we can restrict user to create profit centers but is there any way/configuration steps which we can perform to restrict user to create profit centers through transaction and I also want to know if that process would affect the creation/updation of master data through PRCMAS IDoc.
Thanks,
AmitHi,
As I told you can go forward using SetID but for that you have to create the SET than assign it to a table and also have to cutomize a standard FM.
Meanwhile I will tell you a easy way you can opt for Transaction Variant usinh SHD0 where dont give the option to save so that no user can create any Profit Centre and than assign that Tcode to the users.
Its a simple way hope it helps you.
Thanks
Arbind -
How to update Assignment field in Accounting Document through BAPI ?
I need to change Assignment field in already posted accounting document through bapi or some other automatic method. Please tell me exactly which bapi I should use and how can I pass the changed assignment field?
Hey,
I couldnt find any BAPIs which update an accounting document. I think the safest way is to record FB02 and use BDC/Call Transaction.
-Kiran
*Please reward useful answers -
Hi, I've recently upgraded to Yosemite. I tried to send a picture out from iPhoto as I regularly do without issue. Now I get this error message, 'Your email did not go through because the server did not reply'. Can you help please?
Try rebuilding your iPhoto library. Directions are simple Rebuilding the iPhoto library. Please post back after doing the rebuild and then re-testing.
-
Need Code For PO-GR through MiGO for multiple documents through BAPI
Hi All
Im using BAPI_GOODSMVT_CREATE to post goods for PO-GR.
When im posting multiple documents its giving error.
When im posting individually, it's working fine.
Please send me the code for PO-GR through BAPI.
Urgently required.
Regards,
SImha.Is this not working???
BAPI_GOODSMVT_CREATE to post Goods Movement
The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system.
BAPI TO Upload Inventory Data
GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
02 - MB31 - Goods Receipts for Prod Order
03 - MB1A - Goods Issue
04 - MB1B - Transfer Posting
05 - MB1C - Enter Other Goods Receipt
06 - MB11
Domain: KZBEW - Movement Indicator
Goods movement w/o reference
B - Goods movement for purchase order
F - Goods movement for production order
L - Goods movement for delivery note
K - Goods movement for kanban requirement (WM - internal only)
O - Subsequent adjustment of "material-provided" consumption
W - Subsequent adjustment of proportion/product unit material
report zbapi_goodsmovement.
parameters: p-file like rlgrap-filename default
'c:\sapdata\TEST.txt'.
parameters: e-file like rlgrap-filename default
'c:\sapdata\gdsmvterror.txt'.
parameters: xpost like sy-datum default sy-datum.
data: begin of gmhead.
include structure bapi2017_gm_head_01.
data: end of gmhead.
data: begin of gmcode.
include structure bapi2017_gm_code.
data: end of gmcode.
data: begin of mthead.
include structure bapi2017_gm_head_ret.
data: end of mthead.
data: begin of itab occurs 100.
include structure bapi2017_gm_item_create.
data: end of itab.
data: begin of errmsg occurs 10.
include structure bapiret2.
data: end of errmsg.
data: wmenge like iseg-menge,
errflag.
data: begin of pcitab occurs 100,
ext_doc(10), "External Document Number
mvt_type(3), "Movement Type
doc_date(8), "Document Date
post_date(8), "Posting Date
plant(4), "Plant
material(18), "Material Number
qty(13), "Quantity
recv_loc(4), "Receiving Location
issue_loc(4), "Issuing Location
pur_doc(10), "Purchase Document No
po_item(3), "Purchase Document Item No
del_no(10), "Delivery Purchase Order Number
del_item(3), "Delivery Item
prod_doc(10), "Production Document No
scrap_reason(10), "Scrap Reason
upd_sta(1), "Update Status
end of pcitab.
call function 'WS_UPLOAD'
exporting
filename = p-file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = pcitab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'. "01 - MB01 - Goods Receipts for Purchase Order
loop at pcitab.
itab-move_type = pcitab-mvt_type.
itab-mvt_ind = 'B'.
itab-plant = pcitab-plant.
itab-material = pcitab-material.
itab-entry_qnt = pcitab-qty.
itab-move_stloc = pcitab-recv_loc.
itab-stge_loc = pcitab-issue_loc.
itab-po_number = pcitab-pur_doc.
itab-po_item = pcitab-po_item.
concatenate pcitab-del_no pcitab-del_item into itab-item_text.
itab-move_reas = pcitab-scrap_reason.
append itab.
endloop.
loop at itab.
write:/ itab-material, itab-plant, itab-stge_loc,
itab-move_type, itab-entry_qnt, itab-entry_uom,
itab-entry_uom_iso, itab-po_number, itab-po_item,
pcitab-ext_doc.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
TESTRUN = ' '
IMPORTING
goodsmvt_headret = mthead
MATERIALDOCUMENT =
MATDOCUMENTYEAR =
tables
goodsmvt_item = itab
GOODSMVT_SERIALNUMBER =
return = errmsg
clear errflag.
loop at errmsg.
if errmsg-type eq 'E'.
write:/'Error in function', errmsg-message.
errflag = 'X'.
else.
write:/ errmsg-message.
endif.
endloop.
if errflag is initial.
commit work and wait.
if sy-subrc ne 0.
write:/ 'Error in updating'.
exit.
else.
write:/ mthead-mat_doc, mthead-doc_year.
perform upd_sta.
endif.
endif.
FORM UPD_STA *
form upd_sta.
loop at pcitab.
pcitab-upd_sta = 'X'.
modify pcitab.
endloop.
call function 'WS_DOWNLOAD'
exporting
filename = p-file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = pcitab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6
endform.
*--- End of Program
REgards,
Ravi
Maybe you are looking for
-
Create a xml file from an internal table: CALL TRANSFORMATION
Hello gurus, I want to create a xml file using data from scustom table. I will create an internal table and will select some records to it. I searched the forum and i discovered the call transformation, but when i execute the example program at the C
-
How do I tell the difference between iPad mini and iPad mini 2? I just bought a iPad mini 2, but it doesn't say iPad mini 2 anywhere except the receipt. Am I missing something? Thank you in advance.
-
Character Encodings when using Streams for Text
hi there, i have a table with a key column (ordinary varchar) and a text column (memo field in ms access, connection is done via the jdbc2odbc bridge). if i read the stuff with ResultSet.getAsciiStream() everything is fine, i.e., printing the resulti
-
When I have changed my Apple ID, why won't my IPad allow me to download apps? It says I am using the wrong login or password. Thanks.
-
How to get the embed html code for my webpage so I can use it on eBay listings?
Hi, I already created a Muse webpage, but when i export it as html I get a code that is not compatible with eBay because eBay won't allow "cookies" nor "iFrame" on a listing.. is there a way around so I can get a working html code for eBay? I'm new a