How to catch excpetions of function module?

Hallo everybody,
how can i catch the exception from function module "exception" and deliver it to call function parameter table --exception table.
For example,a function module 'RPY_TABLE_INSERT' is called by Call Function (parameter_table)in order to create a new table.When the table exists already, a exception "Already_exist" activated.But it can not be caught,since it is raised by "message raise". Therefore in the exception-table of caller no error is caught.
How can I deal with it?
Thanks in advance!
Message was edited by: Liying Wang

CALL FUNCTION 'RPY_TABLE_INSERT'
  EXPORTING
  LANGUAGE                = SY-LANGU
    TABLE_NAME              =
  WITH_DOCU               = ' '
  DOCUTYPE                = 'T'
  TRANSPORT_NUMBER        = ' '
  DEVELOPMENT_CLASS       = '$TMP'
    TABL_INF                =
  TABL_TECHNICS           = ' '
  TABLES
    TABL_FIELDS             =
  DOCU_TABLE_USER         =
  DOCU_TABLE_TECH         =
EXCEPTIONS
  CANCELLED               = 1
  ALREADY_EXIST           = 2
  PERMISSION_ERROR        = 3
  NAME_NOT_ALLOWED        = 4
  NAME_CONFLICT           = 5
  DB_ACCESS_ERROR         = 6
  OTHERS                  = 7
IF SY-SUBRC <> 0.
  as per the error sy-subrc will be set, you can see in the exceptions ( 1 for cancel, 2 for already exit)
so using this subrc you can determine the error
ENDIF.

