SAP4TECH

SAP and ABAP Free Tutorials
Menu
  • SAP Technical
    • ABAP Code Snippets
    • ABAP WebDynPro
    • SAP GW
    • SAP IDOC (ALE)
    • SAP PI (XI)
    • SAP Screen Personas
    • SAP Workflow
  • SAP Functional
    • SAP FI
    • SAP FSCM
    • SAP HR
    • SAP SD & SAP MM
    • SAP PM
    • SAP PP
    • SAP PS
    • SAP QM
    • SAP VIM
    • SAP WM
  • SAP Fiori
  • SAP HANA
  • SAP BW
  • SAP CRM
  • SAP SRM
  • SAP4TECH
    • About Us
    • Contact Us
    • Terms & Conditions
    • Privacy and Cookie Policy

SAP4TECH » How To trigger IDOC LOIPRO when PO Changed or Created

SAP PP

How To trigger IDOC LOIPRO when PO Changed or Created

February 19, 2016 John

Trigger IDOC LOIPRO: SAP Process Order IDoc in detail is the main topic of the following SAP ABAP Tutorial.

  • First, the SAP Process Order IDoc structure LOIPRO will be detailed. (covered in Part 1)
  • Second how to fill the extra segment of an IDoc LOIPRO extension (covered in Part 1)
  • Third, the easiest way to Generate Outbound IDoc LOIPRO for SAP PO. (covered in Part 1)
  • Last, How To trigger IDOC LOIPRO when PO Changed/Created.(Part 2)

Table of Contents

  • How To trigger IDOC LOIPRO when PO Changed/Created
    • SAP Process Order BADIs
    • SAP Process Order BADI WORKORDER_UPDATE
    • Method AT_SAVE – trigger IDOC LOIPRO

How To trigger IDOC LOIPRO when PO Changed/Created

In SAP, Process Orders are assimilated to a Master Data. So there is no entry in NACE to trigger an Idoc when an order is updated.
Within the different ways to trigger to create an IDoc LOIPRO once a SAP Process Order is created or update is to implement a BADI. I found that it is the best way to do.

SAP Process Order BADIs

Try to implement the BADI WORKORDER_UPDATE (in SAP Tcode SE18)
Actually the BADI WORKORDER_UPDATE is the Business Add-In PM/PP/PS/PI Orders Operation: UPDATE

The others BADI for Process Order are:

BADI Description
WORKORDER_CONFIRM Business Add-In PM/PP/PS/PI Orders Operation: Confirm
WORKORDER_CONFIRM_CUST_SUBSCR Confirmation: Subscreen with Customer's Own Fields
WORKORDER_CONFIRM_EA_APPL Confirmation: Function Calls from EA-APPL
WORKORDER_DFPS_PIC_ATP Defense BADI for Availability Check
WORKORDER_DOCLINKS BAdI: Document Links (Production Orders)
WORKORDER_FINANCIALS Anbindung FIN Add-On an Fertigungs- und Proze aufrag
WORKORDER_GOODSMVT Business Add-In PM/PP/PS/PI Orders: Automatic Goods Movement
WORKORDER_INFOSYSTEM BAdI: PP and PI Order Information System
WORKORDER_MODIFY_SCREEN Screen Adjustments
WORKORDER_PISHEET Business Add-In PM/PP/PS/PI Orders Operation: Discarding of
WORKORDER_REWORK Business Add-In PP Orders Operation: Rework
WORKORDER_UPDATE Business Add-In PM/PP/PS/PI Orders Operation: UPDATE

SAP Process Order BADI WORKORDER_UPDATE

The first step is to define the list of BADI WORKORDER_UPDATE methods. Here the full list of the methods available:

Method Description
ARCHIVE_OBJECTS Archiving Additional Objects
AT_DELETION_FROM_DATABASE Order is deleted from the database (archiving)
AT_SAVE Save Order Time: Dialog
CMTS_CHECK Check: Configurable Warehouse Order Allowed
INITIALIZE Initialization when Importing/Creating Order
IN_UPDATE Save Order Time: Update
NUMBER_SWITCH Swap Tempory Order Numbers with Final Order Numbers
BEFORE_UPDATE Save Order Time: Before Calling Update
AT_RELEASE Release Order Time: After SAP Checks Before Release
REORG_STATUS_ACT_CHECK Reorganization of Order: Status Check
REORG_STATUS_ACTIVATE Reorganization of Order: Follow-Up Action After Status Set
REORG_STATUS_REVOKE Reorganization of Order: Follow-Up Action After Status Reset

