Compiled by: Titus T Thomas, Sr. ABAP Development consultant, Collabera
[email protected];
[email protected] June 2012 Area menu for Idocs – WEDI. Outbound Idoc generation when creating a PO in SAP: Steps involved for Configuration of Outbound Idoc when PO is created: 1. Configure an output type (for ALE/EDI Idoc output) for Purchase order. Transaction NACE. 2. Create partner profile for vendor to whom PO is created. Transaction WE20. 3. Create a port to specify the end-point of the generated Idoc file. For testing, we can use file port. Transaction WE21. 4. Create a PO and check the messages screen for the configured output type – to appear in yellow status icon. Transaction ME21N. 5. On releasing PO (if a release procedure exists), or on saving the PO, the Idoc is generated and an outbound file is created and sent to the port. Release PO Transaction: ME29N. I. Pre-requisites: Minimum requirements to create a purchase order in SAP. 1. 2. 3. 4. 5. 6.
Company code Purchasing organization Purchasing group Plant (for which to procure items) Vendor (Purchasing from). Material (the item being purchased)
1. Creating a company code. We will copy from an existing company code. 1.a. SPRO → SAP Reference IMG button → Enterprise Structure → Definition → Financial Accounting → Edit, Copy, Delete, Check Company Code.
1.b. Now edit the company code
1.c. Now create a company.
1.d.
If required, define credit control area and assign to the new company code.
1.e. Now, assign company code to a company
1.f. Next, assign company code to credit control area.
1.g.
Assign company code to Controlling area. Transaction: OX19
2. Create purchasing organization. 2.a. SPRO → SAP Reference IMG button → Enterprise Structure → Definition → Materials Management → Maintain purchasing organization.
2.b.
Assign purchasing organization to company code:
3. Create purchasing group.
4. Create Plant. Transaction: OX10
4.a. Create Division: Transaction OVXB
4.b.
Assign plant to company code. Transaction: OX18
4.c. Define Business area.
4.d.
Assign Business Area to Plant/Valuation Area and Division. Transaction: OMJ7.
4.e. Now, assign the plant to a purchasing organization. Transaction: OX17.
5. Create Vendor. 5.a. Create vendor account group.
5.b.
Assign number range to vendor account group.
5.c. To define a new number range for vendor account groups, use transaction XKN1 5.d. Create vendor through Transaction: XK01
6. Create material. 6.a. Create material using transaction MM01.
6.b.
Specify the plant.
II. Configuration Customizations and configurations to be done to enable an ALE/EDI Idoc output when PO is created for a vendor, in this case, ZVEND_IDOC. 1. Configure an output type (for ALE/EDI Idoc output) for Purchase order. Transaction NACE.
1.a. Select EF for Purchase order and click on Output types in Application toolbar.
1.b.
Let us take the output type NEU to be our EDI output of the PO. Select NEU and double-click on processing routines.
1.c. Make sure an entry for medium "EDI" exists. This screen indicates that for an EDI output to be processed, the subroutine EDI_PROCESSING of program RSNASTED is to be called. 1.d.
Next, double-click on Partner functions in the left Dialog structure. Make sure the medium "EDI" has been assigned to the parner function VN, which is vendor.
1.e. Now come back to the NACE initial screen. Select the EF purchase order and click on Condition records.
1.f. Select the output type "NEU" and click on condition records. 1.g.
Now, we need to assign the NEU output (which is our EDI output) to a vendor with whom we raise the PO. We will now assign this output type to vendor ZVEND_IDOC. Select the first key combination "Purchasing Output Determination: Purch. Org./Vendor for EDI".
1.h.
Now, select the vendor and purchasing organization and execute.
1.i. Add the vendor and the partner function in the next screen and assign medium 6 (EDI) and Date/Time as 4 (Immediate output).
1.j. Come back to the NACE initial screen and select EF and click on Procedures.
1.k.
Ensure the output type NEU is configured for the procedure that is active.
2. Create a port to specify the end-point of the generated Idoc file. For testing, we can use file port. Transaction WE21. 2.a. In our example, we will create an Idoc file. For this, select File and click on create.
2.b. Specify the directory in application server level where the Idoc file needs to be created. A function module can be specified which will be used to supply a name for the generated file. 2.c. Click on Access test to see if we have access permissions to the specified directory.
3. Create partner profile for vendor to whom PO is created. Transaction WE20.
3.a. Select the line Partner type LI and click on Create button to create a partner profile for vendor. Enter the details and click on Save.
3.b. Since we want to configure an outbound Idoc during PO creation, we click on Insert button under the Outbound parameters table control.
3.c. Enter the partner role VN, message type ORDERS, receiver port , Idoc type ORDERS03. Select the output mode Transfer Idoc immediately. If collect Idocs are selected, a report program "RSEOUT00" needs to be scheduled to transfer.
Note: To view message type ORDERS, use transaction WE81. To view Idoc Basic type, use transaction WE30. For detailed documentation on the Idoc type, use transaction WE60.
3.d. In Message control tab, click on Insert icon and add the application EF, Message type NEU and Process code ME10 for PO create.
Note: To view the process code ME10, use transaction WE41. 4. Create a PO and check the messages screen for the configured output type – to appear in yellow status icon. Transaction ME21N. 4.a. Enter organization data, material, quantity, net price etc.
4.b. Click on Check button to check for any errors in the entered data.
4.c. Click on Messages button in application toolbar to ensure output type NEU is displayed.
4.d.
Save the PO.
5. If a release procedure exists, Idoc is generated on releasing the PO. Else, On saving the PO, the Idoc is generated and an outbound file is created and sent to the port. For releasing PO use Transaction: ME29N. 5.a. Now open the PO in Change/Display mode and click on messages tab. If a green icon is seen against the output type NEU, the Idoc generation was started successfully. In order to get the Idoc number, select the NEU line and click on Processing log button.
5.b.
To view the file, use transaction AL11.
Text Document
Outbound IDoc file EDI_DC40_U2000000000000223106700 3012 ORDERS03 ORDERS SAPE6T LS E6TCLNT200 ZIDOC_PORTLILFZVEND_IDOC 20120618172355 20120618172353 E2EDK01005 200000000000022310600000100000001 XINR 1.00000 0001 NB 4500001865 ZVEND_IDOC E2EDK14 200000000000022310600000200000002014ZPOR E2EDK14 200000000000022310600000300000002009ZP1 E2EDK14 200000000000022310600000400000002013NB E2EDK14 200000000000022310600000500000002011ZBP1 E2EDK03 20000000000002231060000060000000201220120618 E2EDK03 20000000000002231060000070000000201120120618 E2EDKA1003 200000000000022310600000800000002AG ZCUST_IDOC 12345 5551234 IDoc purchases ZPOR IDoc Purchase Org. ZP1 E2EDKA1003 200000000000022310600000900000002LF ZVEND_IDOC E EN E2EDKA1003 200000000000022310600001000000002WE ZPLN Plant for IDOc Plant ZPLN address 123456 IN ECompany 11 EN E2EDK02 2000000000000223106000011000000020014500001865 20120618172353 E2EDK17 200000000000022310600001200000002001CIFCochin E2EDK17 200000000000022310600001300000002002 Cochin E2EDP01007 20000000000002231060000140000000200010 0010X25.000 EA 25.000 EA 250 1 6250 50 KGM 01 1 1 50 E2EDP20001 20000000000002231060000150000140325.000 0.000 20120618 E2EDP19002 200000000000022310600001600001403001IDOC001 IDoc test material E2EDS01 2000000000000223106000017000000020026250 INR
Annexure 1: Creating a company code in SAP. SAP recommends that you used EC01 to copy an existing company code to a new one. This has the advantage that you also copy the existing company code-specific parameters. If necessary, you can then change certain data in the relevant application. This is much less time-consuming than creating a new company code. Following are the steps to create a new company code:Use EC01 to copy an existing company code. This will ensure that you will not missed out any customizing settings. Tcode is OX02 or Goto tcode SPRO SPRO -> SAP Ref IMG -> Enterprise Structure-> Definition -> Financial Accounting -> Edit,Copy, Delete, Check Company code OKKP - Assign company code to the controlling area OBY6 - Define company code global parameters OB62 - Assign company code to chart of accounts Then check the following if needed, there may be other areas depending on your needs: OBA4 - FI Tolerance Group for Users FBZP - Maintain Payment program OBYA - Inter Company code clearing if being used Annexure 2: SAP MM Config - Create a New Plant IMG for SAP Plant Maintain How to Configure a New Plant in SAP? Plant 0001 is the SAP default provide for your reference. OX14 - Define Valuation Area (Tick one only- Once your system go live, no more changes) Most company take the SAP recommended choice - Value Material Stock at Plant level Value Material Stock at Plant or Company Level If you valuate material stocks at plant level, the plant is the valuation area. If you valuate material stocks at company code level, the company code is the valuation area. The decision you make applies to the whole client. OX10 - Create / Change / View Plants OVXB - Create / Change / View Division OX18 - Assign Plant to company code e.g. 0001 - 0001 - All Plants Px1 - Plant Px1 Px2 - Plant Px2 OX19 - Assignment of company code to the Controlling Area
OB38 - Assign company code to Credit Control Area OMJ7 - Assign business area to Plant/Valuation area and division e.g. Plant Px1 - Business Area Bx1 Bx2 Assign Valuation area to the Business Area .e.g. Valuation area Vx1 - Business Area Bx1 Business Area Bx2 OMS0 - Assign Factory Calendar to the Plant and Business Area The plant plays an important role in the following areas: Material Valuation - If the valuation level is the plant, the material stocks are valuated at plant level. Each plant can have its own material prices and account determination. Inventory Management - The material stocks are managed within a plant. MRP - Material requirements are planned for each plant. Each plant has its own MRP data. Analyses for materials planning can be made across plants. Production - Each plant having they own production/planning. Costing - In costing, valuation prices are defined only within a plant. Plant Maintenance - If a plant performs plant maintenance planning tasks, it is defined as a maintenance planning plant. A maintenance planning plant can also carry out planning tasks for other plants (maintenance plants). If you want to use the application PP (production planning) or product costing and job-order costing, you must set valuation at plant level. The valuation level that you choose affects the maintenance of material master records the G/L accounts in which material stocks are managed the G/L accounts to which transactions are posted in Materials Management Effect on the maintenance of material master records: Depending on the valuation level chosen, you maintain accounting data in the material master record for each plant or for each company code you define a valuation price for the material in each plant or in each company code Effect on G/L accounts: If material stocks are valuated at company code level, all plant stocks of a material are managed in a joint stock account for each company code. If material stocks are valuated at plant level, you can manage the material stocks for each plant in different accounts. For each plant, you can define a separate determination. If several plants are to use account determination, you can group these plants in "Valuation and Account Assignment" Customizing.