Similar Messages

  • How to create a callback function module

    Hi all,
    I am working in a requirement where we need to call a function module at a 'after change' event. So how to create a callback function module and register it with the crmvevent ?_
    I created a sample function module and try to create entries in table crmv_event_cust, but i got an error message saying that the function module name I provided is not in table CRMC_FUNC_ASSIGN. When I try to create entry there, I got a message that function module is not in CRMC_OBJ_FUNC and that table is a standard table with no maintanance options !!
    looks like i am going in wrong way ... can any one please help ??

    Looking at my system all you need to do is create the entry for the callback function in maint view: CRMV_FUNC_ASSIGN.
    Your entry should be as simple as Z-function name Object Function - <same as others in the segment you are assigning>
    IE for the partner it would be CRM_PARTNER as object function, for general order processing CRM_ORDER
    Take care,
    Stephen

  • How to check for a function module with its description and functionality

    Hi all,
    How to check for a function module,with its description and its functionality,in detail how can I know the purpose of a particular function module,how to search for a function module which suits my requirement .

    Hi,
    You can search a FM of your requirement by putting in the Key words and searching for a FM. Like * KEYWORD * and then pressing F4.
    Say for example you need to search something regarding converstion.
    Search for * CONVERT * and press F4.
    If there is something specfic like converting date to something you can give
    DATE * CONVERT *
    OR
    CONVERT * DATE *  and press F4.
    Once you narrow down your search you will have a Function module documentation inside the Function module. Please note that all the FMs willl not have documentation.
    Regards,
    Pramod

  • How to go into a function module through SE80 t - code

    Hi All , 
                 How to go into a function module through SE80 t - code.
    Thanks in advance.

    >
    Balaji Krishnamoorthy wrote:
    > Hi All , 
    >              How to go into a function module through SE80 t - code.
    >
    > Thanks in advance.
    Hi,
    With  help of  function group
    Thanks & Regards
    Edited by: Always Learner on Oct 16, 2008 2:31 PM

  • How to config Check Digits function module for Student Number Validation

    Hi SLCM Experts,
    In the SAP-SLCM, How to use check digits function module for validate student number.  Just only config it or need to customizing program.
    *Any idea to student number validation in SLCM?*
    Best Regards,
    Suvatchai K.

    Hi ,
    Can you expalin it further ?
    You configure the St. no in piq_matr . And set it  as external or internal no. range which suits your business .
    What is the validation you are looking for ?
    Regards
    Gajalakshmi

  • How to connect our outbound function module to the message type

    how to connect our outbound function module to the message type any transcation code exits to assign the message type with the function module .
    Thank in advance .
    A. Thiru

    Hi Thiru,
    Standard Transaction Codes, have their own Function Modules for generating Outbound/Indbound Idocs. Where these Function Modules will be configured to a particular Process Codes.
    For E.g for PO's
    Process code : ME10 - IDOC_OUTPUT_ORDERS - for creation
    In case if its a Z Function Module, It depends on the case how you use IDOC types. either directly through Z Program or through Inbound/Outbound Process  codes with respective Function modules.
    Regards,
    Anbalagan

  • How to create a custom function module with the records in SAP R/3?

    Hi All,
    How to create a custom function module with the records in SAP R/3? Using RFC Adapter I have to fetch the custom function module records.
    Regards
    Sara

    Hi
    goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Look at the below SAP HELP links, These links will show you the way to create a Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

  • How to code a predifined function module in sap ,in se37.

    can any one tell me how to code a predifined function module in sap ,in se37.it's an immediate requirement.if u give a brief description it'll do.

    Hi Henry,
    There are two possible ways in which I can interpret your question.
    1. You want to create a new Function Module in SE37. you will have to refer to the <a href="http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e9a454211d189710000e8322d00/frameset.htm">Function Builder</a> tutorial for that.
    2. You want to use an existing function module in your program. In the code of your program in SE38, click the button <i>Pattern</i>. On the pop-up, give the name of the function module that you wish to use in your program.
    Regards,
    Anand Mandalika.

  • How to replace obsolete download function module in ECC6.0?

    Hi Experts,
    How to replace obsolete download function module in ECC6.0?
    Thanks,
    Adi.

    Hi,
    DOWNLOAD is obsolete FM in ECC 6. To get the same functionality , we need to use
    CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG  method (It provides the File selection feature)
    and
    GUI_DOWNLOAD function module.(It downloads the internal table from program to presentation server)
    Please see the example below:
    Example:
    *CALL FUNCTION 'DOWNLOAD'
              EXPORTING
                   FILENAME            = p_filename
                   FILETYPE            = ‘DAT’
              TABLES
                   DATA_TAB            = T_DOWNL
              EXCEPTIONS
                   INVALID_FILESIZE    = 1
                   INVALID_TABLE_WIDTH = 2
                   INVALID_TYPE        = 3
                   NO_BATCH            = 4
                   UNKNOWN_ERROR       = 5
                   OTHERS              = 6.
    *End of deletion CH01-
    Replacement Method for above code:
    DATA: l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = P_filename.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME             = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'DAT'
      TABLES
        DATA_TAB                        = T_DOWNL
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.

  • How can i use reuse_alv_fieldcatalog_merge function module

    I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
    FORM BUILD_FIELDCATALOG .
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'KUNNR'.
      FIELDCAT-SELTEXT_M = 'Customer Name'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VBELN'.
      FIELDCAT-SELTEXT_M = 'Invoice Reference'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKBUR'.
      FIELDCAT-SELTEXT_M = 'Sales Office'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKGRP'.
      FIELDCAT-SELTEXT_M = 'Sales Person'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'POSNR'.
      FIELDCAT-SELTEXT_M = 'Item No'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FIANL'.
      FIELDCAT-FIELDNAME = 'ARKTX'.
      FIELDCAT-SELTEXT_M = 'Item Description'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.

    Hello,
    It is very easy to use reuse_alv_fieldcatalog_merge.
    You try this it will work.
    example
    data:
    DATA : gv_repid        TYPE syrepid VALUE sy-repid .  " Report id
      PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
    FORM set_field_catalog  USING uv_tab TYPE slis_tabname
                         CHANGING  xt_fieldcatalog TYPE slis_t_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = gv_repid
          i_internal_tabname     = uv_tab
          i_inclname             = gv_repid
        CHANGING
          ct_fieldcat            = xt_fieldcatalog
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 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.
    ENDFORM.                    " set_field_catalog_spec

  • How to use SWC_CREATE_OBJECT in Function Module

    Hi All,
    I need to create a one function module to fill the work flow container field. this work flow builder had only one task, that task is triggering through QM Action box. I need to maintain this function module in AM Action box, FM when saving field.
    Please help me how to create a new function module in QM Acion box. When run the QM02 with usage decesion option is triggered Associated task is triggering, now how i will pass the notification number to work flow container.
    Please help me

    I think you can
    SWC_CREATE_OBJECT 'QMObject' Object Key
    Or you can pass the QM number to the Workflow and use GENERICINSTANTIATE Method of Business Object SYSTEM to instantiate the QM Business Object.
    Thanks
    Arghadip

  • How can i use this  function module

    Hai
    How can i use this function module /SAPHT/SALES_ORDER_READ, already apply the some parameters in this function module, but it shows the error , please tell me, how to declare the parameters in this function module ,
    thanks
    neelima

    Hi
    For a particular sales order,you have to pass the order number and the item number in the sales order.
    It will display the rest of the values which u can capture them using internal tables.
    Regards,
    Vishwa.

  • How to create EXCEPTION in function module

    hi experts,
              how to create exeptions in function module i want step by step.
    regards,
    chaitu

    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.
    Hope this is helps,Do reward.

  • 1...how to find that a function module belongs to normal function module or

    Hi to all.........
    1...how to find that a function module belongs to normal function module or remote enabled function module?
    Thanks and regards,
    K.Swaminath reddy

    Hi Swaminath,
    Go to Transaction SE37.
    In The Remote enabled function module, in the Attribute tab radio Button "Remote Enabled module will be selected and in the Normal Function Module, Normal Function Module will be selected.
    Regards,
    Mukesh Kumar

  • How to find Exits in Function Module & BAPI

    Hi,
      How to find exits in Function Module & BAPI.
    Thanks In advance

    Hi,
       i ve  a standard FM IDOC_INPUT_SALESORDER_CREATEFR which creates sales order using BAPI (inbound process).
      Now my requirement is to check for some custom segment field if its not initial i ve to change item category field in line item for sales order.
    could u pls help me in this.
    Thanks in advance.

