Workflow Configuration of Inbound IDOC processing:

Standard SAP IDoc interface uses ALE as the transfer mechanism and workflow functionality is used to route a failed IDOC to a specific individual or workgroup.

Application Link Enabling (ALE) is a component-based architecture enabling software component from SAP and from other software vendors to communicate and be integrated with each other. ALE can integrate business processes between R/3 Systems and non-R/3 systems as well as between R/3 Systems.

Business data is exchanged with an external system using the IDoc Interface. The IDoc Interface consists of the definition of a data structure and a processing logic for this. The data structure is the IDoc. It is the exchange format that unites the communicating systems. Using IDocs you can define an exception handling within the SAP System using SAP Business Workflow, without the need for the data to already be an SAP application document.

To implement the distribution of business application processes and functions using ALE you need to construct a logical Distribution Model of the whole system. Within the framework of this configuration, customers can specify which applications are to run on which systems and which messages are to be exchanged between the applications.  
Follow the below 3 Steps for the configuration :  

Workflow Configuration of Inbound data processing

Main Path: Tools->Business Communication


First step in the workflow configuration is to identify the IDOC type to be used for the inbound processing
The main menu path to configure the IDOC can be found under Tools in SAP Easy Access Screen:

            ALE > Inbound data processing
            Business Communication > IDOC setup
            Business Workflow > Org setup

WE30 - Identify the IDOC type


Identify the IDOC types for the inbound transaction, e.g.: ORDERS05 for orders, DELVRY03 for shipments, etc
Make sure to use the latest available version, e.g.: for shipment, the latest would be DELVRY03
Make sure the IDOC has been released

WE81 - Identify the Message type


Identify the message type for the transaction, e.g.: ORDERS for orders, SHPCON for shipments, etc

WE82 - Link IDOC to Message type


In this screen, link the Message type with the Basic type

WE57 – Link IDOC to Function Module


For a custom function module that will be used to process the inbound IDOC:
            Use SE37 to create the FM
            Find one that is related and copy
            Create a new entry with the new custom FM

BD51 – Define FM attribute


If your custom FM would be using a 'Call Transaction', enter '2' in 'Input'
Check the 'Dialog allow', this will allow to run foreground and background if checked

WE42 – Define Process Code


For custom FM, create a new process code
Click on Logical message
            Enter the Message Code if your setup required it, eg, you can setup different message code that will be use in the FM to identify logic specific for Beaconlite vs MBP
            Message Code can also be used to assign different org. unit for fallout notifications

            Double click on the process code to get to this screen
            Click on the  ==> to go to next screen
            This setup will be use to configure the fallout event triggering

SWE2 – Event linkage

            Take note of the Receiver type, this will be use in subsequent fallout configuration

Workflow Configuration ALE / Organization Unit:

ALE configuration


Transaction Code: SALE
Steps:
            Maintain Logical system
            Maintain Partner profiles
            Maintain inbox workflow recipient
            Maintain recipient by responsibility (as needed)

Maintain Logical System


The logical system is used to uniquely identify a system in the network
            Use this if the partner is neither a customer or a vendor

Organization Management

Organizational structure is created by assigning objects of the following types to each other:
            Organizational Unit
            Position
            Job
            Person
            User
            Task
  
PPOCW - Maintain inbox workflow recipient:

Create New Org unit

This step is to setup the business user getting the error notification for any failed IDoc

Create New Position

            Put the cursor on the org unit and click on 'Create'
            Click on 'Position', and press the enter button
            Create the new Position

Assign Position to User

            Right click on the position, click on 'Assign'
            Place the cursor on the 'User'
            and press the enter button
            Find the user to be assign
            Press Enter
            Click on 'Yes'

Assign Task to Position

            Place the cursor on Position again (Delivery fallout)
            Right click, and select 'Assign'
            Place the cursor on Standard task, and press the enter button
            Click on the 'Column Configuration'button
            Put a check on all
            Take the ID (XXXXXXXX) for the Org. Unit
            Make sure to save the setup (will create a transport)

