Mbew updation
Dear all,
i have done dialog programming for material updation , this is the coding i have done , my requirement is i have to maitain the table mbew's moving avg price should be even in all plants based on valuation type . for example material 001 is in all plants with valuation class(sf-dom) say 100 rs in plant1 with valuation type sf-dom i need to get rs 100 in all other plants for the valuation type sf-dom,help me with this
LOOP AT T_ZMUITEM WHERE UPDAT1 = 'X'.
BAPI_HEAD-MATERIAL = T_ZMUITEM-MATNR.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
BAPI_MBEW-MOVING_PR = T_ZMUITEM-VERPR.
BAPI_MBEWX-MOVING_PR = 'X'.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
* CLIENTDATA =
* CLIENTDATAX =
* PLANTDATA =
* PLANTDATAX =
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
VALUATIONDATA = BAPI_MBEW
VALUATIONDATAX = BAPI_MBEWX
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = ' '
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
* IMPORTING
* RETURN =
* TABLES
* MATERIALDESCRIPTION =
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
* ENDCASE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RET_COMMIT
ENDLOOP.
Thanks for ur reply karthik ,,,i havent got any error msg , it just executed but no updation in mbew , here i given a brief expla of my requirement
my t_zmuitem table have follwing fields
matnr description sourceplant update valuationtype value verpr (in sourceplnt here mups for matnr 001)
001 bolt mups x sf dom 100
mups sf inhouse 80
mups 70
002 screw chis sf-dom 120
chis sf-repair 45
here the matnr 001 is in plants mapl chis , i have choosen mups as the source plant , now mups- sf-dom value is 100 , this value should be updated in mapl chis for the valuation type sf-dom , mapl chis - sf inhouse should be updated with rs 80 , mapl chis -space shoul;d be updated with 70 .
here update filed is a checkbox , when click that check box and update button , the value 100 should be updated in all plants which has valuation type sf-dom.
Similar Messages
-
Difference between J_3AMADKA and MBEW / Update SKU standard prices with AFS
Dear reader,
Environement: ECC 6 with AFS 6.3
In a first step,I am trying to create, and in a second step, to update the SKU standard prices using FM: BAPI_MATERIAL_SAVEDATA.
It is really strange the way it performs changes on table MBEW and J_3AMADKA.
Can anyone explain to me the different use of those two tables? I thought that the J_3AMADKA was dedicated to SKU level, but finally, the TA: /n/afs/conv1 create the SKU standard prices only in MBEW !? But BAPI_MATERIAL_SAVEDATA.
just create ONE entree in MBEW (?!?) while all SKU entree but without prices in J_3AMADKA.
In FM: BAPI_MATERIAL_SAVEDATA., I mainly filled structure VALUATIONDATA (=> MBEW) and SKU_PLANTDATA_VALUATION, where surprisingly, there is no standard price field for the SKU !?
Any link or remarks about this topice will be most apprecitaed,
Thanks,
DanielHi Kalias,
Many thanks for your fats reply.
I had a look to the (really old) SAP notes and after some few researches, it seems that AFS 6.3 insert the PRICE and ZKPRS columns again into table J_3AMADKA.
Those columns are even populated with values So it means that they are required by some SAP standard programms.
Maybe you have another clue about this topic?
Thanks again for your help,
Daniel -
MB1C 561 with no Accounting Documents
Hi Gurus,
I created initial entry with MB1C 561 to bring into SAP legacy system figures, but no FI documents were created but the stocks are there, if I check MB52 I can see the value in there so the
value of all the stock match with the value that I have outside SAP, the problem is that at GL level there is no posting. When I see the material document in MB03 it does not have any
accouting documents.
I thought on giving reverse with 562 but when I do this, a FI document is created debiting from the accout of spare parts, this is correct in the system but in my scenario is not because
that account was not credited with the 561 movement. Now both 561 and 562 are working correctly and posting FI documents.
How can I take out the stock without impacting the GL account? Is there any way to Re-post the accounting document that should be created?
Root Cause Analysis:
1.I checked that Materials had a moving average price before the 561 movement, so zero price is not an issue.
2.I checke OMS2 settings for the material type and it had both quantity and value update clicked on.
3.I checked the settings in OMJJ for movement type 561 they have EXBWR, value updates and quantity updates.
4. I checked OBYC settings and it had the right accounts in GBB BSA
5. I checked OMWN settings and it has the right parameters.
Options Explored:
1. If I do a 562 movement a FI document is created debiting from spare parts so this is not an option,
2. Making the price 0 before doing 562 mvmnt also does not work because when I do a MR21 a FI document is created.
Please let me know any ideas to solve this issue.Thanks Jurgen, We are trying to explore all other options before manually creating the journal entries. This is the inventory account so we might have to make changes to the G/L account to make manual postings possible.
There were no update terminations so all the update tasks were processed correctly. I went through the sequence of update tasks and the tables which are updated.
MBEW - Updated correctly
CKMI1 - Updated correctly
bkpf - No Updates
bseg - No Updates
S031 - Updated correctly
S032 - Updated correctly
S033 - Updated correctly
Is there a configuration in SAP which will update material valuation (MBEW) but not update the accounting documents?
If I switch off the value update for material type in OMS2, there will not be any updates to MBEW and also FI. We are trying to get to the root cause of this issue and may be replicte it for reverse posting 562.
Edited by: SFC_KY on Jan 23, 2012 3:17 AM -
Updating the Price Determination Field in the Material Master (MBEW-MLAST)
I'm doing a material conversion into an existing SAP system and the program to load the materials didn't load a value in the price determination field (MBEW-MLAST). Normally this field is required but because the conversion BAPI doesn't do as much validation as MM01 it was possible to create the record without a value. The field is not open to input when I use MM02, and even though it appears to work, when I do MM17 mass change the field is also not updated. Finally I tried transaction CKMM - Change Material Price Determination for Material Ledger but it required an entry in the Old Price Determination field and it won't let me enter blank.
We've since corrected the program but my problem is that I've converted about 5000 materials without a value in the field meaning the FI guys can't release cost estimates which is causing a bunch of problems for the testing that we want to do in this system. We've taken about 3 weeks to do this conversion so going back and doing it again is a terrible option. Does anybody know a way to get a value into this field other than what I've mentioned above (MM02, MM17, CKMM)?
Suggestions please.have a look into OSS Note 1491364 - BAdI CKML_SET_VPRSV: Price determination cannot be changed
-
Updation of Custom fields in MBEWH from MBEW
Hi ABAPpers,
Can anyone give me any clarity if I append same structure in both MBEW and MBEWH, then during the update will these custom fields also gets updated? Or do we have any other procedure to do this?
Edited by: VKUPPILI on Dec 9, 2011 1:17 PMHi,
The append field will be the ZFILEDS that you add. Those will not get updated automatically but proper enhancements has be written to pass values to that field. The include where you can start to have a look is LMBMMF20 (FORM MBEW_UPDATE)..
Hope that Helps
Anirban M. -
Updating mbew table using bapi_material_savedata
Hi experts,
when i am tring to updae valuation type using bapi_material_savedata.
i am getting the following error
749Required parameters missing when calling up module T001k_SINGLE_READ.
pleae help
thanks in advance
Naresh
Edited by: naresh.k.dasari on Jan 18, 2011 10:20 AMHi Naresh,
I am facing the same problem when I try to use this BAPI to update profit centre through table MARC.
What did you have to fill in the HEADDATA structure?
Did you fill only the HEADDATA and the structure regarding to the data you want to update?
Thanks in advance.
Ricardo. -
Report for historic valuation of material-MBEW and MBEWH
Hello,
Our client needs a report that shows the value of stock of past period, the medium price during last exercises. Actually they have a Z report that show all this data, considering the data on MBEWH. The problem is that MBEWH only is updated if there is a price change (for example MR21) or a goods receipt. This table only will be changed when in the comiing month a material have any movement of stock.
My question, if we catch the values LFGJA and LFMON OF MBEW table we consider the last change of price, and the key for entering to MBEWH table to get the past values.
I have checked too, the MC.9 transaction. Looks like fine too, but if we can develop a program for accessing to the S039 table, this table is transparent table and we can not get any data. The data is providing from S032 table, and I have seen, that this table sometimes contains insconsistency values or negative values.
Is there another transaction to get our client's requeriments???
ThanksHi Ravikumar,
Hope you are an ABAPer. If not also, you can achieve this through an ABAPer. As mentioned by others, you need to check whether your requirement is met by the standard transaction MB5B. You need to check whether this transaction gives you the exact opening and closing balance for a material. If this gives what you want, then you need to make some small enhancement in the MB5B report program so that you will be getting the result of the opening and closing stock. In this enhancement you will use EXPORT to export the result to your program where you can IMPORT it. This procedure is explained in detail in a document created in SCN dated 30th November, 2012 by Sijin Siji. Have a look in that.
That document is descriptive and it will be helping you in solving this issue. If you have any doubts, please revert back.
Regards,
Abijith -
Moving avergae price updation in material master for project stock
Dear All,
My query is pertaining to updation of MAP( moving average price) for project specific procurement ( as project stock) for valuated project stock.
As definelty the cost of procurement gets consumed by project .but i want to know does the project stock procurement still updates the moving avergae price or not.
Ex:-Suppose MAP in material master is 10 USD ( with qty 1)and i procure the same material ( qty 1)for project with account assignment Q for 9 USD . now will the MAP in material master becomes 9.5 USD or it remains 10 usd.?
Please reply urgently
Regards
AmitHi Amit,
If your Project Stock is valuated, then, the valuation data for it is stored in a different table: QBEW.
The normal, anonymus warehouse stock (the unrestricted use stock which is not assigned to any project or to any sales order) has its valuation data stored in MBEW.
The "Accounting 1" view in the Material Master MM03 ONLY displays the data of MBEW.
In the material master you will never see the valuation data of the valuated project stock (table QBEW) or the valuated sales order stock (valuation indicator "M" - table EBEW).
The valuation data for the tables QBEW and EBEW can be seen in SE16 or in the transaction MBBS.
Also note that these valuated special stocks are managed independently of the normal stock. If, for example, you change the Moving Average Price of your normal stock in MBEW, this will not have any influence on your project stock, as the data is under a totally diferent table QBEW.
I hope this helps you,
Esther. -
Accounting entry not posted but MBEW table shows total stock and value
Hi
My R/3 version 4.7
I have a material which is stockable and valuated of material type ERSA(Spare parts)
This material was created in may 2007 and material ledger activated,i dont see master records in accounting view in material price analysis tab for the month may 07 till aug 07,and i see master recordsfor the month sep 07 till jan 08
For this particular material in the report MB51 for all the 3 material documents posted,there are no accounting entries in accounting document.
Also in the report output the field amount in local currency is zero for all the 3 material documents.
1.1st material document with mvt 202 for qty 1 posted in the month of may 07,no entries in acc.doc
In this case,MSEG-DMBTR(amount in local currency) was not updated
Also i dont see master records for this period in accounting view in material price analysis tab,in material master.
2.2nd material document with mvt 261 posted for qty 1 in the month of nov,no entries in acc.doc
In this case,MSEG-DMBTR(amount in local currency)was not updated.
I see master records for this period in accounting view in material price analysis tab with stock 1 qty and value zero
3.3rd material document with mvt 101 posted qty 1 in the month of dec,in this case once GR is done MSEG-DMBTR(amount in local currency) was not updated,but mbew has the entries for stock and value.
Can any one let me know why the system is not updating the mseg-dmbtr and as well affecting MB51 report
Regards
RathaThe settings in Customizing which define that no negative stocks are allowed for the storage type, have only an effect on the transfer orders. In addition, you must also set message L9040 as an error message. For this, call up the Customizing and branch to: 'Logistics Execution -> Warehouse Management -> Interfaces -> Inventory Management -> Allow negative Stocks in Interim Storage Types'. There, execute point 'Control of System Messages in Warehouse Management' and enter message type 'E' for message number L9040
-
Dear Experts,
We have a Z report for Stock on posting date(similar to MB5B with some addons as per client reqmt) and we have used MARDH table for opening stock for any period in that report. But we face problems now as this table is not getting updated properly. Is there anyway to update the MARDH table for every period for material and storage location combination? Else can we use any other table for Stock on posting date report?
Regards,
Ravi KumarAs of Release 4.5, stock and valuation fields that refer to the previous
period or those dating back even farther, are not stored in those tables
in which the current stock data is stored (MBEW, MARD, MCHB, and so on)
but in so-called history tables (MBEWH, MARDH, MCHBH, and so on.).
(Also compare release note for period closing as of Release 4.5)
These history tables can have one entry per period. The values of such
an entry refer to the end of the period. For the current period, there
are no entries in the history tables. An entry is not written in this
history table for every period. If stock-relevant or valuation-relevant
data change, the system might generate an entry in the history table.
Furthermore, the fields LFMON ('Current Period (Booking period)') and
LFGJA ('Fiscal Year of the Current Period') in the stock tables are no
longer automatically set to the current period by the period closing
program. The period is only transferred to the new period during the
first movement. At the same time, the relevant history entries are also
generated.
You can refer to SAP note 193554 for more information.
What is the addons that required by your client ? -
How to update a custom field of MARC table using BAPI_MATERIAL_SAVEREPLICA
Hi,
I want to update a custom field (Appended field) of MARC table using BAPI_MATERIAL_SAVEREPLICA. Please help me in this issue. I cannot use BAPI_MATERIAL_SAVEDATA as this updated the MARC table record by record. I have to update bulk records at a time.
Thanks
Rahul.Hi,
Use the Documentation given for struture in BAPI docuemntation...
For loading data into custom fields of MARC use the structure - BAPI_TE_MARC.
First, structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE, MARM, MAKT) and the appropriate check structures BAPI_TE_<NAME> (<NAME> = MARAX, for example) have to be extended by the customer to include the required fields. The structures that are delivered as standard only contain the relevant key fields. When new fields are added to this structure, you should ensure that a field has the same name as the field in the database table. Furthermore, the fields in the structures BAPI_TE_<NAME> can only be CHARACTER fields. Data element BAPIUPDATE is to be used for the fields in the check structure (exception to this: key fields.)
Parameters EXTENSIONIN and EXTENSIONINX are used for transferring data to the method. Field STRUCTURE contains the name of the structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX). This names is used to identify the work area (for example, WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to which the data is transferred. The remaining fields in parameters EXTENSIONIN or EXTENSIONINX contain data for the key fields (for example, the material number) and the data for customer-specific fields. The number of characters reserved in both parameters for the contents of the customer-specific fields must match the number of characters for the relevant field in the work area. If the number of required characters is less, the remaining characters are left blank. Only when all characters have been filled can the contact for an additional field be transferred. Bear in mind that only data for which an appropriate indicator has been set in the work area can be updated to the database.
Regards,
Bhargava -
Updating account view in BAPI_MATERIAL_SAVEDATA
Hello!!
I am using the BAPI_MATERIAL_SAVEDATA to create the views of many materials, but I found a trouble in the BAPI. Three fields aren't updated after the BAPI process.
They are the Usage of the material (MARA-MTUSE), Origin of the material (MARA-MTORG) and the Produced in-house (MARA-OWNPR) from table MBEW.
Debugging the BAPI I found that the fields that I filled in the BAPI call aren't filled into the BAPI processing.
Would someone help me in this question? Anybody was in this situation before?
Thanks!
Best regards,
Diogo.Hello Diogo,
have a look at OSS note 308303 "ALE - Fields in Brazilian solution not maintainable". Perhaps this could help you. Even, if it's a note regarding ALE, this could solve your problem too.
Anyway - I would search for an OSS note, or open a call in the OSS, as this is a problem with SAP standard functionality.
Best regards
Stephan -
Updation not happening once after the material has been extened
Dear Guru's,
I want to extend materials from one plant to another plant. I am using BAPI_MATERIAL_SAVEDATA.
every thing is doing good but the material was updated in the destination plant. I have used BAPI_TRANSACTION_COMMIT' also. ans not all getting any any error message. In the return table i am getting success message. please help me. I am sending my code also. please gothrough and give suggestion . it very urgent.
points will be given for solving the problem.
Thanks in advance.
REPORT ZMMR_MATERIAL_EXTENSION.
TABLES: T001L, "Storage Locations
MARA, "General Material Data
MAKT, "Material Descriptions
MBEW, "Material Valuation
MARC, "Plant Data for Material
MARD. " Storage location
DATA : INDEX LIKE SY-TABIX.
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_MARD1 LIKE BAPI_MARD, " STORAGE LOCATION
BAPI_MARDX LIKE BAPI_MARDX,
BAPI_RETURN LIKE BAPIRET2.
DATA: BEGIN OF INT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF INT_MAKT.
for material updation*******
*data:mara_data type bapi_mara,
*mara_datax type bapi_marax,
*wa_bapi_te_mara type bapi_te_mara,
*wa_bapi_te_marax type bapi_te_marax,
*wa_valuepart(960),
*wa_valuepartx(960),
*t_extin type table of bapiparex,
*t_extinx type table of bapiparexx,
*d_extin type bapiparex,
*d_extinx type bapiparexx,
*ret type bapiret2.
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
TRAGR(4), "Transportation group
EKWSL(4), "Purchasing Value Key
marc
EKGRP(3), "Purchasing group
MTVFP(2), "Checking Group for Availability Check
LADGR(4), "Loading group
PRCTR(10), "Profit Center
WEBAZ like BAPI_MARC-GR_PR_TIME, "Goods receipt processing time in days.
PERKZ(1), "Period indicator
AWSLS(6), "Variance Key
DISGR(4), "MRP Group
DISMM(2), "MRP Type
DISPO(3), "MRP controller
DISLS(2), "Lot size (materials planning)
BESKZ(1), "Procurement Type
DZEIT like BAPI_MARC-INHSEPRODT, "In-house production time.
PLIFZ like BAPI_MARC-PLND_DELRY, "Planned delivery time in days.
makt
SPRAS(2), "Language key
MAKTX(40), "Material description
***mbew
BKLAS(4), "Valuation Class.
VPRSV(1), "Price control indicator
VERPR like BAPI_MBEW-MOVING_PR, "Moving Average Price
STPRS like BAPI_MBEW-STD_PRICE, "Standard price
PEINH like BAPI_MBEW-PRICE_UNIT, "Price unit
****mard
LGORT(4), "Storage location
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
text
FORM DOWNLOAD_DATA.
*IF MATLTYPE-LOW NE 'SFGD' OR MATLTYPE-LOW NE 'SPRS'.
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.
IF MARA-MTART = 'SFGD' or MARA-MTART = '' or MARA-MTART = 'SPRS'.
clear : MARA,INT_MAT.
continue.
ENDIF.
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.
CLEAR MARD.
SELECT SINGLE * FROM MARD WHERE MATNR = MARC-MATNR
AND WERKS = MARC-WERKS.
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
MARA-TRAGR, "Trasaction Group
MARA-EKWSL, "Purchase Value key
MARA-IPRKZ, "Period indi.for. SLED.
MARC-EKGRP, "Purchasing group
MARC-MTVFP, "Availability check
MARC-LADGR, "Loading grp.
MARC-PRCTR, "Profit Center
MARC-WEBAZ, "GR processing time
MARC-PERKZ, "Period Indicator
MARC-AWSLS, "Variance key
MARC-DISGR, "MRP GROUP
MARC-DISMM, "MRP TYPE
MARC-DISPO, "MRP CONTOLLER
MARC-DISLS, "LOT SIZE
MARC-BESKZ, "PROCUREMENT TYPE
MARC-DZEIT, "IN-HOUSE PRD TIME
MARC-PLIFZ, "PLANT DELIVERY TIME
MBEW-BKLAS, "VALUATION CLASS
MBEW-VPRSV, "Price control indicator
MBEW-VERPR, "MOVING PRICE
MBEW-STPRS, "Standard price
MBEW-PEINH, "Price unit
MAKT-SPRAS, "Language key
MAKT-MAKTX, "Material description
MARD-LGORT. "Storage location.
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-TRAGR = MARA-TRAGR. "Trasaction Group
INT_MAT-EKWSL = MARA-EKWSL. "Purchase Value key
INT_MAT-IPRKZ = MARA-IPRKZ. "Period indi.for. SLED.
INT_MAT-EKGRP = MARC-EKGRP. "Purchasing group
INT_MAT-MTVFP = MARC-MTVFP. "Availability check
INT_MAT-LADGR = MARC-LADGR. "Loading grp.
INT_MAT-PRCTR = MARC-PRCTR. "Profit Center
INT_MAT-WEBAZ = MARC-WEBAZ. "GR processing time
INT_MAT-PERKZ = MARC-PERKZ. "Period Indicator
INT_MAT-AWSLS = MARC-AWSLS. "Variance key
INT_MAT-DISGR = MARC-DISGR. "MRP GROUP
INT_MAT-DISMM = MARC-DISMM. "MRP TYPE
INT_MAT-DISPO = MARC-DISPO. "MRP CONTOLLER
INT_MAT-DISLS = MARC-DISLS. "LOT SIZE
INT_MAT-BESKZ = MARC-BESKZ. "PROCUREMENT TYPE
INT_MAT-DZEIT = MARC-DZEIT. "IN-HOUSE PRD TIME
INT_MAT-PLIFZ = MARC-PLIFZ. "PLANT DELIVERY TIME
INT_MAT-BKLAS = MBEW-BKLAS. "Valution class
INT_MAT-VPRSV = MBEW-VPRSV. "Price control indicator
INT_MAT-VERPR = MBEW-VERPR. "Moving price
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
INT_MAT-LGORT = MARD-LGORT. " Storage location
APPEND INT_MAT.
CLEAR INT_MAT.
ENDSELECT.
*ENDIF.
ENDFORM. "DOWNLOAD_DATA
*& Form DOWNLOAD_FILE
text
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. "DOWNLOAD_FILE
*& Form UPLOAD_FILE
text
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. "UPLOAD_FILE
*& Form UPDATE_MM
text
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'.
BAPI_HEAD-MRP_VIEW = 'X'.
BAPI_HEAD-STORAGE_VIEW = 'X'.
BAPI_HEAD-QUALITY_VIEW = 'X'.
BAPI_HEAD-COST_VIEW = 'X'.
wa_bapi_te_mara-material = INT_MAT-MATNR.
wa_bapi_te_marax-material = INT_MAT-MATNR.
Material Description
REFRESH INT_MAKT.
INT_MAKT-LANGU = INT_MAT-SPRAS.
INT_MAKT-MATL_DESC = INT_MAT-MAKTX.
APPEND INT_MAKT.
sorage location.
BAPI_MARD1-PLANT = INT_MAT-WERKS.
BAPI_MARD1-STGE_LOC = INT_MAT-LGORT.
BAPI_MARDX-PLANT = INT_MAT-WERKS.
BAPI_MARDX-STGE_LOC = INT_MAT-LGORT.
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_MARA1-TRANS_GRP = INT_MAT-TRAGR.
BAPI_MARA1-PUR_VALKEY = INT_MAT-EKWSL.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
BAPI_MARAX-TRANS_GRP = 'X'.
BAPI_MARAX-PUR_VALKEY = 'X'.
Plant - Purchasing
BAPI_MARC1-PLANT = INT_MAT-WERKS . "PLANT-LOW.
BAPI_MARC1-PUR_GROUP = INT_MAT-EKGRP.
BAPI_MARC1-AVAILCHECK = INT_MAT-MTVFP.
BAPI_MARC1-LOADINGGRP = INT_MAT-LADGR.
BAPI_MARC1-PROFIT_CTR = INT_MAT-PRCTR. " profit center and plant are same
BAPI_MARC1-GR_PR_TIME = INT_MAT-WEBAZ.
BAPI_MARC1-PERIOD_IND = INT_MAT-PERKZ.
BAPI_MARC1-VARIANCE_KEY = INT_MAT-AWSLS.
BAPI_MARC1-MRP_GROUP = INT_MAT-DISGR.
BAPI_MARC1-MRP_TYPE = INT_MAT-DISMM.
BAPI_MARC1-MRP_CTRLER = INT_MAT-DISPO.
BAPI_MARC1-LOTSIZEKEY = INT_MAT-DISLS.
BAPI_MARC1-PROC_TYPE = INT_MAT-BESKZ.
BAPI_MARC1-INHSEPRODT = INT_MAT-DZEIT.
BAPI_MARC1-PLND_DELRY = INT_MAT-PLIFZ.
BAPI_MARCX-PLANT = INT_MAT-WERKS . " PLANT-LOW.
BAPI_MARCX-PUR_GROUP = 'X'.
BAPI_MARCX-AVAILCHECK = 'X'.
BAPI_MARCX-LOADINGGRP = 'X'.
BAPI_MARCX-PROFIT_CTR = 'X'.
BAPI_MARCX-GR_PR_TIME = 'X'.
BAPI_MARCX-PERIOD_IND = 'X'.
BAPI_MARCX-VARIANCE_KEY = 'X'.
BAPI_MARCX-MRP_GROUP = 'X'.
BAPI_MARCX-MRP_TYPE = 'X'.
BAPI_MARCX-MRP_CTRLER = 'X'.
BAPI_MARCX-LOTSIZEKEY = 'X'.
BAPI_MARCX-PROC_TYPE = 'X'.
BAPI_MARCX-INHSEPRODT = 'X'.
BAPI_MARCX-PLND_DELRY = 'X'.
Accounting
BAPI_MBEW1-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEW1-VAL_CLASS = INT_MAT-BKLAS.
BAPI_MBEW1-PRICE_CTRL = INT_MAT-VPRSV.
BAPI_MBEW1-MOVING_PR = INT_MAT-VERPR.
BAPI_MBEW1-STD_PRICE = INT_MAT-STPRS.
BAPI_MBEW1-PRICE_UNIT = INT_MAT-PEINH.
BAPI_MBEWX-VAL_AREA = INT_MAT-WERKS.
BAPI_MBEWX-VAL_CLASS = 'X'.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-MOVING_PR = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
************for testing purpose
*wa_valuepart = wa_bapi_te_mara.
*d_extin-structure = 'BAPI_TE_MARA'.
*d_extin-valuepart1 = wa_valuepart(240).
*d_extin-valuepart2 = wa_valuepart+240(240).
*d_extin-valuepart3 = wa_valuepart+480(240).
*d_extin-valuepart4 = wa_valuepart+720(240).
*wa_valuepartx = wa_bapi_te_marax.
*d_extinx-structure = 'BAPI_TE_MARAX'.
*d_extinx-valuepart1 = wa_valuepartx(240).
*d_extinx-valuepart2 = wa_valuepartx+240(240).
*d_extinx-valuepart3 = wa_valuepartx+480(240).
*d_extinx-valuepart4 = wa_valuepartx+720(240).
*append d_extin to t_extin.
*append d_extinx to t_extinx.
remove up to here only.
*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
STORAGELOCATIONDATA = BAPI_MARD1
STORAGELOCATIONDATAX = BAPI_MARDX
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = INT_MAKT.
extensionin = t_extin
extensioninx = t_extinx.
IF BAPI_RETURN-TYPE = 'S' .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ''.
ENDIF.
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error Message ', BAPI_RETURN-NUMBER,
BAPI_RETURN-MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. "UPDATE_MM
please give me reply
PrashanthWe have encountered the same problem at our company, and the following thread help us to resolve our problem:
Thanks to KevinCur.
Error while saving a .PDF File to a mapped drive
"It has to do with Protected Mode being turned on. I don't know if it was off by default & now it is on with the update but turning it off changes Adobe Reader's behavior back to what the users expect - a prompt warning you if you want to overwrite the existing file & then selecting Yes to overwrite.
To disable Protected Mode:
Start Adobe Reader
Edit - Preferences - Security (Enhanced)
Uncheck Enable Protected Mode at Startup
Close Preferences & Close Reader"
We unchecked the "Enable Protected Mode at startup" box --> Yes --> OK. Our users are happy now. ^_^ -
USER-EXIT / ENHANCEMENT / BADI -- Material Valuation Class (MBEW-BKLAS)
Hi,
I m looking for any user-exit, enhancement or BADI which is triggered while executing MIGO!!!! .
For example, for good movement 101related to a purchase order.
If MIGO item (material) have batch management we have to inform the batch number (mandatory). When material document is posted system updates material master data with a new valuation type (MBEW-BWTAR) with the same name of the batch number.
We need to inform the valuation class (MBEW-BKLAS) related to this valuation type (MBEW-BWTAR) but we don´t know where it´s possible.
Thanks and sorry for my english!!Hi Orion,
You can refer to the following user exits for MIGO:
Exit Name Description
MBCF0002 Customer function exit: Segment text in material doc. item
MBCF0005 Material document item for goods receipt/issue slip
MBCF0006 Customer function for WBS element
MBCF0007 Customer function exit: Updating a reservation
MBCF0009 Filling the storage location field
MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1
MBCF0011 Read from RESB and RKPF for print list in MB26
MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.
Hope this will help you... -
Mass Update of Material Master
Hi,
I have to migrate Material Master from Legacy System to SAP. And data would be getting populated in the following tables:
1. MARA
2. MAKTX
3. MARC
4. MVKE
5. MLAN
6. MARD
7. MBEW
8. PROP
9. MVER
I checked option of LSMW -> Direct Input Method -> Program Name: RMDATIND. This I guess, will help me to update data in all the above mentioned tables except MVER.
May I get a way out to update data in MVER same time when I upload Material Master? Please also let me know if my understading is not correct. Or if there is a better way out than this!!!
Please let me know if I need to provide any further details on the same from my end to get above query answered.
Rgds,
KKHI,
May I get a way out to update data in MVER same time when I upload Material Master? Please also let me know if my understading is not correct. Or if there is a better way out than this!!!
this table related to material consumption
which data you want to put in this table ,material consumption of legacy system ?
Regards
Kailas Ugale
Maybe you are looking for
-
Need Matrix Style Report...
I need to create a matrix style report. There is a template for matrix reports in Oracle Report Writer, but not in APEX. My report should have a list of countries going down and a list of species going across with data showing how many for each count
-
Do I need an app to zoom with the video recorder?
-
No ocijdbc11 in java.library.path
Good day, I am trying to set up SQL Developer to use TAF; I am frequently getting the error in this subject and am pulling my hair out trying to get to the bottom of it. My environment: freshly downloaded Instant Client 11.2.0.3 Full Oracle Client 11
-
Event execution based on the changing direction of boolean control value
Generally an even case is executed as long as the value of a boolean control changes, no matter the change is from true to false or false to true. However, if I want to event case1 to execute if false to true, and case2 to execute if true to false, h
-
Digital lines showing in full quality quicktime export
Hello - just an addition to a previous matter - I exported an 11 min. movie in H.264, w/the default settings, NTSC 4:3; 720 x 480. It's 572.1 MB and I burned to a CD, so that the client can download it into their own laptop, then project it onto a sc