Alv without type-pools statement

hi experts,
can we use reuse_alv_list_display, function module in a report......
without declaring an type-pools: slis. is it possible.
if yes give me an example.....
what are all the mandatory requirements for an alv report.............

Hi ,
  SLIS is basically used to get the various structures and data types which you use in the FM called by the program , so if you want to implement it without SLIS  then you will have to declare all the data types in your program the same way it is declared in SLIS .
Why are u a hesitant in using the type pool?
Regards
Arun

Similar Messages

  • ALV Using  TYPE-POOLS: SLIS

    hi
    Using TYPE-POOLS: SLIS
    I created a "special group" using structure
    slis_sp_group_alv
    and appending it to table of type
    slis_t_sp_group_alv
    i call this special group internal table using the function module:
    "REUSE_ALV_HIERSEQ_LIST_DISPLAY"
    the sample code will look something like this:
    DATA: gt_sgroup TYPE slis_t_sp_group_alv.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    IT_SPECIAL_GROUPS        = gt_sgroup.
    My question is How should i add the contents of my internal tables which i create using 'fieldcat' into this "special group" say 'xyzw' is the name of my special group.
    Deepak

    Hi Deepak,
    First you have to populate the internal table ( i.e, Fill the internal table ). Then pass that internal table to that function u r calling.
    See d below code for your reference for how to add the rows to the internal table. Follow similarly,
    REPORT zsomalv3 NO STANDARD PAGE HEADING.
    TYPE-POOLS: slis.
    DATA: BEGIN OF i_data OCCURS 0,
            qmnum      LIKE qmel-qmnum,
            qmart      LIKE qmel-qmart,
            qmtxt      LIKE qmel-qmtxt,
            ws_row     TYPE i,
            ws_char(5) TYPE c,
            chk,
          END OF i_data.
    DATA: report_id  LIKE sy-repid.
    DATA: ws_title   TYPE lvc_title VALUE 'An ALV Report'.
    DATA: i_layout   TYPE slis_layout_alv.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT qmnum
           qmart
           qmtxt
           INTO TABLE i_data
           FROM qmel
           WHERE qmnum <= '00030000010'.
    LOOP AT i_data.
      i_data-ws_row = sy-tabix.
      i_data-ws_char = 'AAAAA'.
      MODIFY i_data.
    ENDLOOP.
    report_id = sy-repid.
    PERFORM f1000_layout_init CHANGING i_layout.
    PERFORM f2000_fieldcat_init CHANGING i_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = report_id
       i_grid_title                      = ws_title
       is_layout                         = i_layout
       it_fieldcat                       = i_fieldcat
       i_save                            = 'A'
      TABLES
        t_outtab                          = i_data
    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.
    *&      Form  F1000_Layout_Init
    FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
      CLEAR i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-edit = 'X'.
    ENDFORM.                    " F1000_Layout_Init
    *&      Form  f2000_fieldcat_init
    FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: line_fieldcat TYPE slis_fieldcat_alv.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMNUM'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-key       = 'X'. 
      line_fieldcat-seltext_m = 'Notification No.'
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMART'.
      line_fieldcat-ref_tabname = 'I_DATA'.
      line_fieldcat-hotspot = 'X'.          
      line_fieldcat-seltext_m = 'Notif Type'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMTXT'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Description'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_ROW'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_m = 'Row Number'.
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'WS_CHAR'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Test Character Field'.
      line_fieldcat-datatype  = 'CHAR'.
      line_fieldcat-outputlen = '15'.    
      APPEND line_fieldcat TO i_fieldcat.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'CHK'.
      line_fieldcat-tabname   = 'I_DATA'.
      line_fieldcat-seltext_l = 'Checkbox'.
      line_fieldcat-checkbox  = 'X'.
      line_fieldcat-edit      = 'X'.
      APPEND line_fieldcat TO i_fieldcat.
    ENDFORM.                    " f2000_fieldcat_init
    Here i_fieldcat is the internal table u r passing to the function above. Just see how it is populated.
    Regs,
    Venkat

  • Create TYPE-POOlS

    how to create our own Type-pools?for using alv?

    hi,
    This is taken directly from the HELP.
    Type Groups
    Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPE addition in an ABAP program. It was only possible to refer to flat structures. Structures in programs corresponded to the structures of database tables or structures in the ABAP Dictionary. In ABAP programs, you could only refer to database tables and structures in the ABAP Dictionary using LIKE. It was, however, possible to refer to individual components of the Dictionary type. Complex local data types such as internal tables or deep structures had no equivalent in the ABAP Dictionary. The solution to this from Release 3.0 onwards was to use type groups. Type groups were based on the include technique, and allowed you to store any type definitions globally in the Dictionary by defining them using TYPES statements.
    The definition of a type group is a fragment of ABAP code which you enter in the ABAP Editor. The first statement for the type group <pool> is always:
    TYPE-POOL <pool>.
    After this came the definitions of data types using the TYPES statement, as described in Local Data Types in Programs. It was also possible to define global constants using the CONSTANTS statement. All the names of these data types and constants must begin with the name of the type group and an underscore:
    In an ABAP program, you must declare a type group as follows before you can use it:
    TYPE-POOLS <pool>.
    This statement allows you to use all the data types and constants defined in the type group <pool> in your program. You can use several type groups in the same program.
    Let the type group HKTST be created as follows in the ABAP Dictionary:
    TYPE-POOL hktst.
    TYPES: BEGIN OF hktst_typ1,
    col1(10) TYPE c,
    col2 TYPE i,
    END OF hktst_typ1.
    TYPES hktst_typ2 TYPE p DECIMALS 2.
    CONSTANTS hktst_eleven TYPE i VALUE 11.
    This type group defines two data types HKTST_TYP1 and HKTST_TYP2, as well as a constant HKTST_ELEVEN with the value 11.
    Any ABAP program can use this definition with the TYPE-POOLS statement:
    TYPE-POOLS hktst.
    DATA: dat1 TYPE hktst_typ1,
    dat2 TYPE hktst_typ2 VALUE '1.23'.
    WRITE: dat2, / hktst_eleven.
    The output is:
    1,23
    11
    The data types defined in the type group are used to declare data objects with the DATA statement and the value of the constant is, as the output shows, known in the program.
    ~~Guduri

  • Type pool: slis

    Hi experts
       pls could you explain what is TYPE-POOLS: SLIS clearly in ALV program. i want to know what is the basic structure of slis and what is type pool. thax heaps.......
    points awarded...
    kondal

    SLIS is a type pool or group and is nothing more than a collection of TYPE statements.  When you use the TYPE-POOLS: statement in your program, and name the type group SLIS, this gives you access to these TYPES so that you can use them in your DATA statements.  For example, if you want to declare an internal table for the field catalog.....
    type-pools: slis.
    data: ifldcat type slis_t_fieldcat_alv.
    Regards,
    RIch Heilman

  • Type pool

    what is the type pool used for placing a drop down list box on the module pool screen

    <b>TYPE-POOL</b>
    The introductory statement TYPE-POOL can only be used for type groups (type T programs). A program introduced with the TYPE-POOL statement can only contain global type definitions and constants declarations. The CLASS-POOL statement is generated automatically where required by the ABAP Dictionary - you should not insert it into programs manually.
    <b>example  for ALV</b>
    type-pools: slis.
    data:
    i_alv_fieldcat type slis_t_fieldcat_alv,
    i_alv_sortcat type slis_t_sortinfo_alv,
    i_alv_filtercat type slis_t_filter_alv,
    i_alv_eventcat type slis_t_event,
    i_alv_eventexitcat type slis_t_event_exit,
    i_alv_spgroupcat type slis_t_sp_group_alv,
    i_alv_excludingcat type slis_t_extab,
    w_alv_selhide type slis_sel_hide_alv,
    w_alv_isprint type slis_print_alv,
    w_alv_keyinfo type slis_keyinfo_alv,
    w_alv_layout type slis_layout_alv,
    w_alv_variant type slis_layout_alv,
    i_alv_list_top_of_page type slis_t_listheader,
    w_alv_save(1) type c value 'A',
    w_alv_default(1) type c value 'X',
    w_alv_interface_check type c,
    w_alv_sort_pos type i,
    w_alv_screen_start_column type i,
    w_alv_screen_start_line type i,
    w_alv_screen_end_column type i,
    w_alv_screen_end_line type i,
    w_percentage_old type i value 1.
    data: gt_events type slis_t_event,
    ls_event type slis_alv_event,
    g_repid type sy-repid,
    w_callback_subroutine type slis_formname,
    w_callback_program type sy-repid,
    w_no_zero(1) value 'X',
    w_alv_sortcat type slis_sortinfo_alv.
    data: t_header type slis_t_listheader,
    wa_header type slis_listheader,
    t_line like wa_header-info.
    reward points  if it is usefull ...
    Girish

  • Type pool program??

    Hi all,
    I want to write a type pool program.. but i could not see type pool in the pull down menu when you create a program from se38.. there was program types: 1, f, i, j, k, m, s but nothing for type pool. Please give me steps for creating one and also one example of such program by sap.
    Thanks,
    Charles.

    u can create type pool in se11 not se38....
    but use it in se38....
    in se11 u find 'type group'......give a name and create...
    for reference...u check SLIS type group....which we generally use in ALV...
    type pool or group and is nothing more than a collection of TYPE statements. When you use the TYPE-POOLS: statement in your program, and name the type group , this gives you access to these TYPES so that you can use them in your DATA statements.
    Regards
    Vasu

  • What is TYPE GROUP /TYPE-POOL?  When to use that ?

    hello friends
    Can any one tell me
    What is TYPE GROUP /TYPE-POOL?  When to use that ?
    Thanks & Best Regards
    Nilesh

    Type group
    If you want to define global constants, you have to use a type group. The name of
    the type group can only contain a maximum of five characters. In the type group,
    you can define constants using the CONSTANTS statement. As types, you are
    provided with the integrated ABAP types or the global types of the Dictionary.
    In order to be able to use the types of a type group in a program, make the type
    group known using the TYPE POOL statement. From these lines on, you can use
    all constants of the type group.
    The definition of a type group is a piece of ABAP code that is either maintained
    via the Dictionary (SE11) or via the ABAP Editor (SE38).
    Realization:
    The first statement for the type group zmytp is always:
    TYPE-POOL zmytp.This is followed by the definition of data types with the statement TYPES, as
    described under local program data types. Furthermore, cross-program constants
    can be declared using the CONSTANTS statement. All names of this data type
    and constants must begin with the name of the type group and an underline:
    zmytp_
    In an ABAP program, type groups must be made known with the following
    statements before they are used:
    TYPE-POOLS zmytp.
    When using this statement, all data types ansd constants, which are defined in the
    zmytp type group can be used in the program. Several type groups can be used
    in a program.

  • How to create type pools

    Hi Experts,
    I have a query like can we create custom "type pools". if yes, then what are the steps to create it.
    Thank you in advance.
    Samad.

    hi..
    Pls check the f1 help in ur system.
    It gives u  simple examples. Anyway,
    Typepool falls under - Data types.
    Data Types
    You can define program-local data types in ABAP programs that can be used for typing or declaring additional data types and data objects according to validity and visibility.
    The corresponding statements are:
    1. TYPE-POOLS
    2.  TYPES
    3.  INCLUDE TYPE
    TYPE-POOLS
    Syntax
    TYPE-POOLS tpool.
    Effect
    Declaring global data types and constants from a type group.
    The TYPE-POOLS statement declares the data types and constants of type group tpool You can specify it in the global data declarations of an ABAP program or in the declaration section of a class or interface. The data types and constants of the type group are visible as of this statement in the current context.
    Notes
    If the declared type group tpool integrates a further type group with the TYPE-POOLS statement, its data types and constants are also declared.
    ,,Data types declared using type groups cover ABAP Dictionary data types of the same name.
    Example
    Declaration of the predefined type group abap. By referring to the table type abap_func_parmbind_tab from the type group abap, the system declares an internal table parameter_tab for the dynamic parameter transfer to function modules.
    TYPE-POOLS abap.
    DATA parameter_tab TYPE abap_func_parmbind_tab.
    regards,
    Padma
    Edited by: Padmashree RamMaghenthar on Oct 13, 2008 11:18 AM

  • About type pools in ddic

    i would like to about type pools pls let me why we use this and how to create these type pools and what is the advantage of using type pools
    thanks in  advacnce
    kiran

    hi,
    <i>This is taken directly from the HELP.</i>
    <b>Type Groups</b>
    Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPE addition in an ABAP program. It was only possible to refer to flat structures. Structures in programs corresponded to the structures of database tables or structures in the ABAP Dictionary. In ABAP programs, you could only refer to database tables and structures in the ABAP Dictionary using LIKE. It was, however, possible to refer to individual components of the Dictionary type. Complex local data types such as internal tables or deep structures had no equivalent in the ABAP Dictionary. The solution to this from Release 3.0 onwards was to use type groups. Type groups were based on the include technique, and allowed you to store any type definitions globally in the Dictionary by defining them using TYPES statements.
    The definition of a type group is a fragment of ABAP code which you enter in the ABAP Editor. The first statement for the type group <pool> is always:
    <b>TYPE-POOL <pool>.</b>
    After this came the definitions of data types using the TYPES statement, as described in Local Data Types in Programs. It was also possible to define global constants using the CONSTANTS statement. All the names of these data types and constants must begin with the name of the type group and an underscore:
    In an ABAP program, you must declare a type group as follows before you can use it:
    TYPE-POOLS <pool>.
    This statement allows you to use all the data types and constants defined in the type group <pool> in your program. You can use several type groups in the same program.
    Let the type group HKTST be created as follows in the ABAP Dictionary:
    TYPE-POOL hktst.
    TYPES: BEGIN OF hktst_typ1,
    col1(10) TYPE c,
    col2 TYPE i,
    END OF hktst_typ1.
    TYPES hktst_typ2 TYPE p DECIMALS 2.
    CONSTANTS hktst_eleven TYPE i VALUE 11.
    This type group defines two data types HKTST_TYP1 and HKTST_TYP2, as well as a constant HKTST_ELEVEN with the value 11.
    Any ABAP program can use this definition with the TYPE-POOLS statement:
    TYPE-POOLS hktst.
    DATA: dat1 TYPE hktst_typ1,
    dat2 TYPE hktst_typ2 VALUE '1.23'.
    WRITE: dat2, / hktst_eleven.
    The output is:
    1,23
    11
    The data types defined in the type group are used to declare data objects with the DATA statement and the value of the constant is, as the output shows, known in the program.
    In short, type-pools or type groups are like little include programs where you store a bunch of TYPES statements. You can then use these types instead of defining them manually in your program. All you need to do is include the type-pool in your program.
    report ZXYZ_0001.
    Type-pools: slis.
    Data: qinfo_alv type slis_qinfo_alv.
    Regards,
    Anver

  • Creating Type-pools

    How can i create my own type-pools?

    HI
    Type Groups
    Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPE addition in an ABAP program. It was only possible to refer to flat structures. Structures in programs corresponded to the structures of database tables or structures in the ABAP Dictionary. In ABAP programs, you could only refer to database tables and structures in the ABAP Dictionary using LIKE. It was, however, possible to refer to individual components of the Dictionary type. Complex local data types such as internal tables or deep structures had no equivalent in the ABAP Dictionary. The solution to this from Release 3.0 onwards was to use type groups. Type groups were based on the include technique, and allowed you to store any type definitions globally in the Dictionary by defining them using TYPES statements.
    The definition of a type group is a fragment of ABAP code which you enter in the ABAP Editor. The first statement for the type group <pool> is always:
    TYPE-POOL <pool>.
    After this came the definitions of data types using the TYPES statement, as described in Local Data Types in Programs. It was also possible to define global constants using the CONSTANTS statement. All the names of these data types and constants must begin with the name of the type group and an underscore:
    In an ABAP program, you must declare a type group as follows before you can use it:
    TYPE-POOLS <pool>.
    This statement allows you to use all the data types and constants defined in the type group <pool> in your program. You can use several type groups in the same program.
    example :
    Let the type group HKTST be created as follows in the ABAP Dictionary:
    TYPE-POOL hktst.
    TYPES: BEGIN OF hktst_typ1,
                    col1(10) TYPE c,
                    col2 TYPE i,
           END OF hktst_typ1.
    TYPES hktst_typ2 TYPE p DECIMALS 2.
    CONSTANTS hktst_eleven TYPE i VALUE 11.
    This type group defines two data types HKTST_TYP1 and HKTST_TYP2, as well as a constant HKTST_ELEVEN with the value 11.
    Any ABAP program can use this definition with the TYPE-POOLS statement:
    TYPE-POOLS hktst.
    DATA: dat1 TYPE hktst_typ1,
          dat2 TYPE hktst_typ2 VALUE '1.23'.
    WRITE: dat2, / hktst_eleven.
    The output is:
    1,23
    11
    The data types defined in the type group are used to declare data objects with the DATA statement and the value of the constant is, as the output shows, known in the program.

  • Diff. bet TYPE-POOL & TYPE-POOLS

    Hi,
    Could anyone please tell me the difference b/w TYPE-POOL & TYPE-POOLS statements with some examples

    Oh, I think I see what you are talking about.  In a report program write this.
    report zrich_0002.
    type-pools slis.
    Now double click on the SLIS.  This takes you to the type pool.  This first statement in the code is TYPE-POOL.   This is just how you define the start of the type pool.  Sort of like REPORT ZRICH_0002 or FUNCTION ztest.  When developing a type pool you will begin the code by saying TYPE-POOL ZTEST.  Then, to use the type pool in your program, you will say TYPE-POOLS ZTEST.
    Make sense?
    Welcome to SDN. Please reward points for helpful answers and mark your post as solved if answered completely. Thanks.
    Regards,
    Rich Heilman

  • What type pool is used in ALV's

    Hi ,
           What type pool used in ALV's ? and How many secondary lists r possible in ALV's?
    Thanks & Regards,
    Gopi.

    SLIS
    i guess, no such limit,but not very sure about that.
    regards
    srikanth
    Message was edited by: Srikanth Kidambi

  • Do ALV Object oriented routines stored in SLIS type-pool?

    Do ALV Object oriented routines stored in SLIS type-pool?

    hi, suman
    i think
    Yes...
    thk u
    santhosh
    Edited by: santhosh kumar on Oct 16, 2008 12:00 PM

  • Need to use ALV instead of write:/ statement in this perform

    How can I use ALV within this perform instead of using Write:/ in it.
    Scroll the program. At the bottom there is use of write:/ statement.
    How to use ALV in this perform?
    FORM display_logfile .
      TYPES: BEGIN OF lt_openbal,
                bukrs TYPE bukrs,
                hkont TYPE hkont,
                augdt TYPE augdt,
                augbl TYPE augbl,
                zuonr TYPE dzuonr,
                gjahr TYPE gjahr,
                belnr TYPE belnr_d,
                buzei TYPE buzei,
                shkzg TYPE shkzg,
                dmbtr TYPE dmbtr,
             END OF lt_openbal,
             BEGIN OF lt_log2,
                hkont TYPE hkont,
                opbal TYPE dmbtr,
                exp   TYPE dmbtr,
                cap   TYPE dmbtr,
                err   TYPE dmbtr,
             END OF lt_log2,
             BEGIN OF lt_zsct_record,
                kongr TYPE ckml_kongr,
                hkont TYPE hkont,
                zcptp TYPE zdecptp,
                zerrc TYPE zdeerrc,
             END OF lt_zsct_record.
      DATA: lw_zscs_record  TYPE t_zscs_record,
            lw_zsct_record       TYPE lt_zsct_record,
            li_zsct_record         TYPE STANDARD TABLE OF lt_zsct_record,
            li_zsct_record1       TYPE STANDARD TABLE OF lt_zsct_record,
            lw_log1                  TYPE t_zscs_record,
            li_log1                   TYPE STANDARD TABLE OF t_zscs_record,
            li_temp                  TYPE STANDARD TABLE OF t_zsct_autoinv,
            li_openbal              TYPE STANDARD TABLE OF lt_openbal,
            li_openbal_mod      TYPE STANDARD TABLE OF lt_openbal,
            li_log2                   TYPE STANDARD TABLE OF lt_log2,
            li_log2_t                TYPE STANDARD TABLE OF lt_log2,
            lw_log2                 TYPE lt_log2,
            lw_log2_t               TYPE lt_log2,
            lw_openbal_mod    TYPE lt_openbal,
            lw_openbal            TYPE lt_openbal.
      i_zscs_record1 = i_zscs_record.
      DELETE i_zscs_record1 WHERE zerrf NE space.
      SORT i_error_bapi BY recid.
      SORT i_error_bdc BY recid.
      SORT i_suc_bdc BY recid.
      SORT i_suc_bapi BY recid.
      SORT i_zscs_record1 BY recid.
      LOOP AT i_zscs_record1 INTO lw_zscs_record.
        lw_log1-recid = lw_zscs_record-recid.
        lw_log1-kongr = lw_zscs_record-kongr.
        lw_log1-hkont = lw_zscs_record-hkont.
        CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
          EXPORTING
            input  = lw_zscs_record-projk
          IMPORTING
            output = lw_log1-projk.
        lw_log1-werks = lw_zscs_record-werks.
        lw_log1-matnr = lw_zscs_record-matnr.
        lw_log1-zcptp = lw_zscs_record-zcptp.
        lw_log1-zerrf = lw_zscs_record-zerrf.
    To  Check if the KONGR value is is equal to 'E'
        IF lw_zscs_record-kongr = c_e.
          READ TABLE i_error_bapi INTO w_error_bapi WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
          IF sy-subrc = 0.
            lw_log1-zerrc = w_error_bapi-number.
            lw_log1-zertx = w_error_bapi-message.
          ENDIF.
        ELSE.
          READ TABLE i_error_bdc INTO w_error_bdc WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
          IF sy-subrc = 0.
            lw_log1-zerrc = w_error_bdc-number.
            lw_log1-zertx = w_error_bdc-message.
          ENDIF.
        ENDIF.
    *****To Check if the KONGR value is is equal to 'E'
        IF lw_zscs_record-kongr = c_e.
          READ TABLE i_suc_bapi INTO w_suc_bapi WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
          IF sy-subrc = 0.
            lw_log1-zerrf = c_x.
    *******To check if  lw_log1-zertx = w_error_bapi-message.
          ENDIF.
        ELSE.
          READ TABLE i_suc_bdc INTO w_suc_bdc WITH KEY recid = lw_zscs_record-recid BINARY SEARCH.
          IF sy-subrc = 0.
            lw_log1-zerrf = c_x.
    ********To check if lw_log1-zertx = w_error_bdc-message.
          ENDIF.
        ENDIF.
        APPEND lw_log1 TO li_log1.
    *To clear work areas
        CLEAR: lw_log1,
               w_error_bapi,
               w_suc_bdc,
               w_suc_bapi,
               w_error_bdc,
               lw_zscs_record.
      ENDLOOP.
      IF NOT i_zscs_record1 IS INITIAL.
    *To retrieve required data from the custom table ZSCT_AUTOINV
        SELECT saknr
               fipos
               geber
               saknr_off
               fipos_off
          FROM zsct_autoinv
          INTO TABLE i_autoinv
           FOR ALL ENTRIES IN i_zscs_record1
           WHERE saknr = i_zscs_record1-hkont.
        IF sy-subrc = 0.
          SORT i_autoinv.
        ENDIF.
      ENDIF.
    Assigning I_AUTOINV data into a local internal table for further processing
      li_temp[] = i_autoinv[ ].
    Sort LI_TEMP by SAKNR
      SORT li_temp BY saknr.
    Delete adjacent duplicates from LI_TEMP comparing SAKNR
      DELETE ADJACENT DUPLICATES FROM li_temp COMPARING saknr.
    Check if LI_TEMP is initial
      IF NOT li_temp[] IS INITIAL.
    Retrieve required data from table BSIS for all the G/L accounts
        SELECT  bukrs
                hkont
                augdt
                augbl
                zuonr
                gjahr
                belnr
                buzei
                shkzg
                dmbtr
           FROM bsis
           INTO TABLE li_openbal_mod
           FOR ALL ENTRIES IN li_temp
         WHERE  bukrs = c_wfp
           AND  hkont = li_temp-saknr.
        IF sy-subrc = 0.
        ENDIF.
      ENDIF.
      SORT li_openbal_mod BY hkont.
    ****Retrieve data from table ZSCT_RECORD for further processing for
    ****all entries where ZERRF is equal to space
      IF p_prsall = c_x.
        SELECT kongr
               hkont
               zcptp
               zerrc
          FROM zsct_record                                  "#EC CI_NOFIRST
          INTO TABLE li_zsct_record
          WHERE zerrf = space.
        IF sy-subrc = 0.
    *****Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
          DELETE li_zsct_record WHERE hkont EQ space.
        ENDIF.
      ELSEIF p_cstcpt = c_x.
        SELECT kongr
               hkont
               zcptp
               zerrc
          FROM zsct_record                                  "#EC CI_NOFIRST
          INTO TABLE li_zsct_record
         WHERE zerrf = space
         AND   kongr NE c_e.
        IF sy-subrc = 0.
    ******Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
          DELETE li_zsct_record WHERE hkont EQ space.
        ENDIF.
      ELSEIF p_cstexp = c_x.
        SELECT kongr
               hkont
               zcptp
               zerrc
         FROM  zsct_record                                  "#EC CI_NOFIRST
         INTO TABLE li_zsct_record
         WHERE zerrf = space
         AND   kongr EQ c_e.
        IF sy-subrc = 0.
    ******Delete records from LI_ZSCT_RECORD where HKONT value is equal to space
          DELETE li_zsct_record WHERE hkont EQ space.
        ENDIF.
      ENDIF.
      LOOP AT li_openbal_mod INTO lw_openbal.
        IF lw_openbal-shkzg = c_shkzg1.
          v_todmbtr = v_todmbtr + lw_openbal-dmbtr.
        ELSEIF lw_openbal-shkzg = c_shkzg2.
          v_todmbtr = v_todmbtr - lw_openbal-dmbtr.
        ENDIF.
        AT END OF hkont.
          lw_log2-hkont = lw_openbal-hkont.           "GL account
          lw_log2-opbal = ABS( v_todmbtr ).      "Open item balance
          APPEND lw_log2 TO li_log2.
    *log record appended with GL Account and account open item balance
          CLEAR: v_todmbtr,
                 lw_openbal.
        ENDAT .
      ENDLOOP.
      SORT li_log2 BY hkont.
      LOOP AT li_log2 INTO lw_log2.
        CLEAR v_totexppe.
        CLEAR v_totcapit.
        CLEAR v_toterror.
    *Cost portion to be capitalised calculated
        LOOP AT li_zsct_record INTO lw_zsct_record
                 WHERE hkont = lw_log2-hkont AND
                  kongr NE c_e AND zerrc IS INITIAL.
          v_totcapit = v_totcapit + lw_zsct_record-zcptp.  "CC calculated
        ENDLOOP.
    *Expensed cost portion calculated
        LOOP AT li_zsct_record INTO lw_zsct_record WHERE
                hkont = lw_log2-hkont        AND
                kongr = c_e AND zerrc IS INITIAL .
          v_totexppe = v_totexppe + lw_zsct_record-zcptp.  "ECP calculated
        ENDLOOP.
    *Errors calculated
        LOOP AT li_zsct_record INTO lw_zsct_record WHERE
                hkont = lw_log2-hkont AND
                zerrc IS NOT INITIAL .
          v_toterror = v_toterror + lw_zsct_record-zcptp.  "Errors calculated
        ENDLOOP.
        lw_log2-exp = v_totexppe.           "Expensed cost portion
        lw_log2-cap = v_totcapit.           "Cost capitalised
        lw_log2-err = v_toterror.           "Errors
    *Cost portion capitalised expensed and errors in calculation are
    *trans ported for related GL accont
        MODIFY li_log2 FROM lw_log2
        TRANSPORTING exp cap err.
      ENDLOOP.
      LOOP AT li_log2_t INTO lw_log2_t.
        MODIFY li_log2 FROM lw_log2_t TRANSPORTING opbal WHERE hkont = lw_log2_t-hkont.
        CLEAR : lw_log2_t.
      ENDLOOP.
      WRITE:/1(15) text-018,sy-datum.             "SESSION DATE:
      SKIP 2.
    For printing the hear level of the output log
      WRITE:/1(16)   text-003,                     "Record ID number
             20(11)  text-004,                     "Reason Code
             34(10)  text-005,                     "GL Account
             47(12)  text-006,                     "Project Code
             62(5)   text-007,                     "Plant
             70(9)   text-008,                     "Commodity
             82(25)  text-009,                     "Cost portion To be posted
             110(12) text-010,                     "Success Flag
             125(10) text-011,                     "Error Code
             138(50) text-012.                     "Error TXT
      SKIP.
      LOOP AT li_log1 INTO lw_log1.
        WRITE:/1(16)   lw_log1-recid,
               20(11)  lw_log1-kongr,
               34(10)  lw_log1-hkont,
               47(12)  lw_log1-projk,
               62(5)   lw_log1-werks,
               70(9)   lw_log1-matnr,
               82(25)  lw_log1-zcptp,                       "#EC UOM_IN_MES
               110(12) lw_log1-zerrf,
               125(10) lw_log1-zerrc,
               138(80) lw_log1-zertx.
        CLEAR:lw_log1.
      ENDLOOP.
      SKIP 2.
      IF NOT li_log2 IS INITIAL.
        ULINE.
        WRITE:/1(16)  text-013,                  "GL ACCOUNT CODE
               20(17) text-014,                  "OPEN ITEM BALANCE
               40(21) text-015,                  "EXPENSED COST PORTION
               64(24) text-016,                  "CAPITALIZED COST PORTION
               92(20) text-017.                  "ERRORS.
        LOOP AT li_log2 INTO lw_log2.
          WRITE:/1(16)   lw_log2-hkont,
                 20(17)  lw_log2-opbal,                
                 40(21)  lw_log2-exp,                      
                 64(24)  lw_log2-cap,                     
                 92(20)  lw_log2-err.                     
          CLEAR:lw_log2.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " DISPLAY_LOGFILE

    hi,
    You need to use FM 'REUSE_ALV_LIST_DISPLAY' for this purpose. For using this FM, you need to create a field catlog which will contain all information about the coloumns you want to display for example their position, their text etc.
    Below there is a small demo for achiving this.
    TYPE-POOLS:slis.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    TYPES: BEGIN OF ty_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF ty_itab1.
    DATA: itab1 TYPE TABLE OF ty_itab1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    START-OF-SELECTION.
      PERFORM select_data.
    END-OF-SELECTION.
    PERFORM display.
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program       = sy-repid
           i_callback_pf_status_set = c_pf_status
            i_callback_user_command  = 'USER_COMMAND '
           it_events                = t_alv_events[]
            it_fieldcat              = i_fieldcat[]
          TABLES
            t_outtab                 = itab1[]
          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.
      ENDIF.
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.

  • ALV without colors

    Hi All,
    Is it possible to display ALV without colors ?
    If yes pls help me....
    Dilip

    Hi Dilip,
    Try this code,
    REPORT ZTEST.
    TYPE-POOLS : SLIS.
    DATA: BEGIN OF IT_VBAK OCCURS 0,
            VBELN LIKE VBAK-VBELN,
            ERDAT LIKE VBAK-ERDAT,
          END OF IT_VBAK.
    DATA : FLD_CAT TYPE SLIS_T_FIELDCAT_ALV,
    FLD TYPE SLIS_FIELDCAT_ALV .
    DATA:V_REPID LIKE SY-REPID.
    START-OF-SELECTION.
      V_REPID = SY-REPID.
      SELECT VBELN ERDAT FROM VBAK INTO TABLE IT_VBAK.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = V_REPID
         I_INTERNAL_TABNAME           = 'IT_VBAK'
        I_STRUCTURE_NAME             =
         I_INCLNAME                   = V_REPID
        CHANGING
          CT_FIELDCAT                  = FLD_CAT
       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.
      LOOP AT FLD_CAT INTO FLD.
        CASE FLD-FIELDNAME.
          WHEN 'VBELN'.
            FLD-KEY = ' '.
            MODIFY FLD_CAT FROM FLD.
        ENDCASE.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM             = V_REPID
         IT_FIELDCAT                    = FLD_CAT
        TABLES
          T_OUTTAB                       = IT_VBAK
       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.
    Thanks
    Lakshman

