How to display this in ALV

Hi,
Can anyone tell how I will get the following output in ALV grid?
  some records (or items) are starts from second column onwards and some from third colum onwards ...
thanks in advance.

Hi Munvar,
     When you display the ALV you need to pass the values in the form of internal table. now its upto you to decide the field catalog of the ALV grid and you can insert your own logic to display the ALV grid where in the records can be seen in the second or third column depending upon the field position of the internal table.
To display the ALV grid here is an example.
data : itab2 type table of <table>.
x_fieldcat-fieldname = '<field1>'.
x_fieldcat-tabname = '<table>'.
x_fieldcat-col_pos  = 1.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
x_fieldcat-fieldname = '<field2>'.
x_fieldcat-tabname = '<table>'.
x_fieldcat-col_pos  = 2.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
select * from <table> into table itab2.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat              = it_fieldcat
TABLES
t_outtab                 = itab2
EXCEPTIONS
program_error            = 1
others                   = 2.
if
sy-subrc  = 0.
endif.
endform.                  
Hope this helps.
Regards,
Kinshuk

Similar Messages

  • How to display total in ALV Header

    How to display total in ALV Header?

    Hi Venkey,
    As far as your issue is concerned I would like to quote my perception.
    Create a header internal table with title and number of records.
    At the later part of your program you should have found the total number of records ,now assign it to the header internal table and print it.
    For further clarification you can go check this link:
    http://wiki.sdn.sap.com/wiki/display/ABAP/AddHeadertoALVreport
    Thanks
    P.Srikanth

  • How to display LOGO in ALV grid when using class CL_GUI_ALV_GRID

    Hello everyone,
    please let me know how to display Company logo as the header part in the report program with the class cl_gui_alv_grid.
    Thanks and regards,
    Padma.

    Hi,
    Got this info from a site.
    http://sap.ittoolbox.com/documents/document.asp?i=3213
    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    Try this one.
    Also have a look at this link
    http://www.sap-img.com/fu002.htm
    Message was edited by: Judith Jessie Selvi

  • How to display an OO ALV in a Popup?

    The ALV will be non-editable but it has to be able to have the hotspot functionality, so it has to be done in OO. Is there any function module that will display my OO alv as a popup?

    * Show as popup
       CALL METHOD gr_grid->set_screen_popup( EXPORTING start_column = 10
                                                        end_column = 130
                                                        start_line = 5
                                                        end_line = 15 ).
    * Define a column as hotspot
    DATA:
              lr_columns TYPE REF TO cl_salv_columns_table,
               lr_column TYPE REF TO cl_salv_column,
               lr_cols   TYPE REF TO cl_salv_columns,
               lr_column_list TYPE REF TO cl_salv_column_list.
      lr_cols = lr_columns.
      lr_columns = gr_grid->get_columns( ).
      lr_column_list ?= lr_cols->get_column( 'MYCOLUMN' ).
      lr_column_list->set_cell_type( if_salv_c_cell_type=>hotspot ).

  • How to convert this into alv display and also change parameterstoselect opt

    tables :mara,marc,stpo.
    parameters: p_werks like t001w-werks obligatory,
    p_matnr like mara-matnr obligatory.
    *select-options : p_matnr for mara-matnr obligatory.
    *parameters: p_werks like marc-werks obligatory,
    *p_matnr like marc-matnr obligatory.
    constants c_x value 'X'.
    data: begin of it_comp occurs 0,
    idnrk like stpox-idnrk,
    ojtxp like stpox-ojtxp,
    menge like stpox-menge,
    meins like stpox-meins,
    matkl like stpox-matmk,
    end of it_comp.
    data: w_topmat like cstmat.
    start-of-selection.
    perform explode_assembly.
    end-of-selection.
    perform write_report.
    top-of-page.
    perform print_header.
    form print_header.
    write: /(18) 'Component'(h00),
    (40) 'Description'(h01),
    'Mat.Group'(h02),
    (18) 'Quantity'(h03).
    uline.
    endform.
    form write_report.
    write: / w_topmat-matnr under text-h00 color col_heading,
    w_topmat-maktx under text-h01 color col_heading.
    loop at it_comp.
    write: /
    it_comp-idnrk under text-h00,
    it_comp-ojtxp under text-h01,
    it_comp-matkl under text-h02,
    it_comp-menge unit it_comp-meins under text-h03,
    it_comp-meins.
    endloop.
    uline.
    endform.
    form explode_assembly.
    data: it_stb like stpox occurs 0 with header line,
    it_stb2 like stpox occurs 0 with header line,
    it_stb3 like stpox occurs 0 with header line,
    w_msg(255) type c.
    Explode highest level:
    call function 'CS_BOM_EXPL_MAT_V2'
    exporting
    auskz = c_x
    capid = 'PP01'
    cuols = c_x
    datuv = sy-datum
    knfba = c_x
    ksbvo = c_x
    mbwls = c_x
    mdmps = c_x
    BGIXO = c_x
    MKMAT = c_x
    MMAPS = c_x
    FBSTP = c_x
    FTREL = c_x
    mtnrv = p_matnr
    werks = p_werks
    importing
    topmat = w_topmat
    tables
    stb = it_stb
    exceptions
    alt_not_found = 1
    call_invalid = 2
    material_not_found = 3
    missing_authorization = 4
    no_bom_found = 5
    no_plant_data = 6
    no_suitable_bom_found = 7
    conversion_error = 8
    others = 9.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into w_msg.
    write: / w_msg.
    exit.
    endif.
    Don't process documents
    delete it_stb where idnrk is initial.
    Don't process valid from furure:
    delete it_stb where datuv >= sy-datum.
    Explode phantom assemblies up to last level
    *do.
    it_stb2[] = it_stb[].
    *delete it_stb2 where dumps is initial.
    *if it_stb2[] is initial.
    *exit.
    *endif.
    *delete it_stb where not dumps is initial.
    delete it_stb where VPRSV <> 'S' OR MMSTA = '61'.
    loop at it_stb2.
    call function 'CS_BOM_EXPL_MAT_V2'
    exporting
    capid = 'PP01'
    auskz = c_x
    cuols = c_x
    datuv = sy-datum
    knfba = c_x
    ksbvo = c_x
    mbwls = c_x
    mdmps = c_x
    FBSTP = c_x
    FTREL = c_x
    mtnrv = it_stb2-idnrk
    werks = p_werks
    tables
    stb = it_stb3
    exceptions
    alt_not_found = 1
    call_invalid = 2
    material_not_found = 3
    missing_authorization = 4
    no_bom_found = 5
    no_plant_data = 6
    no_suitable_bom_found = 7
    conversion_error = 8
    others = 9.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into w_msg.
    write: / w_msg.
    else.
    delete it_stb3 where idnrk is initial.
    delete it_Stb3 where sobsl = 50.
    loop at it_stb3 .
    multiply it_stb3-menge by it_stb2-menge.
    modify it_stb3 transporting menge.
    endloop.
    append lines of it_stb3 to it_stb.
    endif.
    endloop.
    *enddo.
    Build table of components collecting the same components from
    all levels
    loop at it_stb.
    it_comp-matkl = it_stb-matmk.
    it_comp-idnrk = it_stb-idnrk.
    it_comp-ojtxp = it_stb-ojtxp.
    it_comp-menge = it_stb-menge.
    it_comp-meins = it_stb-meins.
    collect it_comp.
    clear it_comp.
    endloop.
    ENDFORM.
    using this i got the bom explosion and also i tried to use the following code
    to diplay alv diplay,but i got the errormsg,
    here  i got only one material input,instead of i want to use
    select options to from to ,if i give 1 to 10 material
    ouput is
    material 1
    descripn
    bom and components
    materials 2
    desc
    bom comp
    TYPE-POOLS : SLIS.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : WA_FIELDCAT_LN LIKE LINE OF IT_FIELDCAT.
    DATA : IT_EVENTCAT  TYPE SLIS_T_EVENT.
    DATA : WA_EVENTCAT_LN  LIKE LINE OF IT_EVENTCAT.
    DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: S_COL_POS TYPE I.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : WA_FIELDCAT_LN LIKE LINE OF IT_FIELDCAT.
    DATA : IT_EVENTCAT  TYPE SLIS_T_EVENT.
    DATA : WA_EVENTCAT_LN  LIKE LINE OF IT_EVENTCAT.
    DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: S_COL_POS TYPE I.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : WA_FIELDCAT_LN LIKE LINE OF IT_FIELDCAT.
    DATA : IT_EVENTCAT  TYPE SLIS_T_EVENT.
    DATA : WA_EVENTCAT_LN  LIKE LINE OF IT_EVENTCAT.
    DATA : IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: S_COL_POS TYPE I.
    FORM BUILD_FIELDCATALOG.
      PERFORM BUILD_FIELDCAT USING 'MATKL'.
      PERFORM BUILD_FIELDCAT USING 'IDNRK.
      PERFORM BUILD_FIELDCAT USING 'OJTXP.
    PERFORM BUILD_FIELDCAT USING 'MENGE'.
    PERFORM BUILD_FIELDCAT USING 'MEINS'.
    ENDFORM.
    FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
    FORM BUILD_FIELDCAT USING L_FIELDNAME LIKE DD03L-FIELDNAME S_TEXT LIKE DD03P-SCRTEXT_M.
      CLEAR WA_FIELDCAT_LN.
      ADD 1 TO S_COL_POS.
      WA_FIELDCAT_LN-REF_TABNAME  = 'IT_COMP'.
      WA_FIELDCAT_LN-FIELDNAME    = L_FIELDNAME.
      WA_FIELDCAT_LN-SELTEXT_M    = S_TEXT.
      WA_FIELDCAT_LN-COL_POS      = S_COL_POS.
      WA_FIELDCAT_LN-QFIELDNAME   = SPACE.
      WA_FIELDCAT_LN-HOTSPOT      = SPACE.
      WA_FIELDCAT_LN-JUST         = 'R'.
      APPEND WA_FIELDCAT_LN TO IT_FIELDCAT.
    ENDFORM.
    FORM TO BUILD IN FIELD CATALOG FOR ALV FORM
    FORM DATA_DISPLAY.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = TEXT-001
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = IT_FIELDCAT
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_COMP
       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.
    GIVE ME SOLUTION FOR THAT ON, VERY URGENT
    THANKS IN ADVANCE
    regards
    ds

    Hi
    declare select-options instead of parameters
    for converting a report to ALV
    create a field catalog.
    for this two option declare a itab with       
    fcat    TYPE slis_t_fieldcat_alv
    and pass the field name,descr etc to fcat and append the same.
    or create structur same as your itab and pass the same with FM
    'REUSE_ALV_FIELDCATALOG_MERGE'
    use either <b>reuse_alv_grid_display or reuse_alv_list_display</b> .
    and pass the itab.
    thanks
    Shiva

  • How to Display Logo in ALV Header?

    Hi
    I want to display/ print my company logo image in ALV Header. Please help me how can I do this?
    Thanks
    Iftikhar Ali
    Islamabad.

    Hi,
    If you are already   having a logo say ZLOGO .
    You can use it this way .
    Give TOP-OF-PAGE
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    And in top of page do this .
    FORM top-of-page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRIT
      EXPORTING
       IT_LIST_COMMENTARY       = IT_LISTHE
       i_logo                   = 'ZLOGO'
      I_END_OF_LIST_GRID       =
    endform.
    Hope this will work .
    Reward if found useful.
    Regards
    SureshP.

  • How to display rsa3 with ALV grid

    Hello,
    In some of tyhe systems i'm working with, RSA3 have a button to display the data in ALV grid. I checked and it's not because of the support package. Cab someone please advice how to add the ALV functionality.
    Thanks,
    Amir
    Edited by: Amir Dror on Jan 13, 2009 12:41 PM

    Hello,
    we had the same question and problem.
    SAP told us via OSS the following:
    "... The ALV grid in RSA3 will be supported with the PI_BASIS 2006_1_700.
    But you have PI_BASIS 2005_1_700
    Furthermore this software component PI_BASIS is independent from the
    BW releases so that you can upgrade the latest support packages of the
    PI_BASIS 2006_1_700 in source system"
    So if you have PI_BASIS 2005 you won't have the functionality of ALV grid in TC RSA3.
    (remark: At the moment I can not confirm that ALV grid in RSA3 is available with PI_BASIS 2006_x_xxx. We plan to upgrade in a few month.)
    Best regards

  • How to display icon in alv report output

    hi,
    my ewquirement in in alv report in one column to diaplay the icon(tickmark) based on some codition.
    how to achieve it??
    condition is
    Affected (Locked on Current ECM) u2013 can use symbols    for affected and   for changing u2013
    u2022     Lock AEOI u2013 CCLCK for AE01-OBJKT (Material) lock.
    Condition:
      If AEOI u2013 CCLCK is activated then display symbols  (tickmark)  in line of their AE01-OBJKT (Material). else display
    (x mark)

    Hi,
    In field catalog of grid set
    Ex--
    when 'Field'.
      lwa_fcat-icon      = c_true.
    based on your condition
    set the desired icon in table.
    Ex.... lwa_table-field = icon_tick.

  • How to display data in alv through double click

    Hello Friends,
    I am new to this community,please tell me if I make any mistake while posting.
    Friends I had written this code. ALV is displayed at first time but when I am double clicking on the row then error is coming related to mismatch of actual and formal paramaters while calling function 'USER_COMMAND'. I am unable to locate where the error is. Please help me out.
    REPORT  ZALV12.
    TYPE-POOLS SLIS.
    DATA: it_vbak type standard table of VBAK,
          it_vbap type table of VBAP.
    DATA: wa_vbak like line of it_vbak,
          wa_vbap like line of it_vbap.
    DATA syrepid like sy-repid.
    DATA:fld_vbak type SLIS_T_FIELDCAT_ALV,
          fld_vbap type SLIS_T_FIELDCAT_ALV.
    DATA:fld_wa_vbak type SLIS_FIELDCAT_ALV,
         fld_wa_vbap type SLIS_FIELDCAT_ALV.
    DATA:vevent type SLIS_T_EVENT,
         waevent type SLIS_ALV_EVENT.
    DATA:LST_HEADR type SLIS_T_LISTHEADER.
    DATA title_alv type LVC_TITLE value 'LIST FOR VBAK'.
    INITIALIZATION.
    syrepid = sy-repid.
    perform get_event.
    perform populate_event.
    perform set_list_headr using LST_HEADR.
    perform field_cat.
    START-OF-SELECTION.
    .....                       "code for displaying data from table VBAK in ALV.
    form USER_COMMAND using R_UCOMM type SY-UCOMM.           "error is in this function.
        data r_selfield type SLIS_SELFIELD.
        case R_UCOMM.
         when '&IC1'.
           read table it_vbak into wa_vbak index r_selfield-TABINDEX.
            perform data_select.
            perform list_heading using LST_HEADR.
            perform event_get.
            perform build_event.
            perform alv_display.
        endcase.
    endform.
    form data_select.
       select * from VBAP into table it_vbap up to 20 rows.
    endform.
    form list_heading using i_lst type SLIS_T_LISTHEADER.
       data HLINE type SLIS_LISTHEADER.
       HLINE-TYP = 'H'.
       HLINE-INFO = 'FOR VBAP'.
       append HLINE to i_lst.
    endform.
    form alv_display.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           I_CALLBACK_PROGRAM                = syrepid
          I_STRUCTURE_NAME                  = 'VBAP'
           I_GRID_TITLE                      = 'SCREEN2_VBAP'
         TABLES
           T_OUTTAB                          = it_vbap
       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.
       form event_get.
         CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
             I_LIST_TYPE           = 0
         IMPORTING
             ET_EVENTS             = vevent
         EXCEPTIONS
           LIST_TYPE_WRONG       = 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.
      endform.
      form build_event.
        read table vevent into waevent with key name = 'TOP_OF_PAGE'.
        if sy-subrc = 0.
          waevent-form = 'F_TOP_OF_PAGE'.
          modify vevent from waevent transporting form
          where name = 'TOP_OF_PAGE'.
          endif.
      endform.
      form F_TOP_OF_PAGE.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = LST_HEADR
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
          I_ALV_FORM               =
      endform.

    You missed one paramete in user_command form
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    Regards,
    Raymond

  • How to display subtotal in ALV, where the field is not a numeric.

    Hi
    We are having a requirement to display the sub total for a field using ALV grid display, where the field is not numeric.
    The field is characte, Status field(consists of values Submit, Approve ,Reject), where the subtotal should be value of count of group by status .
    say status with submit are 10 records, so after all records with submit status are, displyed, we need to display its subtotal as 10.
    Thanks & Advance

    Hi Satya,
    REPORT z_alv_subtotal.*&---------------------------------------------------------------------*
    *& Table declaration
    *&---------------------------------------------------------------------*TABLES: ekko.*&---------------------------------------------------------------------*
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV*&---------------------------------------------------------------------*
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.*&---------------------------------------------------------------------*
    *& Type declaration
    *&---------------------------------------------------------------------** Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.*&---------------------------------------------------------------------*
    *& Internal table declaration
    DATA:* Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    * Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    * Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    * Internal table for ALV Display events
      i_events TYPE slis_t_event,
    * Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.*&---------------------------------------------------------------------*
    *& Work area declaration
    *&---------------------------------------------------------------------*DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.*&---------------------------------------------------------------------*
    *& Constant declaration
    *&---------------------------------------------------------------------*CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.*&---------------------------------------------------------------------*
    *& Start-of-selection event
    *&---------------------------------------------------------------------*START-OF-SELECTION.* Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material
             matnr " Material
             werks " Plant
             werks " Plant
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.  IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.* To build the Page header
      PERFORM sub_build_header.* To prepare field catalog
      PERFORM sub_field_catalog.* Perform to populate the layout structure
      PERFORM sub_populate_layout.* Perform to populate the sort table.
      PERFORM sub_populate_sort.* Perform to populate ALV event
      PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
    *       To build the header
    *       No Parameter
    FORM sub_build_header .* Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    * Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.* Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
    *       Build Field Catalog
    *       No Parameter
    FORM sub_field_catalog .*  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:     '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',     '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',     '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',     '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.                    " sub_field_catalog*&---------------------------------------------------------------------*
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.* Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.  wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table  IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog*&---------------------------------------------------------------------*
    *&      Form  sub_populate_layout
    *       Populate ALV layout
    *       No Parameter
    FORM sub_populate_layout .  CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM.                    " sub_populate_layout*&---------------------------------------------------------------------*
    *&      Form  sub_populate_sort
    *       Populate ALV sort table
    *       No Parameter
    FORM sub_populate_sort .* Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.* Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort*&---------------------------------------------------------------------*
    *&      Form  sub_get_event
    *       Get ALV grid event and pass the form name to subtotal_text
    *       event
    *       No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.  DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.* Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.ENDFORM.                    " sub_get_event*&---------------------------------------------------------------------*
    *&      Form  sub_alv_report_display
    *       For ALV Report Display
    *       No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .* This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    *    MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.ENDFORM.                    " sub_alv_report_display*&---------------------------------------------------------------------*
    *       FORM sub_alv_top_of_page
    *       Call ALV top of page
    *       No parameter
    *---------------------------------------------------------------------*FORM sub_alv_top_of_page.                                   "#EC CALLED* To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page*&---------------------------------------------------------------------*
    *&      Form  subtotal_text
    *       Build subtotal text
    *       P_total  Total
    *       p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    * Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.* Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Regards,
    Pravin

  • How to display logo in alv grid display

    Hi, i am using 'REUSE_ALV_COMMENTARY_WRITE' to display logo. but i couldn't get in the output.
    plain explain how use this functoin module.
    DATA  :  it_listheader   TYPE slis_t_listheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheader
          i_logo             = 'LOGO'.

    hi
    i am doing month wise customer sale report.
    the output should like that
    month   customer1    customer2   customer3  customer 4  total
    jan       100                200           200              -                500
    feb                                            300                               300
    mar
    apr
    total   100                200              500                            800
    i want to do this dynamicaly.
    let me know how can i display customer as a header.

  • How to display this  ... ?

    Hi all,
    I have two data model where each one generate data as example below :-
    Data Model A
    Reqnum __ Data
    10671____ Submit
    10671____ Forward
    10671____ Approved
    10672____ Submit
    10672____ Forward
    10672____ Approved
    10673____ Submit
    10673____ Forward
    10673____ Approved
    Data Model B
    Reqnum ____Item ____ Qty
    10671 ____12458____ 15
    10671 ____22222____ 36
    10672 ____45485____ 86
    10673 ____12212____ 14
    10673 ____23233____ 3
    10673 ____11212____ 1
    My expected output is something like this :-
    Reqnum__ Action
    10671____ Submit
    10671____ Forward
    10671____ Approved
    Item______Qty
    12458_____ 15
    22222_____ 36
    Reqnum Action
    10672____ Submit
    10672____ Forward
    10672____ Approved
    Item_____ Qty
    45485____ 86
    and carry on to print 10673 and so on. How to link between the two data model, where in range of searching as above, I need to display the details of data in data model A first and link to data model B. It will carry on until the end of search.
    Please helps!!
    Rgds
    Lim

    Hi
    Sorry for not giving more details... I meant something like this:
    select distinct reqnum
    from tablea -- your data model A table
    union
    select distinct reqnum
    from tableb -- your data model B table
    The "union" is only required if there are reqnums that exist in tableb but not in tablea. It it is not the case, you can use just:
    select distinct reqnum
    from tablea

  • How to display tooltip in ALV GRID CELL?

    Hello,
    I'm trying to display dynamic tootips for data in ALV GRID Cells.
    My ALV Gid Cells content does not display Icon or symbol or Exception but pure data (In my case dates).
    Is there a way to do display a toolip that will change dynamicaly according to a rule.
    I took a look at the BCALV_DEMO_TOOLTIP program
    but it does not answer my expectation since it display
    toltip for Icon or symbol or Exception.
    Can someone help on this case.
    Best regards
    Harry

    Hai Harry
    •     icon
    value set: SPACE, 'X'           'X' = column contents to be output as an icon.
    The caller must consider the printability of icons.
    •     symbol
    value set: SPACE, 'X'          'X' = column contents are to be output as a symbol.
    The internal output table column must be a valid symbol character.
    The caller must consider the printability of symbols.
    Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.
    Thanks & regards
    Sreenu

  • How to display image on alv display screen

    Hi All,
    I am using "REUSE_ALV_GRID_DISPLAY" function module for display a simple report.
    I want to add a logo also on that output screen. Can anyone tell me how i can do that?
    Thanks and Regards,
    Nidhi Srivastava.

    Yes.
    But you have to paint the image after the native component has painted the text, to avoid the native component from erasing your image. Something like this should work.
    class MyTextField extends TextField implements Runnable
       public void paint(Graphics g)
          super.paint(g);
          new Thread(this).start();
       public void run()
          Thread.yield();
          Graphics g = getGraphics();
          g.drawImage(....)

  • How to display picture in alv

    how can we display our own images in an alv output...

    hi,
    first import the logo from desktop using se78.
    then use the function module in alv program.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = IT_LISTHEADER
       I_LOGO                   = 'RAJI'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    thanks,
    raji

