How to add a created Z function module to the existing list in WE21


Hi all,
There is some existing function modules ( like EDI_PATH_CREATE_CLIENT_DOCNUM ) in WE21 in the function module field.
here, i need to create one Z function module as per user requirement & want to add to that list.  is it possible???
actually, i want the file name format is like
   " Document Number_YYYYMMDDHHMMSS.xml  ". but existing function modules are not giving this anybody give any idea.
correct answers will be rewarded.
Thanks & Regards


HI Pabitra,
   Yes, can always change the existing fm and add it with message type as follows pls note step 7 and step 8. (for inbound it is we42 and for outbound it is we41 )
Basic IDOCs have supplied by SAP with standard structure. (Segments). You can extend them with your own segments.
IDOCs does have unique number. They contain control, data, and status records.
Useful Transaction Codes:
WEDI : IDoc Menu
WE02 : IDoc List (can enter IDoc number to select on)
WE05 : IDoc List
WE19 : Transaction WE19 can be used to test the IDoc
WE30 : IDoc Type Development: Initial Screen
WE31: Development Segments: Initial Screen
WE60 : Documentation for IDoc Types. This allows you to view the IDoc you have created.
WE81 : Display View ‘EDI: Logical Message Types’: Overview
WE82: Display View ‘Message Types and Assignment to IDoc Types’: Overview
WE21 - Creation of POrt
WE20 - Partner Profile creation
SALE - ALE (Application Linking and Enabling) settings
For Outbound ALE Configurations: (Example)
IDoc definitions and necessary ALE configurations settings for the outbound .
Create Idoc segments – Transaction WE31.
Create Idoc type – Transaction WE30.
Create Message Type – Transaction WE81.
Assign Message Type to Idoc type – Transaction WE82.
Create a distribution Model - Transaction BD64
An IDoc is simply a data container that is used to exchange information between any two processes that can understand the syntax and semantics of the data...
1.IDOCs are stored in the database. In the SAP system, IDOCs are stored in database tables.
2.IDOCs are independent of the sending and receiving systems.
3.IDOCs are independent of the direction of data exchange.
The two available process for IDOCs are
Outbound Process
Inbound Process
AND There are basically two types of IDOCs.
Basic IDOCs
Basic IDOC type defines the structure and format of the business document that is to be exchanged between two systems.
Extended IDOCs
Extending the functionality by adding more segments to existing Basic IDOCs.
for creating a IDOC
see the below steps for outbound processing IDOCS..
2.1 Outbound Interface
Outbound Interface
1. Analyse Hierarchy Levels
2. Create New segment
3. Create New IDoc Type
4. Create New Message Type
5. Link Message with IDoc Type
6. Create an entry in EDP13 via transactions WE20 and BD64
7. Populate the Custom IDoc via ABAP Program
7b Error Handling
7c. Send Status Email
8. Test the Population of the Custom IDoc
Step 1 – Analyse Hierarchy Levels:
Analyse the data relationships being processed in the interface. Define the appropriate hierarchical Parent-to-Child relationships.
Navigate to transaction code WEDI
Transaction WEDI displays the IDOC main menu. This allows navigation around the various development and control areas to create a customised IDOC.
Step 2 – Create a new segment:
via wedi : Development - IDOC Segments or Transaction code WE31.
• Enter segment name and click on Create.
The? name of the segment type must start with Z1 , and have a maximum of eight characters.
• Enter description and enter the relevant field names and data elements.
The segment should represent a structure in the program so for? each field in the segment a field name and a data element must be defined.
• Save the segment and enter Person Responsible and Processing Person .
• Go to Edit and Set Release.
• Repeat this procedure for each new Segment in the IDOC.
Step 3 – Create a new IDOC Type
via wedi Development - IDOC Types or Transaction WE30.
• Enter segment name (starting with Z), click on Basic Type and then Create.
• Create as new, enter Person Responsible and Processing Person and enter description.
• On ‘Create Basic Type’ screen decide where segments should be inserted and go to Edit/Create Segment.
• Complete relevant fields in the Maintain Attributes screen:
• From the relevant segments created in Step 2 enter the Segment type and if mandatory segment.
• The Minimum and Maximum number of segments to be allowed in the sequence. (One minimum and one maximum if segment is mandatory).
• The Parent Segment and Hierarchy Level will be automatically created depending on where in the IDOC tree you decided to create that particular segment.
• Repeat this process for each segment needed in the IDOC type, deciding whether to add the next segments at the same level or as a ‘Child’.
• When IDOC created return to initial screen. Go to Edit and Set Release.
• Go to Transaction WE60 to view the IDoc Type you have created.
Step 4 – Create new Message Type
via wedi Development - Message Types or Transaction WE81.
• Display/Change and click on New Entries
• Create a new Message Type and Save.
Step 5 – Link Message Type to IDOC Type
via wedi Development - IDOC Type/Message or Transaction WE82.
• Display/Change and then click on New Entries.
• Enter Message Type, Basic Type (IDOC Type) and Release (46C) and Save.
Step 6 – Create an entry in EDP13 via transactions WE20 and BD64.
The partner profile for the Idoc must be set up and generated in the transaction BD64 and transaction WE20.
• WE20 – Add Message Type to appropriate Partner Type, Enter Message Type, Receiver Port and Idoc Type and Save.
• BD64 – Create a Model View, Enter Sender and Receiver Ports, Attach Message Type. Go to ‘Environment’ on Menu and click on Generate Partner Profiles and generate (not save) profile.
Step 7 – Populate the custom IDOC via ABAP Program
See Test Program ZOUTBD_IDOC_TEMPLATE, Appendix IV.
• Create an Internal Table for each segment type, this should be exactly the same structure as the segment type.
• The control record is filled into a structure like EDIDC. The message type and the Idoc type for the Idoc must be populated into the eddic structure.
- PERFORM populate_Control_structure USING c_mestyp
• The data segments are filled into a structure like edidd-sdata; sdata and the segment name are populated into the edidd structure.
- PERFORM transfer_Parent_data_to_seg.
• The standard SAP function module MASTER_IDOC_DISTRIBUTE is called to pass the populated IDOC to the ALE Layer.
- PERFORM master_idoc_distribute.
• NOTE: This function module is only called for stand alone programs and Shared Master Data programs (SMD). It is not called when using extensions or output determination.
• The ALE Layer handles the sending of the IDOC to the receiving system.
• Error Handling (see Step 7b).
• Commit work.
Project SpecificStep 7b – Error Handling
• Analyse which fields in the interface are mandatory for the receiving system and who needs to receive error notification.
• Declare a structure of type ‘MCMAILOBJ’ for sending instructions.
• Enter values for the internal table based on structure ‘MCMAILOBJ’
• For selection processes, on SY-SUBRC checks and where fields are mandatory for the receiving system; insert Function Module ‘MC_SEND_MAIL’.
• Enter values in the following parameters: -
MS_MAIL_SENDMODE = ‘B’ (Batch Mode)
MS_MAIL_TITLE = 'Mail Title'
MS_MAIL_DESCRIPTION = ‘Error description’ (e.g. MATNR not given)
MS_MAIL_RECEIVER = ‘Name of Receiver’ (To be determined)
MS_MAIL_EXPRESS = ‘E’ (Express Delivery)
MS_MAIL_LANGU = 'E' (Language)
It has to be determined separately for each interface how these errors and mail notifications are to be grouped – dependant upon the number of errors that are potentially likely. One possible approach is to send an email for each reason for rejection and include all the records that failed for that reason in the mail notification. Another possible approach is to send an email for every failure.
When error checking for mandatory fields it is common SAP practice to reject a record on its first failure (irrespective of subsequent errors in that record)
<b>Step 7
(Transaction WE57)
Assign the custom function module to the IDoc type and the message type.
Set function module to type ‘F’ and direction ‘2’ for inbound.
Step 8
(Transaction WE42)
Create a new process code and assign it to the function module. The process code determines how the incoming IDoc is to be processed in SAP.</b>
Step 9
(Transaction BD67)
Assign the function module to the process code created above. Got to ‘New Entries’ and enter the process code and the function module name.
Step 10
(Transaction WE20 and Transaction BD64)
Create a partner profile for your message and ensure that in transaction WE20 the process code is the one that points to your function module. (See step 6 of creating Outbound Idocs).
Step 11
Ensure that error handling functionality is present.
If u still have doubt, i can send u the print screen doc -  hope this helps u
<b>Reward pts if found usefull :)</b>

