BOM creation using MDM
Can we create Bill of Material using MDM, or can we provide authorizations for changing data with the help of MDM as we can call BOm also as a master data.
Hi,
This might help you
/people/david.marchand/blog/2007/08/22/srm-and-mdm-episode-1-srm-mdm-catalog-v20-is-generally-available
Regards
Sangeetha
Similar Messages
-
Error when ECO and BOM creation using IDoc
Hi experts,
now i am doing an interface about ECO/BOM creation and changing using IDoc.The idoc type is ECMMAS02 ans BOMMAT04.
since i know a little about ECO/BOM, can anyone provide some good materials for me?
and i don't know which fields are mandatory in idoc segment, so i go to tansaction BD30 to run a BOM changing. i input a change number but the idoc log shows that change number does not exist. what is the change number using? where i can implement the changes, e.g, change the quantity? should the change number be used when creation and changing? how can i get this change number?
thanks a lot in advance!Hi experts,
now i am doing an interface about ECO/BOM creation and changing using IDoc.The idoc type is ECMMAS02 ans BOMMAT04.
since i know a little about ECO/BOM, can anyone provide some good materials for me?
and i don't know which fields are mandatory in idoc segment, so i go to tansaction BD30 to run a BOM changing. i input a change number but the idoc log shows that change number does not exist. what is the change number using? where i can implement the changes, e.g, change the quantity? should the change number be used when creation and changing? how can i get this change number?
thanks a lot in advance! -
What is use of Item Category N(non-stock item) in BOM creation
Dear Experts,
What is use of Item Category N(non-stock item) in BOM creation ?
regards
rajakarthikHi,
This item category is used for components which are not kept in stock if they are used in a bill of material (BOM). Non-stock items can be entered in the BOM with or without a master record. To enter a non-stock item without a master record, you must simply enter a descriptive text.
When you use this item category, the system automatically creates a purchase requisition for these components,
Special functions
The following functions are supported for non-stock items
You maintain purchasing data for non-stock items in the bill of material.
In the planning run, the system generates purchase requisitions
instead of dependent requirements for components that are procured directly. When you configure your R/3 System for MRP, you can define whether direct procurement is triggered by the planning run or by production order management.
Product costing processes take valuation data from the BOM item.
The system determines the release strategy on the basis of the price data you enter. The material group is required to produce a purchase requisition.
Pavan -
MDM Material Master data creation using Guided Procedures
Well, i searched a lot on the forums but didnt get any thing.
My requirement is to use MDM Java APIs for creating material master data using Guided Procedures. However, i got one nice document "[How to create master data centrally using guided procedure|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/92811997-0d01-0010-9584-f7d535177831]". This doc discuss about business partner creation and also have a link to downloadable file. But now when i click on this download link, it says download expired !
Can anyone please post a valid link to these deployable files?
Or anyone could post some usefull materail or links on the above mentioned requirement?
Kindly reply, any help will be highly appreciated.
Regards,
Ameya
Edited by: Ameya Pimpalgaonkar on Sep 27, 2008 11:29 AMWow, that was indeed a quick reply i have ever got on SDN. Thanks for the excellent link jitesh. However, where will i get the deployable files that it selects in the Import GP/CAF contents step of the demo? those are the webdynpro components files. One is SCA and other is SDA. Where will i get them?
Kindly post the link to those files if u have them or else send it across.
Regards,
Ameya
Edited by: Ameya Pimpalgaonkar on Sep 27, 2008 11:53 AM -
Need Sample Code for Vendor creation using JAVA API
Hi,
I have a scenario like Vendor creation using <b>Java API</b>.
1.I have Vendors (Main) Table.
2.I have <b>look up</b> tables like Account Group.
3.Also <b>Qualifier table</b>(Phone numbers) too.
Could you please give me the sample code which helps me to create Vendor records using Java API?
<b>I need Code samples which should cover all of the above scenario.</b>
<b>Marks will be given for the relevent answers.</b>
Best Regards
PK DevarajHi Devraj,
I hope the below code might solve all your problem:-
//Adding Qualified field
//Creating empty record in Qualifed table
//Adding No Qualifiers
Record qualified_record = RecordFactory.createEmptyRecord(new TableId(<TableId>));
try {
qualified_record.setFieldValue(new FieldId(<fieldId of NoQualifier), new StringValue(<StringValue>));//Adding No Qualifier
catch (IllegalArgumentException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
catch (MdmValueTypeException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
//Creating Record in Qualified table
CreateRecordCommand create_command = new CreateRecordCommand(connections);
create_command.setSession(sessionId);
create_command.setRecord(qualified_record);
try
create_command.execute();
catch(Exception e)
System.out.println(e.toString());
RecordId record_id = create_command.getRecord().getId();
//Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
QualifiedLookupValue lookup_value = new QualifiedLookupValue();
int link = lookup_value.createQualifiedLink(new QualifiedLinkValue(record_id));
//Adding Yes Qualifiers
lookup_value.setQualifierFieldValue(0 , new FieldId(<FieldID of Yes Qualifier>) , new StringValue(<StringValue>));
//Now adding LookUP values
//Fetch the RecordID of the value selected by user using the following function
public RecordId getRecordID(ConnectionPool connections , String sessionID , String value , String Fieldid , String tableid)
ResultDefinition rsd = new ResultDefinition(new TableId(tableid));
rsd.addSelectField(new FieldId(Fieldid));
StringValue [] val = new StringValue[1];
val[0] = new StringValue(value);
RetrieveRecordsByValueCommand val_command = new RetrieveRecordsByValueCommand(connections);
val_command.setSession(sessionID);
val_command.setResultDefinition(rsd);
val_command.setFieldId(new FieldId(Fieldid));
val_command.setFieldValues(val);
try
val_command.execute();
catch(Exception e)
RecordResultSet result_set = val_command.getRecords();
RecordId id = null;
if(result_set.getCount()>0)
for(int i = 0 ; i < result_set.getCount() ; i++)
id = result_set.getRecord(i).getId();
return id;
//Finally creating the record in Main table
com.sap.mdm.data.Record empty_record = RecordFactory.createEmptyRecord(new TableId("T1"));
try {
empty_record.setFieldValue(new FieldId(<FieldId of text field in Main table>),new StringValue(<StringValue>));
empty_record.setFieldValue(new FieldId(<FieldId of lookup field in Main table>), new LookupValue(<RecordID of the value retrieved using the above getRecordID function>));
empty_record.setFieldValue(new FieldId(<FieldId of Qualified field in Main table>), new QualifiedLookupValue(<lookup_value>));//QualifiedLookUp value Retrieved above
} catch (IllegalArgumentException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (MdmValueTypeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
//Actually creating the record in Main table
CreateRecordCommand create_main_command = new CreateRecordCommand(connections);
create_main_command.setSession(sessionId);
create_main_command.setRecord(empty_record);
try
create_main_command.execute();
catch(Exception e)
System.out.println(e.toString());
Thanks
Namrata -
At the time of BOM creation We choose copy from.After that which material ,which plant needs to be copied how will we come to know about this?Do we need do to select all the items from the BOM of source material.After copying items of the source material can i change the item quantity there .Please giude me on that.
Dear,
First you are enetering material and plant of BOM to be created, in copy screen you enter the material and plant form which you want to copy the material BOM
example
Material A in plant 0001 is existing BOM
Copy function can be used for
Case 1 create BOM for a Material B and plant 0001. Now you want to copy from Material A plant 0001.
Here you use the copy frumction and enter material A and plant 0001.
Once you entrer you will see the items of material A/plant 0001, you can select all items or you can select some of them and click on copy, then system will take you to BOM of B in plant 0002 and items of B. here you can delete/add/change the qty, items whatever and save it...so that Material B BOM willbe created. Nothin will happen to material A BOM
Case 2 create BOM for a Material B and plant 0002. Now you want to copy from Material A plant 0001.
Here you use the copy frumction and enter material A and plant 0001.
Once you entrer you will see the items of material A/plant 0001, you can select all items or you can select some of them and click on copy, then system will take you to BOM of B in plant 0002 and items of B. here you can delete/add/change the qty, items whatever and save it...so that Material B BOM willbe created. Nothin will happen to material A BOM
I hope you got it -
Hi,
I am trying to build a business case as to why a business should go for MDM implementation. Can anyone provide any insight into what are the key business benefits of implementing MDM ?
ThanksHi GS,
In addition to above posts
MDM Implementation basically deals to manage and maintain master data of the any firm/organization.
The Dis separate and bad data is lying through out your IT landscape. to get a "singel version of truth" or "360 degree view of your data" you need to implement MDM.
though many MDM technologies are in market in order to implement. but as far as SAP MDM is concern, it is the most versatile and beautiful platform over all others
as it gives you
Master Data Integration :
Use MDM remote system extractor to extract customizing data in the initial setup of your MDM system
Use MDM remote system extractor to automatically extract master data
Use MDM import mechanisms to load master data from various sources
Use MDM business content to integrate data
Use MDM Syndicator to distribute master data to various targets
Use MDM APIs and Web services to integrate data
Some of the Operations :
Data Modeling
Role-Based Data Access
Search
Workflow-enabled Data Creation/Maintenance
Data Publishing
Master Data Quality
Use validations and assignments to check the accuracy and consistency of your master data
Create more complete and meaningful master data using the MDM Enrichment Architecture
Create non-redundant and consistent master data using matching and merging capabilities
I think things are clear for you as far as MDM Implementation is concern.
Hope it helps.
Deep -
Cideon / Autocad 2007 / Material BOM Creation from autocad
Hi,
we are using Cideon integration for AutoCad 2007 & SAP ERP communication. DIR's in DMS are created from AutoCad drawings via SAP menu.
We want to create Material & Material BOM from AutoCad but we cannot see any option present in SAP menu. We can just create Header Material from SAP menu in AutoCad, no BOM option. What steps should be taken to enable material & bom creation from AutoCad SAP menu.
Thanks
Edited by: Rob Burbank on Oct 22, 2010 3:56 PMModerator message - Welcome to SCN
Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
In particular, offering points is against forum rules
Rob -
Is there any BAPI for BOM creation? which does by RCSBI010 / Batch Input.
Hi Experts,
I need to Upload the extracted Excel-file(.txt) for BOM creation, so, pls, let me know that, Is there any BAPI for this purpose. In detail the requirement is that,
The suggested idea shuld work as like as pgm. RCSBI010
thanq
Edited by: Srinivas on Feb 14, 2008 6:18 PMHi Srinivas,
Try these Function Modules
CS_BI_BOM_CREATE_BATCH_INPUT - Create BOM Via Batch Input
CS_BI_BOM_CREATE_BATCH_INPUT1 - Create BOM Via Batch Input (Corrected Session Handling)
There are two BAPI's too, which can be used
ALE_MATERIAL_BOM_GROUP_CREATE
BAPI_MATERIAL_BOM_GROUP_CREATE - Creation of a material BOM group
Hoe this helps.
Edited by: Priyabrata Samanta on Feb 15, 2008 3:56 AM -
Hi All,
Could you plz tell me,
In R/3 also Master data is available. Why we are using MDM( For Master Data ) seperately ?
In R/3 Master tables are there (MARA, KNA1, VBAK), Then Why we are Designing seperate Repositories in MDM for store the data ?
Regards...
Murali.
Edited by: Murali Dusi on Jul 3, 2008 12:24 PMHi Murali,
In R/3, Master data is available but we use MDM( For Master Data ) separately because of some special features of MDM which are given below:
CAPABILITIES OF MASTER DATA MANAGEMENT
1. Synchronization:
An MDM layer improves the ability to share, consolidate, and analyze business information quickly, both globally and regionally. And it makes it possible to rapidly assemble new, composite applications (software that combines the elements of a business activity in a coordinated application and user interface) out of accurate master information and reusable business processes. For e.g. helps to maintain Universal dimensional structures for multi-organizational regulatory compliance.
2. Reduced time to market.
MDM provides a single system for creating and maintaining product information, promotions, and rich, accurate consumer communications via online and traditional channels. One major retailer used MDM to reduce the time to introduce a new product from four weeks to one day.
3. Supply chain improvements.
A single, accurate and agreed upon definition of products and suppliers, made possible by MDM, eliminates duplication, increases buying power, and provides insight into supplier relationships. A major European retailer is combining MDM with Web Sphere Portal to allow more than 30,000 suppliers to manage their own master information
4. Revenue increases.
MDM contributes to better customer relationships. By creating a single 360 degree view of customers, MDM helps sales, marketing, and service teams better anticipate customer needs, provide targeted offers, and improve customer service. Revenue is increased by, for example, from providing more accurate and comprehensive information to the right customers at point of sale.
5. Realize Internal Efficiency
An MDM layer enables companies to realize internal efficiencies by reducing the cost and complexity of processes that use master data (through fewer code clashes, less data duplication, better control over business processes, and so on). It reduces manual translation and analysis to improve repeatability and speed to insight.
6. Finance and Operations:
MDM can lead to more accurate reporting and BI, more efficient planning and budgeting and enhanced ability for regulatory compliance.
7. Sales and Marketing:
MDM can provide a "single view of the customer," leading to greater customer satisfaction. For example Spend Analysis is one the trend that is used in Sales and Marketing with the help of MDM, say for example if we say HCL supplies computers to Wipro Technologies and also to Wipro InfoTech, now if HCL uses MDM than the data would be consolidated that is it would see that in total how many computers are being send to Wipro and accordingly HCL can plan out its business with Wipro like how much discount it has to give and all other business related issues.
8. Procurement and Supply Chain Management:
MDM could mean reduced delays in shipment and fewer errors in item coding. For Example Say we need to deliver a product to out Customer and if we have reliable and correct data, then we can send the Right Product to Right Place and at Right Time, because of which our delay in shipment would be less and it would also reduce the extra cost which the company has to pay for wrong shipment.
9. Product developers:
MDM means faster product launches and a better handle on customer feedback. For Example- We have heard about the companies like Maruti which deals in Cars, now say if Maruti comes out with a new Car Model, then it generally happens that many Customers do the Advance booking for that particular car, now if the data is not maintained properly then Company would not be able to release the product in Time and also this would affect its image in the Market, however if the Product launches on time we will always
get good Customer feedback which would in turn increase the reputation of our Company.
10. Customer Data Integration (CDI):
It is the process of consolidating and managing customer information from all available sources, including his contact details, customer valuation data, and information gathered through interactions such as direct marketing. CDI ensures that all the relevant departments of the company have access to the most current and complete view of customer information available.
11. Interpretability:
Interpretability, or the ability to recognize and understand data, is one of the biggest challenges to implementing successful data quality programs. In many cases, stored data exists in a wide variety of formats. Also, the individual elements within a given record have not been separated or may contain misleading data. Before any data quality processes can be implemented, the source data must be parsed into the appropriate components so that it can be understood by data quality systems. In addition, certain data elements may need to be moved, deleted or formatted.
12. MDM maximizes the return on SOA Investments:
Much of the hype and attention in service-oriented architecture (SOA) deployments has gone into web service creation and deployment and management standards and technologies. However, if data is inconsistent across applications, composite applications and business processes that cut across multiple systems and departments will not yield the desired results and benefits. For example, a composite application in a large multi-channel financial service institution that calculates a customers global credit risk will only work if that customer is described in a consistent manner across retail banking, brokerage, mortgage, and credit card systems. In a retail environment, a composite application that gets a customers order history from a data warehouse and recommends a related product requires consistent product and customer information across all the relevant systems. On a smaller scale, even business services to update an address or provision a service require semantic consistency of master data across customer relationship management (CRM), billing, and product systems.
Effective MDM helps organizations realize the full ROI potential from their SOA and business process management (BPM) investments.
13. High-end scalability:
Scalability is the growth capacity of a system. If a companys data volumes, transaction-processing rates and number of simultaneous users are modest and static, then most products should be able to meet those scalability requirements. But that is not the typical description of an MDM candidate.
Global enterprises with immense amounts of master data, millions of records, tens to hundreds of client business applications and thousands to tens of thousands of users are more the norm. Master data management is a large task. Smaller vendors with lesser-known products simply will not have the capability to support the capacities required.
14. Customer satisfaction due to effective and efficient supply chain management.
15. High productivity due to effective inters operability in company.
16. Effective formulation of policies in company in respect of vendors and customers.
17. In the absence of an MDM function, each system, application, and even department within the enterprise collects its own version of key business entities. Like the collection of customer data. Key attributes such as customer name and address information are collected repeatedly throughout the enterprise. Unfortunately, it is rare that this gathering process produces the same or consistent data about customers. This leads to the critical difficulty (aside from the storage costs of it) with such redundant data poor data quality. According to a report from The Data Warehousing Institute, Data Quality and the Bottom Line by Wayne Ackerson, corporations lose more than $600 billion a year due to poor data quality, and most of that cost can be attributed to redundant and low quality master data.
18. Organizations constant changes as new products and services are introduced and withdrawn, companies are acquired and sold, and new technologies appear and reach maturity. this changes can be managed effectively in MDM and can be reflected every where in the company data.
19. Organizations can build a complete view of their customers, products, and other critical business entities.
Regards
Richa -
Bdc for tocde CS01(BOM CREATION)
Hi,
I want to make a bdc for the tcode CS01(BOM Creation),but the thing when i perform the Recording then there is a point that the BOM having the sub - items which might be 3 or 2 or maybe 10 . how can i manage that during the recording.
plzz provide me guidelines for solving this problem.Hi,
This code for BOM creation/Change,
using BAPI as well as BDC check this.
LOOP AT it_bom_create INTO wa_bom_create.
* Begin of CCT51465 - B09794 - 11/28/2007
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0100'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM f_bdc_field USING 'RC29N-MATNR'
* wa_bom_create-matnr.
* PERFORM f_bdc_field USING 'RC29N-WERKS'
* wa_mbew-bwkey.
* PERFORM f_bdc_field USING 'RC29N-STLAN'
* '2'.
* PERFORM f_bdc_field USING 'RC29N-STLAL'
* '01'.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0110'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* CONDENSE wa_bom_create-bmeng.
* PERFORM f_bdc_field USING 'RC29K-BMENG'
* wa_bom_create-bmeng.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0111'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* CONDENSE wa_bom_create-menge.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0140'.
* PERFORM f_bdc_field USING 'BDC_CURSOR'
* 'RC29P-IDNRK(01)'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM f_bdc_field USING 'RC29P-IDNRK(01)'
* wa_bom_create-idnrk.
* CONDENSE wa_bom_create-menge.
* PERFORM f_bdc_field USING 'RC29P-MENGE(01)'
* wa_bom_create-menge.
* PERFORM f_bdc_field USING 'RC29P-POSTP(01)'
* 'L'.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0130'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0131'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM f_bdc_dynpro USING 'SAPLCSDI' '0140'.
* PERFORM f_bdc_field USING 'BDC_OKCODE'
* '=FCBU'.
* PERFORM f_bdc_transaction USING 'CS01'.
it_stko1-base_quan = wa_bom_create-bmeng.
CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
EXPORTING
material = wa_bom_create-matnr
plant = wa_marc-werks
bom_usage = '2'
valid_from = v_valid " CCT52206 - B09794 - 12/10/2007
* CHANGE_NO =
* REVISION_LEVEL =
i_stko = it_stko1
* FL_NO_CHANGE_DOC = ' '
fl_commit_and_wait = 'X'
* FL_CAD = ' '
fl_default_values = ' '
IMPORTING
fl_warning = flg_warning
* BOM_NO =
TABLES
t_stpo = it_stpo1
* T_DEP_DATA =
* T_DEP_DESCR =
* T_DEP_ORDER =
* T_DEP_SOURCE =
* T_DEP_DOC =
* T_LTX_LINE =
* T_STPU =
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Begin of CCT59311 - B09794 - 07/01/2008
IF p_show = 'X'.
PERFORM f_check_lock.
ENDIF.
* End of CCT59311 - B09794 - 07/01/2008
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
lang = sy-langu
no = sy-msgno
v1 = sy-msgv1
v2 = sy-msgv2
v3 = sy-msgv3
v4 = sy-msgv4
IMPORTING
msg = v_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CONDENSE v_mstring.
wa_errormsg-matnr = wa_bom_create-matnr.
wa_errormsg-werks = wa_marc-werks.
wa_errormsg-mtart = v_mat_typ.
wa_errormsg-msgtyp = sy-msgty.
IF sy-msgid = '29' AND sy-msgno = '037'.
v_mstring = text-027. " Costing BOM already exist (For Material -
CONCATENATE v_mstring wa_marc-matnr ')' INTO v_mstring.
wa_errormsg-msgtxt = v_mstring.
ELSE.
wa_errormsg-msgtxt = v_mstring.
ENDIF.
APPEND wa_errormsg TO it_errormsg1.
CLEAR wa_errormsg.
ENDIF.
ELSE.
wa_successmsg-matnr = wa_marc-matnr.
wa_successmsg-werks = wa_marc-werks.
wa_successmsg-mtart = v_mat_typ.
wa_successmsg-msgtyp = 'S'.
v_mstring = text-017. " Costing BOM created successfully (For Material -
CONCATENATE v_mstring wa_marc-matnr ')' INTO v_mstring.
wa_successmsg-msgtxt = v_mstring.
APPEND wa_successmsg TO it_successmsg.
CLEAR wa_successmsg.
ENDIF.
Code Formatted by: Alvaro Tejada Galindo on Dec 23, 2008 10:21 AM -
Dear Gurus
Are there any other Tcodes for BOM creation other than CS01? Any Tcodes I could use for BOM creation for LSMW upload?
Need help ASAP. Points assured
Thanks in advanceHi Obie,
As all experts has suggested there are only two transaction codes for material BOM,
1. CS01 for creation of BOM
2. CS02 for editing of BOM
There are diffrenet t codes if you want to create equipment BOM like IB01 & IB11.
Hope this will resolve your querry.
Regards,
Avinash. -
Hi,
Is there a BAPI or a function module available for Equipment BOM creation for transaction IB01.
ThanksHi Nidhi,
Chk the below links you might get an idea.
/people/prakash.singh4/blog/2005/05/15/explode-boms-in-enterprise-portal-using-htmlb-tree--part-1-abap
http://help.sap.com/saphelp_erp2005/helpdata/en/d1/2e4114a61711d2b423006094b9d648/frameset.htm
Reward points for the helpful answer.
Regards,
Harini -
Dear Experts,
I have created a role to give access to TCodes IB01,IB02,IB11,IB12. and specified values for BEGRP, INGRP, KOSTL etc.
And assigned the roe to the user.
But, what I find is the access is not confined to any of these values. These T-Codes are working for any value of the above fields.( of an Equipment/FL master)
Request for help to know what went wrong.
Regards
Jogeswara RaoThanks Narasimhanji,
Yes, I am using this object also namely C_STUE_BER. The field value for BEGRU presently I am using 'SM1'. And I am using value 'RM1' in the BEGRP (header page) of equipment master, on whcih the BOM creation is being tried. This is allowing the creation.
(As said earlier It is allowing the BOM creation even the values in the Plant maintenance objects differ)
One doubt here. What is the corresponding field for BEGRU in equipment master. I am not finding anything else than BEGRP?
Regards
Jogeswara Rao -
Error in : Purchase order Creation using BAPI_PO_CREATE1
Hell guys,
I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
I want the new PO to have all the characteristics of an existing PO. whose PO # is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
* Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
* Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
* Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
* Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
* Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
* Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa[].
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
poitem = i_bpoi[]
poitemx = i_bpoix[]
poschedule = i_bpos[]
poschedulex = i_bposx[].
i_order = i_new_ebeln .
SHIFT i_order LEFT DELETING LEADING '0' .
i_return-errortype = c_char_i .
i_return-workarea = c_zsw .
i_return-message = '064' .
i_return-variable1 = i_order .
loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
append i_bapiretn to t_bapi_return .
endloop .
if t_bapi_return[] is initial .
i_create_order = c_char_x .
CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
EXPORTING
act_return = i_return. "Popup with new PO no.
ENDCASE . " Docind
ENDIF .
ENDLOOP.Hi Shareen,
I think in the following parts of the code,
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa[].
Error in : Purchase order Creation using BAPI_PO_CREATE1
Posted: Mar 20, 2006 7:39 PM Reply E-mail this post
Hell guys,
I am trying to create a PO using a BAPI - BAPI_PO_CREATE1
I want the new PO to have all the characteristics of an existing PO. whose PO # is stored in wa_order_split_create-docnr and for the new PO, i want the quantity from wa_order_split_create-qty_acptd and the delivery data to be wa_order_split_create-dly_date. But this process and code below gives a short dump in the std FM - MEPO_DOC_ITEM_GET . It raises an exception of failure. I am trying to create many new PO's in the loop below. If there is just one row, sometimes, it creates the PO even with the exception failure ( which is pretty weird).
Am i making any mistake while filling the header or item or schedule lines for the BAPI_PO_CREATE1 ? Any tips or clues why I am getting a dump ?
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = <b>i_ekpa[].</b>
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
<b> poitem = i_bpoi[]
poitemx = i_bpoix[]
poschedule = i_bpos[]
poschedulex = i_bposx[].</b>
it should be only i_bpoi, i_bpoix, i_bpos, i_bposx but not i_bpoi[], i_bpoix[], i_bpos[], i_bposx[].
CHange the code as follows:
DATA: i_insert,
i_create_order,
i_cycle TYPE cycle,
i_qty_acpt TYPE dzmeng,
i_dly_date TYPE vbak-vdatu,
i_item TYPE roijnomiio .
DATA: i_order TYPE symsgv,
i_return TYPE swd_return .
DATA: i_vbak TYPE vbak,
i_vbap TYPE vbap,
i_ekko TYPE ekko,
i_ekpo TYPE ekpo,
i_bsoh TYPE bapisdhd1,
i_bsohx TYPE bapisdhd1x,
i_bpoh TYPE bapimepoheader,
i_bpohx TYPE bapimepoheaderx,
i_vbeln TYPE vbeln_va,
i_posnr TYPE posnr_va,
i_contr TYPE vbeln_va,
i_conit TYPE posnr_va,
i_ebeln TYPE ebeln,
i_ebelp TYPE ebelp,
i_pargr TYPE pargr,
i_thead TYPE thead,
i_line TYPE tline,
i_note TYPE txw_note,
i_new_vbeln TYPE vbeln_va,
i_new_ebeln TYPE ebeln,
i_wa_bsoi TYPE bapisditm,
i_wa_bsoix TYPE bapisditmx,
i_wa_bsop TYPE bapiparnr,
i_wa_bsos TYPE bapischdl,
i_wa_bsosx TYPE bapischdlx,
i_wa_vbpa TYPE vbpa,
i_wa_vbkd TYPE vbkd,
i_wa_bpoi TYPE bapimepoitem,
i_wa_bpoix TYPE bapimepoitemx,
i_wa_bpos TYPE bapimeposchedule,
i_wa_bposx TYPE bapimeposchedulx,
i_wa_bpop TYPE bapiekkop,
i_wa_ekpa TYPE ekpa,
i_message TYPE char72,
i_bapiretn TYPE bapiret2,
i_bapiret2 TYPE TABLE OF bapiret2 INITIAL SIZE 1,
i_vbpa TYPE TABLE OF vbpa INITIAL SIZE 1,
i_vbkd TYPE TABLE OF vbkd INITIAL SIZE 1,
i_ekpa TYPE TABLE OF ekpa INITIAL SIZE 1,
i_bsoi TYPE TABLE OF bapisditm INITIAL SIZE 1,
i_bsoix TYPE TABLE OF bapisditmx INITIAL SIZE 1,
i_bsos TYPE TABLE OF bapischdl INITIAL SIZE 1,
i_bsosx TYPE TABLE OF bapischdlx INITIAL SIZE 1,
i_bsop TYPE TABLE OF bapiparnr INITIAL SIZE 1,
i_bpoi TYPE TABLE OF bapimepoitem INITIAL SIZE 1,
i_bpoix TYPE TABLE OF bapimepoitemx INITIAL SIZE 1,
i_bpos TYPE TABLE OF bapimeposchedule INITIAL SIZE 1,
i_bposx TYPE TABLE OF bapimeposchedulx INITIAL SIZE 1,
i_bpop TYPE TABLE OF bapiekkop INITIAL SIZE 1,
i_text_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_line_tab TYPE TABLE OF tline INITIAL SIZE 1,
i_txw_note TYPE TABLE OF txw_note INITIAL SIZE 1,
i_oij_el_doc_mot TYPE oij_el_doc_mot .
CONSTANTS: c_char_c VALUE 'C',
c_char_e VALUE 'E',
c_char_p VALUE 'P',
c_char_g VALUE 'G',
c_char_i VALUE 'I',
c_char_s VALUE 'S',
c_char_x VALUE 'X',
c_zsw(3) VALUE 'ZSW',
c_nomit_stat(4) VALUE 'ZDNY' .
DATA : lv_nomtk_split TYPE oij_nomtk.
DATA : i_order_split_create TYPE TABLE OF zsws_order_split.
DATA : wa_order_split_create TYPE zsws_order_split.
LOOP AT i_order_split_create INTO wa_order_split_create.
IF NOT i_create_order IS INITIAL .
CLEAR: i_create_order .
MOVE: wa_order_split_create-docnr TO i_ebeln,
wa_order_split_create-docitm TO i_ebelp .
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = i_ekko
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
ENDIF .
Fill PO Header
i_bpoh-comp_code = i_ekko-bukrs .
i_bpoh-doc_type = i_ekko-bsart .
i_bpoh-vendor = i_ekko-lifnr .
i_bpoh-langu = i_ekko-spras .
i_bpoh-pmnttrms = i_ekko-zterm .
i_bpoh-purch_org = i_ekko-ekorg .
i_bpoh-pur_group = i_ekko-ekgrp .
i_bpoh-currency = i_ekko-waers .
i_bpoh-agreement = i_ekko-konnr .
i_bpoh-incoterms1 = i_ekko-inco1 .
i_bpoh-incoterms2 = i_ekko-inco2 .
Fill PO update indicator 'X'
i_bpohx-comp_code = c_char_x .
i_bpohx-doc_type = c_char_x .
i_bpohx-vendor = c_char_x .
i_bpohx-langu = c_char_x .
i_bpohx-pmnttrms = c_char_x .
i_bpohx-purch_org = c_char_x .
i_bpohx-pur_group = c_char_x .
i_bpohx-currency = c_char_x .
i_bpohx-agreement = c_char_x .
i_bpohx-incoterms1 = c_char_x .
i_bpohx-incoterms2 = c_char_x .
CALL FUNCTION 'ME_EKPO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
pi_ebelp = i_ebelp
IMPORTING
po_ekpo = i_ekpo
EXCEPTIONS
no_records_found = 1
OTHERS = 2.
IF sy-subrc <> 0 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
Fill PO Item
i_wa_bpoi-po_item = i_ekpo-ebelp .
i_wa_bpoi-material = i_ekpo-matnr .
i_wa_bpoi-plant = i_ekpo-werks .
i_wa_bpoi-stge_loc = i_ekpo-lgort .
i_wa_bpoi-quantity = wa_order_split_create-qty_acptd .
i_wa_bpoi-po_unit = i_ekpo-meins .
i_wa_bpoi-tax_code = i_ekpo-mwskz .
i_wa_bpoi-val_type = i_ekpo-bwtar .
i_wa_bpoi-item_cat = i_ekpo-pstyp .
i_wa_bpoi-acctasscat = i_ekpo-knttp .
i_wa_bpoi-agreement = i_ekpo-konnr .
i_wa_bpoi-agmt_item = i_ekpo-ktpnr .
APPEND i_wa_bpoi TO i_bpoi .
Fill PO Item update indicator 'X'
i_wa_bpoix-po_item = i_ekpo-ebelp .
i_wa_bpoix-po_itemx = c_char_x .
i_wa_bpoix-material = c_char_x .
i_wa_bpoix-plant = c_char_x .
i_wa_bpoix-stge_loc = c_char_x .
i_wa_bpoix-quantity = c_char_x .
i_wa_bpoix-po_unit = c_char_x .
i_wa_bpoix-tax_code = c_char_x .
i_wa_bpoix-val_type = c_char_x .
i_wa_bpoix-item_cat = c_char_x .
i_wa_bpoix-acctasscat = c_char_x .
i_wa_bpoix-agreement = c_char_x .
i_wa_bpoix-agmt_item = c_char_x .
APPEND i_wa_bpoix TO i_bpoix .
Fill PO Item Schedule
i_wa_bpos-po_item = i_ekpo-ebelp .
i_wa_bpos-sched_line = '0001' .
i_wa_bpos-delivery_date = wa_order_split_create-dly_date .
i_wa_bpos-quantity = wa_order_split_create-qty_acptd .
APPEND i_wa_bpos TO i_bpos .
Fill PO Item schedule update indicator 'X'
i_wa_bposx-po_item = i_ekpo-ebelp .
i_wa_bposx-sched_line = '0001' .
i_wa_bposx-delivery_date = c_char_x .
i_wa_bposx-quantity = c_char_x .
APPEND i_wa_bposx TO i_bposx .
CLEAR: i_pargr .
SELECT SINGLE pargr
INTO i_pargr
FROM t161
WHERE bstyp = i_ekko-bstyp
AND bsart = i_ekko-bsart .
CLEAR i_ekpa[].
CALL FUNCTION 'MM_READ_PARTNERS'
EXPORTING
application = c_char_p
ebeln = i_ebeln
bstyp = i_ekko-bstyp
pargr = i_pargr
TABLES
x_ekpa = i_ekpa.
LOOP AT i_ekpa INTO i_wa_ekpa .
i_wa_bpop-partnerdesc = i_wa_ekpa-parvw .
i_wa_bpop-langu = sy-langu .
IF NOT i_wa_ekpa-lifn2 IS INITIAL .
i_wa_bpop-buspartno = i_wa_ekpa-lifn2 .
ELSE .
i_wa_bpop-buspartno = i_wa_ekpa-parnr .
ENDIF .
APPEND i_wa_bpop TO i_bpop .
CLEAR: i_wa_ekpa, i_wa_bpop .
ENDLOOP .
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = i_bpoh
poheaderx = i_bpohx
IMPORTING
exppurchaseorder = i_new_ebeln
TABLES
return = i_bapiret2
poitem = i_bpoi
poitemx = i_bpoix
poschedule = i_bpos
poschedulex = i_bposx.
i_order = i_new_ebeln .
SHIFT i_order LEFT DELETING LEADING '0' .
i_return-errortype = c_char_i .
i_return-workarea = c_zsw .
i_return-message = '064' .
i_return-variable1 = i_order .
loop at i_bapiret2 into i_bapiretn where type ca 'EAX' .
append i_bapiretn to t_bapi_return .
endloop .
if t_bapi_return[] is initial .
i_create_order = c_char_x .
CALL FUNCTION 'SWD_POPUP_MESSAGE_SEND'
EXPORTING
act_return = i_return. "Popup with new PO no.
ENDCASE . " Docind
ENDIF .
ENDLOOP.
Maybe you are looking for
-
Just downloaded FCPX, and I have two tracks in my storyline - a background clip and a foreground PNG image. 'm trying to apply a mask to the foreground PNG image. I double-click on the Mask effect, and I see the Mask handlers, but I'm unable to mov
-
Regrading standby database in standard edition
hi gurus i m facing problem in configuring standby database in standard edition windows 2008 . os-windows 2008 standard oracle 11gr2 i have copied files from primary n copied it to same location on standby...at that time database was in noarchivelog
-
Pixel Bender only available for jpg files?
I'm running Photoshop CS5 on a brand new macbook. Everything has been working fine. I recently installed Pixel Bender and started playing with it. It seems to work fine on .jpg files, but whenever I open any PSD files, (or raw files from my Nikon) th
-
I Was searching for a file in LR and my files all went out of order. Some went under my name and some under pics. I had imported these files and named them according to date and place all in consecutive order and now they are messed up. What can I d
-
Hi I tried installing MySQL 5 and used darwin ports, which normally does a great job installing anything I throw at it. However, after 'sudo port install mysql5' I get, when trying to run it, "ERROR 2002 (HY000): Can't connect to local MySQL server t