ALV output with different Titles

Hi,
I have one requirement,that we have set of radibuttons in selection screen.
when we are selecting that radiobutton ALV out put will be displayed.
but user wants the description of the selected radio button in Menu Title Bar of AlV out put.
can any one help me to know ,what is approach to sort this...?
Thanks...

Hi Sekhar,
go through this thread.
Changing title bar of ALV  list
also try this code patch.
start-of-selection.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'TEST'.
write 'hi'.
at user-command.
if sy-ucomm = 'TEST'.
MESSAGE 'HI' TYPE 'I'.
ENDIF.
Regards,
Vijay

Similar Messages

  • Display amount in ALV Grid with different Decimal Places based on Currency

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2.
    we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65
    i need to display values like AED : 22.56

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2. we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65 (converting this value to 22.565 using BAPI_CURRENCY_GETDECIMALS according to currency in my Report)
    i need to display values like AED : 22.56
                                             KWD---22.565 but here field is NETWR with 2 decimal.
    Need to Display amount in ALV Grid with different Decimal Places based on Currency
    Regards,
    Dileep Kumar Reddy

  • ALV BLOCK with frame titles

    Hi all,
    I need an example of ALV Blocks with frame titles.
    Can anyone help me?
    Regards,
    Roxana

    Hi,
    Check this link for ALV block list..
    https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ProgramforALVBlocklist
    Not sure what do you mean by WITH FRAME TITLE.
    Thanks,
    Naren

  • How to get ALV Output with selected Layout

    I have a program which displays the output in ALV list format and i changed the layout and saved
    In the selection-screen i have a field to select the layout after selecting the layout it output is not coming with that layout
    can anyone tell me what is the problem
    or give me a sample code
    Thank you

    Hi,
    Check this code.
    Hope it helps.
    *& Report  zSALES_ORDER
    report  z_sales_order.
    type-pools: slis.
    *DATA DECLARATION.
    types: begin of i_vbak,
           vbeln type vbeln_va,
           augru type augru,
           erdat type erdat,
           end of i_vbak.
    types: begin of i_vbap,
           vbeln type vbeln_va,
           augru type augru,
           posnr type posnr_va,
           matnr type matnr,
           zmeng type dzmeng,
           end of i_vbap.
    types: begin of i_makt,
           matnr type matnr,
           maktx type maktx,
           end of i_makt.
    types: begin of i_lips,
           posnr type posnr_vl,
           matnr type matnr,
           lfimg type lfimg,
           end of i_lips.
    types: begin of i_reason,
           spras type spras,
           augru type augru,
           bezei type bezei40,
           end of i_reason.
    types: begin of i_vbpa,
           vbeln type vbeln,
           parvw type parvw,
           kunnr type kunnr,
           end of i_vbpa.
    types: begin of i_kna1,
           kunnr type kunnr,
           name1 type name1_gp,
           end of i_kna1.
    types: begin of i_final,
           vbeln type vbeln_va,
           posnr type posnr_va,
           matnr type matnr,
           zmeng type dzmeng,
           maktx type maktx,
           lfimg type lfimg,
           spras type spras,
           augru type augru,
           bezei type bezei40,
           parvw type parvw,
           kunnr type kunnr,
           name1 type name1_gp,
           end of i_final.
    *INTERNAL TABLES
    data: it_vbak type standard table of i_vbak.
    data: it_vbap type standard table of i_vbap.
    data: it_makt type standard table of i_makt.
    data: it_lips type standard table of i_lips.
    data: it_vbpa type standard table of i_vbpa.
    data: it_kna1 type standard table of i_kna1.
    data: it_final type standard table of i_final.
    data: it_reason type standard table of i_reason.
    data : v_flag.
    *WORK AREA
    data: wa_vbak type i_vbak.
    data: wa_vbap type i_vbap.
    data: wa_makt type i_makt.
    data: wa_lips type i_lips.
    data: wa_vbpa type i_vbpa.
    data: wa_kna1 type i_kna1.
    data: wa_final type i_final.
    data: wa_reason type i_reason.
    *DATA DECLARATION.
    data: v_progname type sy-repid.
    data: v_vbeln type vbak-vbeln.
    data: v_gridtitle type lvc_title.
    *PARAMETERS: D_VARI LIKE DISVARIANT-VARIANT.
    data: i_variant like disvariant.
    data: p_vari like disvariant-variant.
    *DATA DECLARATION FOR CATALOGS LAYOUT SORT EVENTCATALOG TOPOFPAGE.
    data: i_fieldcat type slis_t_fieldcat_alv.
    data: i_layout type slis_layout_alv.
    data: i_sortinfo type slis_t_sortinfo_alv.
    data: i_listheader type slis_t_listheader.
    data: i_eventcat type slis_t_event.
    *INITIALIZATION - First point of execution of program
                    To initialize Any variables that are to be
                    used in the program, even before selection screen
                    appears.
    initialization.
      v_progname = sy-repid.
      v_flag = space.
      perform z_default_variant.
    *SELECTION SCREEN
      selection-screen begin of block blk1 with frame title text-002.
      select-options: s_vbeln for v_vbeln.
      selection-screen end of block blk1.
    *Variable for ALV Variant
      selection-screen begin of block b_var with frame title text-020.
      parameters: d_vari like disvariant-variant.
      selection-screen end of block b_var.
    *AT SLECTION-SCREEN.
    at selection-screen.
      perform z_validations.
    *AT SELECTION SCREEN.
    at selection-screen on d_vari.
    CHECK FOR THE EXISTENCE OF THE VARIANT SELECTED
      perform zf_check_var_exist.
    at selection-screen on value-request for d_vari.
    PROVIDE THE F4-HELP.
      perform zf_variant_f4.
    *START OF SELECTION.
    start-of-selection.
      perform z_select.
      perform check_validation_flag.
      perform z_fieldcat using i_fieldcat.
      perform z_layout.
      perform z_sortinfo using i_sortinfo.
      perform z_eventcat using i_eventcat.
      perform z_gridtitle.
      perform z_listheader using i_listheader.
      perform z_display.
    *&      Form  Z_VALIDATIONS
          text
    -->  p1        text
    <--  p2        text
    form z_validations .
      select vbeln into v_vbeln
                   up to 1 rows
                   from vbak
                   where vbeln in s_vbeln.
      endselect.
      if sy-subrc <> 0.
        message i002(sy) with 'No Records'.
        v_flag = 'X'.
      endif.
    endform.                    " Z_VALIDATIONS
    *&      Form  Z_FIELDCAT
          text
         -->P_I_FIELDCAT  text
    form z_fieldcat  using  p_i_fieldcat type slis_t_fieldcat_alv.
      data: i_fieldcat type slis_fieldcat_alv.
    *VBAK-VELN
      i_fieldcat-col_pos     = '1'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'VBELN'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-key         = 'X'.                        " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
      i_fieldcat-just        = 'C'.                        " FOR JUSTIFICATION.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'SALES ORDER'.              " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   =  15.                         " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBAK'.                     " FOR F1 & F4 HELP AS REFERNCED TO THE DDIC TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-SPRAS
      i_fieldcat-col_pos     = '2'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'SPRAS'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'LANGUAGE'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 5.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'TVAUT'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-AUGRU
      i_fieldcat-col_pos     = '3'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'AUGRU'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'REASON'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 5.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBAK'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-bezei
      i_fieldcat-col_pos     = '4'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'BEZEI'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'DESCRIPTION'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 20.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'TVAUT'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-POSNR
      i_fieldcat-col_pos     = '5'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'POSNR'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'ITEM'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 8.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBAP'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-MATNR.
      i_fieldcat-col_pos     = '6'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'MATNR'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'MATERIAL'.                 " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 10.                         " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBAP'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *VBAP-ZMENG
      i_fieldcat-col_pos     = '7'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'ZMENG'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'QUANT'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 10.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBAP'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *MAKT-MAKTX
      i_fieldcat-col_pos     = '8'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'MAKTX'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'DESCRIPTION'.                     " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 20.                          " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'MAKT'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *LIPS-VBELN
      i_fieldcat-col_pos     = '9'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'VBELN'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'DELIVERY'.                 " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   = 15.                         " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'LIPS'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *LIPS-LFIMG
      i_fieldcat-col_pos     = '10'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'LFIMG'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-do_sum      = 'X'.
      i_fieldcat-seltext_l   = 'LFIMG'.                    " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   =  18.                        " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'LIPS'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *parvw
      i_fieldcat-col_pos     = '11'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'PARVW'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'PARTNER FUN'.                    " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   =  18.                        " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBPA'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *KUNNR
      i_fieldcat-col_pos     = '12'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'KUNNR'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'SHIP'.                    " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   =  18.                        " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'VBPA'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    *NAME1
      i_fieldcat-col_pos     = '13'.                        " POSITION OF THE COLUMN.
      i_fieldcat-fieldname   = 'NAME1'.                    " FIELD FOR WHICH CATALOG ID FILLED.
      i_fieldcat-tabname     = 'IT_FINAL'.                 " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
      i_fieldcat-lzero       = 'X'.                        " OUTPUT WITH LEADING ZEROS.
      i_fieldcat-seltext_l   = 'NAME'.                    " LONG TEXT FOR HEADER.
      i_fieldcat-outputlen   =  18.                        " SET THE OUTPUT LENGTH.
      i_fieldcat-ref_tabname = 'KNA1'.                     " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
      append i_fieldcat to p_i_fieldcat.
    endform.                    " Z_FIELDCAT
    *&      Form  Z_SELECT
          text
    -->  p1        text
    <--  p2        text
    form z_select .
      select vbeln
             augru erdat into corresponding fields of table it_vbak
                   from vbak
                   where vbeln in s_vbeln.
      loop at it_vbak into wa_vbak.
        wa_vbak-erdat = '99991231'.
        modify it_vbak from wa_vbak transporting erdat.
      endloop.
    select * from vbak into corresponding fields of table it_vbak
                   for all entries in it_vbak
                   where erdat = it_vbak-erdat.
      if sy-subrc = 0.
        select vbeln
               posnr
               matnr
               zmeng into corresponding fields of table it_vbap
                     from vbap
                     for all entries in it_vbak
                     where vbeln = it_vbak-vbeln.
        if sy-subrc = 0.
          select spras
                 augru
                 bezei into corresponding fields of table it_reason
                       from tvaut
                       for all entries in it_vbak
                       where augru = it_vbak-augru.
          if sy-subrc = 0.
            select vbeln
                   parvw
                   kunnr into corresponding fields of table it_vbpa
                         from vbpa
                         for all entries in it_vbak
                         where vbeln = it_vbak-vbeln.
            if sy-subrc = 0.
              select kunnr
                     name1 into corresponding fields of table it_kna1
                           from kna1
                           for all entries in it_vbpa
                           where kunnr = it_vbpa-kunnr.
              if sy-subrc = 0.
                select posnr
                       matnr
                       lfimg into corresponding fields of table it_lips
                             from lips
                             for all entries in it_vbap
                             where posnr = it_vbap-posnr.
                if sy-subrc = 0.
                  select matnr
                         maktx into corresponding fields of table it_makt
                               from makt
                               for all entries in it_vbap
                               where matnr = it_vbap-matnr.
                endif.
              endif.
            endif.
          endif.
        endif.
      else.
        message i002(sy) with 'No Data found'.
        leave list-processing.
      endif.
      if sy-subrc = 0.
        loop at it_vbap into wa_vbap.
          read table it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln binary search.
          if sy-subrc = 0.
    *MOVE DATA INTO IT_FINAL.
            move: wa_vbak-vbeln to wa_final-vbeln,
                  wa_vbak-augru to wa_final-augru,
                  wa_vbap-posnr to wa_final-posnr,
                  wa_vbap-matnr to wa_final-matnr,
                  wa_vbap-zmeng to wa_final-zmeng.
          endif.
          read table it_lips into wa_lips with key posnr = wa_final-posnr binary search.
          if sy-subrc = 0.
            move: wa_lips-lfimg to wa_final-lfimg.
          endif.
          read table it_reason into wa_reason with key augru = wa_final-augru binary search.
          if sy-subrc = 0.
            move: wa_reason-spras to wa_final-spras,
                  wa_reason-bezei to wa_final-bezei.
          endif.
          read table it_makt into wa_makt with key matnr = wa_final-matnr binary search.
          if sy-subrc = 0.
            move: wa_makt-maktx to wa_final-maktx.
          endif.
         read table it_vbpa into wa_vbpa with key vbeln = wa_final-vbeln binary search.
          if sy-subrc = 0.
            move: wa_vbpa-parvw to wa_final-parvw,
                  wa_vbpa-kunnr to wa_final-kunnr.
          endif.
           read table it_kna1 into wa_kna1 with key kunnr = wa_final-kunnr binary search.
          if sy-subrc = 0.
            move: wa_kna1-name1 to wa_final-name1.
          endif.
          append wa_final to it_final.
          clear wa_final.
        endloop.
      endif.
    endform.                    " Z_SELECT
    *&      Form  Z_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    form z_layout .
      i_layout-zebra = 'X'.
      i_layout-totals_text = 'Total'(a00).
      i_layout-subtotals_text = 'SubTotal'(a01).
      i_layout-box_tabname = 'IT_FINAL'.
    endform.                    " Z_LAYOUT
    *&      Form  Z_SORTINFO
          text
         -->P_I_SORTINFO  text
    form z_sortinfo  using    p_i_sortinfo type slis_t_sortinfo_alv.
      data: i_sortinfo type slis_sortinfo_alv.
      clear i_sortinfo.
      i_sortinfo-spos = '1'.
      i_sortinfo-fieldname = 'VBELN'.
      i_sortinfo-tabname = 'IT_FINAL'.
      i_sortinfo-up = 'X'.
      i_sortinfo-group = 'UL'.                     " I.E UNDERLINE AFTER EVERY GROUP
      i_sortinfo-subtot = 'X'.
      append i_sortinfo  to p_i_sortinfo.
    endform.                    " Z_SORTINFO
    *&      Form  Z_EVENTCAT
          text
         -->P_I_EVENTCAT  text
    form z_eventcat  using    p_i_eventcat type slis_t_event.
      data: i_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = p_i_eventcat
        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.
      clear i_event.
      read table p_i_eventcat with key name = slis_ev_top_of_page into
      i_event.
      if sy-subrc = 0.
        move 'TOP_OF_PAGE' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      read table p_i_eventcat with key name = slis_ev_pf_status_set into i_event.
      if sy-subrc = 0.
        move 'SET_PF_STATUS' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      clear i_event.
      read table p_i_eventcat into i_event with key name = slis_ev_user_command .
      if sy-subrc = 0.
        move 'USER_COMMAND' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
    endform.                    " Z_EVENTCAT
    *&      Form  Z_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form z_display .
      call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program                = v_progname
         i_callback_pf_status_set          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         i_grid_title                      = v_gridtitle
         i_save                            = 'A'
         is_layout                         = i_layout
         it_fieldcat                       = i_fieldcat[]
         it_sort                           = i_sortinfo
         it_events                         = i_eventcat
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = it_final
       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.
    endform.                    " Z_DISPLAY
    *&      Form  Z_GRIDTITLE
          text
    -->  p1        text
    <--  p2        text
    form z_gridtitle .
      v_gridtitle = 'ALV FOR SALES ORDER DISPLAY'.
    endform.                    " Z_GRIDTITLE
    *TOP OF PAGE.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_listheader.
    endform.                    "TOP_OF_PAGE
    *MENU SETTINGS.
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ALV_MENU'.
    endform.                    "SET_PF_STATUS
    *USER-COMMAND
    form user_command using p_ucomm type sy-ucomm
                            rs_selfield type slis_selfield.
      data : vbeln type vbeln_va.
      case p_ucomm.
        when 'BACK'.
          leave program.
        when '&IC1'.
          clear : vbeln.
          vbeln = rs_selfield-value.
          set parameter id: 'AUN' field vbeln.
          call transaction 'VA03' and skip first screen.
      endcase.
    endform.                    " USER_COMMAND
    *&      Form  Z_LISTHEADER
          text
         -->P_I_LISTHEADER  text
    form z_listheader using p_i_listheader type slis_t_listheader.
      data: l_listheader type slis_listheader.
      refresh p_i_listheader.
      clear l_listheader.
      l_listheader-typ = 'H'.
      l_listheader-info = text-001.
      append l_listheader to p_i_listheader.
      clear l_listheader.
      l_listheader-typ = 'H'.
      l_listheader-info = text-002.
      append l_listheader to p_i_listheader.
    endform.                    " Z_LISTHEADER
    *&      Form  check_validation_flag
          text
    -->  p1        text
    <--  p2        text
    form check_validation_flag .
      if not v_flag is initial.
        leave list-processing.
      endif.
    endform.                    " check_validation_flag
    *&      Form  Z_DEFAULT_VARIANT
          text
    -->  p1        text
    <--  p2        text
    form z_default_variant .
      i_variant-report = v_progname.
      call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
        exporting
          i_save        = 'A'
        changing
          cs_variant    = i_variant
        exceptions
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          others        = 4.
      if sy-subrc = 0.
        p_vari = i_variant-variant.
       D_VARI = P_VARI.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " Z_DEFAULT_VARIANT
    *&      Form  ZF_CHECK_VAR_EXIST
          text
    -->  p1        text
    <--  p2        text
    form zf_check_var_exist .
      data: l_variant like disvariant.
      if not p_vari is initial.
        clear l_variant.
        l_variant-report = v_progname.
        l_variant-variant = p_vari.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
          exporting
            i_save        = 'U'
          changing
            cs_variant    = l_variant
          exceptions
            wrong_input   = 1
            not_found     = 2
            program_error = 3
            others        = 4.
        if sy-subrc = 0.
          clear i_variant.
          move: l_variant-variant to i_variant-variant,
                l_variant-report to i_variant-report.
        else.
          message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
      endif.
    endform.                    " ZF_CHECK_VAR_EXIST
    *&      Form  ZF_VARIANT_F4
          text
    -->  p1        text
    <--  p2        text
    form zf_variant_f4 .
      data: x_variant like disvariant.
      call function 'REUSE_ALV_VARIANT_F4'
        exporting
          is_variant                = i_variant
      I_TABNAME_HEADER          =
      I_TABNAME_ITEM            =
      IT_DEFAULT_FIELDCAT       =
         i_save                    = 'U'
         i_display_via_grid        = 'X'
       importing
      E_EXIT                    =
         es_variant                = x_variant
       exceptions
         not_found                 = 1
         program_error             = 2
         others                    = 3
      if sy-subrc = 0.
        p_vari = x_variant-variant.
        d_vari = p_vari.
        clear i_variant.
        move: x_variant-variant to i_variant-variant,
              x_variant-report to i_variant-report.
      else.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " ZF_VARIANT_F4
    Regards,
    Pritha.

  • Compare editable alv output with database fields

    I generated 1 editable alv report with attaching flat file data,
    but i want to change the wrong fields in alv output and compare with database filds for validation.
    but when i do this . it takes previous entries of flat file.
    how can i solve it?

    Your title is much better than in the first post, however your problem description hasn't changed.
    Let me guess, you are importing a flat file, present the contents in an editable ALV grid, some values are being changed, and now the changed values do not reflect in the internal table, instead you are seeing the values as imported from the file?
    If yes -> FAQ, please search for the many previous discussions of this topic.
    Thomas

  • How to structure the DMA buffer for PXie 6341 DAQ card for analog output with different frequencies on each channel

    I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
    The examples, e.g. aoex5, show a single Timer  (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
    There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
       (the comment is: Switching between different buffer sizes will not be used)
    Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?

    Hello Kenstern,
    The data is always interleaved because each card only has a single timing engine for each subsystem.
    For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
    kenstern wrote:
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
    In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
    Update Frequency: 150 KHz
    Channels: 2
    Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
    Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
    Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
    You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.

  • Regarding ALV outputs ( with layout variants)

    Hi,
    I have a problem where in an ALV report when it is executed with a variant (there is one layout parameter in the screen which is also filled. This layout is set with a filter),
    displays the output. But the displayed output doesn't filter the output as per the required criteria set in the layout filter.
    When I execute the report with the same variant but now if I select the layout by pressing F4 on the layout field and select the same layout as earlier (which is having the filter criteria), now it displays the output as per the required criteria set in the filter.
    I don't understand why if I execute the report with a variant with the layout value also filled, it is not able to give the required output as per the filter criteria set for the layout.
    When the report is executed with the same variant but the layout value selected from F4, it dispalys the correct output with the filter criteria set for the layout.
    In general, I mean why the program is not able to load the layout with filter when it is called from a variant?
    Regards,
    Rajesh

    It depends on your Layout, How you saved it .
    And one more question are you passing the layout parameter and Filter parameter to the Function module

  • ALV - Subtotals with different waers

    Hello!
    I have a hierarquical ALV sorted by LIFNR and payments with the WRBTR and WAERS columns.
    WAERS can be 'ARS' 'USD' etc. for the same LIFNR.
    I want to display subtotals of WRBTR field for each LIFNR by WAERS.
    Can anyone help me please?
    Thanks,
    Liliana.

    Hi Liliana,
    Plz check this code .
    report  zxx_alvexer4    message-id zz        .
    *& TABLES DECLARATION                                                  *
    tables: vbak, vbap.
    *& TYPE POOLS DECLARATION                                              *
    type-pools: slis.
                          DATA DECLARATIONS                             *
    data: v_flag type c.                        "Flag to display the header
    data: v_repid type sy-repid.
    *& INTERNAL TABLE DECLARATION                                          *
    data: begin of it_vbak occurs 0,
           vbeln like vbak-vbeln,
           audat like vbak-audat,
           auart like vbak-auart,
           netwr like vbak-netwr,
           expand(1),
          end of it_vbak.
    data: begin of it_vbap occurs 0,
           vbeln like vbap-vbeln,
           posnr like vbap-posnr,
           matnr like vbap-matnr,
           pstyv like vbap-pstyv,
           charg like vbap-charg,
         end of it_vbap.
    data: it_fldcat type slis_t_fieldcat_alv,
          it_fldcat1 type slis_t_fieldcat_alv,
    *events
          it_events type slis_t_event with header line,
          v_call type c,
          x_user type  slis_exit_by_user,
          it_variant like  disvariant occurs 0 with header line,
          x_keyinfo type slis_keyinfo_alv,
    *layout
          x_layout type slis_layout_alv,
    *sort
          it_sort type slis_t_sortinfo_alv,
          wa_sort like line of it_sort,
          x_cat type slis_fieldcat_alv,
          v_tabix like sy-tabix.
          Selection screen Declaration
    *--BLOCK1
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_vbeln for vbak-vbeln,
                    s_auart for vbak-auart.
    selection-screen end of block b1.
    AT SELECTION-SCREEN                                                 *
    *- Validations
    at selection-screen.
      perform validate_screen.
                  START OF SELECTION                                    *
    start-of-selection.
    *- To get data from VBAK
      perform get_data.
    *to get data from VBAP
      perform get_data_vbap.
      perform prepare_alv.
                  END OF SELECTION                                    *
    end-of-selection.
      perform display_report.
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    form validate_screen .
      data: lv_vbeln like vbak-vbeln,
            lv_auart like vbak-auart.
      if not s_vbeln[] is initial.
        select vbeln
               into lv_vbeln
               from vbak
               where vbeln in s_vbeln.
        endselect.
        if sy-subrc <> 0.
          message e000 with 'INVALID SALES DOC'(002).
        endif.
      endif.
      if not s_auart[] is initial.
        select auart
               into lv_auart
               from vbak
               where auart in s_auart.
        endselect.
        if sy-subrc <> 0.
          message e000 with 'INVALID SALES DOC TYPE'(003).
        endif.
      endif.
    endform.                    " VALIDATE_SCREEN
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form get_data .
      select vbeln
             audat
             auart
             netwr
             from vbak
             into table it_vbak
             where vbeln in s_vbeln
             and auart in s_auart.
      if sy-subrc = 0.
        sort it_vbak by vbeln.
      endif.
    endform.                    " GET_DATA
    *&      Form  GET_DATA_VBAP
          text
    -->  p1        text
    <--  p2        text
    form get_data_vbap .
      select vbeln
             posnr
             matnr
             pstyv
             charg
             into table it_vbap
             from vbap
             for all entries in it_vbak
             where vbeln = it_vbak-vbeln.
      if sy-subrc = 0.
        sort it_vbap by vbeln posnr.
      endif.
    endform.                    " GET_DATA_VBAP
    *&      Form  prepare_alv
          text
    -->  p1        text
    <--  p2        text
    form prepare_alv .
    Prepare field catalog .
      perform prepare_catalog.
    Modify catalog
      perform change_attr_of_catalog.
    Modify Layout
      perform modify_layout.
    Sort Catalog
      perform sort_catalog.
    endform.                    " prepare_alv
    *&      Form  prepare_catalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_catalog .
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = sy-repid
          i_internal_tabname     = 'IT_VBAK'
          i_inclname             = sy-repid
        changing
          ct_fieldcat            = it_fldcat1[]
        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.
      append lines of it_fldcat1 to it_fldcat.
      clear: it_fldcat1[].
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = sy-repid
          i_internal_tabname     = 'IT_VBAP'
          i_inclname             = sy-repid
        changing
          ct_fieldcat            = it_fldcat1[]
        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.
      append lines of it_fldcat1 to it_fldcat.
    endform.                    " prepare_catalog
    *&      Form  change_attr_of_catalog
          text
    -->  p1        text
    <--  p2        text
    form change_attr_of_catalog .
      loop at it_fldcat into x_cat.
        v_tabix = sy-tabix.
        case x_cat-fieldname.
          when  'EXPAND'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-no_out = 'X'.
            endif.
         when  'VBELN'.
           if x_cat-tabname = 'IT_VBAK'.
             x_cat-no_out = 'X'.
           endif.
          when  'VBELN'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '1'.
              x_cat-seltext_m = 'SALES DOC'.
              x_cat-seltext_l = 'SALES DOC'.
              x_cat-seltext_s = 'SALES DOC'.
              x_cat-outputlen = '10'.
            endif.
          when  'AUDAT'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '2'.
              x_cat-seltext_m = 'DOC DATE'.
              x_cat-seltext_l = 'DOC DATE'.
              x_cat-seltext_s = 'DOC DATE'.
              x_cat-outputlen = '8'.
            endif.
          when  'AUART'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '3'.
              x_cat-seltext_m = 'ORDER REASON'.
              x_cat-seltext_l = 'ORDER REASON'.
              x_cat-seltext_s = 'ORDER REASON'.
              x_cat-outputlen = '5'.
            endif.
          when  'NETWR'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '4'.
              x_cat-seltext_m = 'NET PRICE'.
              x_cat-seltext_l = 'NET PRICE'.
              x_cat-seltext_s = 'NET PRICE'.
              x_cat-outputlen = '15'.
            endif.
        endcase.
        modify it_fldcat from x_cat.
        clear x_cat.
      endloop.
    endform.                    " change_attr_of_catalog
    *&      Form  modify_layout
          text
    -->  p1        text
    <--  p2        text
    form modify_layout .
      x_layout-default_item = 'X'.
      x_layout-zebra = 'X'.
      x_layout-expand_fieldname = 'EXPAND'.
    endform.                    " modify_layout
    *&      Form  sort_catalog
          text
    -->  p1        text
    <--  p2        text
    form sort_catalog .
      clear wa_sort.
      wa_sort-spos = '01'.
      wa_sort-fieldname = 'VBELN' .
      wa_sort-tabname   = 'IT_VBAP'.
      wa_sort-up        = 'X'.
      append wa_sort to it_sort.
      clear  wa_sort.
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'POSNR' .
      wa_sort-tabname   = 'IT_VBAP'.
      wa_sort-up        = 'X'.
      append wa_sort to it_sort.
    endform.                    " sort_catalog
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    form display_report .
      it_variant-report = sy-repid.
      sort it_vbak by vbeln.
      sort it_vbap by vbeln posnr.
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        exporting
          i_callback_program      = sy-repid
          is_layout               = x_layout
          it_fieldcat             = it_fldcat[]
          it_sort                 = it_sort
          is_variant              = it_variant
          it_events               = it_events[]
          i_tabname_header        = 'IT_VBAK'
          i_tabname_item          = 'IT_VBAP'
          is_keyinfo              = x_keyinfo
        importing
          e_exit_caused_by_caller = v_call
          es_exit_caused_by_user  = x_user
        tables
          t_outtab_header         = it_vbak
          t_outtab_item           = it_vbap
        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.
    endform.                    " DISPLAY_REPORT
    Regards,
    Laxmi
    Message was edited by: Laxmi

  • Is it possible to create the ALV output with dropdown list for the columns

    Hi forum experts,
                              Could the ALV output contain the dropdown list for the column names? if yes, then how we can acheive this to happen.
    Thanks in advance,
    Regards,
    Samad.
    Edited by: Samad arif on Aug 21, 2009 4:40 PM

    Hi Arif,
    Yes we can .FOr the codding check the article,
    [dropdowns in ALV|https://wiki.sdn.sap.com/wiki/display/Snippets/DropdownsinALV]
    regards,
    Archana
    Edited by: Archana Kumari on Aug 21, 2009 1:22 PM

  • Search for Duplicates with different titles

    Some of us ill organized users have thousands and even tens of thousands of pictures scanned in from old albums, 35mm slides, and shoe boxes full of loose pictures. The result is many duplicates with different names. In Elements one could search on 'similar photos' or some such nomenclature and it did fairly good. How is it possible that an organizer in Photoshop Elements can have a superior tagging and search system to that in lightroom. I realize Lightroom does a lot more, but you have come so close to the good things in Elements why not include them in version 1.2?
    I asked about this in the forum and got some good answers, but basically told if I want to search on photo based color data, I need to use a program other than Adobe. Hope Adobe fixes that, it would be a great service to lots of us dis- or ill- organized people.
    I love Lightroom, but sure hope for some real improvements. Talk to your buddies in Elements.
    Jack

    here is one way to find all matches first and then you can add a fine search/separation if there is more than one match
    depending on the size of the sorted array it might be faster if you search for the first match and than look if the next still matches ...
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    find all matches.vi ‏11 KB

  • Alv output with lines

    hi all,
       is it possible to display alv report output when printed with horizontal, vertical lines.
    when displayed we can see the lines, but i want to see the lines in the print out also.
    how

    Hi,
    Try using this class SE24-> CL_GUI_ALV_GRID-> to display list in ALV format.
    In the attributes section we can see tehe Printing Options like-
    MC_FC_PRINT
    MC_FC_PRINT_PREV
    using them we can set the lines and thier display on printout aslo.
    We can aslo use the loayout atribues method-SET_LAYOUT_PROPERTIES to set the properties you reuqire.
    You can study more on this.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • Unable to download data in ALV output with local file option

    Hi,
    I am displaying ouput in ALV grid display.Its showing output fine.When i am trying to down load the data into Excel file from ALV ouput .when i am downloaded the data by using Local file option,its down loading the data but its not downloading all the fields.
    Could you plz provide me solution.Thanks!

    Just Check that one of your parameters is defined in lower case letters.
    Earlier it used to give dump on execution but now if you download then it will give ABAP dump.
    I have seen this problem many times.
    Regards,
    Gaurav Sood

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • Alv output with 2 tables..

    Hi gurus,
    my requirement is as follows:
    I have two radio buttons , for two radiobuttons i have two different tables ( different fields in final table ) to display in alv
    How can i do this..?
    Like the way we do in report program for alv grid display..
    Need this urgently..
    best regards,
    navin fernandes.

    hi
    1 bind both the view , to 2 different context attribute of type WDUI_VISIBILITY
    2 initially set both the views under ur ViewContainer to invisible
    // set the context attrribute to '01' to make it invisible
    3 now bind the VISIBLE property of ur views to the context attribute
    4 now make a action for ur radiobutton & in OnAction of tht , set the attribute to '02' to make either of ur view visible
    5 other view wud remain invisible still
    u can use code wizard set_attribute method , press control +f7 and set the attribute to '02'
    DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
        DATA ls_cn_node TYPE wd_this->element_cn_node .
        DATA lv_attr  LIKE ls_city-ca_attr.
    *   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
        lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
    *   get element via lead selection
        lo_el_cn_node = lo_nd_cn_node->get_element(  ).
    *   set single attribute
        lo_el_cn_node->set_attribute(
          EXPORTING
            name =  `CA_ATTR`
           value = '02' ).
    // attribute CA_ATTR under node CN_NODE  set to '02' now
    regards,
    amit

  • Alv output with pushbuttons

    Hi all ,
    how can i get alv out put with two push buttons?

    Hi,
    You can add push buttons in the application toolbar..
    Go to SE41...
    Press copy status..(Ctrl + F6)
    Frm                                      
      Program         SAPLKKBL               
      Status          STANDARD               
    to                                       
      Program         Y_TEST_PROGRAM  "GIve your program.
      Status            TEST2                     
    Press Copy..
    Then go to change mode..And give function codes in the application tool bar..
    Then check this program of how to display the new status..Marked in bold..
    TYPE-POOLS: slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    DATA: s_layout       TYPE slis_layout_alv.
    DATA: BEGIN OF itab OCCURS 0,
          icon  TYPE icon-id,
          vbeln TYPE vbeln,
          kunnr TYPE kunnr,
          erdat TYPE erdat,
          box TYPE c,
    END OF itab.
    DATA: v_repid        TYPE syrepid.
    START-OF-SELECTION.
    Get the data.
      SELECT vbeln kunnr erdat UP TO 100 ROWS
             FROM vbak
             INTO CORRESPONDING FIELDS OF TABLE itab.
      IF sy-subrc <> 0.
        MESSAGE s208(00) WITH 'No data found'.
        LEAVE LIST-PROCESSING.
      ENDIF.
    Modify the record with red light.
      itab-icon = '@0A@'.
      MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.
      v_repid = sy-repid.
    Get the field catalog.
      CLEAR: s_fieldcatalog.
      s_fieldcatalog-col_pos = '1'.
      s_fieldcatalog-fieldname = 'ICON'.
      s_fieldcatalog-tabname   = 'ITAB'.
      s_fieldcatalog-seltext_l = 'Status'.
      s_fieldcatalog-icon      = 'X'.
      APPEND s_fieldcatalog TO t_fieldcatalog.
      CLEAR: s_fieldcatalog.
      s_fieldcatalog-col_pos = '2'.
      s_fieldcatalog-fieldname = 'VBELN'.
      s_fieldcatalog-tabname   = 'ITAB'.
      s_fieldcatalog-rollname  = 'VBELN'.
      APPEND s_fieldcatalog TO t_fieldcatalog.
      CLEAR: s_fieldcatalog.
      s_fieldcatalog-col_pos = '3'.
      s_fieldcatalog-fieldname = 'KUNNR'.
      s_fieldcatalog-tabname   = 'ITAB'.
      s_fieldcatalog-rollname  = 'KUNNR'.
      APPEND s_fieldcatalog TO t_fieldcatalog.
      CLEAR: s_fieldcatalog.
      s_fieldcatalog-col_pos = '4'.
      s_fieldcatalog-fieldname = 'ERDAT'.
      s_fieldcatalog-tabname   = 'ITAB'.
      s_fieldcatalog-rollname  = 'ERDAT'.
      APPEND s_fieldcatalog TO t_fieldcatalog.
    Set the layout.
      s_layout-box_fieldname = 'BOX'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program       = v_repid
                is_layout                = s_layout
    <b>            i_callback_pf_status_set = 'SET_PF_STATUS'</b>
                i_callback_user_command  = 'USER_COMMAND'
                it_fieldcat              = t_fieldcatalog[]
           TABLES
                t_outtab                 = itab.
          FORM SET_PF_STATUS                                            *
    -->  EXTAB                                                         *
    FORM set_pf_status USING  extab TYPE slis_t_extab.
    <b>  SET PF-STATUS 'TEST2'.</b>
    ENDFORM.
          FORM user_command                                             *
    -->  UCOMM                                                         *
    -->  SELFIELD                                                      *
    FORM user_command USING ucomm LIKE sy-ucomm
                            selfield TYPE slis_selfield.
    Check the ucomm.
      IF ucomm = 'DETAIL'.
        LOOP AT itab WHERE box = 'X'.
          itab-icon = '@08@'.
          MODIFY itab TRANSPORTING icon.
        ENDLOOP.
      ENDIF.
      selfield-refresh = 'X'.
    ENDFORM.
    Thanks,
    Naren

Maybe you are looking for

  • Copying data from a tree to another

    Hi all! I am in a trouble when I try to copy somedata from one tree to another one. The interface allows the user to select one item from the first tree, and then when he clicks on a button, this item is copied to the second tree. The first tree stay

  • Problems with File I/O in  java applications at KVM/CLDC Layer

    I wrote couple of programs made use of Connector.open with "file" protocol to perform File I/O. Code snippet from java application for File Read InputConnection conn = (InputConnection) Connector.open("file:/input.txt", Connector.READ ); I got javax.

  • I updated to latest version of iTunes and it isn't working.  What do I do?

    I downloaded iTunes update 12.0.1 to my Windows 8 computer, and it did not open when I finished.  It gave an error message that it cannot find iTunes.  I tried uninstalling and reinstalling iTunes 2 or 3 times.  I'm afraid I lost all my music.  It st

  • Wire Payments

    Hi All, i done the configuration for Wire payments and used the program RFFOUS_T to pay it automatically by using F110s transaction. but the payment program is not picking the checks automatically. I can do it manually by using fch5 T-code and update

  • Inventory Program 2

    I need some serious help and I'd appreciate anyone who knows Java. Here is the assignment: Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one produ