November 30, -0001

How to add a created Z function module to the existing list in WE21

Hi all, There is some existing function modules ( like EDI_PATH_CREATE_CLIENT_DOCNUM ) in WE21 in the function module field. here, i need to create one Z function module as per user requirement & want to add to that list.  is it possible??? actually,

How to add Image in "SX_OBJECT_CONVERT_OTF_PDF" Function module

Hi, We have scenario to add a BMP image from report to PDF format ,they are  using the SX_OBJECT_CONVERT_OTF_PDF function module to generate the report in PDF ,so we want to know how to add a image(BMP) for this function module or is there any other

How to create RFC function module and how to call this function module

Hi, i want to know step for creating RFC function module and then How to  use this function module from some other sap system. Thnaks, jigarJigar, To implement a remote function module in ABAP, perform the following steps: Register the module as remo

How to create a Function Module

Hi Please tell me the procedure to create a function module. Thanks in advance, PriyaHi Srinivas, In order to create a function module firstly you need to assign it to a function group. In order to create function group goto t-code se37. Choose Goto-

How to Suppress information message from Function module ?

Hello Every one , I have a problem when executing the function module in RF Tranasaction ,   I have a requirement to create a handling units through COPAWA transaction, i am using few function modules  which is using by transactions ,  in that  the f