Method AT_SAVE – trigger IDOC LOIPRO

To trigger the LOIPRO01 IDoc when SAP Process Order/ Work Order is modified or created, we will rewrite the method AT_SAVE. This method is triggered when the user clicks on SAVE button on PO/WO SAP Tcodes ( COR1/ COR2 ).
The AT_SAVE takes as input IS_HEADER_DIALOG Order Header in Dialog Structure. It is quite enough because it has all the keys to access the SAP PO.

An important point, you must put wrapper you ABAP code in a Function Module and call the processing in BACKGROUND TASK AS SEPARATE UNIT DESTINATION ‘NONE’.
This call will wait until the Main SAP GUI Process for Saving before triggering the IDOC.
The advantages are:

  1. Wait until a COMMIT before triggering the LOIPRO IDoc
  2. Avoid blocked Processing Order – conflict
  3. keep the main flow of the SAP standard Process unchanged
  4. Avoid Stopping Saving the SAP PO if error occurs for IDoc Generation.

An ABAP Sample for creating LOIPRO in AT_SAVE Method would be:

ABAP
1
2
3
4
5
6
7
8
" Call in Background Task in a separate Unit
CALL FUNCTION 'ZIDOC_CREATE_LOIPRO' IN BACKGROUND TASK
  AS SEPARATE UNIT DESTINATION 'NONE'
       EXPORTING
            message_type = 'ZLOIPRO'
            aufnr        = is_header_dialog-aufnr
            werks        = is_header_dialog-werks
            matnr        = is_header_dialog-matnr.

Check this article about Statement SUBMIT is not allowed in this form which explain how to use the IN UPDATE TASK.

Prev Article
Next Article
Tags:Process Order SAP IDOC SAP Transaction Codes

Related Articles

SAP CRM Catalog e1461269538601
Best ABAP Ressources on the web list the main Blog …

Best ABAP Ressources on the Web

SAP PP Tcodes e1478774325601
SAP PP Tcodes – Production Planning Transactions Codes in SAP: …

List of the important SAP PP Tcodes – Production Planning Transactions Codes in SAP

Search on SAP4TECH

The Most Populars

  • The Most Important SAP ISU Tables
    The Most Important SAP ISU Tables
  • SAP Users Tables
    SAP Users Tables (for Personal, Logon, and Address Data)
  • List of SAP Purchase Order Tables in SAP MM SAP PO Tables
    SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • Full list of SAP Movement Types
    SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP GL Account Tcodes SAP GL Account Tables
    The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables
    SAP BOM Tables for BOM Header, Items and components and Category

Related Posts

  • SAP send email cl bcs
    CL_BCS Class : 5 Easy Steps To Send Email with ABAP
  • SAP Batch Management 1
    SAP Batch Management Tcodes, Tables and Customizing (SAP Batch Management)
  • ABAP Shared Memory
    ABAP Memory ID : How to use EXPORT or IMPORT data
  • ABAP Workbench
    SAP Refresh Buffer – All the Tcodes to refresh Buffer in SAP
  • SAP PP Tcodes e1478774325601
    List of the important SAP PP Tcodes – Production Planning Transactions Codes in SAP

SAP4TECH

SAP and ABAP Free Tutorials

Trending Posts

  • The Most Important SAP ISU Tables
  • SAP Users Tables (for Personal, Logon, and Address Data)
  • SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables for BOM Header, Items and components and Category

The Most Recents

  • The Most Important SAP ISU Tables
  • SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd Lecture
  • The Main SAP Dunning Transaction Codes
  • SAP Accounts Payable Tcodes & Accounts Receivable Tcodes ( SAP AP Tcodes & SAP AR Tcodes)
  • The Most Important SAP Payment Terms Tables (ZTERM, Text…)

Search

SAP Tutorials by Topics

  • SAP Tables
  • SAP Tcodes
  • SAP BAPI
  • ABAP Snippets
  • Top SAP Courses
  • Top SAP Books
Copyright © 2021 SAP4TECH

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
This website uses cookies to improve your experience. We'll assume you accept this policy as long as you are using this websiteAcceptView Policy