Material Master: Update the Z fields using BAPI
Hi to all,
My requirement is simple. But I do not have much knowledge on BAPI. I have got some information that we can extend th BAPI and update the Z fields in material master. I have added the z fields in MARA. So when I call the bapi z fields has to get update.
Which BAPI can i use? I have got one BAPI - BAPI_MATERIAL_SAVEDATA. plz suggest me to do it.
1. how do i enhance the BAPI or extend th BAPI.
2. Is ther any approch to do it.
thnks
Yerukala Setty
Hi,
Append the z fields to BAPI_TE_MARA and BAPI_TE_MARAX structures using append structures.
Populate two structures for the fields in BAPI_TE_MARA and BAPI_TE_MARAX.
To BAPI_MATERIAL_SAVEDATA, under EXTENSIONIN parameters, pass structure name as BAPI_TE_MARA and Value Part1, 2, 3, 4 with the filled structure info.
Similarly append X structure as well.
Regards,
Ganga
Similar Messages
-
Issue in material master update from presentation server using BAPI....
Hi Guru's...
i am trying to change the material master from presentation server (desktop flat file)
using BAPI(BAPI_MATERIAL_SAVEDATA) ....
while executing my program i am getting the message like material had changed...
but while in mm02 i am un able to fine the updates...
please find below program logic and correct me if any mistakes....
thanks in advance...
*& Report ZAREPAS36
REPORT zarepas36.
DATA : gs_bapimathead TYPE bapimathead,
gs_clientdata TYPE bapi_mara,
gs_clientdatax TYPE bapi_marax.
TYPES : BEGIN OF gty_itab1,
matnr(18),
matkl(9),
spart(2),
ntgew(13),
gewei(3),
meins(3),
END OF gty_itab1.
DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
gwa_itab1 TYPE gty_itab1.
TYPES: BEGIN OF gty_itab2,
abc(132),
END OF gty_itab2.
DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
gwa_itab2 TYPE gty_itab2.
flat file at selection screen
PARAMETERS: p_files TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_files
filetype = 'ASC'
CHANGING
data_tab = gt_itab2
EXCEPTIONS
OTHERS = 8.
LOOP AT gt_itab2 INTO gwa_itab2.
IF gwa_itab2-abc(1) = 'S'.
gwa_itab1 = gwa_itab2-abc(132).
APPEND gwa_itab1 TO gt_itab1.
ENDIF.
ENDLOOP.
loop at gt_itab1 into gwa_itab1.
*Material
gs_bapimathead-material = gwa_itab1-matnr.
*Material details at client data
*material group.
gs_clientdata-matl_group = gwa_itab1-matkl.
gs_clientdatax-matl_group = 'X'.
*Division
gs_clientdata-division = gwa_itab1-spart.
gs_clientdatax-division = 'X'.
*Net Weight
gs_clientdata-net_weight = gwa_itab1-ntgew.
gs_clientdatax-net_weight = 'X'.
*Unit of Weight
gs_clientdata-unit_of_wt = gwa_itab1-gewei.
gs_clientdatax-unit_of_wt = 'X'.
*Base Unit of Measure
gs_clientdata-base_uom = gwa_itab1-meins.
gs_clientdatax-base_uom = 'X'.
endloop.
*calling BAPI for making changes in material and saving thru BAPI.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = gs_bapimathead
clientdata = gs_clientdata
clientdatax = gs_clientdatax.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE: / 'Error occured while changing material'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'material',gs_bapimathead-material,'changed'.
ENDIF.hi hello Guru's
i resolved the issuee..
pleaso go thru the below proram logic for your reference..........
*& Report ZAREPAS36
REPORT zarepas36.
DATA : gs_bapimathead TYPE bapimathead,
gs_clientdata TYPE bapi_mara,
gs_clientdatax TYPE bapi_marax.
TYPES : BEGIN OF gty_itab1,
matnr(18),
matkl(9),
spart(2),
ntgew(13),
gewei(3),
meins(3),
END OF gty_itab1.
DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
gwa_itab1 TYPE gty_itab1.
TYPES: BEGIN OF gty_itab2,
abc(132),
END OF gty_itab2.
DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
gwa_itab2 TYPE gty_itab2.
DATA:ls_return TYPE bapiret2,
lt_bapiret2 TYPE standard table of bapiret2.
flat file at selection screen
PARAMETERS: p_files TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_files
filetype = 'ASC'
CHANGING
data_tab = gt_itab2
EXCEPTIONS
OTHERS = 8.
LOOP AT gt_itab2 INTO gwa_itab2.
IF gwa_itab2-abc(1) = 'S'.
gwa_itab1 = gwa_itab2-abc(132).
APPEND gwa_itab1 TO gt_itab1.
ENDIF.
ENDLOOP.
LOOP AT gt_itab1 INTO gwa_itab1.
*Material
gs_bapimathead-material = gwa_itab1-matnr.
*Material details at client data
*material group.
gs_clientdata-matl_group = gwa_itab1-matkl.
gs_clientdatax-matl_group = 'X'.
*Division
gs_clientdata-division = gwa_itab1-spart.
gs_clientdatax-division = 'X'.
*Net Weight
gs_clientdata-net_weight = gwa_itab1-ntgew.
gs_clientdatax-net_weight = 'X'.
*Unit of Weight
gs_clientdata-unit_of_wt = gwa_itab1-gewei.
gs_clientdatax-unit_of_wt = 'X'.
*Base Unit of Measure
gs_clientdata-base_uom = gwa_itab1-meins.
gs_clientdatax-base_uom = 'X'.
ENDLOOP.
*calling BAPI for making changes in material and saving thru BAPI.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = gs_bapimathead
clientdata = gs_clientdata
clientdatax = gs_clientdatax
IMPORTING
return = ls_return.
LOOP AT lt_bapiret2 INTO ls_return.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE: / 'Error occured while changing material'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'material',gs_bapimathead-material,'changed'.
ENDIF. -
Creating a material with just the basic view using BAPI
Hi
I intend to create a new material with just the basic view using BAPI BAPI_MATERIAL_SAVEDATA -
To do this - I believe I have to fill in the structure HEADDATA data - ( mandatory ) with the required values - I fill values for fields IND_SECTOR, MATL_TYPE & basic view ( check this field ) and leave the MATERIAL field as blank (assuming internal numbering ) and then fill values of the CLIENTDATA structure with values for the basic data view.
Is this correct ? Will my material number created be returned in the RETURN structure - how do I look for the material number exclusively in my RETURN structure ?hi
good
go through this progarm which ll give you detail idea about BAPI_MATERIAL_SAVEDATA
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
thanks
mrutyun^ -
How to update the Weekly data using BAPI for MD61
Hi All,
i have used two BAPI's in my Z program to upload data from flat file to sap-system (BAPI_REQUIREMENTS_GETDETAIL and BAPI_REQUIREMENTS_CHANGE) and i uploaded the Monthly Data from the flat file on sap system successfully.
but i have to also upload the Weekly Data on the sap system using BAPI.
is there any BAPI for the same or what can be the solution for the uploading weekly data on sap system ?
Please reply me.
Thanks in advance..
Edited by: Prajapati_Shyam on Dec 29, 2010 4:19 PMHi Jovito,
thanks for your reply,
i developed a Z program to upload monthly data as well as weekly data into tcode MD61 by selecting the radio button weekly or monthly but i am not able to upload the weekly data as i didnt' get any BAPI OR any other logic to upload weekly data Or not able to use the existing BAPI BAPI_Requirement_create , because the upload file is in monthly format.
MD61 tcode can be used for both data (Monthly or weekly data).
can you suggesst me any BAPI to upload the weekly data or any other logic for the same
thanks & regards
Prajapati -
IS-RETAIL: How to update custom enhancement field using BAPI?
Hi gurus,
Like ECC BAPI: BAPI_MATERIAL_SAVEDATA,
This BAPI(BAPI_MATERIAL_MAINTAINDATA_RT) is specific for IS-RETAIL to create and update material master data.
But now If I append one custom field "ZFIELD" to end of table MARA, my question is how to update this custom enhancement field(ZFIELD) using BAPI(BAPI_MATERIAL_MAINTAINDATA_RT)
Thanks in advance!Hi DongHai,
I suggest you create your own BAPI. Just copy the codes in BAPI_MATERIAL_MAINTAINDATA_RT and add your custom fields. If you want to append the data of the custom field in table MARA, first, you have to create a structure table then goto SE11, type MARA and display. Click the APPEND STRUCTURE then choose the structure that you've created. Hope this will help.
Rewards if useful
Regards,
Mark -
Update the table SCMG_T_CASE_ATTR using BAPI
Hi Experts,
I have query regarding bapi BAPI_DISPUTE_ATTRIBUTES_CHANGE.
what are the values to be passed in attribute of tables section.
I have pass field name as 'closed_by' (of table SCMG_T_CASE_ATTR) in parameter of bapi (ATTR_ID).
And attr_value field with 'test'.
Please help me to update a field value like 'closed_by' of SCMG_T_CASE_ATTR using this bapi.
Thanks in advance,
SahilHi Cristobal,
Thanks for helping me, however the function does not give me any results, the problem is that this document is a linked object, and not an attachment.
Thanks for your help.
Best regards,
Adriana -
Update the Oracle Table using BAPI
Hi All,
I would like to update Oracle Data Base with my custom BAPI using the Business Logic Transaction.
Could any one please give me some logic how to do it?.
Thanks
R MRM,
Please follow the steps below:
1) Create and Configure the Data Server for the database you want to access/update (basically
you are creating a database connection here).
2) Save and test the connection by clicking the 'Status' button
3) Create new query template with template type as 'SQL Query' and select the server you have
configured in step#1
4) Select the mode as 'Command' and type-in your Insert/Update statements in the 'Fixed Query'
tab. For example: insert into yourtable values ('[Param.1]','[Param.2]')
5) Test the query by passing parameters from the 'Parameters' tab. You are supposed to get a
'Command Execution Successful' message if the data is successfully posted to the database.
6) Create a 'SQL Query' action block in your Business logic transaction to access the above query
and map your Param.1, Param.2 etc. to your BAPI result (on the Link Editor).
Hope this helps.
John -
Upload Journal Voutures of customer master from the Excel sheet using BAPI
Hi experts,
Can U have any sample program so that it can help me for my coding.Hi,
You need write the abap program in the following manner,
1. Read the data from the excel sheet and then enforce the checks if at all any in the new program.
2. Fill all the parameters of the BAPI *BAPI_CASHJOURNALDOC_CREATE *.
3. After the above BAPI call, you need to call another *BAPI_TRANSACTION_COMMIT *.
4. Once Transaction commit bapi is successfully executed then only you will get the document number.
Please follow all the above mentioned steps then you can create the Journal Voutures migrated from an excel sheet to SAP successfully.
Thanks,
Mahesh. -
How to update the Customer field value of PO Item under the Delivery Address Tab?
Hi Friends,
i tried to update the Customer field Using Bapi_PO_change.I passed the PO Order no,POADDRDELIVERY data with Item no,Adrees no,Customer no.But i am getting no data changed message from return table.I attached the screen shots.So please suggest me the helpful information for resoving this issue.
Thanks,
DineshThank you friends,
My Problem was resolved.In my case i have passed the customer value in BAPI_PO_CHANGE POITEM Table with updated customer value.
Thanks,
Dinesh -
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 AroraSome more fields need to be updated along with the discont. indicator. Now working fine.
-
Material master update through BAPI
Hello Experts,
We are using BAPI_MATERIAL_SAVEREPLICA to update material master . It is required to update RefPlant:consumption (MARC-VRBWK) in forecast view . We could not find any field corresponding to MARC-VRBWK in table parameters PLANTDATA .
Please help me if there is any way to update RefPlant:consumption (MARC-VRBWK ) in forecast view by using BAPI_MATERIAL_SAVEREPLICA .
If there is any other BAPI to update the field please let me know .
Regards,
Kiran.Hi Suhas,
I tried EXTENSIONIN & EXTENSIONINX approach but the MARC-VRBWK was not reflected. I did some research and came to know that these extensions can be used to update the custom fields . If there is any way to update the standard field like MARC-VRBWK using extension please let me know . It would be great help .
Thanks,
Kiran. -
Custom - Material Master Update using an IDOC (Message Type - MATMAS_BAPI)
Hello everyone,
I was writing a functional specs. Basically, I want to update the material master MM02 using an IDOC (MATMAS_BAPI01 - Basic Type & MATMAS_BAPI - Message Type). This is currently working.
To my understanding, this currently uses function module - BAPI_IDOC_INPUT1 to update the material master after the IDOC is posted to SAP ECC from XI system.
Now I want to add one small validation logic before it actually updates the material master (MM02).
I looked around and found one exit - EXIT_SAPLMV02_002 in enhancement MGV00001. I was almost sure that this EXIT can be used to write the custom validation code before, actual MM02 updation.
However while trying to establish a link between this EXIT and BAPI_IDOC_INPUT1, I found that EXIT_SAPLMV02_002 is actually a part of another function module - IDOC_INPUT_MATMAS01 and not BAPI_IDOC_INPUT1. I am stuck here if adding the custom logic in the exit really going to work.
a bit of googling and I found from WE30 that the purpose of both these function modules are actually different. While BAPI_IDOC_INPUT1 actually create & updates the material master (also plant specific master data which is my need), IDOC_INPUT_MATMAS01 is just for maintenence of few fields in MM02 (may be custom fields).
Can anyone point out if my thing is in right direction?
Also please offer any solution where shall I put the Custom Logic in the EXIT or the some variants of
BAPI_IDOC_INPUT1.
A less technical explanation would be appreciated as I come from a functional background and invloved in this for writing the func specs. I want to make it sure that what I write is not useless and makes some sense.
Thanks in advance,
AruneshHi Lalit,
Did some head breaking with the function module - BAPI_IDOC_INPUT1 to check whether it is calling the EXIT_SAPLMV02_002 internally. Couldn't get anywhere.
On question of another EXIT in BAPI_IDOC_INPUT1, I don't see any. I am not very proficient in ABAP code, I must say though.
I found the list of exits from google, almost same list everywhere.
http://www.sapfans.com/forums/viewtopic.php?f=21&t=296637
here I got the EXIT, I am talking about.
Any other way to find either the EXIT or link the above?
-- Arunesh -
Adding a Z field in the material master at the plant level
Hi,
I want to add a new text field in the material master.
The data maintained inthis field should be easliy retrievable using some STD SAP Report or using Abap query ( SQ01/SQ02)
Please advise how do i do it.
Regards,Hi,
I want to add a new text field in the material master.
The data maintained inthis field should be easliy retrievable using some STD SAP Report or using Abap query ( SQ01/SQ02)
Please advise how do i do it.
Regards, -
Update the material quantity in the sales order using LSMW...
Hi Guru's,
I created one sales order using BAPI..now i wanted update the material quantity in the sales order using LSMW...
could you please provide the step by step process....
if anyone of you provide the program logic similar to requirement that would be helpfull to me...
thanks in advance
Srinivas....Hi Sri,
Hope it may help you.
First do the recording for VA02 transaction, in that give the existing sales order number
and update the Quantity and save it. Remaining steps are same what we used(LSMW) to upload data to applications.
Regards,
Vishvesh
if helpful, rewards it. -
Hi Abap Experts,
I am facing an issue with an update of material master data when using a Bapi BAPI_MATERIAL_SAVEREPLICA. I am trying to update the below fields
Minlotsize,pl_ti_fince,plnd_delry.
Below is the code which i have used
LOOP AT it_zcostupdate INTO zcostupdate.
READ TABLE it_cost_clr INTO wa_cost_clr "+JS01
WITH KEY lifnr = zcostupdate-lifnr"+JS01
matnr = zcostupdate-matnr."+JS01
IF sy-subrc EQ 0. "+JS01
CLEAR wa_headdata.
wa_headdata-function = c_upd.
wa_headdata-material = zcostupdate-matnr. "Material
wa_headdata-mrp_view = c_x.
APPEND wa_headdata TO it_headdata.
Plant Data
CLEAR wa_plantdata.
wa_plantdata-function = c_upd.
wa_plantdata-material = zcostupdate-matnr. "Material
wa_plantdata-plant = zcostupdate-dwerk. "Plant
wa_plantdata-minlotsize = zcostupdate-bstmi. "Min Lot Size
wa_plantdata-round_val = zcostupdate-bstrf. "Rounding Value
wa_plantdata-pl_ti_fnce = zcostupdate-plifz. "Plnd Delivery Time
wa_plantdata-plnd_delry = zcostupdate-plifz. "Plnd Delivery Time
APPEND wa_plantdata TO it_plantdata.
Plant Data
CLEAR wa_plantdatax.
wa_plantdatax-function = c_upd.
wa_plantdatax-material = zcostupdate-matnr. "Material
wa_plantdatax-plant = zcostupdate-dwerk. "Plant
wa_plantdatax-minlotsize = c_x.
wa_plantdatax-round_val = c_x.
wa_plantdatax-pl_ti_fnce = c_x.
wa_plantdatax-plnd_delry = c_x.
APPEND wa_plantdatax TO it_plantdatax.
ENDIF. "+JS01
ENDLOOP.
When Plantdata internal table is not initial proceed with an update.
IF NOT it_plantdata[] IS INITIAL.
CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
EXPORTING
noappllog = 'X'
nochangedoc = ' '
testrun = ' '
inpfldcheck = ' '
IMPORTING
return = wa_return
TABLES
headdata = it_headdata
plantdata = it_plantdata
plantdatax = it_plantdatax
returnmessages = it_returnmsg.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.
And later stage i am deleting the messages from the it_returnnmsg table other than error and then displaying the log.
It worked perfectly fine when i have done testing in Development & Quality system with couple of test . But it has not done the same when it went into production and no log is displayed .
And in production it has executed for 24k Materials at the same time. I am Just think that due to mass of material it has executed ,it may have cause a problem in update,But not sure whether this is the issue . I am planning to split into 100 materials update at one time.But if any one have any other solution ,i would be great ful to you.
Thanks in advance.
Cheers
J.Hi
Check this link
BAPI_MATERIAL_SAVEDATA with custom z-fields
Maybe you are looking for
-
ITS templates are not correctly loaded.
Dear everyone, I am have a problem in installing ITS IAC template to ITS 4.6(it's old..) We are using EBP 2.0C and I newly installed ITS 4.6 and published all the necessary HTML templates. However, when I access to BBPSTART, it does not load expected
-
SmartView Hsgetvalue function and Refresh
Hi All, I'm creating a SmartView Report using HsgetValue() function. When i Refresh the data is getting displayed correctly, but giving pop up warning that Essbase Error (1020047): A column item conflicts with a Row item Why it is happening ? Can any
-
Changes are not reflecting in Int Directory. Pls suggest
Hi All, I made changes in my Integration Directory. I run the scenario. Changes are not reflected in sxmb_moni. I do SXI_cache, CPA Cache and then again run scenario. Changes are reflected. What steps to do so that I do not have to do SXI_cache, CPA
-
Cluster Shared Volume disappeared after taking the volume offline for Validation Tests.
Hi, After an unknown issue with one of our Hyper-V 4 Node cluster running on Server 2008 R2 SP1 with fibre channel NEC D3-10 SAN Storage all our cluster shared volumes were in redirecting mode and I was unable to get them back online. Only after rebo
-
My requirement is- I have HR ESS in place. Whenever an user places a request for leave, mail goes to SAP Inbox. I need to send a copy to external mail. I got the code somehow. I need to sent mail to the approver/manager as soon as there is a leave re