WE20 – Partner Profile


3 types of Partner types
            KU – customer
            LI – vendor
            LS – logical system
Create a new partner profile under Partner type LS
            For AP, I think we would need to create the partner under LS
Enter the Partner number, Type and Agent.
            You should not use a user for this, user can come in and out, not stable
            This is the default Agent that will get notified if the agent in the inbound Post processing agent does not get resolved

Click on the "+" create the inbound parameter
Enter the Message type and Process code
                        - Select Processing to be 'Trigger by background program'
Click on the 'Post processing permitted agent'
                        Enter Type, Agent and Lang
                        This is the setup for the error notification

Workflow Processing Inbox fallout:

SBWP – SAP Business Work Place


            Any outstanding fallout items would be available here
            A user can be assigned to multiple tasks

Reserving a work item


            You can execute workflow items by either "double clicking the item" or selecting the item and clicking "Execute" button on the menu bar
                        This prohibits anyone else from taking the same work item
            There are 2 kind of status buttons, one is white (square shape) and the other is blue (square shape). Items in white has not been reserved by anyone.

Releasing a work item


If you determine that the item does not belongs to your business unit or for any other reason you are not going to trouble shoot this item you MUST release the item
            This will allow the work item to be place back in the queue
Place the cursor on the item, right click and select 'Replace' or use the  (dotted square shape)button on top of the menu bar.

Forwarding a work item


To forward a workflow items beyond your team, place the cursor on the item, right click and select 'Forward'.  A new popup screen will come up, you can enter the User in this box.

Fallout processing - Process


Double click on the work item to get more info for the fallout.
Use the 'Process' button to fix the fallout.

Fallout processing - Deletion


If there is a need to resend the IDOC, you must delete the existing fallout work item to delete it from the queue
Click on the 'Delete flag' and the 'Yes' button to confirm the deletion.

Fallout processing  - IDOC Status


Expand the 'Status records' to view error messages

Workflow Processing IDOC programming / Testing :


SE37 – Function Module builder


FM usually starts with IDOC_INPUT_XXXXXX
            XXXXXX usually is the message type, eg DESADV for delivery, ORDERS for order, etc
The FILL_DATA_XXXXXX is where you do data validation and build internal tables and variables needed for subsequent process
The MAINTAIN_DATA_XXXXXX is usually where you see the main logic of the program, eg: to update orders, delivery, purchase order, etc 

FILL_DATA_XXXXXX


This section contains editing logic and data validation

IDOC_STATUS_FILL


This is where you fill up the error messages you want display in the IDOC. You will need the status, document number,  message ID, message number, and detail messages (msgv1-4).

Status value:

50 - erster_statuswert_eingang
51 - fehler_bei_uebergabe
52 - beleg_unvollstaendig
53 - alles_ok
54 - fehler_in_der_bearbeitung

WE19 – IDOC test tool


Find an IDOC to be copied and change the data
Use the Inbound function module to test the IDOC

IDoc : Transaction Codes


WE31 – IDoc segments
WE60 – IDoc types documentation
WE30 – IDoc types
WE81 – Message types
WE82 – IDoc Type / Message
WE60 – Process codes
WE41 – Outbound process code
WE42 – Inbound process code
WE57 – Message / application object
WE09 – Find IDoc in database
WE19 – test tool
WE20 – Partner profiles
WE21 – Ports in IDoc processing
SBWP – SAP Business Work Place
SALE – ALE IMG
BD67 – Function modules for inbound ALE-EDI: details
BD64 – Maintain Distribution Model and Distribute Views
SM59 – Display and maintain RFC destinations
PFTC_DIS – Maintain Task
PFAC_DIS – Maintain Rule
PPOSW– Maintain Organization Structure
WE47 – IDOC status maintenance
SWO1 – business object builder
SE37 – function module builder
SE91 – messages

