Information

Please visit our international page to see all the numbers matching your region.

What on Earth is an SAP IDoc?

What on Earth is an SAP IDoc?

Part of:

Language

English

Pages

213

Edition

1

Level

Beginner

ISBN

9783960123408

ISBN Print

9783960123996

E-Books

or access all content

Flat rate

$19 per month

  • Single license
  • 1000+ eBooks and video tutorials
  • Instant access
  • 12 months($228per year)
  • Automatic renewal

More Details

This book provides you with the essential knowledge you need to work with SAP IDoc interfaces successfully. Walk through the IDoc anatomy and different kinds of segments. Dive into inbound and outbound IDoc interfaces and learn how to create a port and logical system. Walk step by step through how to configure IDoc interfaces for various business scenarios including sending an invoice to an EDI partner, receiving a sales order from an EDI partner, and receiving material master data from an external system. Learn how to use output and change pointer techniques. Examine how to monitor and troubleshoot post-IDoc interface implementation activities and get a handle on archiving best practices. Navigate IDoc interface enhancement options including adding segments and user exits. By using detailed examples, tips, and screenshots, the author brings readers up to speed on the fundamentals of SAP IDocs.


  • Fundamentals of inbound and outbound IDoc interfaces and configuration
  • Learn how to implement interfaces with ALE and EDI
  • Troubleshoot common post-implementation challenges
  • Quick reference guide to common IDoc transaction codes and reports

Reading Example

2.1 Port definition—WE21

A communication port in an SAP system is quite similar to an actual sea port. Except instead of ships dropping off or picking up their cargo, it is information flowing in and out of an SAP system. And just like ships from many countries that arrive at the same sea port, one IDoc port can be used for multiple outbound and inbound interfaces.

Ports are maintained in transaction WE21. On the left-hand side (Figure 2.1) we can see a list of the port types.

IDoc

Figure 2.1: Port types

There is, of course, SAP documentation on the port definition but, in my opinion, it has too much information no one cares for yet lacks a clear and simple explanation of what all those port types are for. Although if SAP Help was perfect, then no one would need this book, so it is probably a good thing... Anyway, here is my “simplified” explanation of the available port types.

  • Transactional RFC—This port type is used when two systems, or clients of the same SAP system, exchange data directly by establishing a remote connection and calling a special remote-enabled function (I briefly mentioned RFC in Chapter 1). The remote connection needs to be defined beforehand in transaction SM59. Note that the connection does not have to be between two SAP systems, it could be between an SAP system and a third-party application.
  • File—This port creates a plain text file in the specified directory. The file will have the segment names at the beginning of each line followed by a stream of data (usually unreadable). This port type seems to be rarely used these days as more preference is given to RFC and XML types.
  • CPI-C—This port is used for R/2 systems, which is an old version of SAP ERP.
  • ABAP-PI—This port triggers a custom ABAP function. ABAP-PI is short for “ABAP Programming Interface” and has nothing to do with the SAP Process Integration solution (which has already been renamed twice and is now called SAP PRO). In the outbound interfaces, function module OWN_FUNCTION may be used as a template for the custom function. In the inbound interfaces, the custom function must call function module IDOC_INBOUND_ASYNCHRONOUS to create the IDoc.
  • XML file—This port creates an XML file in the specified directory. In the XML file, you will see the IDoc segments as nodes. This port type is used as an example in this book because it is easy to deal with and works well for illustration purposes.
  • XML HTTP—This port is sort of an XML / RFC hybrid. No file is created, but data is transmitted in XML format using an HTTP connection.

What about web services?

SAP does not provide a web service port for IDocs. One might argue that if a web service can be used, then why bother with IDocs at all? There is a great blog titled “IDoc as Web Service” on SCN by Amaresh Pani that describes a possible solution (without SAP PI/PO/PRO) and also mentions a valid business scenario in the comments.

For the File and XML port types, there are two choices for the directory where the file will be created: logical and physical. What is the difference and when or why use one or the other?

Physical directory

If we choose physical directory name then we need to enter the actual directory pathname on the application server. SAP application server directories can be viewed in transaction AL11. Note that some shared network directories can also be added there.

It is a good idea to check with the system administrator which directory should be used in the port definition.

Most of the examples in this book use a physical directory for simplicity, but in real life it is better to use a logical directory.

Logical directory

If we choose the logical directory option, then we need to use a logical file path. Logical file paths (i.e., directory and file names) are maintained in the transaction FILE. In a nutshell, these paths allow the use of a neutral identifier instead of specific physical location.

Why would anyone need that? In some cases, it is convenient because we can maintain path definition once and then use the logical path name in many ports (or other places—logical paths are used all over SAP). So if the actual (i.e. “physical”) directory changes then it is only necessary to make a change in only one place—logical path.

But, most importantly, logical names can be dynamic. For example, ‘/usr/DEV/temp’ is a static name, but ‘/usr//temp’ is dynamic. In the last case, is a variable that will be filled in with the system ID, so we can conveniently use the same logical path in DEV, QAS, and PRD systems and not worry about changing it.

Logical directories take some additional effort to set up, but they can be a life saver if the path names must be changed due to a server replacement, hosting provider switch, or any other technical reason.

Also, logical directories allow for some cool customization using a function module, see Section 6.4.

Beware of case sensitivity

Note that in some operating systems (OS), such as UNIX and Linux, file names are case sensitive. To find which OS is used in your SAP system, go to the menu System • Status from any screen and check the Operating System field.

Frequentlyasked questions

General questions and answers about our learning content.

Who is the learning content suitable for?

The learning content is designed for anyone who wants to gain SAP knowledge in a simple, compact, and practical way. Our learning platform offers content for beginners, advanced learners, and experts. This enables you to expand your knowledge step by step and continuously develop your skills toward becoming an SAP expert.

What makes the learning content special?

Our products—whether books, videos, or online training—deliver SAP knowledge concisely and practically, so you can apply it directly in your daily work, even if you have limited time. You benefit from a broad coverage of relevant SAP topics, high-quality content in four languages, and learning formats designed to fit your individual needs. This ensures that you can stay up to date and continuously develop your expertise.

What distinguishes our books from those of other providers?

Our books are characterized by a clear practical focus and a compact, easy-to-understand presentation. We explain complex SAP topics concisely—without unnecessary marketing buzzwords—so readers can quickly grasp the essentials and apply the new knowledge directly.

Can the product be exchanged?

Our print books can be returned within 14 days, in original condition. Return shipping is at your own cost.

How can I order a book outside of Germany?

We currently only ship books directly within Germany. If you are ordering from outside Germany, we recommend purchasing via Amazon. You can find the link by selecting “Buy eBook” on any product in our webshop and Amazon will then show you both the eBook and print versions available for purchase.

Alternatively, you can access all our content with a digital subscription, starting at $19 per month.

Who can I contact if I have questions?

Our team is always happy to help and will respond to your questions as quickly as possible (usually within 1–2 days). You can also contact us if you have questions for one of the authors. Email: contact@espresso-tutorials.com

Support-Team

  • For more help, visit our documentation or click on Chat.