Maybe you are looking for

  • DBIF_RSQL_TABLE_UNKNOWN Table AUSPN_V1 does not exist in the database with ID R/3

    Hi All, We are encountering numerous short dumps in our system caused by Table AUSPN_V1 does not exist in the database with ID R/3. Can anyone advise how to solve the issue? Please find below portion of the short dumps. Category               ABAP Pr

  • Could not access the central system - CUA problem

    Hi all, Please help me with this problem. Its just a test scenario, when everything will be good here, i have to do the same for Production. We just did upgrade our R3 system from 4.6 to ECC6.0. I created CUA on DB1100 ( Dev BW 4.6 ) with two child s

  • Apache from Companion CD is not starting?

    Hi: I have installed oracle 10.1.0 db and then tried to install Apache from Companion CD, but at the time of starting Apache it generates an error and shows windows error (Windows XP SP3). I switched off the firewall and added oracle directory to kas

  • Hello world servlet in Glassfish. Need help to start, please.

    Hello. I am new to servlet technology. I am reading the Servlet specification 2.4 and I want to try everything on practice. I want to start using the Glassfish. Currently I want to try it as a simple servlet container. A few years ago I used to work

  • Kanaka 2.7 on MacOsx 10.8.2

    When we try to start the Console Plug-in, we become following error messages: The required user attribute could not be found! The user attribute 'dsAttrTypeStandard: Realname' is required to use Plug-in Console. Make sure that your are logged in via