Workflow Configuration of Inbound IDOC processing:

Standard SAP IDoc interface uses ALE as the transfer mechanism and workflow functionality is used to route a failed IDOC to a specific individual or workgroup.

Application Link Enabling (ALE) is a component-based architecture enabling software component from SAP and from other software vendors to communicate and be integrated with each other. ALE can integrate business processes between R/3 Systems and non-R/3 systems as well as between R/3 Systems.

Business data is exchanged with an external system using the IDoc Interface. The IDoc Interface consists of the definition of a data structure and a processing logic for this. The data structure is the IDoc. It is the exchange format that unites the communicating systems. Using IDocs you can define an exception handling within the SAP System using SAP Business Workflow, without the need for the data to already be an SAP application document.

To implement the distribution of business application processes and functions using ALE you need to construct a logical Distribution Model of the whole system. Within the framework of this configuration, customers can specify which applications are to run on which systems and which messages are to be exchanged between the applications.   


Main Path: Tools->Business Communication


First step in the workflow configuration is to identify the IDOC type to be used for the inbound processing
The main menu path to configure the IDOC can be found under Tools in SAP Easy Access Screen:

            ALE > Inbound data processing
            Business Communication > IDOC setup
            Business Workflow > Org setup

WE30 - Identify the IDOC type


Identify the IDOC types for the inbound transaction, e.g.: ORDERS05 for orders, DELVRY03 for shipments, etc
Make sure to use the latest available version, e.g.: for shipment, the latest would be DELVRY03
Make sure the IDOC has been released

WE81 - Identify the Message type


Identify the message type for the transaction, e.g.: ORDERS for orders, SHPCON for shipments, etc

WE82 - Link IDOC to Message type


In this screen, link the Message type with the Basic type

WE57 – Link IDOC to Function Module


For a custom function module that will be used to process the inbound IDOC:
            Use SE37 to create the FM
            Find one that is related and copy
            Create a new entry with the new custom FM

BD51 – Define FM attribute


If your custom FM would be using a 'Call Transaction', enter '2' in 'Input'
Check the 'Dialog allow', this will allow to run foreground and background if checked

WE42 – Define Process Code


For custom FM, create a new process code
Click on Logical message
            Enter the Message Code if your setup required it, eg, you can setup different message code that will be use in the FM to identify logic specific for Beaconlite vs MBP
            Message Code can also be used to assign different org. unit for fallout notifications

            Double click on the process code to get to this screen
            Click on the  ==> to go to next screen
            This setup will be use to configure the fallout event triggering

SWE2 – Event linkage

            Take note of the Receiver type, this will be use in subsequent fallout configuration


Workflow Configuration ALE / Organization Unit:


ALE configuration


Transaction Code: SALE
Steps:
            Maintain Logical system
            Maintain Partner profiles
            Maintain inbox workflow recipient
            Maintain recipient by responsibility (as needed)

Maintain Logical System


The logical system is used to uniquely identify a system in the network
            Use this if the partner is neither a customer or a vendor

Organization Management

Organizational structure is created by assigning objects of the following types to each other:
            Organizational Unit
            Position
            Job
            Person
            User
            Task
  
PPOCW - Maintain inbox workflow recipient:

Create New Org unit

This step is to setup the business user getting the error notification for any failed IDoc

Create New Position

            Put the cursor on the org unit and click on 'Create'
            Click on 'Position', and press the enter button
            Create the new Position

Assign Position to User

            Right click on the position, click on 'Assign'
            Place the cursor on the 'User'
            and press the enter button
            Find the user to be assign
            Press Enter
            Click on 'Yes'

Assign Task to Position

            Place the cursor on Position again (Delivery fallout)
            Right click, and select 'Assign'
            Place the cursor on Standard task, and press the enter button
            Click on the 'Column Configuration'button
            Put a check on all
            Take the ID (XXXXXXXX) for the Org. Unit
            Make sure to save the setup (will create a transport)