How to log input parameters for Function Modules?

Hi, I need to create a Logging system to trace input parameters for function modules. The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I w

How to capture errors when a Function module is called as BACKGROUND TASK

How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise. FUNCTION ZRPM_DELETE_PROJECT_DATA_API. ""Local interface: *"  IMPORTING *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL *"     VALU

Error when workflow created from Function Module

Hi All, I am trying to implement leave module workflow for one of my requirement. when i create a leave from PTARQ transaction workflow it is being triggered, but when i tried to do the same from a custom function Module using the same FMs used in PT

How to create a function to get the 16th of the current month and the 15th of the next month

I need to create a function to get the 16th of the current month and 15th of the next month to use it in the fast formula to calculate the sick leave. Example: If an employee takes a sick leave from 16 feb 2015 to 17 feb 2015 , I want it to affect ma

RSAR_TRFC_DATA_RECEIVED Function module does not exist or EXCEPTION raised

Dear All,         We have 2 production systems one is a APO server & the other being BW server.         While checking in SM58 of our APO production server we found that so many entries were in error saying "ERROR REQU_<number> PG# 12 In BW

Function module does not exist in ECC 6.0

Hi All, These two below function module does not exist in ECC 6.0 but exist in 4.6.Could you please let me know replacement of these two's. FI_DOCUMENT_ARCH_READ_SINGLE CHECK_IBAN_ACTIVE Thanks MohitHi, Thanks for your reply.Could you please give me

How do I automatically create bookmarks in adobe using the Scanjet pro 3000 s2?

How do I automatically create bookmarks in adobe using the Scanjet pro 3000 s2?Does the file you are writing have a timestamp in it?  If so you could read the timestamp from the last time it was written and see if the day has changed, handling the na

Is there any function module for getting distribution list name

Hi all, Is there any function module for getting distribution list name when there is same description for two distribution list name. or help me how to fetch the correct distribution name when there is same description. In order to send mails. Tell

Function module for checking existance of rfc destination?

hi all,    is their any function module for checking existance of rfc destination? regards deepakHi, check teh table 'RFCDES'. reward if helpful. Regards, nagarajRead other 3 answers

RFC Function module's where used list

Dear Experts,    I have a situation where in I need to change certain parameters/ the logic of an RFC function module. but before making the changes to the function module I need to know where this function module is used in various systems. So can s

How to use a user defined function module in IP

Hi All, Can you please guide me on how to use a user created function module in IP? My requirement is to have 2 exit function modules to be used in IP to load the falt file data into a cube.. Regards,Hi, /people/marc.bernard/blog/2007/11/25/how-to-lo

Creating RFC Function Module

I am trying to use PHP and SAPRFC to pull out some information from our SAP database.  I've been reading documentation and I've stumbled across this in the SAP documentation: There are two restrictions on writing remote functions that are to be calle

How to call a function module from the Web Template?

Hi all, how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template? Many thanks for your hints. Regards, NilsHi! I am too working on a similar issue. Probably this helps: Re: Calling a function

How to detect caller of a function module

Hello, how is it possible to detect who is calling a function module? Thanks a lot, Tanguy MezzanoHi, May i know why you need the caller name. If suppose you want to know currently who is executing the function. then you can check the sy-uname inside

[SOLVED]How to add OAL driver level functionality in the AM335x BSP source code???

Dear developers, Greetings!!! As, my platform is WinCE 7 with AM335x BSP and I would like to copy one driver and update the driver as per my requirements. The location from where I have taken the existing driver is -  BSP\SRC\CSP\COMMON_TI_AMXX\OAL -