0% found this document useful (0 votes)
2K views16 pages

Extending The Standard IDOC For Outbound Delivery

The document describes the steps to extend a standard SAP IDOC (VL02N) by adding a custom segment, creating an extension IDOC type, and configuring the necessary transactions and coding to populate the custom segment and trigger the extended IDOC from the VL02N transaction. Key steps include creating a custom segment, extending the IDOC type, assigning the extension to a message type and partner profile, coding a customer exit to populate the custom segment, and configuring the VL02N transaction to trigger the extended IDOC.

Uploaded by

Salih Sahin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views16 pages

Extending The Standard IDOC For Outbound Delivery

The document describes the steps to extend a standard SAP IDOC (VL02N) by adding a custom segment, creating an extension IDOC type, and configuring the necessary transactions and coding to populate the custom segment and trigger the extended IDOC from the VL02N transaction. Key steps include creating a custom segment, extending the IDOC type, assigning the extension to a message type and partner profile, coding a customer exit to populate the custom segment, and configuring the VL02N transaction to trigger the extended IDOC.

Uploaded by

Salih Sahin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Extending the standard IDOC for Outbound delivery (VL02N)

By Rajeev Sharma, Intelligroup

http://www.saptechnical.com/Tutorials/ALE/IDOCExtension/VL02N.htm

Scenario:

Step by step procedure for extending a standard IDOC, populating the custom segment and trigger the
extension IDOC from VL02N transaction.  

Extending an IDOC:  

This begins with creating a custom segment; custom segment creation is developed in transaction
WE31.  

Custom segments begin with ‘Z1’ (just a name standard), now go to T-code: WE31 and type your
custom segment name as Z1EDLPI and click on the create button as shown below.  

When the create button is clicked, the below shown screen will be displayed. Enter a short description
for the custom segment and add the required field name and the corresponding data element. Once
the required fields are added click on the save button.  

 
After clicking on save button, click on back button you will see the below shown screen. Now click on
the segment definition you have created and do “Set Release” from EDIT menu.  

Note: Without releasing your segment definition you cannot use the segment.  

With this, custom segment creation is completed.

Next step is to create an extension IDOC with the above created custom segment, Go to transaction
WE30.  

Enter a name ‘ZDELVRY03’ for the extension IDOC and check on the Extension check box and click
create button.  

The following popup screen will be displayed. Click on the ‘Create New’ radio button to create an
extension with the help of a Basic IDOC type. Enter the standard basic type name ‘DELVRY03’ in the
‘Linked Basic type’ field and enter a short description and click continue.  
The following screen will be displayed with all the standard segment of basic type ‘delvry03’.

Now we need to add our custom segment to the required segment, in our example we will take
segment E1EDL22. We will have to add the custom segment Z1EDLPI to segment ELEDL22.  

Select the segment E1EDL22 and click on the create button, an information message will pop up and
say ‘Extension segment type(s) will be in child segment type(s) of E1EDL22’. Click on continue.
Another pop up will be prompted for entering the custom segment name and attributes.

Enter the name of the segment Z1EDLPI, minimum and maximum occurs as shown below.  

Note: Attribute entries may vary depending on the requirement, the below shown attribute entries are
for our requirements only.
 

Newly added segment is seen as below.

Extending the standard IDOC for Outbound delivery (VL02N)


...Previous
Save the extension IDOC and click on the back button and go to Utilities -> Enhancement ->Assign
basic type.  

The below pop up will be prompted with the basic type name, which we have used to create our
extension type. In our case it is ‘delvry03’. Click on the continue button.

Now click on the Set Release menu item in EDIT menu to release the extension IDOC.

   

A pop up will be prompted as shown below, click on YES to release the Extension IDOC.
 

We have successfully created our extension IDOC ‘ZDELVRY03’.  

Next step is to create a logical message type. Go to transaction WE81.  

By default the screen will be in display mode, go to change mode to enter a new entry.

