Hot Search: Bb 8320 qosmio g30 freezes is DVI compatible with vga drivers sccm reinstall remote distribution point CRIF_RW_WEB_CALL_REPORT upgrade cisco c160 to c190 file extension sys parser free proxy hideip.me
Home >Default > How to place am icon in alv

How to place am icon in alv

-0001-11-30 | Default
Advertisement
Dear Freinds,
               I have a requirement when  i have updated the data coming  from alv ( using the function module 'REUSE_ALV_GRID_DISPLAY'  or REUSE_ALV_LIST_DISPLAY ) . i want to select the  checboxes  on ALV ouput and execute( i want  an additonal standard button) so that the data which is there on the alv output will be updated . Some times i dont want some data for that reason i require some cheboxes .
Could any please help me how to get an additional button on alv Tool bar and the checkboxes along withe the cells.
i have tried using the below  code but iam not getting any new icon additonal to that
of the standard icons which are there from the below FM. If  iam passing
CALLBACKPF_STATUS_SET = 'PROCESS_USER_COMMANDS'   "'ZBUTTON'
     i can seen none of the buttons on the tool bar, including the standard buttons are going
please help me .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_interface_check       = ' '
      i_callback_program     = sy-repid  
      I_CALLBACK_PF_STATUS_SET = 'PROCESS_USER_COMMANDS'   "'ZBUTTON'
      i_callback_top_of_page = l_c_top_of_page
      i_structure_name       = c_i_final
      is_layout              = l_wa_layout
      it_fieldcat            = l_i_fieldcat
      it_sort                = l_i_sort[]
      it_events              = l_i_get_event
    TABLES
      t_outtab               = fp_it_final
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
  IF sy-subrc <> 0.
    MESSAGE e131. " Displaying the ALV GRID has failed
  ENDIF.
FORM PROCESS_USER_COMMANDS USING  RT_EXTAB TYPE SLIS_T_EXTAB
                                   systucomm LIKE syst-ucomm
                                 selfield TYPE slis_selfield.
data : wa_fianl_alv type ty_final.
  CASE systucomm.
    WHEN '&IC1'.
get cursor field fieldname.
      READ TABLE IT_FINAL into wa_fianl_alv INDEX selfield-tabindex.
       SET PARAMETER ID 'EMPNP' FIELD wa_fianl_alv-empno .
      call Transaction 'PA30' and skip first screen.
        SET PF-STATUS 'ZSTANDARD'. " EXCLUDING RT_EXTAB.
  ENDCASE.
ENDFORM.                               " PROCESS_USER_COMMANDS
In the addtion to this i want cheboxes along with the cells  so that i can check and then execute ( the additonal button  which i want along with ALV Grid).
regards
srini

Latest answer

Advertisement
Hi Kumar,
you can get the solution  by doing the following way.
This internal has data and will be passed to the ALV function module later.
DATA:BEGIN OF tbl_output OCCURS 0, 
      check TYPE charx,            "-----------CHECK BOX APPEARENCE-----
      vbeln LIKE vbak-vbeln,        "Sales Doc
      posnr LIKE vbap-posnr,        "Item-sales Doc
      omeng LIKE vbbe-omeng,        "Open qty
      color_line(04) TYPE c,
   END OF tbl_output.
CONSTANTS:    c_standard(20) TYPE c             VALUE 'STANDARD',
                        c_user_command TYPE slis_formname VALUE  'USER_COMMAND',
                        c_pfstatus     TYPE slis_formname VALUE 'PF_STATUS_SET',
                        c_bcgrd        LIKE bapibds01-objkey VALUE 'ALV_BACKGROUND'.
Start-of-selection.
Perform get_data.  " fetch data from datbase depending on the selection screen params
Perform begin_alv_process.
FORM begin_alv_prcoess.
  gv_repid =  sy-repid.
* initialize layout
  PERFORM initialize_layout USING gs_layout.
* Subroutine to build events
  PERFORM f_build_events.
* fill fields to be output
  PERFORM fill_field_catalog.
* call ALV function module
  PERFORM alv_grid_display.
ENDFORM.                    " begin_Alv_prcoess }
FORM initialize_layout USING rs_layout TYPE slis_layout_alv.
  rs_layout-zebra        = c_x.         "Striped Pattern
  rs_layout-no_keyfix    = c_x.         "Fix Key columns
  rs_layout-max_linesize = 855.
* Name of the field with color
  rs_layout-info_fieldname = 'COLOR_LINE'.
