Setting up an Idoc "definition of content" is a rather thrilling task, where the difference between creating a brand new Basic Type or creating an Extension should be clear... R/3 has Idocs set up for every business relevant "Document" it can produce. Ergo: where R/3 documents are produced (e.g. a Purchase Order) the electronic version or Idoc version of this document can be produced as well. In effect: when Idoc traffic is set up from a customer system, the traffic is likely to be about a document produced in R/3. So now you have a choice: is the Idoc you want to define (inbound or outbound) based on an existing SAP document or not ?If it is, simply lean on the Basic Type and inbound (and outbound) function module(s) that come with them like:
- Material master data needs to be interfaced between 2 SAP systems, "they" are leading, so inbound for us, outbound for the sender
- Message type
MATMAS
is selected from transactionWE81
- Via transaction
WE82
the Basic Type is determined (pick the latest version:)MATMAS05
- A little research would e.g. lead to process code
BAPI
which uses function moduleIDOC_INPUT_MATMAS_BAPI
to transform the Idoc into an actual material
So where do Extensions come in ? Quite simple, where the data you want to interface goes beyond what is made available in R/3, the segments of the existing Basic type could be changed, ensuring that Idoc can no longer be used with other systems. Creating an Extension is the far more elegant way to accomplish additions to an Idoc. Extensions are based on a Basic type and allow adding a segment (or 20) in a predefined location on the Basic Type.