Professional Documents
Culture Documents
Enhancement of IDoc Type
Enhancement of IDoc Type
IDocs provided by SAP are not sufficient for the 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.
Outbound process
Step2: Write a module pool program to update some existing customers to add data for Visitor.
Transaction Code: WE31 Segment type: Z1KNA11 Click (create). Provide short text
Save
Transaction WE30
Object Name DEBMASEXT
Step6: Assign Basic type to extension / messages Transaction: WE82 ,Click , then
Select DEBMAS message type against DEBMAS06 basic type ,Click provide the information
Delete the earlier one from which it was copied. Save. Observe the result as follows
Ensure that there are no errors or warnings Now transport Path: Development -> Transport
Step8: Find suitable user exit for writing code to support IDoc extension
Transaction: SE84. Click Enhancements In short text provide *customer* Find suitable enhancement
to be VSV00001
Alternative way
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
helpful for inbound ALE process. This user exit can be used to read the segments
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 13. Execute the transaction to ‘Send Customers’ from Outbound system.
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
*&---------------------------------------------------------------------*
*& Include 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
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