Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
business process. IDoc extension can take place whenever dictionary table has a new structure
appended required by the business process.
In brief IDoc extension takes place when extra fields are required for the business process.
In this scenario say visitor is different from the actual customer who has came to the sales office in
behalf of the customer to obtain the quotation or inquiry etc. Or an authorized agent qualified by
the actual customer to order for items. So a field by name NAMEVI (Visitor) is added to Customer
master data. As there is no provision given by SAP to handle this, we need to extend an IDoc.
The standard message type and IDoc type provided by SAP are DEBMAS and DEBMAS05.
Consider the data in the table below for extending the IDoc. These details can be understood in
different sections in the process of extending it.
Version 4.7
Outbound process
VISITOR NAMEVI
Step2: Write a module pool program to update some existing customers to add data for Visitor.
VISITOR NAMEVI
Save
Transaction WE30
Choose Extension
Observe all the segments to be copied into your IDoc extension from linked basic
type.
Select E1KNA11 and click (create segment) to obtain a popup window
Provide the required values and observe child segment Z1KNA11 to be added to
Transaction: WE31
Transaction: WE82
Click , then
Save.
Transaction: WE30
Now transport
Step8: Find suitable user exit for writing code to support IDoc extension
Transaction: SE84.
Click Enhancements
Alternative way
Transaction: SMOD
Path: F4help -> SAP Applications -> Logistics general -> Logistics Basic Data ->
Now search for different extensions like VSV00001. Then see for its components.
Additional Customer Master Segments). This user exit can be used in outbound ALE
Transaction: CMOD.
From the initial screen of the transaction, select components and click change.
Activate them.
Select user exit EXIT_SAPLVV01_001 for outbound process and double click it. It leads to
function builder.
Now, write supporting code for IDoc extension, i.e., populating custom segments in IDoc.
Code in ZXVSVU01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*extended
*&---------------------------------------------------------------------*
*Data declarations
* since customer number is not passed in this user exit, you need to go
loop at idoc_data.
case idoc_data-segnam.
when 'E1KNA1M'.
when 'E1KNA11'.
select single *
into w_kna1
if sy-subrc eq 0.
idoc_cimtype = 'DEBMASEX'.
clear z1kna11.
condense: z1kna11-visitor.
* populate segment name in the data record, copy data contents into it
append idoc_data.
Step 10:
INBOUND PROCESS
Step 11: Append the custom structure to the table KNA1 similar to the process done
in outbound process.
Step 12.
Step 14. Now in the Inbound system, create the project in the similar way as done at
outbound side.
In the user exit EXIT_SAPLVV02_001, find include ZXVSVU02. Write the code to
Code in ZXVSVU02
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
LOOP AT IDOC_data.
case idoc_data-segnam.
when 'E1KNA1M'.
kna1m = idoc_data-sdata.
when 'E1KNA11'.
kna11 = idoc_data-sdata.
when 'Z1KNA11'.
z1kna11 = idoc_data-sdata.
select single *
from kna1
into fs_kna1
where kunnr = kna1m-kunnr.
if sy-subrc eq 0.
update kna1
else.
idoc_status-docnum = idoc_control-docnum.
idoc_status-status = '51'.
idoc_status-msgty = 'E'.
idoc_status-msgid = 'ZE'.
idoc_status-msgno = '005'.
idoc_status-msgv1 = kna1m-kunnr.
append idoc_status.
Transaction: WE57