Some example of Material Master Data Record
Which one is the examples of recorded data in a material Master record:
I. Information on possible sources of supply, SLR.
II. Unit of measurement and material description.
III. Purchasing history of a material and its respective purchasing documents.
only the second.
Similar Messages
-
Program to update info record with material master data
I am trying to determine if there is a standard SAP program that can be run as a batch file to update the fields in the info record with the same fields that are in the material master? ie: Planned delivery time, Tolerance, purchasing group etc.
Hi,
There is no standard report or transaction that can do this.
The data from these fields in the material master is brought in as a default to the info record when it is created. beyond this point the Info record is treated as being the correct data regardless of what happens to the material master data and so no updates occur in the standard system.
It would not be difficult to build an LSMW job to copy the data from the material master to the info records and this would be the recommendation if you want to do this.
Steve B -
Create Material Master Data with BAPI
Hi,
I don't know using of BAPI. I want using BAPI_MATERIAL_SAVEDATA bapi for creating material master data for Basic Data1, Basic Data2, Purchasing and MRP views. Does anybody can help me ?
Thank you
Good nightHi,
Please refer to the documentation below:
BAPI_MATERIAL_SAVEDATA
Short Text
Create and Change Article Master Data
Functionality
You use this method to create new material master data or to change existing material master data. The data on a material can be transferred for each call.
When creating material master data, you must transfer the material number, the material type, and the industry sector to the method. You must also enter a material description and its language.
When changing material master data, you need enter only the material number.
In the header data, you must select at least one view for which data is to be created. Depending on the view selected, you must maintain other required parameters. If you do not enter values for all of the required parameters, the method is ended with an error message.
The corresponding fields in the tables (such as CLIENTDATA) must first be supplied with data by the calling program. An indicator must also be set for each of these fields so that the data is written to the database by the method. This requires the calling program to supply the corresponding field with the indicator in a checkbox table (for example, CLIENTDATAX). Checkbox tables exist for tables that do not contain any language-dependent texts (MAKT, MLTX), International Article Numbers (MEAN), or tax classifications (MLAN). Several data records for a material can be created in these tables.
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 you want to maintain long texts (basic data texts, internal comments, purchase order texts, material memos, or sales texts) or customer-defined fields for a material, some special conditions have to be observed. They are described in the documentation for parameters MATERIALLONGTEXT and EXTENSIONIN.
Parameters
HEADDATA
CLIENTDATA
CLIENTDATAX
PLANTDATA
PLANTDATAX
FORECASTPARAMETERS
FORECASTPARAMETERSX
PLANNINGDATA
PLANNINGDATAX
STORAGELOCATIONDATA
STORAGELOCATIONDATAX
VALUATIONDATA
VALUATIONDATAX
WAREHOUSENUMBERDATA
WAREHOUSENUMBERDATAX
SALESDATA
SALESDATAX
STORAGETYPEDATA
STORAGETYPEDATAX
FLAG_ONLINE
FLAG_CAD_CALL
NO_DEQUEUE
NO_ROLLBACK_WORK
RETURN
MATERIALDESCRIPTION
UNITSOFMEASURE
UNITSOFMEASUREX
INTERNATIONALARTNOS
MATERIALLONGTEXT
TAXCLASSIFICATIONS
RETURNMESSAGES
PRTDATA
PRTDATAX
EXTENSIONIN
EXTENSIONINX
Exceptions
Function Group
1001UEB
Thanks,
Sandeep. -
Material Master Data Loading Error
Hi All,
I am loading master data for material. i got the following error.
1. 0material_attr :
Record 1 :0MATERIAL : Data record 1 ('000000000000010220 '): Version '000000000000010220 ' is not valid
Process : If this message appears during a data load, maintain the attribute in
the PSA maintenance screens. If this message appears in the master data
maintenance screens, leave the transaction and call it again. This
2.0material_text : Data record 1 ('000000000000010220E '): Version '000000000000010220 ' is not valid
Process : Same as above.
I have applied RSKC tcode in BI with ALL_CAPITAL, ALL_CAPITAL_PLUS_HEX, and one special character string. but still getting the same error.
Regards,
Komik ShahHi All,
Thanks for the reply. i have solved most of errors. but there are some errors like this
Diagnosis
Data record 261 & with the key '000000000000132559 &' is invalid in
value '10x8x5 &' of the attribute/characteristic 0SIZE_DIM &.
System Response
The system has recognized that the value mentioned above is invalid, and
has processed this general error message. A subsequent message may give
you more information on the error. This message refers to the same
value, even though it does not state this explicitly.
Procedure
If this message appears during a data load, maintain the attribute in
the PSA maintenance screens. If this message appears in the master data
maintenance screens, leave the transaction and call it again. This allows to maintain your masterdata
which string i should have to add in RSKC to remove this error ? i have already added the ALL_CAPITAL, ALL_CAPITAL_PLUS_HEX.
I have assigned points.
Regards,
Komik Shah -
Message Type for Material Master Data Changes
Hi all
I'm managing Message Types for Material Master Data extraction from R\3 system to BW system, in order to load on BW only the changes done to some fields of MARA table that are delta relevant.
Now from R/3 BD50 Transaction I can see that there is a message type that refer to changes done on MARA fields: RS0044.
I would like to replace this message type with another one (RS0020) in order to align different systems.
Now changes to material master data in R/3 system are recorder with both message types but only those with RS0044 message type are processed and loaded into BW system.
So I would like to know:
1. How is the message type related to the DataSource 0material?
2. is it possible to replace a message type for BW?
3. if yes, how can I do it?
Thanks in advance.
Elisa
mail: [email protected]Hi Oscar!
At the moment I'm using Delta queue of 0MATERIAL. I know that in the queue there are all the new and changed records.
But I would like to be able not to load all the changed records, but only those that refer to some fields of MARA table.
E.g. if the gross weight of a material is modified I don't want to load this change on BW with Delta loading .
I've seen that from R/3 Transaction BD52 you can set only delta relevant fields referred to a specific message type and to delete the other fields.
As I'm able to do this directly in the Development system and Test System, I haven't got the authorization of doing it in the Production system.
That's why I need to include this setting in a CR and then ask to transport it from Test to Production system.
But message types referred to MARA field changes are different between the two systems.
And it seems they are automatically created.
Is it true?
Thanks
Elisa -
Error in uploading the material master data
HI friends,
I have trasferred the material master data through idocs from one server to another server(with in SAP only).
Outbound side the status of idoc is 3 which is OK.But inbound side ,the status is 51 and the error is 'Function module not allowed IDOC_INPUT_MATMAS01'.I debugged the function module in which the control records , data records are getting transferred correctly and also the segments data is also fine.But , i am not able to rectify the error.
Can anybody give the solutHi mahesh,
check the proces code may be having the FM module 'IDOC_INPUT_MATMAS01'. change with some other FM for processing the IDOC. you need check with different ways what is the problem. better dont stick on one thought.
~linganna -
Material Master Data load failed
Hi All,
I am loading material master data. I have around 8055 records in R/3. The load has failed with an error "Non-updated Idocs found in Business Information Warehouse" and asking me to process the IDocs manually. I have checked in WE05 for the IDocs and found 3 Idocs with status 64(IDoc ready to be transferred to application).
But when I checked in the manage screen of the 0MATERIAL I could find the Transfered and Updated records as 8055. I have even checked the data in 0MATERIAL and found that all the data(8055 records) has already been uploaded.
Why is it still showing an error(load failed) even when all the data has been uploaded? What should I do now?
Best Regards,
Nene.hi Nene/Sankar,
for material text no language please check Note 546346 - Material texts: no selection on languages
and for why idocs problem, check e.g Note 561880 - Requests hang because IDocs are not processed, Note 555229 - IDocs hang in status 64 for tRFC with immediate processing.
hope this helps.
Note 546346 - Material texts: no selection on languages
Summary
Symptom
When loading material texts from R/3 into the Business Information Warehouse, you cannot select languages.
Other terms
DataSource, 0MATERIAL_TEXT, InfoSource, InfoObject, 0MATERIAL, SPRAS, LANGU, 0LANGU, MAT_BW, extraction, selection field, delta extraction, ALE, delta, change pointer
Reason and Prerequisites
As of PI/PI-A 2001_2 Support Package 6, the selection option for the 'SPRAS' field in the OLTP system was undone in the 0MATERIAL_TEXT DataSource. (Refer here to note 505952).
Solution
As of PI/PI-A 2002_1 Support Package 4, the 'SPRAS' field is provided for selection again with the 0MATERIAL_TEXT DataSource in the OLTP system. When loading the material texts from BW, the language is still not provided for selection in the scheduler, instead all languages of the language vector in BW are implicitly requested from the source system. However, during the delta update in the source system, the change pointers for all languages in the source system are now set to processed, regardless of whether the language was requested by BW or not.
Import
Support Package 4 for PI/PI-A 2002_1_31I - PI/PI-A 2002_1_45B
Support Package 4 for PI 2002_1_46B - PI 2002_1_46C
Support Package 3 for PI 2002_1_470
In transaction RSA5, copy the D version of the 0MATERIAL_TEXT DataSource to the A version.
Then replicate the DataSources for 0MATERIAL in the BW system. The 'SPRAS' field is then flagged again as a selection field in the transfer structure of the 0MATERIAL InfoSource. The transfer rules remain unchanged. Activate the transfer rules and perform a delta initialization again.
Note 561880 - Requests hang because IDocs are not processed
Symptom
Data extraction in a BW or SEM BW system from an external OLTP System (such as R/3) or an internal (via DataMart) OLTP System hangs with the 'Yellow' status in the load monitor.
After a timeout, the request status finally switches to 'Red'.
Information IDocs with the status '64' are displayed in the 'Detail' tab.
Other terms
IDoc, tRFC, ALE, status 64
Reason and Prerequisites
Status information on load requests is transferred in the form of IDocs.
IDocs are processed in the BW ALE model using tRFC in online work processes (DIA).
IDoc types for BW (RSINFO, RSRQST, RSSEND) are processed immediately.
If no free online work process is available, the IDocs remain and must then be restarted to transfer the request information.With the conversion to asynchronous processing, it can often happen that no DIA is available for tRFC for a short period of time (see note 535172).
The IDoc status 64 can be caused by other factors such as a rollback in the application updating the IDocs. See the relevant notes.
Furthermore, you can also display these IDocs after the solution mentioned below, however, this is only intended as information.
You must therefore analyze the status text.
Solution
We recommend asynchronous processing for Business Warehouse.
To do this, you need the corrections from note 535172 as well as note 555229 or the relevant Support Packages.
The "BATCHJOB" entry in the TEDEF table mentioned in note 555229 is generated automatically in the BW system when you import Support Package 08 for BW 3.0B (Support Package 2 for 3.1 Content).For other releases and Support Package levels, you must manually implement the entry via transaction SE16.
Depending on the Basis Support Package imported, you may also have to implement the source code corrections from note 555229.
The following basic recommendations apply in avoiding bottlenecks in the dialog processing and checking of IDocs for BW:
1. Make sure there is always sufficient DIA, that is, at least 1 DIA more than all other work processes altogether, for example, 8 DIA for a total of 15 work processes (see also note 74141).
TIP: 2 UPD process are sufficient in BW, BW does not need any UP2.
2. Unprocessed Info IDocs should be processed manually within the request in BW;in the 'Detail' tab, you can start each IDoc again by selecting 'Update manually' (right mouse button).
3. Use BD87 to check the system daily (or whenever a problem arises) for IDocs that have not yet been processed and reactivate if necessary.
However, make sure beforehand that these IDocs can actually be assigned to the current status of requests.
TIP: Also check transaction SM58 for problematic tRFC entries.
IMPORTANT: Notes 535172, 555229 and the above recommendations are relevant (unless otherwise specified) both for BW and for SAP source systems. -
Can anyone please tell me some basic infomation about Master data?
Can anyone please tell me some basic infomation about Master data like
1)The history of master data
2) Why it is so critical
3) What the advantages of it
4) What is the future of master data
Any inputs in this regard will be very helpful
Thanks in advanceHi Gowri,
Master data is backbone of any business software.It helps us to do transaction.
If you go to any ATM and do some transaction,you get a monthly statement.This monthly statement contains your address details and your transaction details.
So your address details and your account is like master data which is not changed so frequently but your transactions keep on happening on regular basis on your account and name.So your name and account are your master data which is set up once and donot change so frequently.
Similary if you create a Purchase order in SAP system.You need Material master and vendor master.The material master contains material details and vendor master contains vendor details and using that you create PO which is a transactional data which keep on happening for a particular vendor & material combination on regular basis.
So we set up master data once and make changes to these only when needed and record transaction against that.
So in first case your banking details which you enter while opening account is your master data and in next case Material Master and vendor master is master data which set up mostly once.
There are three types of data in SAP system
1. Organizational level data (ICICI Bank and Branch)
2. Master data (Your User data while opening account)
3. Transactional data (Your Regular transaction).
I hope ,you are clear on this by now.
There is a SAP software in Netweaver Stack now called MDM (Master data management) which will help to manage master data.
regards,Nishant
Please reward points if this helps.
Message was edited by:
Nishant Rajan -
How to maintain material master data in plant....
Hi all,
while creating BOM I am getting an error "no material master data in plant' can some one help me how to maintain the material master data in plant
Regards,
BaluHi,
Please check the below link for MMR creaion .
http://web.mit.edu/sapr3/windocs/bpmdb01m.htm
Regards, -
How to maintain the material master data in plant
Hi all,
while creating BOM I am getting an error "no material master data in plant' can some one help me how to maintain the material master data in plant
Regards,
BaluCheck the material available in MARC table in SE11 transaction against your plant.If it is not available please maintain through MM01 transaction.
-
ALE:Material Master Data Distribution
Hi
I am new to ALE Material Master Data Distribution and if the questions are incorrectly worded, please accept my apologies. It is due to lack of knowledge.
I am doing Material Master Data distribution and I am using standard basic type MATMAS03. The standard TCode MM01, MM02 has SAP tables and 3 custom tables.
I have turned the active on using BD61 and change pointers to message type.
Q: Is the change pointer, applicable to entire material master? i.e. if I change a field in Z table or standard material tables, can an IDOC be created for the entire material record?
Q: What is the function of BD52? Does this override the option Activate Change pointers for message type? Does it mean, if the changes are made to those fields in BD52 a change pointer is created?
Q: If I change Z table only, will there be a change pointer created? If not, how could I accomplish this using BD52.
Q When do we use the enhancement MGV00001?
Also, If you could add anything in addition to above queries, it will be helpful to me and I appreciate it.
With regards,
WilliamThank you Sudhakar.
Your tips are good, but, I was not able to get the problem resolved.
Let me explain what I have done based on your tips.
1. MATMAS uses MATMAS03. The basic type has NOT been modified to have z fields yet.
2. Using BD52, i have created the following fields
MATERIAL ZEMM_MARA_TECH IM_ADVISORY_CODE
MATERIAL ZEMM_MARA_TECH KEY.
3. Modified the MMR for IM_ADVISORY_CODE.
I did not see a change pointer for this change.
Q: When I created above entry using BD52, was asking the table name. The table name is stored in TCD0B. What TCode is available the entries in TCDOB. For the time being, i created using SQL.
Q. Is there a follow up configuration required to capture the changes?
I will award the points in a couple of days time, even if I do not get the solution, because you have spent your precious time for the community. I will wait for a couple of days for other suggestions and close the Problem. -
Material master data and Asset
Hello Guys
Considering the every material master data that I am buying will end up been an Asset in my company.
I would like to know how can I alredy related the material master data that I am creating with a possible hierarchy to make it esier at the time of creating the asset?
Some one could briefly explain to me how can I related the material master data and a creation of an asset in SAP?
thanksHi guys
Jignesh Thakkar
That was really good answer you gave it is according with the Help instruction that I read, but the main point for me is that I will not know the asset description or capitalized date or serial number, location, etcu2026 until I goods receipt the individual material creating serial nods and the equipment master data.
In this scenario from the equipment master data is there any way to create an Asset master data, create the asset master data with the information of the GR equipment master Data or populate the Asset AS01 with the equipment master data?
Otherwise I will need manually create the Asset and manually synchronize the equipment with the asset?
Thanks Guys it have been incredibly helpful this network I hope I can help some one in future as it have been helpful for me at the moment.
Carlos -
SAP Business Connector with Java (material master data)
Hey,
I have a question about the SAP BC. What are the steps I have to do, to use the BC with a Java program?
My task is to create a program which downloads material master datas from SAP.
I just installed the BC, and hope, that I did it correctly
Many thanks in advance!!
Kind regards,
Alex
German Version:
Hey,
wie ich oben schon geschrieben habe, habe ich ein paar Fragen zum SAP BC. Ich habe ein Hochschul-Projekt und muss hierfür Materialstammdaten aus SAP herunterladen und mit einem Java Programm ausgeben lassen.
Kann mir vielleicht jemand weiterhelfen, wie die Schritte hierfür aussehen?! Wie verbinde ich den BC mit meinem SAP System? und wie bekomme ich anschließen die Daten mit einem Java Programm ausgelesen?
Ich habe bereits den BC installiert und konnte mich meines Wissens auch richtig anmelden;-)
Ich hoffe, dass mir jemand weiterhelfen kann und bedanke mich schon im Voraus für eventuelle Antworten!!!
Viele Grüße
Alex
Edited by: Rolf Gersbacher on May 19, 2010 10:34 PMHi,
I work with SAP BC some time ago... I remember that you configure the connection in SM59 / SICF and the server open a port to "listen" (connect external).
So, your external program can execute functions inside SAP and exchange data.
See some links:
http://en.wikipedia.org/wiki/SAP_Business_Connector
http://help.sap.com/saphelp_nw04/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
http://www.thespot4sap.com/articles/SAP_XML_Business_Integration.asp
Best regards,
Leandro Mengue -
LSMW--Create Material master data
Hi,
When I use LSMW to create material master data, I set up all step, but when I go to last step "13 Run Batch Input Session", there is error message like "Select at least one view" in moudle SAPLMGMM, screen 0070, anybody can tell me what is problem, thanks a lot.Hi,
This is due to error while recording for MM01,
Please do a Repeat recording and ensure that once the material number, industry sector and material type is entered, on the next screen you need to select all or at least a single view to create the MMR.
Regards
Merwyn -
About material master data batch input
hello
i wrote a batch input for material master data. but it can't work ,i can't use it to create material.hope someone help me!thanks.code is below.
report z_mat_batchinput no standard page heading
line-size 255 message-id YB.
mat batch input
include bdcrecx1.
include .
tables: mara,marm,MARC,MARD,T134,NRIV,T006A,T023,T001W,T001L,
TVKO,TVTW,T025,TTGR,TLGR,TVKWZ,T006.
data: DIMID like t006-DIMID.
data: flag, K, tmp.
DATA: X TYPE I.
************ÉÏÔØÎļþÄÚ±í************************
data: begin of record occurs 0,
MATNR(018), " ÎïÁϺÅ
MTART(004), " ÎïÁÏÀàÐÍ
**generaldata1**
MAKTX(040), " ÎïÁÏÃèÊö
EAKTX(040), " Ó¢ÎÄÃèÊö
MEINS(003), " »ù±¾¼ÆÁ¿µ¥Î»
MATKL(009), " ÎïÁÏ×é
BISMT(018), " ¾ÉÎïÁϺÅ
EXTWG(018), " ÍⲿÎïÁÏ×é
SPART(002), " ²¿ÃÅ
MTPOS_MARA(004), " ÆÕͨÏîÄ¿Àà±ð×é
BRGEW(017), " ëÖØ
GEWEI(003), " ÖØÁ¿µ¥Î»
NTGEW(017), " ¾»ÖØ
VOLUM(017), " Ìå»ý
VOLEH(003), " Ìå»ýµ¥Î»
GROES(032), " Á¿¸Ù
MAGRV(004), " ÎïÁÏ×éµÄ°ü×°Îï
**generaldata2**
NORMT(018), " ¹¤Òµ±ê×¼ÃèÊö
FERTH(018), " ÀàÐÍ
WRKST(048), " ¹æ¸ñ
**generaldata1**
EAN11(018), " ²úÆ·±íʶÂë
**generaldata2**
ZEIAR(003), " ÎĵµÀàÐÍ£¬ºÏÀí´¢±¸ÖÜתÆÚ
WERKS(004), " ¹¤³§
VKORG(004), " ÏúÊÛ×éÖ¯
VTWEG(002), " ·ÖÏúÇþµÀ
**salesorg 1**
VRKME(003), " ÏúÊÛµ¥Î»
VMREN(006), " ÏúÊÛµ¥Î»×ª»»Òò×Ó
VMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
SPART(002), " ²úÆ·×é
DWERK(004), " ½»»õ¹¤³§
TAXKM(001), " ÎïÁÏË°·ÖÀà
**salesorg 2**
KONDM(002), " ÎïÁ϶¨¼Û×é
KTGRM(002), " ¿ÆÄ¿ÉèÖÃ×é
MVGR1(003), " ÎïÁÏ×é 1
MVGR2(003), " ÎïÁÏ×é 2
MTPOS(004), " ÏîÄ¿Àà±ð×é
VERSG(001), " ÎïÁÏͳ¼Æ×é
**ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý**
MTVFP(002), " ¿ÉÓÃÐÔ¼ì²é
XCHPF(001), " Åú´Î¹ÜÀí
YCHPF(001), " ÅúÁ¿¹ÜÀí
TRAGR(004), " ÔËÊä×é
ladgr(004), " ×°ÔØ×é
**pur**
BSTME(003), " ¶©µ¥µ¥Î»
UMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
UMREN(006), " ¶©µ¥µ¥Î»×ª»»Òò×Ó
WEBAZ(003), " ÊÕ»õ´¦Àíʱ¼ä
EKGRP(003), " ²É¹º×é
LGORT(004), " ¿â´æµØ
**Ò»°ã¹¤³§Êý¾Ý/²Ö´¢1**
AUSME(003), " ·¢»õµ¥Î»
UMREJ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
UMREF(006), " ·¢»õµ¥Î»×ª»»Òò×Ó
XCHPF(001), " ÅúÁ¿¹ÜÀí
**MRP 1**
DISGR(004), " MRP×é
DISMM(002), " MRPÀàÐÍ
FXHOR(003), " ¼Æ»®µÄʱ½ì
DISPO(003), " MRP¿ØÖÆÕß
DISLS(002), " ÅúÁ¿
MAABC(001), " ABC±êʶ
BSTFE(018), " ¹Ì¶¨ÅúÁ¿´óС
**MRP 2**
RESKZ(001), " »ñÈ¡ÀàÐÍ
BESKZ(001), " ²É¹ºÀàÐÍ
SOBSL(002), " ÌØÊâ²É¹ºÀà
LGPRO(004), " ·¢»õ²Ö´¢µØµã
RGEKZ(001), " ·´³å
PLIFZ(003), " ¼Æ»®½»»õʱ¼ä
VEBAZ(003), " ÊÕ»õ´¦Àíʱ¼ä
DZEIT(008), "×ÔÖÆÉú²ú
FHORI(003), " ¼Æ»®±ß¼ÊÂë
EISBE(018), " °²È«¿â´æ
**MRP 3**
PERKZ(001), " ÆÚ¼ä±êʶ
STRGR(002), " ²ßÂÔ×é
VRMOD(001), " ÏûºÄģʽ
VINT1(003), " ÄæÏòÏûºÄÆÚ¼ä
VINT2(003), " ÏòÇ°ÏûºÄÆÚ¼ä
NTVFP(002), " ¿ÉÓÃÐÔ¼ì²é
**MRP 4**
SAUFT(001), " Öظ´ÖÆÔì±êÖ¾
SFEPR(004), " Öظ´Éú²ú²ÎÊýÎļþ
**¹¤×÷¼Æ»®**
FEVOR(003), " Éú²úµ÷¶ÈÔ±
FRTME(003), " Éú²úµ¥Î»
SMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
SMREN(006), " Éú²úµ¥Î»×ª»»Òò×Ó
UEETK(001), " ÎÞÏÞÖƹýÁ¿½»»õ
**»á¼Æ 1**
BKLAS(004), " ÆÀ¹ÀÀà
BWTTY(001), " ¹À¼Û·ÖÀà
VPRSV(001), " ¼Û¸ñ¿ØÖÆ
PEINH(006), " ¼Û¸ñµ¥Î»
VERPR(015), " Òƶ¯Æ½¾ù¼Û
STPRS(015), " ±ê×¼¼Û
**»á¼Æ 2**
BWPRH(014), " ÉÌÒµ¼Û¸ñ 1
**³É±¾ 1**
LOSGR(018), " ÅúÁ¿³É±¾ºËËã
**³É±¾ 2**
ZPLP1(014), " ¼Æ»®¼Û¸ñ 1
ZPLD1(010), " ¼Æ»®ÈÕÆÚ 1
**qm**
ART1(8), "¼ìÑéÀàÐÍ1
AKTIV1(1), "ÒѼ¤»î
QMPUR(1), "¼¤»î²É¹ºÖÐµÄ QM
SSQSS(8), "QM ¿ØÖÆÂë¡¢
QMATV(8), "QM¼ìÑéÉèÖÃ
ART2(8), "¼ìÑéÀàÐÍ2
AKTIV2(6), "ÒѼ¤»î
ART3(8), "¼ìÑéÀàÐÍ3
AKTIV3(6), "ÒѼ¤»î
end of record.
************ÏÂÔظñʽ/´íÎóÎļþÄÚ±í**************
data: begin of record1 occurs 0,
MATNR(018), " ÎïÁϺÅ
MTART(008), " ÎïÁÏÀàÐÍ
**»ù±¾Êý¾Ý1**
MAKTX(040), " ÎïÁÏÃèÊö
EAKTX(040), " Ó¢ÎÄÃèÊö
MEINS(013), " »ù±¾¼ÆÁ¿µ¥Î»
MATKL(009), " ÎïÁÏ×é
BISMT(018), " ¾ÉÎïÁϺÅ
EXTWG(018), " ÍⲿÎïÁÏ×é
SPART(002), " ²¿ÃÅ
MTPOS_MARA(004), " ÆÕͨÏîÄ¿Àà±ð×é
BRGEW(017), " ëÖØ
GEWEI(008), " ÖØÁ¿µ¥Î»
NTGEW(017), " ¾»ÖØ
VOLUM(017), " Ìå»ý
VOLEH(008), " Ìå»ýµ¥Î»
GROES(032), " Á¿¸Ù
MAGRV(014), " ÎïÁÏ×éµÄ°ü×°Îï
**»ù±¾Êý¾Ý2**
NORMT(018), " ¹¤Òµ±ê×¼ÃèÊö
FERTH(018), " ÀàÐÍ
WRKST(048), " ¹æ¸ñ
**»ù±¾Êý¾Ý1**
EAN11(018), " ²úÆ·±íʶÂë
**»ù±¾Êý¾Ý2**
ZEIAR(003), " ÎĵµÀàÐÍ£¬ºÏÀí´¢±¸ÖÜתÆÚ
WERKS(004), " ¹¤³§
VKORG(008), " ÏúÊÛ×éÖ¯
VTWEG(008), " ·ÖÏúÇþµÀ
**ÏúÊÛ×éÖ¯ 1**
VRKME(003), " ÏúÊÛµ¥Î»
VMREN(006), " ÏúÊÛµ¥Î»×ª»»Òò×Ó
VMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
SPART(006), " ²úÆ·×é
DWERK(008), " ½»»õ¹¤³§
TAXKM(010), " ÎïÁÏË°·ÖÀà
**ÏúÊÛ×éÖ¯ 2**
KONDM(010), " ÎïÁ϶¨¼Û×é
KTGRM(010), " ¿ÆÄ¿ÉèÖÃ×é
MVGR1(003), " ÎïÁÏ×é 1
MVGR2(003), " ÎïÁÏ×é 2
MTPOS(010), " ÏîÄ¿Àà±ð×é
VERSG(001), " ÎïÁÏͳ¼Æ×é
**ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý**
MTVFP(010), " ¿ÉÓÃÐÔ¼ì²é
XCHPF(008), " Åú´Î¹ÜÀí
YCHPF(001), " ÅúÁ¿¹ÜÀí
TRAGR(006), " ÔËÊä×é
ladgr(006), " ×°ÔØ×é
**²É¹º**
BSTME(003), " ¶©µ¥µ¥Î»
UMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
UMREN(006), " ¶©µ¥µ¥Î»×ª»»Òò×Ó
WEBAZ(003), " ÊÕ»õ´¦Àíʱ¼ä
EKGRP(006), " ²É¹º×é
LGORT(004), " ¿â´æµØ
**Ò»°ã¹¤³§Êý¾Ý/²Ö´¢1**
AUSME(003), " ·¢»õµ¥Î»
UMREJ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
UMREF(006), " ·¢»õµ¥Î»×ª»»Òò×Ó
XCHPF(001), " ÅúÁ¿¹ÜÀí
**MRP 1**
DISGR(004), " MRP×é
DISMM(009), " MRPÀàÐÍ
FXHOR(003), " ¼Æ»®µÄʱ½ì
DISPO(011), " MRP¿ØÖÆÕß
DISLS(004), " ÅúÁ¿
MAABC(007), " ABC±êʶ
BSTFE(018), " ¹Ì¶¨ÅúÁ¿´óС
**MRP 2**
RESKZ(001), " »ñÈ¡ÀàÐÍ
BESKZ(008), " ²É¹ºÀàÐÍ
SOBSL(002), " ÌØÊâ²É¹ºÀà
LGPRO(004), " ·¢»õ²Ö´¢µØµã
RGEKZ(001), " ·´³å
PLIFZ(012), " ¼Æ»®½»»õʱ¼ä
VEBAZ(003), " ÊÕ»õ´¦Àíʱ¼ä
DZEIT(008), "×ÔÖÆÉú²ú
FHORI(010), " ¼Æ»®±ß¼ÊÂë
EISBE(018), " °²È«¿â´æ
**MRP 3**
PERKZ(008), " ÆÚ¼ä±êʶ
STRGR(006), " ²ßÂÔ×é
VRMOD(001), " ÏûºÄģʽ
VINT1(003), " ÄæÏòÏûºÄÆÚ¼ä
VINT2(003), " ÏòÇ°ÏûºÄÆÚ¼ä
NTVFP(010), " ¿ÉÓÃÐÔ¼ì²é
**MRP 4**
SAUFT(001), " Öظ´ÖÆÔì±êÖ¾
SFEPR(004), " Öظ´Éú²ú²ÎÊýÎļþ
**¹¤×÷¼Æ»®**
FEVOR(003), " Éú²úµ÷¶ÈÔ±
FRTME(003), " Éú²úµ¥Î»
SMREZ(006), " »ù±¾µ¥Î»×ª»»Òò×Ó
SMREN(006), " Éú²úµ¥Î»×ª»»Òò×Ó
UEETK(001), " ÎÞÏÞÖƹýÁ¿½»»õ
**»á¼Æ 1**
BKLAS(006), " ÆÀ¹ÀÀà
BWTTY(001), " ¹À¼Û·ÖÀà
VPRSV(008), " ¼Û¸ñ¿ØÖÆ
PEINH(008), " ¼Û¸ñµ¥Î»
VERPR(015), " Òƶ¯Æ½¾ù¼Û
STPRS(015), " ±ê×¼¼Û
**»á¼Æ 2**
BWPRH(014), " ÉÌÒµ¼Û¸ñ 1
**³É±¾ 1**
LOSGR(018), " ÅúÁ¿³É±¾ºËËã
**³É±¾ 2**
ZPLP1(014), " ¼Æ»®¼Û¸ñ 1
ZPLD1(010), " ¼Æ»®ÈÕÆÚ 1
**ÖÊÁ¿¹ÜÀí**
ART1(8), "¼ìÑéÀàÐÍ1
AKTIV1(6), "ÒѼ¤»î
QMPUR(010), "¼¤»î²É¹ºÖÐµÄ QM
SSQSS(8), "QM ¿ØÖÆÂë¡¢
QMATV(8), "QM¼ìÑéÉèÖÃ
ART2(8), "¼ìÑéÀàÐÍ2
AKTIV2(6), "ÒѼ¤»î
ART3(8), "¼ìÑéÀàÐÍ3
AKTIV3(6), "ÒѼ¤»î
end of record1.
selection-screen begin of block 0 with frame title text-001.
selection-screen begin of line .
selection-screen position 1.
parameters: test like rkec1-test .
selection-screen
comment 3(4) text-004 for field test.
selection-screen position 26.
parameters: oldfile like rlgrap-filename.
selection-screen
comment 9(17) text-003 for field oldfile.
selection-screen: end of line.
selection-screen begin of line.
selection-screen position 1.
parameters: dnldflag like rkec1-test default 'X'.
selection-screen
comment 3(4) text-005 for field dnldflag.
selection-screen position 26.
parameters: outfile like rlgrap-filename .
selection-screen
comment 9(17) text-006 for field outfile.
selection-screen: end of line.
selection-screen end of block 0 .
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-002.
selection-screen begin of line.
selection-screen position 1.
PARAMETERS: GEN1 LIKE RKEC1-TEST.
selection-screen
comment 3(9) text-007 for field GEN1.
selection-screen position 26.
PARAMETERS: GEN2 LIKE RKEC1-TEST.
selection-screen
comment 28(9) text-008 for field GEN2.
selection-screen end of line.
selection-screen begin of line.
selection-screen position 1.
PARAMETERS: SALORG1 LIKE RKEC1-TEST.
selection-screen
comment 3(21) text-009 for field SALORG1.
selection-screen position 26.
PARAMETERS: SALORG2 LIKE RKEC1-TEST.
selection-screen
comment 28(21) text-010 for field SALORG2.
selection-screen position 51.
PARAMETERS: SALPLANT LIKE RKEC1-TEST.
selection-screen
comment 53(19) text-011 for field SALPLANT.
selection-screen end of line.
selection-screen begin of line.
selection-screen position 1.
PARAMETERS: PURCHASE LIKE RKEC1-TEST.
selection-screen
comment 3(21) text-012 for field PURCHASE.
selection-screen position 26.
PARAMETERS: PLTSTRG1 LIKE RKEC1-TEST.
selection-screen
comment 28(21) text-018 for field PLTSTRG1.
selection-screen end of line.
selection-screen begin of line.
selection-screen position 1.
PARAMETERS: MRP1 LIKE RKEC1-TEST.
selection-screen
comment 3(4) text-013 for field MRP1.
selection-screen position 13.
PARAMETERS: MRP2 LIKE RKEC1-TEST.
selection-screen
comment 15(4) text-014 for field MRP2.
selection-screen position 26.
PARAMETERS: MRP3 LIKE RKEC1-TEST.
selection-screen
comment 28(4) text-015 for field MRP3.
selection-screen position 37.
PARAMETERS: MRP4 LIKE RKEC1-TEST.
selection-screen
comment 39(4) text-016 for field MRP4.
selection-screen position 51.
PARAMETERS: PLANTSTR LIKE RKEC1-TEST.
selection-screen
comment 53(8) text-017 for field PLANTSTR.
selection-screen end of line.
selection-screen begin of line.
selection-screen position 1.
PARAMETERS: QAU LIKE RKEC1-TEST.
selection-screen
comment 3(8) text-023 for field QAU.
selection-screen position 13.
PARAMETERS: ACC1 LIKE RKEC1-TEST.
selection-screen
comment 15(5) text-019 for field ACC1.
selection-screen position 26.
PARAMETERS: ACC2 LIKE RKEC1-TEST.
selection-screen
comment 28(5) text-020 for field ACC2.
selection-screen position 37.
PARAMETERS: COR1 LIKE RKEC1-TEST.
selection-screen
comment 39(5) text-021 for field COR1.
selection-screen position 51.
PARAMETERS: COR2 LIKE RKEC1-TEST.
selection-screen
comment 53(5) text-022 for field COR2.
selection-screen end of line.
SELECTION-SCREEN END OF BLOCK 1.
at selection-screen on value-request for oldfile.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',Îı¾Îļþ(ÖƱí·û·Ö¸ô),*.txt'
static = 'X'
CHANGING
file_name = oldfile.
at selection-screen on value-request for outfile.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',Microsoft Excel¹¤×÷²¾,*.xls'
static = 'X'
CHANGING
file_name = outfile.
initialization.
******µÃµ½ÎļþĿ¼*******
call function 'WS_QUERY'
EXPORTING
query = 'CD'
IMPORTING
return = outfile.
if sy-subrc <> 0.
message e005 with outfile.
endif.
oldfile = outfile.
concatenate outfile 'mat_fat' into outfile.
*ÅúÊäÈëĬÈÏÃû³Æ
group = 'MATBATCHIN'.
start-of-selection.
if dnldflag eq 'X' and not ( outfile is initial ).
perform download_data.
stop.
endif.
perform upload_data.
if test = ' '.
*ÊÓͼ²ÎÊý¼ì²é
IF ( GEN1 NE 'X' AND GEN2 NE 'X' AND SALORG1 NE 'X'
AND SALORG2 NE 'X' AND SALPLANT NE 'X'
AND PURCHASE NE 'X' AND PLTSTRG1 NE 'X'
AND MRP1 NE 'X' AND MRP2 NE 'X' AND MRP3 NE 'X'
AND MRP4 NE 'X' AND PLANTSTR NE 'X'
AND ACC1 NE 'X' AND ACC2 NE 'X'
AND COR1 NE 'X' AND COR2 NE 'X' and qau ne 'X' ) .
MESSAGE E000 WITH 'ÇëÑ¡ÔñÐèά»¤ÊÓͼ'.
ENDIF.
perform open_group.
SORT RECORD BY WERKS MATNR.
loop at record.
perform bdc_fill.
perform bdc_transaction using 'MM01'.
clear: bdcdata.
refresh: bdcdata.
endloop.
perform close_group.
else.
perform file_check.
endif.
end-of-selection.
*& Form UPLOAD_DATA
ÉÏÔØÅúÊäÈëÊý¾Ý
--> p1 text
<-- p2 text
form upload_data.
call function 'WS_UPLOAD'
EXPORTING
filename = oldfile
filetype = 'DAT'
TABLES
data_tab = record
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10.
if sy-subrc <> 0.
message E000 with 'ÇëÊäÈëÉÏÔØÎļþ'.
endif.
read table record with key MATNR = '**'.
if sy-tabix lt 1.
message E000 with 'ÉÏÔØÎļþÎļþÍ·ÓëÊý¾ÝÖ®¼äÎÞ**'.
endif.
delete record from 1 to sy-tabix.
endform. " UPLOAD_DATA
*& Form BDC_FILL
ÅúÊäÈë
--> p1 text
<-- p2 text
form bdc_fill.
data: N type I,
M type I,
S_MATNR(018),
test(1) type N.
PERFORM BDC_FILL_INITALSCR. "³õʼÆÁÄ»
tmp = '0'.
condense record-matnr no-gaps.
test = record-matnr(1).
if test <> ''.
M = STRLEN( RECORD-MATNR ).
M = 18 - M.
DO M TIMES.
CONCATENATE '0' RECORD-MATNR INTO S_MATNR.
RECORD-MATNR = S_MATNR.
ENDDO.
endif.
**ÅжÏÎïÁÏ»ù±¾ÊÓͼÊÇ·ñÒѾ±»Î¬»¤¹ý**
SELECT SINGLE * FROM MARA WHERE MATNR = RECORD-MATNR.
IF SY-SUBRC NE 0.
K = '0'.
Else.
condense MARA-PSTAT no-gaps.
N = strlen( mara-pstat ).
M = 0.
record-meins = mara-meins.
do N times.
K = MARA-PSTAT+M.
IF K = 'K'.
EXIT.
ENDIF.
M = M + 1.
enddo.
ENDIF.
IF ( ( GEN1 EQ 'X' OR GEN2 EQ 'X' ) AND SALORG1 NE 'X'
AND SALORG2 NE 'X' AND SALPLANT NE 'X'
AND PURCHASE NE 'X' AND PLTSTRG1 NE 'X'
AND MRP1 NE 'X' AND MRP2 NE 'X' AND MRP3 NE 'X'
AND MRP4 NE 'X' AND PLANTSTR NE 'X'
AND ACC1 NE 'X' AND ACC2 NE 'X'
AND COR1 NE 'X' AND COR2 NE 'X' and qau ne 'X' ) .
IF K EQ 'K'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(15)'.
perform bdc_field using 'BDC_OKCODE'
'/N'.
ELSE.
PERFORM BDC_FILL_CHOICEVIEW. "Ñ¡ÔñÊÓͼ
ENDIF.
ELSE.
PERFORM BDC_FILL_CHOICEVIEW. "Ñ¡ÔñÊÓͼ
PERFORM BDC_FILL_ORGVIEW. "×éÖ¯¼¶±ð
ENDIF.
TRANSLATE record-MEINS TO UPPER CASE.
TRANSLATE record-BSTME TO UPPER CASE.
TRANSLATE record-VRKME TO UPPER CASE.
TRANSLATE record-FRTME TO UPPER CASE.
TRANSLATE record-AUSME TO UPPER CASE.
if gen1 eq 'X'.
IF K NE 'K'.
PERFORM GENERALDATA1.
ENDIF.
endif.
if gen2 eq 'X'.
IF K NE 'K'.
perform generaldata2.
ENDIF.
endif.
if salorg1 eq 'X'.
perform salorg1.
endif.
if salorg2 eq 'X'.
perform salorg2.
endif.
if salplant eq 'X'.
perform salplant.
endif.
if purchase eq 'X'.
perform purchasedata.
endif.
if mrp1 eq 'X'.
perform MRP1.
endif.
if mrp2 eq 'X'.
perform MRP2.
endif.
if mrp3 eq 'X'.
perform MRP3.
endif.
if mrp4 eq 'X'.
perform MRP4.
endif.
if PLANTSTR eq 'X'.
perform PLANTSTR.
endif.
if PLTSTRG1 eq 'X'.
perform PLTSTRG1.
endif.
if qau eq 'X'.
perform qualitydata.
endif.
if ACC1 eq 'X'.
perform ACC1DATA.
endif.
if ACC2 eq 'X'.
perform ACC2DATA.
endif.
if COR1 eq 'X'.
perform COR1DATA.
endif.
if COR2 eq 'X'.
perform COR2DATA.
endif.
perform BDC_SAVE.
endform. " BDC_FILL
*& Form GENERALDATA1
Ò»°ãÊý¾Ý 1
--> p1 text
<-- p2 text
form generaldata1.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
"'=ZU01'.
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX. " ÎïÁÏÃèÊö
perform bdc_field using 'MARA-MEINS'
record-MEINS. " »ù±¾¼ÆÁ¿µ¥Î»
perform bdc_field using 'MARA-MATKL'
record-MATKL. " ÎïÁÏ×é
perform bdc_field using 'MARA-BISMT'
record-BISMT.
perform bdc_field using 'MARA-EXTWG'
record-EXTWG.
perform bdc_field using 'MARA-SPART'
record-SPART.
perform bdc_field using 'MARA-MTPOS_MARA'
record-MTPOS_MARA.
perform bdc_field using 'BDC_CURSOR'
'MARA-GROES'.
perform bdc_field using 'MARA-BRGEW'
record-BRGEW.
if record-gewei = '' and ( salorg1 = 'X' or salorg2 = 'X'
or salplant = 'X' ).
perform bdc_field using 'MARA-GEWEI'
'KG'. " ÖØÁ¿µ¥Î»
else.
perform bdc_field using 'MARA-GEWEI'
record-GEWEI. " ÖØÁ¿µ¥Î»
endif.
perform bdc_field using 'MARA-NTGEW'
record-NTGEW.
perform bdc_field using 'MARA-VOLUM'
record-VOLUM.
perform bdc_field using 'MARA-VOLEH'
record-VOLEH.
perform bdc_field using 'MARA-GROES'
record-GROES.
condense record-EAN11 no-gaps.
if record-EAN11 <> ''.
perform bdc_field using 'MARA-EAN11'
record-EAN11.
perform bdc_field using 'MARA-NUMTP'
'HT'.
endif.
perform bdc_field using 'MARA-MAGRV'
record-MAGRV.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=ZU02'.
condense record-EAKTX no-gaps.
if record-EAKTX <> ''.
perform bdc_field using 'SKTEXT-SPRAS(2)'
'EN'.
perform bdc_field using 'SKTEXT-MAKTX(2)'
record-EAKTX.
endif.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=MAIN'.
if record-meins <> 'PAK'.
perform bdc_field using 'SMEINH-UMREN(05)'
'1'.
perform bdc_field using 'SMEINH-MEINH(05)'
'PAK'.
perform bdc_field using 'SMEINH-UMREZ(05)'
'1'.
endif.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
endform. " GENERALDATA
*& Form generaldata2
Ò»°ãÊý¾Ý 2
--> p1 text
<-- p2 text
FORM generaldata2.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX.
perform bdc_field using 'BDC_CURSOR'
'MARA-NORMT'.
condense record-ferth no-gaps.
if record-ferth <> ''.
perform bdc_field using 'MARA-FERTH'
record-FERTH.
endif.
perform bdc_field using 'MARA-NORMT'
record-NORMT.
perform bdc_field using 'MARA-WRKST'
record-WRKST.
perform bdc_field using 'MARA-ZEIAR'
record-ZEIAR.
ENDFORM. " generaldata2
*& Form salorg1
ÏúÊÛ×éÖ¯ 1
--> p1 text
<-- p2 text
FORM salorg1.
condense RECORD-SPART no-gaps.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX. " ÎïÁÏÃèÊö
IF K NE 'K'.
perform bdc_field using 'MARA-MEINS'
record-MEINS. " »ù±¾¼ÆÁ¿µ¥Î»
ENDIF.
perform bdc_field using 'MARA-SPART'
record-SPART. " ²úÆ·×é
perform bdc_field using 'MVKE-DWERK'
record-DWERK. " ½»»õ¹¤³§
PERFORM BDC_FIELD USING 'MG03STEUER-TAXKM(01)'
RECORD-TAXKM. " ÎïÁÏË°·ÖÀà
condense RECORD-VRKME no-gaps.
IF RECORD-MEINS <> RECORD-VRKME and RECORD-VRKME <> ''.
perform bdc_field using 'MVKE-VRKME'
record-VRKME. " ÏúÊÛµ¥Î»
select single * from MARM where matnr = record-matnr
and meinh = record-vrkme.
if SY-SUBRC NE 0.
tmp = 'W'.
select single * from t006 where MSEHI = record-meins.
if t006-DIMID = 'AAAADL'.
DIMID = ''.
else.
DIMID = t006-DIMID.
endif.
select single * from t006 where MSEHI = record-vrkme.
if dimid <> t006-DIMID.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0510'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMZU-UMREN'
record-VMREN. "ÏúÊÛµ¥Î»×ª»»Òò×Ó
perform bdc_field using 'RMMZU-UMREZ'
record-VMREZ. "»ù±¾µ¥Î»×ª»»Òò×Ó
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
endif.
endif.
ENDIF.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE' " µ÷ÓÃË°Àà×ÓÆÁÄ»
'/00'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' " ·µ»ØÏúÊÛ×éÖ¯ 1ÆÁÄ»
'/00'.
ENDFORM. " salorg1
*& Form salorg2
ÏúÊÛ×éÖ¯ 2
--> p1 text
<-- p2 text
FORM salorg2.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MVKE-KTGRM'.
PERFORM BDC_FIELD USING 'MVKE-VERSG'
RECORD-VERSG. " ÎïÁÏͳ¼Æ×é
PERFORM BDC_FIELD USING 'MVKE-KTGRM'
RECORD-KTGRM. " ¿ÆÄ¿ÉèÖÃ×é
PERFORM BDC_FIELD USING 'MVKE-KONDM'
RECORD-KONDM. " ÎïÁ϶¨¼Û×é
perform bdc_field using 'MVKE-MTPOS'
RECORD-MTPOS. " ÏîÄ¿Àà±ð×é
PERFORM BDC_FIELD USING 'MVKE-MVGR1'
RECORD-MVGR1. " ÎïÁÏ×é 1
PERFORM BDC_FIELD USING 'MVKE-MVGR2'
RECORD-MVGR2. " ÎïÁÏ×é 2
ENDFORM. " salorg2
*& Form salplant
ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý
--> p1 text
<-- p2 text
FORM salplant.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
select single * from marc where matnr = record-matnr
and werks = record-werks.
if SY-SUBRC NE 0 OR MARC-MTVFP = ''.
PERFORM BDC_FIELD USING 'MARC-MTVFP'
RECORD-MTVFP. " ¿ÉÓÃÐÔ¼ì²é
endif.
PERFORM BDC_FIELD USING 'MARA-TRAGR'
RECORD-TRAGR. " ÔËÊä×é
PERFORM BDC_FIELD USING 'MARC-LADGR'
RECORD-LADGR. " ×°ÔØ×é
perform bdc_field using 'MARC-XCHPF'
record-XCHPF. " ÅúÁ¿¹ÜÀí
ENDFORM. " salplant
*& Form PURCHASEDATA
²É¹ºÊý¾Ý
--> p1 text
<-- p2 text
form purchasedata.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARC-WEBAZ'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX.
IF K NE 'K'.
perform bdc_field using 'MARA-MEINS'
record-MEINS. " »ù±¾¼ÆÁ¿µ¥Î»
perform bdc_field using 'MARA-MATKL'
record-MATKL. " ÎïÁÏ×é
ENDIF.
condense RECORD-BSTME no-gaps.
IF RECORD-MEINS <> RECORD-BSTME and RECORD-BSTME <> ''.
perform bdc_field using 'MARA-BSTME'
record-BSTME. " ¶©µ¥µ¥Î»
select single * from MARM where matnr = record-matnr
and meinh = record-bstme.
if SY-SUBRC NE 0 and
( record-vrkme <> record-bstme or tmp <> 'W' ).
tmp = 'W'.
select single * from t006 where MSEHI = record-meins.
if t006-DIMID = 'AAAADL'.
DIMID = ''.
else.
DIMID = t006-DIMID.
endif.
select single * from t006 where MSEHI = record-bstme.
if dimid <> t006-DIMID.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0510'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMZU-UMREN'
record-UMREN. "¶©µ¥µ¥Î»×ª»»Òò×Ó
perform bdc_field using 'RMMZU-UMREZ'
record-UMREZ. "»ù±¾µ¥Î»×ª»»Òò×Ó
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
endif.
endif.
ENDIF.
perform bdc_field using 'MARC-EKGRP'
record-EKGRP. " ²É¹º×é
perform bdc_field using 'MARC-WEBAZ'
record-WEBAZ. " ÊÕ»õ´¦Àíʱ¼ä
endform. " PURCHASEDATA
*& Form MRP1
text
--> p1 text
<-- p2 text
FORM MRP1.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX. " ÎïÁÏÃèÊö
IF K NE 'K'.
perform bdc_field using 'MARA-MEINS'
record-MEINS. " »ù±¾µ¥Î»
ENDIF.
perform bdc_field using 'MARC-DISGR'
record-DISGR. " MRP×é
perform bdc_field using 'MARC-MAABC'
record-MAABC. " ABC±êʶ
perform bdc_field using 'MARC-DISMM'
record-DISMM. " MRPÀàÐÍ
perform bdc_field using 'MARC-FXHOR'
record-FXHOR. " ¼Æ»®µÄʱ½ì
perform bdc_field using 'MARC-DISPO'
record-DISPO. " MRP¿ØÖÆÕß
perform bdc_field using 'MARC-DISLS'
record-DISLS. " ÅúÁ¿
perform bdc_field using 'MARC-BSTFE'
Here is a sample program which creates a material with the bare minmal fields, this will get you started.
report zrich_0003 .
data: headdata type bapimathead.
data: clientdata type bapi_mara.
data: clientdatax type bapi_marax.
data: descdata type table of BAPI_MAKT with header line.
data: return type bapiret2 .
data: returnm type table of bapi_matreturn2 with header line.
data: xmara type mara.
parameters: p_matnr type mara-matnr.
headdata-material = p_matnr.
headdata-ind_sector = 'M'.
headdata-matl_type = 'FERT'.
headdata-basic_view = 'X'.
clientdata-BASE_UOM = 'EA'.
clientdatax-BASE_UOM = 'X'.
clientdata-old_mat_no = 'Old Material'.
clientdatax-old_mat_no = 'X'.
clientdata-division = '00'.
clientdatax-division = 'X'.
descdata-LANGU = sy-langu.
descdata-MATL_DESC = 'This is the description'.
append descdata.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
* PLANTDATA =
* PLANTDATAX =
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA =
* VALUATIONDATAX =
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA =
* SALESDATAX =
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
importing
return = return
tables
MATERIALDESCRIPTION = descdata
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
returnmessages = returnm
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
check sy-subrc = 0.
Regards,
Rich Heilman
Maybe you are looking for
-
External Hard disk has space problem for Time Machine
Im not sure this is the right place to post this, but I've just got OSX.5 so Time Machine is new to me. I've got a 500Gb Firewire Lacie Drive which I now have, as far as I can see, about 110GB of stuff in. I have a bout 300Gb to back up. Currently my
-
How can I delete a wireless network from my MacBoork Ai
How can I delete a wireless network from my MacBoork Air. I had set up a WEP Network but I need to set up a WPA (personal) network now and i cant seem to change the WEP network to a WPA2 network. Thank you for any help you can provide me. LShaps
-
[RESOLVED] dbms_metadata.get_ddl() issues
Hi all, I'm having a bit of an issue using the dbms_metadata package. I've never used it so possibly I'm unaware of something basic. I'm getting diferent results in my production and dev servers, both of which have this configuration: Oracle9i Enterp
-
Commitment calculation partial reception of Services PO
Due to the Public Sector Management implementation, we changed our customizing setting it like this in SPRO and CUNI transaction: CUNI: Application parameters: x Commercial meas. unit SPRO: Material Management - External Services Management - Source
-
File sender, uploader widget
Is there any file sender, uploader widget for Muse?