Maybe you are looking for

  • Report Developer Control Of Applying Hints to Analytics Queries

    There are numerous ways to apply hints to the queries generated by Analytics: - Table level - Join level - Evaluate calculation Each has its advantages and drawbacks. - Table level: applies the hint to every query that references the table. - Join le

  • Ipod touch 5 headphone jack not working please help?

    I have tried with multiple pairs of earbuds/ headphones. Either there will be audio in the left, or right, but usually never at the same time unless you twiddle with the headphone plug in. Sometimes there's no audio. I only got the ipod in December,

  • Can't delete podcast from nano

    My wife has a nano and now has a podcast on it that we can't get off. On the iTunes screen, she has a "D's iPod" node and a "D's iPod Selection" node. The "D's iPod Selection" has all the songs she wants on the iPod. She then right-clicks on the "D's

  • Is my NX6600GT-TD128E faulty?

    I bought the MSI NX6600GT-TD128E in February of 2005. I haven't touched it since I first put it into my computer and it has been working fine for the past two years. For the past month or so whenever I run something that uses accelerated graphics the

  • Gnome 3.4.1 update 'menu' key shortcut

    Hi, Im very disappointed that after last gnome update to 3.4.1 version its not possible to assign a key shortcut to single 'menu' key... very bat thing happend... I allways used to have terminal assigned to that key. So, is there any way to get reaso