WE20 – Partner Profile  

 3 types of Partner type
            KU – customer
            LI – vendor
            LS – logical system
Create a new partner profile under Partner type LS
            For AP, I think we would need to create the partner under LS
Enter the Partner number, Type and Agent.
            You should not use a user for this, user can come in and out, not stable
            This is the default Agent that will get notified if the agent in the inbound Post processing agent does not get resolved

Click on the "+" create the inbound parameter
Enter the Message type and Process code
                        - Select Processing to be 'Trigger by background program'
Click on the 'Post processing permitted agent'
                        Enter Type, Agent and Lang
                        This is the setup for the error notification

Workflow Processing Inbox fallout:

SBWP – SAP Business Work Place


            Any outstanding fallout items would be available here
            A user can be assigned to multiple tasks

Reserving a work item


            You can execute workflow items by either "double clicking the item" or selecting the item and clicking "Execute" button on the menu bar
                        This prohibits anyone else from taking the same work item
            There are 2 kind of status buttons, one is white (square shape) and the other is blue (square shape). Items in white has not been reserved by anyone.

Releasing a work item


If you determine that the item does not belongs to your business unit or for any other reason you are not going to trouble shoot this item you MUST release the item
            This will allow the work item to be place back in the queue
Place the cursor on the item, right click and select 'Replace' or use the  (dotted square shape)button on top of the menu bar.

Forwarding a work item


To forward a workflow items beyond your team, place the cursor on the item, right click and select 'Forward'.  A new popup screen will come up, you can enter the User in this box.

Fallout processing - Process


Double click on the work item to get more info for the fallout.
Use the 'Process' button to fix the fallout.

Fallout processing - Deletion


If there is a need to resend the IDOC, you must delete the existing fallout work item to delete it from the queue
Click on the 'Delete flag' and the 'Yes' button to confirm the deletion.

Fallout processing  - IDOC Status


Expand the 'Status records' to view error messages

Workflow Processing IDOC programming / Testing :

SE37 – Function Module builder


FM usually starts with IDOC_INPUT_XXXXXX
            XXXXXX usually is the message type, eg DESADV for delivery, ORDERS for order, etc
The FILL_DATA_XXXXXX is where you do data validation and build internal tables and variables needed for subsequent process
The MAINTAIN_DATA_XXXXXX is usually where you see the main logic of the program, eg: to update orders, delivery, purchase order, etc 

FILL_DATA_XXXXXX


This section contains editing logic and data validation

IDOC_STATUS_FILL


This is where you fill up the error messages you want display in the IDOC. You will need the status, document number,  message ID, message number, and detail messages (msgv1-4).

Status value:

50 - erster_statuswert_eingang
51 - fehler_bei_uebergabe
52 - beleg_unvollstaendig
53 - alles_ok
54 - fehler_in_der_bearbeitung

WE19 – IDOC test tool


Find an IDOC to be copied and change the data
Use the Inbound function module to test the IDOC

Why do we need to DEBUG : BREAK POINT : WATCH POINT

DEBUG
We write programs to achieve certain functionality and like other actions, we make mistakes while writing the code. If they are not trapped at the right time, problem becomes bigger, and bigger and bigger.
Read more in ... DEBUG
 

BREAK POINT


The BREAK POINT is a debugging aid. When we run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues. If the program is running in the background or in an update task, the system generates a system log message. 
Read more in ... BREAK POINT
WATCH POINT
Indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point.
Read more in ...WATCH POINT

Why do we need to debug?

We write programs to achieve certain functionality and like other actions, we make mistakes while writing the code. If they are not trapped at the right time, problem becomes bigger, and bigger and bigger.

Mistakes can be syntactical or logical.

