How to raise the exception in function module

Dear abaper's.
               I am creating a Function module .In that in' EXCEPTION' Tab i am giving
3 exception .1.NO_DATA_FOUND 2.NO_PRINTER_FOUND 3.SMARTFORM_INTERFACE_NOT_FOUND.
In my coding if this condtion matches i want to raise this exception.how can i do this in my coding .can any one suggest me..
advance thanks,
Warm regards,
Veera

Hi,
if that condition is not satisfied,and u didn't handle that exception while calling function module then in the runtime error u will get the text as the description of the exception in function module definition.
rgds,
bharat.

Similar Messages

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • What is the Exceptions in function module

    Hi,
    wt is the exceptions in function module? can anyone tell me?
    Thanks
    swathi

    Exception is the mechanism by which you can give the error messages back to the program.
    Say for the REUSE_ALV_GRID_DISPLAY, we have so many exceptions. Every exception has some meaning. Say the exception PROGRAM_NOT_FOUND will be raised when you had passed wrong program name in the CALLBACK program.
    PROGRAM_NOT_FOUND  = 1...
    If the exception was raised than this value will be set to the SY-SUBRC.
    SO, by accessing SY-SUBRC, you can get to know which exception was raised.
    Regards,
    Naimesh Patel

  • EXIT_SAPLCORF_008 - how to raise the exception "PREDEC_NOT_CONFIRMED "

    Hi,
    I am using the user exit " EXIT_SAPLCORF_008 "  to the check the previous activity is confimed or not.
    so i want to raise the exception "PREDEC_NOT_CONFIRMED " , Because this exit comes under function module  "CO_RU_CHECK_OPERATION ".
    I am not able to raise the Exception . Plz guide me how to go ahead.
    Exception List - CO_RU_CHECK_OPERATION
    CONFIRMATION_NOT_ALLOWED     Confirmation not allowed
    NEW_STATUS_NOT_POSSIBLE     Confirmation not possible because of status management
    OPERATION_NOT_FOUND     Operation not found
    OPERATION_NOT_SELECTABLE     Operation cannot be selected because of parameter setting
    ORDER_DATA_MISSING     Order data was not yet supplied
    PREDEC_NOT_CONFIRMED     Predecessor of operation not confirmed
    PRT_LOCKED     Production resource/tool is frozen.
    Regards,
    Rani

    Hi,
    I am using the user exit " EXIT_SAPLCORF_008 "  to the check the previous activity is confimed or not.
    so i want to raise the exception "PREDEC_NOT_CONFIRMED " , Because this exit comes under function module  "CO_RU_CHECK_OPERATION ".
    I am not able to raise the Exception . Plz guide me how to go ahead.
    Exception List - CO_RU_CHECK_OPERATION
    CONFIRMATION_NOT_ALLOWED     Confirmation not allowed
    NEW_STATUS_NOT_POSSIBLE     Confirmation not possible because of status management
    OPERATION_NOT_FOUND     Operation not found
    OPERATION_NOT_SELECTABLE     Operation cannot be selected because of parameter setting
    ORDER_DATA_MISSING     Order data was not yet supplied
    PREDEC_NOT_CONFIRMED     Predecessor of operation not confirmed
    PRT_LOCKED     Production resource/tool is frozen.
    Regards,
    Rani

  • How to change the name of function module ,generated by SMARTFORMS

    Dear All,
    As you all know, SMARTFORMS generates one function module.
    The default name is somewhat like    /1BCDWB/SF00000099
    instead of, i want to give some specific user defined name.
    how to do???

    Hi,
    I think its not possible to give it a user defined name, but you can assign it to a variable and use that variable name instead.
    Please see the code below
    Data: V_FMNAME type RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
                 EXPORTING
                   formname                 = 'ZSMARTFORM'
                  VARIANT                  = ' '
                  DIRECT_CALL              = ' '
                IMPORTING
                  FM_NAME                  =  V_FMNAME
                EXCEPTIONS
                  NO_FORM                  = 1
                  NO_FUNCTION_MODULE       = 2
                  OTHERS                   = 3
               IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
               ENDIF.
              CALL FUNCTION V_FMNAME
               EXPORTING
                ARCHIVE_INDEX              =
                ARCHIVE_INDEX_TAB          =
                ARCHIVE_PARAMETERS         =
                CONTROL_PARAMETERS         =
                MAIL_APPL_OBJ              =
                MAIL_RECIPIENT             =
                MAIL_SENDER                =
                OUTPUT_OPTIONS             =
                USER_SETTINGS              = 'X'
                  wa_itab1                   = wa_itab1
                  wa_itab2                   = wa_itab2
                  wa_itab3                   = wa_itab3
                  wa_itab4                   = wa_itab4
                IMPORTING
                DOCUMENT_OUTPUT_INFO       =
                JOB_OUTPUT_INFO            =
                JOB_OUTPUT_OPTIONS         =
                TABLES
                  i_itab1                    =  i_itab1
                  i_itab2                    =  i_itab2
                  i_itab4                    =  i_itab4
                  i_itab3                    =  i_itab3
              EXCEPTIONS
                FORMATTING_ERROR           = 1
                INTERNAL_ERROR             = 2
                SEND_ERROR                 = 3
                USER_CANCELED              = 4
                OTHERS                     = 5
              IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
    Regards,
    Manish

  • How to automate the creation of Function Module & Class Object (SE24)

    Experts,
    I have the requirement to automate the creation of any type of programs: ie function module (like how we normally create in SE37 together with the parameters), class object (like how we normally create in SE24 together with attribute & method), normal report (like how we did in SE38), module pool and so on.
    For example. I backuped my program into a flat file (the entire source code in txt formal or HTML) through a download program and I need to upload back this flat file into another installation of SAP.
    Does SAP provide any predefined FM to cater for the above cases or better still, does anyone know of any upload program which I can use for the above requirement.
    Thanks in advance.

    Hi Kris, I can't use the transport system as these are 2 separate SAP installation in a different place. The requirement came in the form of creation of program to be able to generate FM/Class/Report on the go.

  • How to restrict the access of FUNCTION MODULE for others after transporting

    A Function module needs to be executed in one server and should be executed when others try to access it.how to restrict the access of FM to one application server after being transported using SM59.

    issue resolved

  • How to find the outbound idoc function module?(Urgent)

    Dear All,
    How to identify the outbound function module if there is process code assigned to message type.
    For partner profile the mesasge type is assigned and idoc type .This is the only information maintained .
    Now my question is how to identify the fucntion module which is getting trigger in the system is there any data maintained in the standard table  or any t-code .
    Points will be rewarded for right answers.
    Thank You.
    Regards,
    Ravi Ganji

    Hi,
    If u know the message and basictype then we can know the process code for that message type in transaction code WE64.
    if we know process codes then we can know the function modules in transaction codes WE41(Outbound process code) and WE42(Inbound process code).
    Each process code is attached with a FM...
    Reward if helpful
    Regards,
    Nagaraj

  • How to raise the exception

    how to rise exception when the cursor returns no data,suppose
    begin
    for rec in (select * from scott.emp e
    where exists ( select 1 from scott.emp where e.deptno=30 ))
    loop
    dbms_output.put_line(rec.ename);
    end loop;
    exception
    when no_data_found then
    dbms_output.put_line('no such employee');
    end;now when other deptno(which is not there in table) given ,the exception should be raised.
    how to do this

    Hi,
    What about this?
    DECLARE
       v_numrecords NUMBER;
       no_matching_emp EXCEPTION;
    BEGIN
       SELECT COUNT(*) INTO v_numrecords FROM scott.emp e WHERE e.deptno = 30;
       IF v_numrecords = 0 THEN
          RAISE no_matching_emp;
       END IF;
       -- Here comes your loop
       FOR rec IN (SELECT * FROM scott.emp e WHERE e.deptno = 30) LOOP
          dbms_output.put_line(rec.ename);
       END LOOP;
    EXCEPTION
       WHEN no_matching_emp THEN
          dbms_output.put_line('no such employee');
    END;Regards,
    Edited by: Walter Fernández on Mar 3, 2009 11:29 AM - Adding loop...

  • How to find the names of Function Module used in the program

    Hi all,
    can you people help me with this issue.I want to the names of all the Function Module used in the program  along with their parameters into an internal table.It will be helpful for your suggestions.
    Kind Regards,
    Edited by: Prasenjit Sengupta on Nov 20, 2008 7:39 AM

    Take structure of internal table as
    TYPES : BEGIN OF TY_FM,
            FUNCNAME TYPE RS38L_FNAM,  "Name of Function Module
            PARAMETER TYPE RS38L_PAR_, "Parameter name
            PARAMTYPE TYPE RS38L_KIND, " Parameter type
            R3STATE TYPE R3STATE,      "ABAP: Program Status (Active, Saved, Transported...)
            STRUCTURE TYPE RS38L_TYP,  "Associated Type of an Interface Parameter
            DEFAULTVAL TYPE RS38L_DEFO,"Default value for import parameter
            REFERENCE TYPE RS38L_REFE, "Call by reference
            OPTIONAL TYPE RS38L_OPTI,  "Optional parameters
            TYPE TYPE RS38L_TYPE,      "Reference Structure is an ABAP/4 Type
            END OF TY_FM.
    DATA : IT_FM TYPE TABLE OF TY_FM WITH HEADER LINE.

  • How to Debug the DMEE exit function module

    Hi All,
    I wants to Debug the DMEE  tree exit function module.
    Could you please guide me.
    Regards,
    Seshadri

    Put a BREAK USER in User-Exit.
    Once the system enters into debugging mode,
    in debuger on setting tab,
    check the Update Debugging and System Debugging.
    Regards
    Bala Krishna

  • Exceptions in function module.... for beginner......

    Dear all experts,
    I am new to ABAP. 
    Can anybody please tell, how to use the exceptions in function module ?
    and if any exception happens, then how to link some messages to that exceptions?
    I will also like to know, how to create those messages ?
    <b>Can anybody please illustrate with help of example, so that a beginner will be able to understand. ?</b>
    <b>eg,</b> i am adding two numbers in function module, and if any one passing number is negative, then i need to raise exception with message please do not enter -ve numbers for addition.
    your help will be surely, rewarded with points.
    waiting for reply.
    Regards & Thanks
    Vinay.

    hi..
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE <except>.
    and
    MESSAGE..... RAISING <except>.
    The effect of these statements depends on whether the calling program handles the exception or not. If the name <except> of the exception or OTHERS occurs in the EXCEPTIONS addition of the CALL FUNCTION statement, the exception is handled by the calling program.
    If the calling program does not handle the exception
    The RAISE statement terminates the program and switches to debugging mode.
    The MESSAGE ..... RAISING statement display the specified message. How the processing continues depends on the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE ..... RAISING statement does not display a message. Instead, it fills the system fields SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION READ_SPFLI_INTO_TABLE.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(ID) LIKE  SPFLI-CARRID DEFAULT 'LH '
    *"       EXPORTING
    *"             VALUE(ITAB) TYPE  SPFLI_TAB
    *"       EXCEPTIONS
    *"              NOT_FOUND
      SELECT * FROM SPFLI INTO TABLE ITAB WHERE CARRID = ID.
      IF SY-SUBRC NE 0.
        MESSAGE E007(AT) RAISING NOT_FOUND.
      ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table SPFLI_TAB. If it cannot find any entries, the exception NOT_FOUND is triggered using MESSAGE...RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Also check these links
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/search/highlightContent.jsp
    regards,
    veeresh

  • Exceptions in function module

    Hi,
    What are the exceptions in function module.
    Thanks in advance

    HI,
    Exceptions are used to return the error which happens in function module to the calling program.
    You can't show error messages directly from Function modules. So when there are some error occurs in function module it raises the desired exception. and this exception number is passed back to calling program. in this way calling program can trace out the error happens in function module.
    REgards,

  • Raising exceptions in function module

    I am writing a coding inside the userexit. The call customer function has 'exception' parameters like below:
             EXCEPTIONS
               IDOC_ERROR          = 1
               DO_NOT_PROCESS_IDOC = 2
               OTHERS              = 3.
    Now, I want to raise the exception to '1' depending on some conditions. How do I do that? I used to just get the import parameters from the funciton module but never raised exceptiosn before.
    please advice.
    Thanks

    Hi,
    Please try this.
    IF <your field check>  NE <your condition>
      RAISE IDOC_ERROR.
    ENDIF.
    OR
    SY-SUBRC = '1'.
    Regards,
    Ferry Lianto

  • 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 format.do 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
    PROCESS DIAGRAM
    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
    c_SEGMENT_type1.
    • 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_DLINAME = Leave Blank
    MS_MAIL_LANGU = 'E' (Language)
    MS_MAIL_FUNKOBJ_NAME = Leave Blank
    TABLES
    MS_MAIL_CONT = I_MCMAILOBJ
    Note:
    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>
    regards
    Sathish

Maybe you are looking for