Maybe you are looking for

  • Error message not displayed in a pop up

    Hi , I have a pop up screen in my web dynpro  with a input field and two buttons. i have a error message written in the WDDOBEFOREACTION method of my pop up window. But the message is not displayed on the window. But If the same is written in the eve

  • Inconsistent playback on a big external drive

    I recently consolidated my iTunes songs onto one hard-drive; running 7.0.1 on a late model pre-intel 1,25 ghz, 1gb RAM MacMini. It's a lot of material, over 400 gb. When I used to have the songs split over two roughly equal sized drives, one drive wo

  • Project Server 2010 - Import Project Wizard - Local Resource Import Error

    Using Project Server 2010 SP2 with admin rights when I encountered the following error: Steps: Upon importing a local mpp file with Import Projects Wizard Mapped Resources.  Some were mapped to enterprise resources and others were left as local. Foll

  • Problem with onBlur=validate_int_range javascript function

    Hi i have a java script function which is use to check for the range of the integer i enter. The function works fine but the problem is once i click ok on the validation boxes that come up when i enter a wrong value it allows me to click the submit b

  • Autonomous to LWAPP upgrade failure on 1242ag AP

    Using upgrade tool I'm trying to convert an autonomous AIR-AP1242AG-A-K9 AP to LWAPP but the upgrade fails when it tries to load the recovery image onto the AP. Has anyone run into this issue and if so what is the fix? Running 12.3(11)JA IOS on the A