|
| 1 | +--- |
| 2 | +title: Create a Simple IDoc Interface |
| 3 | +description: Create a simple IDoc interface to enable monitoring IDocs with SAP Application Interface Framework. |
| 4 | +auto_validation: true |
| 5 | +time: 20 |
| 6 | +tags: [ tutorial>beginner, products>sap-s-4hana, tutorial>license] |
| 7 | +primary_tag: products>sap-application-interface-framework |
| 8 | +--- |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + - You have set up SAP Application Interface Framework |
| 12 | + - You have working IDoc communication in place |
| 13 | + - SAP S/4HANA 1709 or later, AIF 4.0 |
| 14 | + |
| 15 | +## Details |
| 16 | +### You will learn |
| 17 | + - How to create a simple IDoc interface |
| 18 | + - How to use the IDoc Structure Generator |
| 19 | + - How to set up IDoc monitoring in SAP Application Interface Framework |
| 20 | + |
| 21 | +In this tutorial, you'll learn how to create a simple IDoc interface that enables you to set up IDoc monitoring. In this process, you'll use the IDoc Structure Generator to create interfaces to display and process IDocs. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +[ACCORDION-BEGIN [Step 1: ](Create namespace)] |
| 26 | +The **IDoc Structure Generator** is a report that generates most of the required customizing settings for SAP Application Interface Framework. To be able to use it correctly, you require a namespace. |
| 27 | + |
| 28 | +Open your system. Go to **Customizing** for SAP Application Interface Framework (transaction `/n/AIF/CUST`) and navigate to **Interface Development** > **Define Namespace**. |
| 29 | + |
| 30 | +Select **New Entries** and enter the following name and description for your new namespace: |
| 31 | + |
| 32 | +| NS | Namespace description |
| 33 | +| :----------- | :-------------------- |
| 34 | +| **`DEMO_1`** | **`For AIF IDoc tutorials`** |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +Press **Enter** to confirm your entry. |
| 39 | + |
| 40 | +[DONE] |
| 41 | +[ACCORDION-END] |
| 42 | + |
| 43 | +[ACCORDION-BEGIN [Step 2: ](Create package)] |
| 44 | +For the next steps, you need to create a package that serves as the destination for your newly created objects. |
| 45 | + |
| 46 | +Go to the **Object Navigator** (transaction `SE80`). From the drop-down menu, select **Package**, enter the name **`ZDEMO`**, and press **Enter** or select **Display or Create Object**. Confirm the dialogue window, enter a meaningful short description for your new package, and select **Confirm**. If prompted, enter a workbench request and confirm again. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +You have successfully created a new package named `ZDEMO`. |
| 51 | + |
| 52 | +[DONE] |
| 53 | +[ACCORDION-END] |
| 54 | + |
| 55 | +[ACCORDION-BEGIN [Step 3: ](Generate DDIC structure and interface)] |
| 56 | +Internally, SAP Application Interface Framework works with DDIC structures, but IDoc Basic Types are not available as DDIC structures. However, the IDoc Structure Generator can create the required DDIC structure for a specific basic type and extension combination. |
| 57 | + |
| 58 | +Open the **IDoc Structure Generator** (transaction `/n/AIF/IDOC_GEN`) and enter the following general information about the IDoc you want to monitor: |
| 59 | + |
| 60 | +| Field name | Description | Value |
| 61 | +| :---------------------------- | :-------------------------------------------------------- | :------- |
| 62 | +| Basic Type | The basic type of the IDoc you want to monitor | **`FLCUSTOMER_CREATEFROMDATA01`** |
| 63 | +| Message Type | The message type used in the IDoc you want to monitor | **`FLCUSTOMER_CREATEFROMDATA`** |
| 64 | +| Extension | The extension name if used in the IDoc | leave empty |
| 65 | +| Root Structure Name | The name of the structure you want to create | **`ZDEMO_1_FLCUSTOMER_CREATEFROMD`** |
| 66 | +| Destination for Remote Search | The standard name of an RFC destination | leave empty |
| 67 | +| Create or Update Structure | Indicates if a DDIC structure should be created or updated | check the box |
| 68 | +| Create Interface | Indicates if an interface should be created | check the box |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +Once you check the boxes for **Create or Update Structure** and **Create Interface**, two additional sections are displayed: Structure Details and Interface Definition. |
| 73 | + |
| 74 | +In section **Structure Details**, leave the boxes unchecked and enter the following details: |
| 75 | + |
| 76 | +| Field name | Description | Value |
| 77 | +| :--------- | :------------ | :----------- |
| 78 | +| Structure Prefix | All DDIC objects created by the generator will start with this prefix to ensure correct naming | **`ZDEMO_1_`** |
| 79 | +| Package | The destination package for the new DDIC objects; if the field is left empty, the objects will be created as local objects | **`ZDEMO`** |
| 80 | +| Workbench Request | Enter a workbench request if the structure should be transported | your workbench request |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +In section **Interface Definition**, enter the following details: |
| 85 | + |
| 86 | +| Field name | Description | Value |
| 87 | +| :--------- | :---------- | :------------- |
| 88 | +| Namespace | An existing namespace in which the interface should be created | **`DEMO_1`** (the namespace created in step 1) |
| 89 | +| Interface Name | The name of the to be created interface, for example (an abbreviation of) the basic type | **`FCUSTOMER`** |
| 90 | +| Interface Version | The version number of the interface | **`1`** |
| 91 | +| Interface Description | The short description of the interface | your short description |
| 92 | +| IDoc Processing Scenario | There are several possibilities to monitor and process an IDoc with SAP Application Interface Framework; depending on the scenario the interface is generated with different settings | **`ALE runtime; AIF enabler writing application log`** |
| 93 | +| Customizing Request | Enter a customizing request if the interface should be transported | your customizing request |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +When you've entered all the details, press **F8** or select **Execute**. The IDoc Structure Generator will start to create the required DDIC objects and the interface. Once the report is finished, a summary of what was created is displayed. Select **Continue**. |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +[DONE] |
| 102 | +[ACCORDION-END] |
| 103 | + |
| 104 | +[ACCORDION-BEGIN [Step 4: ](Create interface-specific single index table)] |
| 105 | + |
| 106 | +It's recommended to implement an interface-specific single index table to ensure full flexibility, especially if you expect a high load of messages or if you plan to define key fields for your interface (now or later). |
| 107 | + |
| 108 | +> You can also switch the single index table later, but when you do, all processed messages stored in the old single index table will no longer be visible in the Interface Monitor. The information for the newly incoming messages is stored in the new single index table of the interface. |
| 109 | +
|
| 110 | +Create a table via transaction `SE11`. You can use table `/AIF/STD_IDX_TBL` as a template by entering **`/AIF/STD_IDX_TBL`** in the field **Database table**, right-clicking it and selecting **Copy...**. Enter the name **`ZIDOC_MON_IDX`** for the new table and select **Continue**. When prompted, enter the package name you created earlier. |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | +After creating the single index table, activate it by selecting **Display** and then **Activate**. |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +Go to **Customizing** (transaction `/n/AIF/CUST`) and navigate to **SAP Application Interface Framework** > **Error Handling** > **Define Namespace-Specific Features**. Enter your namespace **`DEMO_1`** and select **Continue**. |
| 119 | + |
| 120 | +Select **New Entries** to create a new entry in **Define Interface-Specific Features**. Enter your interface name **`FCUSTOMER`** and version **`1`** and enter the name of the newly created single index table **`ZIDOC_MON_IDX`** in the field **Message Index Table**. |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +**Save** your changes. |
| 125 | + |
| 126 | +[DONE] |
| 127 | +[ACCORDION-END] |
| 128 | + |
| 129 | +[ACCORDION-BEGIN [Step 5: ](Create recipient for interface)] |
| 130 | +If you want to monitor the newly created interface in the Interface Monitor of the Message Dashboard app, a recipient for the interface is required. |
| 131 | + |
| 132 | +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**. |
| 133 | + |
| 134 | +In the menu on the left, navigate to **Define Recipients** by double-clicking it. Select **New Entries**, enter a meaningful name for your new recipient and add a description. |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +**Save** your changes. |
| 139 | + |
| 140 | +[DONE] |
| 141 | +[ACCORDION-END] |
| 142 | + |
| 143 | +[ACCORDION-BEGIN [Step 6: ](Assign recipient to interface)] |
| 144 | + |
| 145 | +To be able to see any data in the Interface Monitor or the Message Dashboard, a recipient must be assigned to the interface you want to monitor. |
| 146 | + |
| 147 | +Go to **Customizing** (transaction `/AIF/CUST`) and navigate to **SAP Application Interface Framework** > **Error Handling** > **Define Interface-Specific Features**. Enter or select your namespace **`DEMO_1`**, as well as your interface name **`FCUSTOMER`** and interface version **`1`**. Select **Continue**. |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | +In the menu on the left, double-click **Assign Recipients Without Key Fields** and create a new entry. Enter or select the namespace and the recipient you created before. |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | +**Save** your changes. |
| 156 | + |
| 157 | +[DONE] |
| 158 | +[ACCORDION-END] |
| 159 | + |
| 160 | +[ACCORDION-BEGIN [Step 7: ](Assign users to recipient)] |
| 161 | + |
| 162 | +Now the users in charge of monitoring the IDoc must be assigned to the recipient. |
| 163 | + |
| 164 | +Go to transaction `/n/AIF/RECIPIENTS` and select or enter your user name and any additional user names you want to assign to the recipient. |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | +Create a new entry and select the namespace and recipient you created in the steps before. Enter a user number and check the boxes for **Include on Overview Screen** and **Technical User**. |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | +**Save** the new entry. |
| 173 | + |
| 174 | +[DONE] |
| 175 | +[ACCORDION-END] |
| 176 | + |
| 177 | +[ACCORDION-BEGIN [Step 8: ](Test IDoc interface)] |
| 178 | + |
| 179 | +After the setup is complete, you should test your settings and verify that the IDoc monitoring is working as planned. |
| 180 | + |
| 181 | +Send in new test IDocs, for example using the **Test Tool for IDoc Processing** (transaction `WE19`). |
| 182 | + |
| 183 | +If you're using SAP GUI, check the results of your test in the **Interface Monitor** (transaction `/n/AIF/IFMON`). You'll only be able to see the new interface if you correctly assigned your user to the recipient. |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | +When you select the summary line for your recipient, you're forwarded to **Monitoring and Error Handling**, where you can see your selected test message(s). |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | +Alternatively, if you're using SAP Application Interface Framework with SAP Web Dynpro, you can check the test results on the **Message Dashboard** (transaction `/n/AIFX/ERR_WEB`). |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +Here, too, selecting the summary line for your recipient forwards you to **Monitoring and Error Handling**, where you can see your selected test message(s). |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | +Congratulations! You've created and tested a simple IDoc interface for monitoring in SAP Application Interface Framework. |
| 200 | + |
| 201 | +[DONE] |
| 202 | +[ACCORDION-END] |
| 203 | + |
| 204 | +[ACCORDION-BEGIN [Step 9: ](Test Yourself )] |
| 205 | + |
| 206 | +[VALIDATE_1] |
| 207 | +[ACCORDION-END] |
| 208 | +--- |
0 commit comments