Skip to content

Commit 8252733

Browse files
authored
Merge pull request #2 from sap-tutorials/master
Fetching changes
2 parents 03428d5 + 9b7f0e1 commit 8252733

320 files changed

Lines changed: 2611 additions & 1486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
107 KB
Loading
190 KB
Loading
93.2 KB
Loading
66.6 KB
Loading
67.8 KB
Loading
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
parser: v2
3+
auto_validation: true
4+
time: 30
5+
tags: [ tutorial>beginner, software-product>sap-s-4hana, tutorial>license]
6+
primary_tag: software-product>sap-application-interface-framework
7+
---
8+
9+
# Determine Recipients by Key Fields
10+
<!-- description --> Define recipients based on key field values to be able to dispatch messages in the message monitor of SAP Application Interface Framework to different users or processing teams.
11+
12+
## Prerequisites
13+
- You've set up SAP Application Interface Framework
14+
- SAP S/4HANA 1709 or later, AIF 4.0
15+
- You've completed the tutorial [Create a Simple IDoc Interface](aif-idoc-monitoring-interface-create)
16+
17+
## You will learn
18+
- How to define a single key field
19+
- How to create recipients
20+
- How to create and maintain a recipient assignment table
21+
22+
## Intro
23+
You use recipients to control which interfaces and messages can be accessed within the message monitor of SAP Application Interface Framework. To assign recipients to users, you can apply the following approaches: either by interface, by key field values, by error categories or via a combination of latter two approaches.
24+
25+
In this tutorial, you will learn how to set up recipients based on key field values. In our example, messages are dispatched to different users depending on a particular country code.
26+
27+
> As a prerequisite, you should have gone through the [Create a Simple IDoc Interface](aif-idoc-monitoring-interface-create) tutorial where you simply assigned a recipient to the IDoc interface. You will replace the recipient assignment by interface with a recipient assignment based on key field values.
28+
29+
> This tutorial focuses on customizing an IDoc interface. All the settings are also supported for any other technology that SAP Application Interface Framework supports, such as Proxies or Web Services.
30+
31+
32+
---
33+
34+
35+
### Maintain interface-specific single index table
36+
37+
To be able to determine recipients based on business data, you need to enhance the interface-specific index table.
38+
39+
> As a prerequisite, you should have gone through the [Create a Simple IDoc Interface](aif-idoc-monitoring-interface-create) tutorial and hence should have already defined an interface-specific single index table with name `ZIDOC_MON_IDX`. Otherwise, run through **step 7** of the tutorial to create the index table.
40+
41+
1. Run transaction code `SE11`, enter the table name `ZIDOC_MON_IDX` and choose **Change**.
42+
43+
2. Add the following new entry:
44+
45+
| Field | Data element
46+
| :-----------------------| :-------------------------------------------
47+
| **`COUNTRY`** | **`S_COUNTRY`**
48+
49+
3. **Save** and **activate** your changes.
50+
51+
<!-- border -->![Enhance index table](index-table-country-add.png)
52+
53+
54+
### Define single key field
55+
56+
You need to define the key field for your interface.
57+
58+
1. In the **Customizing** for SAP Application Interface Framework (transaction code `/AIF/CUST`), navigate to **Error Handling** > **Define Interface-Specific Features**.
59+
60+
2. In the upcoming dialog, enter namespace `DEMO_1`, interface `FCUSTOMER`, and version `1`, then press **Enter**.
61+
62+
3. Double-click **Define Key Fields for Multi. Search** in the menu on the left. Add a new entry with **Field Sequence No.** `10` and add the following values:
63+
64+
| Field name | Value
65+
| :----------------------------------------| :-------------------------------------------
66+
| Key Field Name | **`COUNTRY`**
67+
| Data element | **`S_COUNTRY`**
68+
| Field Name | **`E1SCU_CRE-E1BPSCUNEW-COUNTR`**
69+
| Raw or SAP Structure | **`Source structure`**
70+
| Multi.Selection Type | **`Single selection`**
71+
| Hide Tree Node in the View 1 Tree | **selected**
72+
| Field Name in Alert Recipient Assignment | **`COUNTRY`**
73+
| Relevant for Recipient Determination | **selected**
74+
75+
4. **Save** your changes.
76+
77+
<!-- border -->![Add key field country](aif-cust-key-field-define.png)
78+
79+
80+
### Create recipient assignment table
81+
82+
You need to create a recipient assignment table by copying the template table `/AIF/T_ALRT_DEF`.
83+
84+
1. Run transaction code `SE11`, enter **`/AIF/T_ALRT_DEF`** in the field **Database table**, right-click it and select **Copy...**.
85+
86+
2. Enter the name **`ZFCUST_RECIPIENT`** for the new table and select **Continue**. When prompted, enter the package name you created in the previous tutorial.
87+
88+
3. Once created, choose **Change**.
89+
90+
4. Add the following new entry:
91+
92+
| Field | Data element
93+
| :-----------------------| :-------------------------------------------
94+
| **`COUNTRY`** | **`S_COUNTRY`**
95+
96+
5. **Save** and **Activate** your changes.
97+
98+
<!-- border -->![Create Recipient Assignment Table](recipient-table-create.png)
99+
100+
101+
### Define recipients
102+
103+
You need to create different recipients for different key field values.
104+
105+
1. Go to **Customizing** (transaction `/AIF/CUST`) and navigate to **SAP Application Interface Framework** > **Error Handling** > **Define Namespace-Specific Features**. Enter or select your namespace **`DEMO_1`** and select **Continue**.
106+
107+
2. In the menu on the left, navigate to **Define Recipients** by double-clicking it. You should see a recipient that you have defined in the previous tutorial. You need to create three more recipients: two for the key field based recipient determination and one as default. Select **New Entries**, and enter the following details:
108+
109+
| Recipient for Alert | Alert Recipient Description
110+
| :------------------------------| :-----------------------------------------------
111+
| **`ZFCUST_RECIPIENT_DE`** | **`Key field based recipient for country DE`**
112+
| **`ZFCUST_RECIPIENT_US`** | **`Key field based recipient for country US`**
113+
| **`ZFCUST_RECIPIENT_DEFAULT`** | **`Default recipient`**
114+
115+
3. **Save** your changes.
116+
117+
<!-- border -->![Define Recipients](aif-cust-recipients-define.png)
118+
119+
120+
### Assign recipient assignment table to your interface
121+
122+
You need to assign the beforehand created recipient assignment table as well as the default recipient to your interface.
123+
124+
> You maintain a default recipient to make sure that no message slips through without anybody being notified. If the system cannot find any other recipient that receives a notification, a notification is always sent to the default recipient regardless of the alert settings.
125+
126+
1. While in **Customizing** (transaction `/AIF/CUST`), navigate to **SAP Application Interface Framework** > **Error Handling** > **Define Namespace-Specific Features**. Enter your namespace **`DEMO_1`** and select **Continue**.
127+
128+
2. Double-click the node **Configure Alerts**, and select **New Entries** to create a new entry. Enter your interface name **`FCUSTOMER`** and version **`1`**, and maintain the parameters as follows:
129+
130+
| Field | Value
131+
| :-----------------| :--------------------------
132+
| Rec Assgn Table | **`ZFCUST_RECIPIENT`**
133+
| Namespace | **`DEMO_1`**
134+
| Default Recipient | **`ZFCUST_RECIPIENT_DEFAULT`**
135+
136+
3. **Save** your changes.
137+
138+
<!-- border -->![Configure Alerts](aif-cust-alerts-config.png)
139+
140+
141+
### Maintain recipient assignment table
142+
143+
You need to maintain the recipient assignment table to map key field values to your recipients.
144+
145+
> As a prerequisite to add entries to the recipient assignment table, the **Data Browser/Table View Editing** table setting should be set to **`Display/Maintenance Allowed`**. Since we copied the recipient assignment table from a template table, this should automatically apply. Otherwise, ensure to change the setting accordingly.
146+
147+
1. Run transaction code `SE16`, enter **`ZFCUST_RECIPIENT`** in the field **Table Name**, and select **Create Entries**.
148+
149+
2. Add the following entries to the table:
150+
151+
| NS | IFNAME | IFVERSION | NSRECIP | RECIPIENT | COUNTRY
152+
| :------------| :---------------| :---------| :------------| :-------------------------| :--------
153+
| **`DEMO_1`** | **`FCUSTOMER`** | **`1`** | **`DEMO_1`** | **`ZFCUST_RECIPIENT_DE`** | **`DE`**
154+
| **`DEMO_1`** | **`FCUSTOMER`** | **`1`** | **`DEMO_1`** | **`ZFCUST_RECIPIENT_US`** | **`US`**
155+
156+
3. **Save** your changes.
157+
158+
<!-- border -->![Maintain assignment table](recipient-table-maintain.png)
159+
160+
161+
### Assign users to recipients
162+
163+
Now the users in charge of monitoring the IDoc must be assigned to the recipients. We assume that you have already created two different users, one will be responsible for the messages related to country **`DE`** and the other for country **`US`**.
164+
165+
1. Go to **Customizing** (transaction `/AIF/CUST`) and navigate to **SAP Application Interface Framework** > **System Configuration** > **Recipients** > **Assign Recipients**. Enter or select your namespace **`DEMO_1`** and the beforehand created recipient **`ZFCUST_RECIPIENT_DE`**, then select **Apply**.
166+
167+
2. Select **New Entries** to create a new entry in **Assign Users**. Enter your user responsible for **`DE`** and check the boxes for **Include on Overview** and **Tech. User**.
168+
169+
3. **Save** the new entry.
170+
171+
<!-- border -->![Assign users to recipient ](aif-cust-user-assign-de.png)
172+
173+
4. Navigate back, and run through the same steps for the recipient **`ZFCUST_RECIPIENT_US`**.
174+
175+
<!-- border -->![Assign users to recipient ](aif-cust-user-assign-us.png)
176+
177+
178+
179+
### Send sample requests
180+
181+
Let's create a couple of sample messages to showcase the customizing changes.
182+
183+
Open the **Test Tool for IDoc Processing** (transaction code `WE19`). Send in two new test messages with different countries, choose either **`DE`** or **`US`**. Maintain customer names, regions, and cities. Enter an existing customer type, either `P` or `B`, to ensure that the message won't fail. Optionally, enter any other customer type to force a message processing error.
184+
185+
<!-- border -->![Sample Data](idoc-test-de.png)
186+
187+
188+
### Monitor your interface
189+
190+
Now, let's check the results of your tests in the Monitoring and Error Handling.
191+
192+
1. Log on with one of the users, e.g., the one responsible for **`DE`**.
193+
194+
2. Open the **Interface Monitor** (transaction code `/AIF/IFMON`). You should see one new message.
195+
196+
<!-- border -->![Display summary in interface monitor](interface-monitor-overview-de.png)
197+
198+
3. When you select the summary line for your interface, you’re forwarded to **Monitoring and Error Handling** where you can see your selected test message for country **`DE`**. You should not see the messages for any other country.
199+
200+
<!-- border -->![Display message](interface-monitor-details-de.png)
201+
202+
4. Alternatively, if you’ve set up Message Monitoring for Administrators in the SAP Fiori launchpad, you can check the test results there. Here, you see all messages grouped by recipient. See [Message Monitoring for Administrators](https://help.sap.com/docs/ABAP_PLATFORM_NEW/4db1676c3f114f119b500bd80ccd944d/2bfccaebd70f4efe905d4f0ec42da2c3.html).
203+
204+
<!-- border -->![Display messages in Message Monitoring for Administrators](message-monitor-admin.png)
205+
206+
Congratulations! You've successfully defined key field based recipients.
207+
208+
### Test yourself
209+
210+
211+
212+
213+
214+
---
94.3 KB
Loading
87.1 KB
Loading
118 KB
Loading
163 KB
Loading

0 commit comments

Comments
 (0)