Syntax check for tables and function modules

Hi,
I am writing a program that perform syntax check on object such as executable programs , function modules and tables.
Syntax check works fine for programs, but not for tables.
How can I perform syntax check on my tables or structures?
I get my data from the table TADIR. But I don't get my function modules from there. What is the table for this.
Thanks 4 ur replies.
Parvez

hi
good
generally in sap while creating a table or structure we get the error and we solved them,but like reports during runtime it is not possible to check the syntax of a table or structure.
thanks
mrutyun^

Similar Messages

  • Hash table and function module input

    Hi ABAP Expert,
    Please advise what happening if i am passing the intertal table (hashtable) become input of function module (table).
    so insite the function module is this table still hashtable type or just normal internal table ?
    Thank you and Regards
    Fernand

    Typing of such parameter should be either generic (i.e ANY TABLE) or fully specified (HASHED/SORTED/STANDARD TABLE). In both cases when you pass i.e. HASHED table to that formal parameter the dynamic type will be inherited by the actual paremeter.
    This means that inside the function module you will not be able to use HASHED table "banned" statement i.e. not appending to this table. The system must be fully convinced about the type of passed parameter to allow certain access. Without that knowledge it won't pass you through the syntax checker or will trigger runtime error.
    I.e
    "1) parameter is typed
    CHANGING
       C_TAB type ANY TABLE
    "here you can't use STANDARD/SORTED table specific statements as the dynamic type of param might be HASHED TABLE
    append ... to c_tab.  "error during runtime
    "2) parameter is typed
    CHANGING
       C_TAB type HASHED TABLE
    "here system explicitly knows that dynamic type is the same as static one so you can append to this table too
    append ... to c_tab.  "syntax error before runtime
    So the anwser to your question
    so insite the function module is this table still hashtable type or just normal internal table ?
    is...
    During syntax check system takes static type of table and shouts if table related operation is not allowed for this kind.
    During runtime system takes dynamic type of the table and checks whether particular statement is allowed for this kind of table, if not triggers an exception.
    Regards
    Marcin

  • When we go for Views and Function Modules for Generic Extraction

    Hi Experts,
    Can you please explain when we go for extracting the data using Views and when we got using Function Modules using Generic Extraction from R/3 system to BW with examples. And also can you explain when we go for delta for the above both scenarios.
    Thanks for you help in advance
    Rohith

    Hi,
    Scenario for Extarction using FM
    Imagine the scenario where you need to extract data from
    tables having no common field between them and thereby preventing you from creating a view on top of those tables..
    Or simply consider tables that are highly unrelatd in terms of fields, but you have a requiremnt to extract data from them.
    Also Refer.
    create generic extractor based on 2 tables
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Steps.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
    Scenario for Extraction using View
    If there are more number of tables and data in those tables can be represented using joins then we can use this type of extraction
    For more info Refer these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
    Difference between "Help View" and "Search Help"
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
    for more detailed info look on:
    http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&
    For GEneric Delta refer these links
    [generic with delta;
    [https://forums.sdn.sap.com/click.jspa?searchID=11388803&messageID=5164737]

  • Material Availablity check for production order - function module?

    I have a production order with Material BOM, which has more than 30 components in it. Please suggest me if there is any function module to do the material availability check of a production order. I need the missing component list as output of that function module, with quantities if possible.
    thanks,
    Subbareddy

    You might want to look at these FMs:
    CO_ZA_AVAILABILITY_CHK_ORDER
    ISA_AUC_MATERIAL_AVAILABILITY
    Thanks,
    Santosh

  • Good source for tables and reports

    Hello!
    Does any one know a good source for tables and reports in SRM (EBP) I really
    looking to report on the Org Structure.
    But any information you can give me would be really helpful.
    Regards
    sas

    Hi,
    See these threads :
    SRM Tables
    SRM Tables
    Re: Availability of Standard Reports in SRM
    SRM standard reports?
    SRM Reports
    For developing custom reports,you can use the stanadard tables and Function modules.
    BR,
    Disha.

  • What is the exact syntax for calling remote function module.

    Hi to all
    1.....what is the exact syntax for calling remote function module.?
    Thanks and regards,
    k.swaminath reddy

    hi
    good
    Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.
    Do the following steps for creating RFC in server A.
    1. log on to server A
    2. go to se37
    3. Edit -> function groups-> create function group and give the function group name (say ZGRP).
    4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.
    5. go to attribute tab -> choose remote-enabled module from processing type.
    so that your FM will become RFC.
    6. provide the import parameter in import tab.
    we will provide only two import parameters.
    - parameter name : P_NUM1, typing: TYPE, associated type : I & check the pass value (all the parameters of RFC must pass by value).
    - parameter name : P_NUM2, typing: TYPE, associated type : I & check the pass value
    7. provide the export parameter in export tab.
    parameter name : P_SUM, typing: TYPE, associated type : I & check the pass value
    8. write the given simple code in source code tab.
    FUNCTION Z_TEST_RFC.
    P_TOT = P_NUM1 + P_NUM2.
    ENDFUNCTION.
    Do the following steps for creating ABAP program which will call the RFC in server B.
    1. se38 - > creat a program.
    2. write the given simple code.
    data tot type i.
    call function 'Z_TEST_RFC' destination 'XXXXXX'
    exporting
    p_num1 = 10
    p_num2 = 15
    importing
    p_tot = tot.
    write tot.
    please note that XXXXXX is RFC connection which is avialable in sm59 transaction in server A.
    -go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of XXXXXX in the code.
    finally you can execute the normal abap program that will call the RFC and display the result.
    reward point if helpful.
    thanks
    mrutyun^

  • Any docs regarding Table/View,Function Module for Generic Extraction

    Hello All
    I need to do Generic Extraction,for that if anyone has docs., I need docs on how to create table,view,Function module and infoset query ,on that pl forward to my id
    [email protected]
    Many Thanks
    balaji

    hi Amit
    Thanks for your docs,but this docs i have already,do u have any thing different one,if so please forward?
    Facing a Problem
    Iam trying to create view(database view)for <b>vbak</b> and <b>vbap</b> and given in Tables in <b>Table/Join Conditions</b> tab and clicked in <b>Relationship</b> and the relantionship has been generated automatically,now when i tried to activate this view its saying like "<b>No tables and/or fields are defined for view xxxxx</b>(xxxx-> name of a view)
    what will be the problem?pl let me know how to create a view?
    And also I need to know the diffference between database view,Manintenance view,Projection view and help view?
    Pl let me know on this?
    Many Thanks
    balaji

  • Table or Function module to get Internal order planning and Cost element pl

    Dear All,
    Table or Function module to get Internal order planning and Cost element planning.
    Internal order planning from T-code KO13.
    Thanks in advance.
    Regards,
    Ravi
    Edited by: Ravi Chandra on Sep 13, 2011 8:08 AM

    BPEJ, BPEG, BPEP

  • I need to know thelist of bapi's and function modules used for transaction

    I need to know thelist of bapi's and function modules used for transaction in order to use these FM or BAPI in reading some fields of equipment master and functional loocation.Can any one suggest me some methods...or do i need to write  a report for the same.

    Steps to find the BAPI/function modules used in a transaction
    1) Find the package of the transaction thro' SE93.
    For example the package for the transaction VA03 is VA
    2) Go to Se80, key-in the package (say VA)
    3) You can see the function modules under the folder finction group and
    you can see the BAPI's under the folder Business Engineering-> Business Objects-> double click on the released methods of the Business Objects

  • To know thelist of bapi's and function modules used for transaction IH10

    I need to know thelist of bapi's and function modules used for transaction in order to use these FM or BAPI in reading some fields of equipment master and functional loocation.Can any one suggest me some methods...or do i need to write a report for the same.

    hi,
    provide report name (here: RIEQUI20)
    goto se38 - utilities - cross reference - function modules
    or use report RPR_ABAP_SOURCE_SCAN
    with search string call function
    A.
    Message was edited by:
            Andreas Mann

  • Function Groups and Function Modules

    Hi,
    Can anyone give me the detail steps for creating Function Group and then from that function group creation of function module with example?
    Regards,
    Chandru

    Hi,
    Function Group creation -
           A function group is a program that contains function modules. With each R/3 system, SAP supplies more than 5,000 pre-existing function groups.
         In total, they contain more than 30,000 function modules. If the functionality you require is not already covered by these SAP-supplied function modules, you can also create your own function groups and function modules.
          We can put all the relevant function modules under one function group and all the global variables can be declared in this FG.
    FG Creation:
    1)     Function group can be created in SE80. There choose the 'Function Group' from the list of objects.
    2)    Then give a name for ur function group (starts with Y or Z) and press ENTER.
    3)   The click 'YES' in the create object dialog box and give a short desc. for this FG and save.
    Function Module:
                 A function module is the last of the four main ABAP/4 modularization units. It is very similar to an external subroutine in these ways:
    Both exist within an external program.
    Both enable parameters to be passed and returned.
    Parameters can be passed by value, by value and result, or by reference.
    The major differences between function modules and external subroutines are the following:
    Function modules have a special screen used for defining parameters-parameters are not defined via ABAP/4 statements.
    tables work areas are not shared between the function module and the calling program.
    Different syntax is used to call a function module than to call a subroutine.
    Leaving a function module is accomplished via the raise statement instead of check, exit, or stop.
    A function module name has a practical minimum length of three characters and a maximum length of 30 characters. Customer function modules must begin with Y_ or Z_. The name of each function module is unique within the entire R/3 system.
    Defining Data within a Function Module
    Data definitions within function modules are similar to those of subroutines.
    Within a function module, use the data statement to define local variables that are reinitialized each time the function module is called. Use the statics statement to define local variables that are allocated the first time the function module is called. The value of a static variable is remembered between calls.
    Define parameters within the function module interface to create local definitions of variables that are passed into the function module and returned from it (see the next section).
    You cannot use the local statement within a function module. Instead, globalized interface parameters serve the same purpose. See the following section on defining global data to learn about local and global interface parameters.
    Defining the Function Module Interface
    To pass parameters to a function module, you must define a function module interface. The function module interface is the description of the parameters that are passed to and received from the function module. It is also simply known as the interface. In the remainder of this chapter, I will refer to the function module interface simply as the interface.
    To define parameters, you must go to one of two parameter definition screens:
    1) Import/Export Parameter Interface
    2) Table Parameters/Exceptions Interface
    Then in the FM interface screen, give the following
    1) Import parameters
    2) Export parameters
    3) Changing parameters
    Then give
    1) Define internal table parameters
    2) Document exceptions
    You enter the name of the parameter in the first column and the attributes of the parameter in the remaining columns. Enter one parameter per row.
    Import parameters are variables or field strings that contain values passed into the function module from the calling program. These values originate outside of the function module and they are imported into it.
    Export parameters are variables or field strings that contain values returned from the function module. These values originate within the function module and they are exported out of it.
    Changing parameters are variables or field strings that contain values that are passed into the function module, changed by the code within the function module, and then returned. These values originate outside the function module. They are passed into it, changed, and passed back.
    Table parameters are internal tables that are passed to the function module, changed within it, and returned. The internal tables must be defined in the calling program.
    An exception is a name for an error that occurs within a function module. Exceptions are described in detail in the following section.
    Syntax for the call function Statement
    The following is the syntax for the call function statement.
    call function 'F'
        [exporting   p1 = v1 ... ]
        [importing   p2 = v2 ... ]
        [changing    p3 = v3 ... ]
        [tables      p4 = it ... ]
        [exceptions  x1 = n [others = n]].
    where:
    F is the function module name.
    p1 through p4 are parameter names defined in the function module interface.
    v1 through v3 are variable or field string names defined within the calling program.
    it is an internal table defined within the calling program.
    n is any integer literal; n cannot be a variable.
    x1 is an exception name raised within the function module.
    The following points apply:
    All additions are optional.
    call function is a single statement. Do not place periods or commas after parameters or exception names.
    The function module name must be coded in uppercase. If it is coded in lowercase, the function will not be found and a short dump will result.
    Use the call function statement to transfer control to a function module and specify parameters. Figure 19.9 illustrates how parameters are passed to and received from the function module.
    sample FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = ' '
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
      IT_FIELDCAT                       =
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          =
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example
    1  report ztx1905.
    2  parameters: op1 type i default 2,   "operand 1
    3              op2 type i default 3.   "operand 2
    4  data rslt type p decimals 2.        "result
    5
    6  call function 'Z_TX_DIV'
    7       exporting
    8            p1      = op1
    9            p2      = op2
    10      importing
    11           p3      = rslt.
    12
    13 write: / op1, '/', op2, '=', rslt.
    Regards,
    Shanthi.P
    Reward points if useful ****
    Edited by: shanthi ps on Jan 26, 2008 12:03 PM

  • Debugging Tips for Mapping and Validation modules

    Hi,
    I am new to CRM, anybody can send the dubuging tips for  Mapping and Validation modules and the list of tables which I have to check before loading.
    (Intilal load & delta load)
    Regards
    KHM

    KHM,
    The first thing you need to make sure is that all queues are deregistered on both systems.  Check the settings in SMQR and SMQS on your systems.  The next step is that your middleware connection user must be a dialog user in order to debug the middleware properly.
    If you have those two steps done, then for an initial load you can actually go into to the queues and debug the entries from each queue.  For a delta load you will need to put a break point in the transaction before the middleware trigger, and then turn on update debugging(if you want to go through the full process).
    The only other key is looking up the correct function modules for the adapter objects to determine what is being called.  Once you know these and have done the steps above you can in general debug.
    Validate the information above in your system and then let me know where you are getting stopped in your debug process.  We can then try to figure out why the debugger is not being called.
    Good luck,
    Stephen

  • Where the documentation is provided for the Standard Function module ?

    If there is no documentation provided for the standard function module in SE37 what is the best way to understand the functionality of the function module?Is there any where we can find the documentation?
    Please dont say the From coding part its too vast to understand
    Ex: HRCM_ORGSTRC_INFO_TABLE_GET
    Paint for me ..
    Regards
    sas
    Edited by: Julius Bussche on Mar 18, 2009 1:17 PM

    O Really thanks amit !!
    Are you able to understand the below code and please provide your valuable inputs what we are understanding is the same.
    PERFORM read_infotypes.
    *-- ********************************************************** NMP
    *-- IF scb frozen then write to itab-scb field.  nmp 11/2001.
    *-- ********************************************************** NMP
    *--Begin of Change by vneld - 01/17/2007
    *  IF PA0001-ZZBERN NE SPACE.
    *    FROZEN = PA0001-ZZBERN.
    *  ENDIF.
    *  ITAB-SCB = FROZEN.
    *-- ********************************************************** NMP
    *--end of Change by  vneld- 01/17/2007
      PERFORM get_date USING '92'
                       CHANGING w_hiredate.
      PERFORM get_date USING '93'
                       CHANGING w_rehire.
      PERFORM get_date USING '94'
                       CHANGING w_termdate.
      IF NOT ( w_rehire IS INITIAL ).
        w_hiredate = w_rehire.
        itab-code = 'R'.
      ELSE.
        itab-code = 'H'.
      ENDIF.
      IF p0001-persg = '3'.
        itab-code = 'T'.
      ENDIF.
    *Change by Mdukes
    ** We need HIRE,Rehire & term  within 13 month`s window
    ** But if someone Hire in IT ,change dept and then terminated .
    ** We need to exclude that person from the list  .
    ** We need to change his Org.Unit by END_DATE 12/31/9999 from Pa0001.
      CLEAR:result_tab.REFRESH:result_tab.
      CALL FUNCTION 'HRCM_ORGSTRC_INFO_TABLE_GET'
        EXPORTING
          PLVAR          = '01'
          ROOT_OTYPE     = 'O'
          ROOT_OBJID     = P0001-ORGEH
          BEGDA          = SY-DATUM
          ENDDA          = P0001-ENDDA
          PATH_ID        = EVPATH
          PATH_DEPTH     = 10
        TABLES
          ORG_INFO_TABLE = result_tab
        EXCEPTIONS
          PATH_ERROR     = 1
          ROOT_ERROR     = 2
          OTHERS         = 3.
    *  CALL FUNCTION 'RH_STRUC_GET'
    *    EXPORTING = 'O'
    *      act_objid       = PA0001-ORGEH
    *      act_wegid       =  EVPATH
    *      act_plvar       =  TYPE
    *      act_tflag       = space
    *      act_vflag       = space
    *      authority_check = space
    *    TABLES
    *      result_tab      = result_tab
    *    EXCEPTIONS
    *      no_plvar_found  = 1
    *      no_entry_found  = 2
    *      OTHERS          = 3.
    * reading the Org.Unit based on employee Org.unit (Evaluation Path 'O-O'.
    * After that making sure the latest Pa0001 org.unit is part of selection org.unit
    * If yes, set the flag to = 1 . Otherwise ignore the rec .
    * We want only IT folks hire/rehire/term within 13 monthu2019s window
    * if somebody change the dept and get term within 13 monthu2019s .it
    * Should show up in hire but not in term report .
      CLEAR:REC.
      lOOP AT result_tab.
        read table PCHOBJID with key low = result_tab-OBJID.
        if sy-subrc = 0 .
          Rec = 1.
          EXIT.
        Endif.
      ENDLOOP.
      if rec  = 1.
    *--begin of change by vneld- 01/17/07
        CHECK ( ( w_hiredate >= w_13th_mnth_date AND w_hiredate <= sy-datum )
          OR
              ( w_termdate >= w_13th_mnth_date AND w_termdate <= sy-datum ) ).
    *--end of change by vneld- 01/17/07
    **---check for hires or terms in the calendar year.
    **---No future terms
    *  CHECK ( ( W_HIREDATE(4) = SY-DATUM(4) ) OR
    *  ( W_TERMDATE(4) = SY-DATUM(4) AND W_TERMDATE <= SY-DATUM ) ).
        CONCATENATE p0002-vorna p0002-nachn INTO itab-name SEPARATED BY ' '.
    *--Begin of change by vneld 03/29/2007
    *--get supervisor name
        data : lname(20),
               fname(20).
        clear: lname,
               fname.
        Select vorna nachn from pa0002 into (fname ,lname)
               where pernr =  p0001-zzsuper_no.
        endselect.
        CONCATENATE lname fname INTO itab-supv SEPARATED BY ' '.
    *  itab-supv = p0001-zzsuper_text.
    *--End of change by vneld 03/29/2007
    *----get employee group text
        CLEAR t501t.
        SELECT SINGLE * FROM t501t WHERE sprsl = 'EN' AND
                                         persg = p0001-persg.
        IF sy-subrc EQ 0.
          itab-group = t501t-ptext.
        ENDIF.
        PERFORM get_dept.
        PERFORM get_position.
        PERFORM append_fields.
      endif.
    ENDFORM.                    " PROCESS_EMPLOYEE
    Edited by: saslove sap on Mar 19, 2009 7:45 AM

  • Vendor-Customer balances in group currency-table/structure/function module?

    Hi All,
    Which table/structure/function module can be used to get balances for vendors and customers in group currency? We just wnat to extract balances in group currency so FBL1N and FBL5N are not options. Is there any SAP report which can provide these balances for both vendors and customers?
    Thanks and regards,
    Pinky

    Hi Pinky,
    I came across one report S_ALR_87012079 - Transaction Figures: Account Balance, Program RFSRRCUA, which extracts Account Balances of Vendor. Once the report is executed, you can do Currency Translation from one currency to different currencies. In the output screen, in the Top Menu, select 'Settings -> Currency' and you can convert to another currency. I am not sure, if this helps you. If this helps, kindly update your comments here.
    Thank you.
    Suresh Jayanthi.

  • Passing dynamic table to function module

    Hi all,
    actully i have to pass dynamic internal table from function module.
    for that i use syntax
    move <dyn_table> to data_tab.
    but now my question is that in fm parameters what is the  type spec & associated type for data_tab in fm parameters.
    regards,
    anuj

    Hi
    Good
    Here is a simple example of passing an internal table "itab" to a function module "REUSE_ALV_LIST_DISPALY".
    It displays the internal table data into a list format.
    data : itab like ztest213 occurs 0 with header line.
    tables : ztest213 .
    select * from ztest213 into table itab.
    loop at itab.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = ' '
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    i_structure_name = 'ztest213'
    IS_LAYOUT =
    IT_FIELDCAT =
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IR_SALV_LIST_ADAPTER =
    IT_EXCEPT_QINFO =
    I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    tables
    t_outtab = itab
    exceptions
    program_error = 1
    others = 2
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endloop.
    Thanks
    mrutyun^

Maybe you are looking for