Monday, 1 June 2020

How to set up the ALE Distribution Unit(UPS) to Receive Inbound IDOCS.

I haven’t found any blog that details the steps to be followed to set up the ALE unit. Hence written this blog to detail all the configurations to be done for the ALE unit setup. Narrated the steps by taking a Scenario. Please find the Scenario details in the below sections.

What is ALE Distribution Unit(UPS)


ALE distribution consist of one original packet with batches of same type of data.

Ex: One Packet may consist of below details.

◉ Material
◉ Material Characteristics
◉ BOM
◉ Routing

Why do we need ALE Packet?


To create/update similar type of  data in sequence in SAP. Also Packet reduces the number of dialog processes called and improves system performance.

Ex: Material Characteristics should be created only when Material is created. If we use packet and define dependency in UPSC02 then no additional coding required to check the prerequisites.

Let’s take a Scenario to understand the steps in detail.

Scenario:


◉ Create “Change Number” and BOM in SAP using the ALE packet.
◉ BOM/MBOM should be created only after “Change Number” is created in SAP.

In case if there are multiple BOMs in ALE packet and few of the BOMs are ended up with an error, then successfully created BOM’s should not be used by the Business.

Solution Approach to avoid usage of Partially processed BOM’s:

If change Number is created and few of the BOMs in the ALE packet are not processed, then there is a possibility of using the BOMs by other processes.  To avoid the usage of such BOMs, we should create two change Number idocs.

◉ One” Change Number“IDOC with Default date 31/12/8888 and this will be processed first. BOM will be created with the Default date.
◉ Second “Change Number” IDOC with Actual Date. This IDOC will be processed once all the BOM idocs are processed. Once Change No. is updated with Actual Change date, the actual Date will reflect in BOM.

Solution Approach for Scenario:

Create the ALE packet which should consist of following.

1. Change Number – Change Number with Default Date i.e 31/12/8888
2. BOM/MBOM – BOM or Multi-level BOM’s.
3. Change Number – Change Number with the actual date.

ALE Unit(UPS) Configuration Steps


I. Define Object Types and dependencies:


T.Code: UPSC01.

1. Create Object Types.

◉ ZPMBOM (For BOM/MBOM)
◉ ZPECM( For Change Number with Default Date)
◉ ZECM (For Change Number with Actual Date)

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

2. Define Dependency between object types.

◉ BOM/MBOM should be created after Change Number with Default Date ic created. Hence ZPECM is the predecessor of ZPMBOM.

◉ Change No. with actual date should be created after BOM/MBOM is created so ZPMBOM is a predecessor of ZECM.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

3. Define Objects in Distribution

Note: Used standard objects only

Details of “Objects in Distribution” for Change Number-Default Date” i.e (ZPECM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

◉ Details of “Objects in Distribution” for BOM/MBOM” i.e (ZPMBOM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

◉ Details of “Objects in Distribution” for Change Number-Actual Date” i.e(ZECM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

4. Define Objects As an Import Object

Note: Used Standard only.

Details of “Object As an Import Object” for Change Number(ZPECM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

Details of “Object As an Import Object” for BOM/MBOM(ZPMBOM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

5. Define ALE Interface

◉ Interface Details for Change Number-Default Date(ZPECM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

◉ Interface Details for BOM/MBOM(ZPMBOM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

◉ Interface Details for Change Number-Actual Date(ZECM):

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

II. Define packet Types


T.Code : UPSC02

1. Define Packet Type

Ex: ZEBIP .

Also, check the “Correction in Source System” and “Correct in Target System” checkboxes.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

Note: Create a custom ALE Layer(Ex: Z_SAP_ALE) and choose the same here. How to create a custom ALE layer is explained in  below steps.

Change Number and BOM message Types are not part of the standard ALE layer. Hence choosing custom ALE Layer so we can map the Message Types to Object types(ZPECM, ZPMBOM) in the custom Class tagged to custom ALE Layer.

2. Define Object types managed.

Here map the Object types defined in UPSC01 to the Packet type(ZEBIP).

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

3. Define “Automatic Activity Control(Inbox)”

The ALE Packet should be auto-approved and auto-posted so enable below checkboxes.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

4. Define “Receipts To Sender”.

Here define the statuses that should be sent to the sender. In the below screenshot all the available statuses are chosen but generally “Errors”, “Posted”, “Partially Posted” statuses will be defined.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

III.Generation Object Type Serialization


T.code : UPSC01S

Execute this T.code bypassing the packet so that the Serialization of object types will be generated.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

IV. ALE Distribution Unit: Middleware


Note: This is not required if you are using standard Object types. In case of custom object types, to map the Object types to Message Types and for any other custom logic to be added in the ALE layer better create Custom ALE layer and add required code in respective methods of ALE Layer class.

T.Code: UPSC07

Define the Custom AlE layer Ex: Z_SAP_ALE.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

Copy Class linked to standard ALE layer into Custom class and assign it.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

In Custom Class in method MAP_OBJTYP_TO_MESTYP map the Message types to Object types.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

V. Define Logical System: In SALE T.code Define logical system.

VI. Create Port: In We21 Create Port

VII. Distribute Model View: Using BD64 do the following

◉ Define a logical view
◉ Map Inbound and Outbound Message Types
◉ Generate Partner Profile.

In We20 we can view the message types that are generated from the above step.

Following are the Inbound Message Types :

Message Type Process Code 
BOMMAT  BOM2
ECMMAS  ECM2
UPSMAS  UPSM 

Outbound Message Types:

Message Type Basic Type
UPSRCP UPSRCP01

BOMMAT and ECMMAS should be “Triggered by background Program‘ where as UPSMAS should be “Triggered Immediately“.

UPSMAS will generate the Packet.

VIII. If all the above steps are correctly followed then idocs will be serialized in ALE packets and automatically approved and posted.

NW ABAP Integration Technology (ALE), ABAP Connectivity, ABAP Development, SAP ABAP Exam Prep

IX. Processing of ALE Packet:

◉ Once ALE Packet is created in SAP, status will be “Received”. You can view the ALE packet in UPS03/UPS.

◉ As the “Auto Approval” checkbox is enabled in UPSC02 T.code, idoc No. will be assigned to each item, and Status of idoc will be “Approved”.

◉ Once the ALE packet is “Approved”, as the “Auto processing” checkbox is enabled in UPSC02 T.code, the RUPSPOST program will be automatically scheduled and items in the ALE packet will be processed.

◉ If all the items in ALE Packet are successfully processed, ALE packet status will be “Updated”.

◉ If there are any error status of the packet will be “Errors Found”. If there are any Master data-related issues, after fixing them, the ALE packet can be reprocessed manually using the program “RUPSPOST” bypassing ALE packet Name.

No comments:

Post a Comment