ENDFORM.                    " initialize_layout
FORM fill_field_catalog.
  PERFORM build_catalog USING:
   'CHECK'   'TBL_OUTPUT'     'CHECK'     'TBL_OUTPUT'  'X'   ' ',
   'VBELN'   'TBL_OUTPUT'      'VBELN'      'TBL_OUTPUT'         ' '   text-005,
   'OMENG'  'TBL_OUTPUT'     'OMENG'   'TBL_OUTPUT'  'E'   text-008.
ENDFORM.                    " fill_field_catalog
FORM build_catalog USING    p_ref_fieldname
                            p_ref_table
                            p_fieldname
                            p_table
                            p_check
                            p_short.
  DATA: ls_fieldcat TYPE slis_fieldcat_alv.
  ls_fieldcat-fieldname        = p_fieldname.
  ls_fieldcat-tabname          = p_table.
  ls_fieldcat-seltext_m        = p_short.
  ls_fieldcat-seltext_l        = p_short.
  ls_fieldcat-outputlen        = p_short.
  IF p_check = c_x.
    ls_fieldcat-checkbox = c_x.
    ls_fieldcat-input    = c_x.
  ENDIF.
  IF p_check = c_e.
    ls_fieldcat-input = c_x.
  ENDIF.
  APPEND ls_fieldcat TO gt_fieldcat.
  CLEAR ls_fieldcat.
ENDFORM.                    " build_catalog
FORM alv_grid_display.
* The order quantities in output report can be edited to print datasheet
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program       = gv_repid
            i_background_id          = c_bcgrd
            i_callback_pf_status_set = c_pfstatus
            i_callback_user_command  = c_user_command
            is_layout                = gs_layout
            it_fieldcat              = gt_fieldcat[]
            i_save                   = 'U'
            it_events                = tbl_alv_events[]
       TABLES
            t_outtab                 = tbl_output
       EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.
ENDFORM.                    " alv_list_display
FORM pf_status_set USING extab TYPE slis_t_extab .
  REFRESH extab. CLEAR   extab.
  SET PF-STATUS 'ZDATASHEET'.
ENDFORM.                    " PF_STATUS_SET
FORM user_command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  CASE ucomm.
    WHEN 'SALL'.
      LOOP AT tbl_output.
        tbl_output-check = c_x.
        MODIFY tbl_output TRANSPORTING check omeng.
      ENDLOOP.
    WHEN 'DSEL'.
      LOOP AT tbl_output.
        CLEAR tbl_output-check.
        MODIFY tbl_output TRANSPORTING check omeng.
      ENDLOOP.
    WHEN 'PRNT'.
      PERFORM  After_output_data.
      ENDCASE.
  selfield-refresh = c_x.
ENDFORM.                    " USER_COMMAND
FORM f_build_events.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            i_list_type     = 0
       IMPORTING
            et_events       = tbl_alv_events
       EXCEPTIONS
            list_type_wrong = 1
            OTHERS          = 2.
Add event name for User Command
  READ TABLE tbl_alv_events WITH KEY name = slis_ev_user_command
                           INTO s_evts.
  IF sy-subrc = 0.
    s_evts-form = c_user_command.
    MODIFY tbl_alv_events  FROM s_evts
                       TRANSPORTING form
                       WHERE name = slis_ev_user_command.
    CLEAR s_evts.
  ENDIF.
ENDFORM.                    " f_build_events
Regds
Parvathi

Related recommended

Open Field in ALV Report

Hi all, i have to develop a ALV report. In that report i have to put a open quantity column , so that the user can enter values in that, and that value should get updated in the database. So please suggest me how to develop such report with open fiel [More]

2015-10-11 Default

Unable to capture data in an editable dynamic ALV.

Hi , I have created a dynamic editable ALV whose displayed structure can be changed at runtime based on the selection in a drop down list value selector. Im trying to capture the values entered in the ALV into an internal table before the user change [More]

2015-10-11 Default

Total is not getting displayed in the ALV output.

Hi, Total is not getting displayed in the ALV output. I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY Are  there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY source code: DATA: layout TYPE [More]

2015-10-11 Default

'@' not getting displayed in the ALV report

Hello, I am facing  a strange issue in the ALV report display. A string starting with '@' is not getting displayed and says "default icon " on the report. and this is varying from system to system for the same user. can anyone please help me in [More]

2015-10-11 Default

Vendor open items wise ALV Grid Display (FBL1N) report to Excel Sheet