Syntactical errors are trapped during syntax check in code editor. Program does not get compiled and activated till they are removed. Existences of logical errors are not understood till we get a difference in outputs. It can reside anywhere in flow logic and can get activated when the proper condition is fired.

ABAP Debugger


ABAP Debugger helps to get rid of logical mistakes by trapping the field values at different stages in program flow. ABAP Debugger is the efficient means of identifying errors in ABAP programs. Programs can be stopped at a particular statement, event, subroutine, and function module or system exceptions. Field contents can be displayed or changed at runtime.
 
Overview of the ABAP Debugger Screen:

Fields: It will show the value of single Fields value of the object
Tables: It will show the value of the internal table
Break points: It will show all the break points in the program
Watch Points: It will display all the watch points in the program.
Calls: It will show name of the program their respective events and the processing block.
Overview: It will give the overview of the program. i.e. Name of the Program their processing block and what type of is the block.
Settings: From Settings one can trace whether the program is running on the Update task Memory Monitoring update debugging and other features.

Other features of Debugger screen:

1)      It will increase the visible area of the program in the debugger mode. The program will show in the whole screen instead of the half screen.

2)      It will display the current line where the program is executing.

3)      All the four buttons are respectively executing the program in each different steps i.e. F5, F6, F7, F8 etc.

4)      SY-SUBRC/SY-TABIX/SY-DBCNT: These fields will show the different value of sy-subrc,

5)      sy-tabix and sy-dbcnt at the different stage of the program.

6)      Delete Icon: This icon will delete all the items in the field names

7)      Line Number: It will show the different Line Number of the Program

8)      Main program: One can find the name of program, which is currently executing.

9)   Watch-point: From that Icon itself it will create the watch-point in the screen.

Why do we need to debug: BREAK POINT

Definition:


The BREAK POINT is a debugging aid. When we run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues. If the program is running in the background or in an update task, the system generates a system log message. 

Break point types:

  1. Static
  2. Dynamic
    1. Directly set
    2. Specially set
                                                              i.      At statement
                                                            ii.      At event
                                                          iii.      At function module
                                                          iv.      At system exceptions


Static Breakpoint


Written in ABAP program.
Should be used in development environment only.

            If sy-subrc eq 0.
            break-point.
            endif .

Dynamic Breakpoint


  • User specific.
  • Can be set/deactivated/deleted at runtime.
  • Deleted automatically when the user logs off from R/3 system.
  • Can be set even when a program is locked by other programmer.
  • Logics can be built while defining it.

Different ways of putting the Break-point in the Program


1)      Writing the Break point in the program.
2)      Writing the Break statement along with the user name in the program Break sy-uname.
3)      By Clicking the Red Button on a line, one can create the Break point at that line.

How to Create/Delete Break Point



  • You can set the break point by duble clicking on the statement during the debugging in
  • You can set the break point through menu option: place the cursor on the statement where you want to put the break point.
    • Goto the menu bar > Break point > select the Create/delete.
  • After creating the break point select Ctrl+S / Select Save in the menu bar - to save all the break points for that session.
  • Viewing all the break points in a ABAP Program.
    • For viewing all the break point in the ABAP Program: Goto – Utilities - Break points - Display
  • If we want to delete the selected break point then click on the display selected Object.
  • After deleting all the break points, the table will be empty and no break point is left in the table.

How to Activate/Deactivate Break point

1. Activate/deactivate all: It will activate the single deactivated break point and vice-versa.
2. Delete All: It will delete all the break points, which is in the programs
3. Deactivate All: It will deactivate all the break points in the program.
4. Activate All: It will activate all the deactivated break points.
5. Save: After setting the break point, by clicking the save button it will save the break point in the program.
  
One can put a break-point at a Statement, Subroutine, Function Module and exception always at runtime.
If in a specific program there is one function module and two subroutines, in that case
The Program will stop at the statement select.
The Program will stop at subroutine.
            The Program will stop at Function Module