Give some name to the logical message type and a short description. Save the entry.    

Next step is to assign the created extension IDOC type with the above created logical message type.
This is carried out in transaction WE82.  

Here you will assign the message type with the extension IDOC type along with the basic type and
release version combination as shown below.
 

Save the entry.  

Next step is to create a partner profile and assign our message type to it. Also provide details like
output types, process code etc in message control tab. To create a partner profiles go to transaction
WE20.  

Note: The partner number in partner profile and ship to party number in delivery (VL02N) should be
same. In the below shown example we are using Delivery number ‘80016347’ and hence the ship to
party ‘1171’ will be our partner number. In WE20 transaction, expand the partner type ‘Partner type KU
Customer’ and find the partner number ‘1171’. If it doesn’t exist then click on the create button and
type the partner number ‘1171’ and save the entry.  

Now click on the Create Outbound Parameter button (A icon with green plus symbol).
Extending the standard IDOC for Outbound delivery (VL02N)
...Previous

The following screen will be displayed. Enter the partner role(optional), message type, receiver port,
basic type and extension type names respectively. Also select the ‘Transfer IDOC immed.’ Radio
button. And save the entries.  

Now click on the message control tab as shown below and click on the insert row icon (green plus
symbol) to enter the necessary details.  

Use the F4 help to select the appropriate application, in our case it is ‘V2’ (For Delivery). The next
entry is choosing the message type (note that this message type is different from the one which we
have created earlier, this message type is used to set the output types in VL02N transaction). In our
case the message type is ‘LD00’.  
NOTE: Appropriate message types are selected with the help of NACE transaction. In NACE
transaction, select the appropriate Application (V2) and click the output type PUSH button in the
application tool bar. List of output types will be displayed, see which output type is configured for your
required output medium (ALE, EDI, PTINTER, FAX etc.) you can use only those output types as
message types in partner profile.  

Next entry is to choose the process code.

For each applications (V1for sales order, V2 for delivery, V3 for invoice) there are set of process codes
maintained in transaction WE41 (For outbound process code). Go to WE41 transaction and select the
appropriate process code. In our case it is ‘DELV’.  

NOTE: The process codes are assigned to function modules which has the code to process (Populate
the IDOC segments, save the segment data in EDI specific database table etc) the IDOC segments at
runtime.

Once the necessary entries are made click on save button.  

This ends your partner profile creation.  

Time for a little coding, as stated earlier the process codes are associated with function modules to
process our extension IDOC. To see the function module double click on the process code ‘DELV’. It
will take to the following screen.  
Next step is to find the customer exit in the function module to populate the custom segment in the
extension IDOC. Check for the PERFORM that fill the Data records internal table and proceed to find
the relevant customer exit or directly you can search customer exit for Data record. Usually the
customer exits for Data records will be “customer-function ‘002’ ”.  

Note: FM: IDOC_OUTPUT_DELVRY has all the standard logic to populate the standard segments of
the extension IDOC ‘ZDELVRY03’. We use the customer exit to imply our logic on standard segments
and to populate custom segments. In our case we are using it for latter case.  
 

The below code has the logic for adding the custom segment ‘Z1EDLPI’ as child of
‘E1EDL22’ and what data needs to be populated in the fields of the custom segment. Save
and activate include ZXTRKU02.  

Note: The code written above will be executed only if this enhancement component’s
Project is activated in SMOD.  

With this all the necessary configurations on the EDI IDOC front is over. The next step will
be configuring the output types in VL02N to trigger the Extension IDOC. To do this, go to
Transaction VL02N.  
 

 
Select the ‘Send Immediately option’ and click on back button and save the Delivery.  

When the delivery is saved successfully we can see the IDOC number by selecting the
output type and clicking on processing log push button as shown below.  

Now to see whether the custom segment has been populated as desired and to know the
status of the IDOC, go to transaction WE02.  

You might also like