Hi All, I need vendor wise open items and cleared items in ALV Grid format in excel sheet. I'm Trying that in T Code FBL1N, After the execution. I had select ALV Grid format like this From the menu bar->Settings-> Switch list. After that i get ALV  [More]

2015-10-11 Default

Report for CRM-Opportunities - Open CRMD_ORDER for selected ALV row

Hello, i created a report which can be used to find the relevant opportunities and list them in a ALV table. I have the requirement that by doubleclick on the table line the selected opportunity shall open in tx crmd_order. I have the GUID and the ob [More]

2015-10-11 Default

To find total in blocked alv

hi experts, i have created blocked ALV program. in the o/p , it displays list of recors for open items,then list of records for cleared items. now i want it  to display sum of both open and cleared items of particular column. in grid display it is di [More]

2015-10-11 Default

PF STATUS IN ALV REPORT

hi, How to use PF STATUS IN ALV REPORT?HI, see this code. TABLES:MARA. SELECT-OPTIONS: MATNR FOR MARA-MATNR. DATA:BEGIN OF ITAB OCCURS 0,      MATNR LIKE MARA-MATNR,      ERSDA LIKE MARA-ERSDA,      MTART LIKE MARA-MTART,      MBRSH LIKE MARA-MBRSH, [More]

2015-10-11 Default

Menu options in ALV report

Hi, Im not getting Menu options in ALV report output. Not even default menu options SYSTEM, HELP Its dispalying as <b>????????????????????????????????</b>. Can someone help me regarding this? Regards, amalHi Amal,             Check the screen [More]

2015-10-11 Default

Double click in alv report

Hi all, I have below output in alv report. matnr 101_102 121_122 123_124 10000   23          34              45 10001   34          34              456 if i m clicking on 23 in combination of 121_122 and 10000 then i want to see detail for 121_122 an [More]

2015-10-11 Default

Click Ranking

  • Not allowing to change the plants in me51n transaction

    hi all, my requirement is to not allow the user to use different plants at item level(10,20 etc) . for that i have used the user exit MEREQ001 in the function module EXIT_SAPLMEREQ_010 i have written following code DATA : WA_EBAN LIKE EBAN,        WA

  • How do i change the old apple id that comes up when i want updates to my new apple id?

    I want to update my apps on my iphone but i am not able to because i have an old apple id that keeps coming up. is there a way to remove the old id and replace it with the new apple id.  i do not have the password for the previous id and i keep going

  • Error while trying to create a Universe on Function Module in IDT

    Hi, We are using BO 4.1 Support Pack 2. I am trying to create a Universe on Function Module. I created data foundation layer, but when I right click on the table and click on 'Show table values' it doesn't bring any data (and there is data available

  • Small black icon

    Sometimes, in some websites an attempt to download a PDF returns a blank white swindow with a small black icon containing a white "X" in the upper left corner of the screen.  What is this icon saying and how do I fix it to download PDFs.  I'm us

  • I can't run my mac!!

    i did these.. force quit to the Finder.. now i cant doing a boot..just apple laple come to me then.. i cant enter the osx 10.5.6.. what i can do??!! thnxHow to Perform an Archive and Install An Archive and Install will NOT erase your hard drive, but

  • I need help making a layer clickable

    I am trying to make the layer "click to call" clickable but cant do it.   Please help.   Thanks!  You can only isolate it using the slice tool in CS6. It's not possible in Elements however you could save the entire design as a jpeg or png file a

  • Sounds drops in a middle of a project

    Hey everybody, I exported a premiere pro (cs4) project to encore, and when i'm playing it in encore there is a point where the sounds stops without any apparent reason. any idea why? thanks, Noam.This is aimed at Premiere Pro, but may help Work throu

  • How do i use synths?

    i know it must sounds stupid but im used to using cubase and in that you just need to choose the output of your midi track to a synth and bingo. but i want to learn how to use the plugins in logic pro and every tutorial i read never seems to help and

  • Livecycle Form Paging Issue

    Hi there, Please could someone help with a paging issue that I am having with a Livecycle form? One of the subforms I have created keeps jumping to the end of the page and I do not know for the life of me how to fix it!! It is driving me crazy and I

  • NO LANGUAGE Field in DATASOURCE

    Hi    I dont have any Language Field in 0VENDOR_TEXT Datasource(Checked in RSA5) .So how do i add them Language field to the datasource??Would appreciate ur help at this time.. manythanks arunas far as i know vendor master data is language indepenent