Adding button in classical report

Hi All,
I have a requirement to add a button in the Classical report.
Iam new to abap.can anyone please guide me regarding this?
Thanks in advance

hi,
if you use reuse alv grid. you can define your button at pf status. here the example :
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                = sy-repid
     i_callback_pf_status_set       = 'MY_PF_STATUS'
     i_callback_user_command     = 'MY_USER_COMMAND'
then :
FORM my_pf_status USING it_extab TYPE slis_t_extab.
  SET PF-STATUS 'MY_PF_STATUS'.
ENDFORM.                    "MY_PF_STATUS
FORM my_user_command USING ip_ucomm    TYPE sy-ucomm
                                                      ip_selfield TYPE slis_selfield.
  CASE ip_ucomm.
    WHEN 'VBELN'.
    SET PARAMETER ID 'AUN' FIELD ip_sellfield-value.
   CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
  ENDCASE.
  CLEAR : ip_ucomm.
  ip_selfield-refresh =
  ip_selfield-col_stable =
  ip_selfield-row_stable = 'X'.
ENDFORM.
if you use : write for output.
START-OF-SELECTION.
  SET PF-STATUS 'DENEME'.
  WRITE : 'EXAMPLE'.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'EXAM'.
      BREAK-POINT.
  ENDCASE.
if you use Class for ALV u can find more info at here : [OO ALV Reference|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]

Similar Messages

  • How to get add/edit button in classic report

    Hi,
    Iam trying to built a classic report,but here i need to have add/edit button.How can i achieve this in classic reports?
    I know this add/edit button with a pencil on note will come through the interactive report.
    But here iam trying to build a page same as the sample application Orders tab i.e. My Orders page.Here he created a classic report with alternating rows but has an add/edit button to it.How could that be achieved??
    Can Anyone help me in this regard to built the My orders page including the add/edit navigation getting to order for items.How can tat sample application of My orders built?
    TIA,
    Regards,
    Kranthi.
    Edited by: Kranthi.K on Sep 29, 2009 12:38 AM

    One more doubt is
    But here iam trying to build a page same as the sample application Orders tab i.e. My Orders page and when we hit add/edit image it directs us to the My orders info and order items.
    How can we build that page of My orders info and order items.Can anyone guide me through the steps the sample is created.
    I tried many times with master detail,but dint achieve what the default Sample Application has been done.
    Thanks in Advance
    Edited by: Kranthi.K on Sep 29, 2009 4:54 AM

  • Adding buttons to a report

    Can you add a button to a report component (sql based) and add code to call a stored procedure or an application component). (form layout editor tab)

    This thread has been moved from the Oracle9iAS Portal forum to the Oracle9iAS Portal Applications forum. It is unlocked in the Oracle9iAS Portal Applications forum and responses should be posted there.
    Thanks,
    Rich

  • REFRESH button in Classical report

    Hi,
    We have one classical interactive report using write statement and we would like add refresh button, so that user need not execute the report from initial screen.
    I have added refresh button in GUI and wrote in at user command also, but still not working. When i added refresh button in another ALV report it was working fine.
    Is that refresh button will work for write command report? if possible how can we acheive this?

    Hi,
    It should work. 
    Define a button in GUI Status with FCODE 'REFRESH' (or whatever)
    in At USER-COMMAND event do:
    - get new data from DB
    - output new data
    Make sure you have the start-of-selection and end-of-selection events in the program.
    If you didn't figure it out by now, post your code  and I'll have a look at it.
    regards.

  • Adding buttons to ALV report

    I am using CL_SALV_TABLE to generate a report. How do I add custom buttons on the application toolbar? Is this done in the menu or screen painter? I have not created any screens yet as I want it to remain a simple ALV report.

    First create a PF status: We need to create a PF status with our own buttons as well as the ALV standard buttons. If we don't add the ALV buttons than it would not provide the standard functions of ALVs. On the other hand it is very tedious to add all the ALV buttons in our PF status manually. So here is the easy way: We will copy the PF-Status using of any standard SALV_DEMO report using the transaction SE41: Menu Painter. After Copying the PF-Status we can add our own buttons.
    Call Method of SALV to display PF: Now we will call this newly created PF status in our ALV using the method SET_SCREEN_STATUS of the reference of the class CL_SALV_TABLE
    In this section we will define the private methods which can be implemented to set the properties of the ALV and can be      called in the
    PRIVATE SECTION.    METHODS:     
    set_pf_status     CHANGING    co_alv TYPE REF TO cl_salv_table.
    In this area we will call the methods which will set the  different properties to the ALV   
    CALL METHOD set_pf_status      CHANGING        co_alv = o_alv.
    In this area we will implement the methods which are defined in  the class definition
      METHOD set_pf_status.
      Calling method to set the PF-Status  
    co_alv->set_screen_status(
        pfstatus      =  'SALV_STANDARD'    
       report        =  'SALV_DEMO_TABLE_SELECTIONS'    
       set_functions = co_alv->c_functions_all ).
      ENDMETHOD.                  "set_pf_status

  • Adding the Checkbox for each row in classic report

    Hello,
    I have created classic report with checkboxes in each row and added the On-Submit process, BUTTON CONDITIONAL, to determine the behavior of the checkboxes. The PL/SQL process is suppose to delete the selected row from database.
    I am getting the Success message, but When I check the database, the row still persist in the database.
    PLSQL CODE:
    FOR i IN 1..apex_application.g_f01.count LOOP
    DELETE 
    FROM
      registry 
    WHERE
      reg_id = apex_application.g_f01(i);END LOOP;
    ORACLE APEX: 4.2
    Thank you

    Hi ApexNewLearner,
    Try this
    DECLARE
    j number;
    BEGIN
    FOR i IN 1..apex_application.g_f01.count LOOP
      j := apex_application.g_f01(i);
      DELETE FROM  registry
      WHERE  reg_id = apex_application.g_f01(j);
    END LOOP;
    END;
    or better try to replicate your issue on apex.oracle.com , that is easy for users to investigate the issue and give you appropriate solution.
    Hope this helps you,
    Regards,
    Jitendra

  • Classical Report on clicking button on ALV Report

    I have a requirement where I have to display a classical report based on the user-click on a "custom button" on my ALV. I am unable to display the classical report. Please help with code example..

    Hi,
    See the example.Change the code according to your requirement.
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           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_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Pls. reward if useful...

  • Adding a push button on the report toolbar

    adding a save button on the report toolbar, so that after clicking the button, the data fetched on the report will be stored in the application server.

    Hi
    to automate this process ,best way is to create a Z rport and there u can submit this sap standard report and get its output into an Internal table and then u can write this internal table to application server via following demo code -
    this is code for both (download /upload),u can not use CG3y and CG3z as u want to do it as a background job ..
    *& Report ZGILL_AS *
    REPORT ZGILL_AS message-id rp .
    tables: pa0001,pa0002.
    select-options s_pernr for pa0001-pernr no intervals MODIF ID XYZ.
    parameters: p_dwnld AS CHECKBOX ,
    p_upld AS CHECKBOX DEFAULT 'X'.
    parameters: P_DSNI(75) TYPE C MODIF ID ABG DEFAULT
    '/usr/local/sapdata/amit.dat' LOWER CASE.
    data: begin of itab occurs 0,
    pernr(8),
    sp1(1) value ',',
    werks(4),
    sp2(1) value ',',
    persg(1),
    sp3(1) value ',',
    persk(2),
    end of itab.
    data: s_eof(3).
    start-of-selection.
    if p_upld = 'X'.
    OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.
    PERFORM FETCH_DATA.
    STOP.
    elseif p_dwnld = 'X'.
    OPEN DATASET P_DSNI FOR INPUT IN LEGACY TEXT MODE.
    IF SY-SUBRC NE 0.
    MESSAGE E016 WITH
    'Error opening seq. file, RC:' SY-SUBRC.
    EXIT.
    ENDIF.
    CLEAR S_EOF.
    DO.
    PERFORM FETCH_file.
    IF S_EOF EQ 'YES'. stop. ENDIF.
    ENDDO.
    endif.
    END-OF-SELECTION.
    if itab[] is not initial.
    perform print_file1 tables itab.
    else.
    write:/ 'No records exists'.
    endif.
    *& Form FETCH_DATA
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_DATA .
    SELECT * FROM PA0001 WHERE PERNR IN S_PERNR.
    MOVE-CORRESPONDING PA0001 TO ITAB.
    TRANSFER ITAB TO P_DSNI.
    APPEND ITAB.
    ENDSELECT.
    CLOSE DATASET P_DSNI.
    ENDFORM. " FETCH_DATA
    *& Form FETCH_file
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_file .
    READ DATASET P_DSNI INTO itab.
    append itab.
    clear itab.
    IF SY-SUBRC NE 0.
    S_EOF = 'YES'. EXIT.
    ENDIF.
    ENDFORM. " FETCH_file
    *& Form print_file1
    text
    -->P_ITAB text
    FORM print_file1 tables P_ITAB structure itab .
    write:/2 'EmpNo',
    14 'Personnel Area',
    34 'Emp Group',
    47 'Emp SubGroup'.
    skip 1.
    loop at p_itab.
    write:2 p_itab-pernr,
    14 p_itab-werks,
    34 p_itab-persg,
    47 p_itab-persk.
    skip 1.
    endloop.
    ENDFORM. " print_file1
    <b>Reward if usefull</b>

  • Adding button to report to link to master detail form

    I want to add a button to a report to direct me to a blank master detail form to insert a new record. I have used the following code in the additional PL/SQL code section:
    htp.formopen('PORTAL30.wwa_app_module.new_instance?p_moduleid=1271601405');
    htp.formsubmit('p_request','Create New');
    htp.formClose;
    When I click this I get 'Page Not Found'.
    But if I hit refresh I am directed to the correct form with the same url.
    Any ideas on what the issue is?
    Thanks.

    Hi,
    Check this sample code.
    tables:sscrfields. "Fields on selection screens
    selection-screen function key 1.
    selection-screen function key 2.
    Initialization.
      sscrfields-functxt_01 = 'Report'.
      sscrfields-functxt_02 = 'Exit'.
    at selection-screen.
       if sscrfields-ucomm = 'FC01'.
      perform f_alv_sub.
       elseif sscrfields-ucomm = 'FC02'.
       endif.
    Hope it helps.

  • Adding button in report to store report on server

    hi,
    i dont know whether this is the appropriate place to ask this question.. but
    i have the requirement to send data from a report to another instance.
    basically what the users want is to run a report.. check the outcome, if its ok, then send the data to the other system.
    this does not have to be high tech.. the file can be stored on the server in a certain format. (so not the users PC)
    i was thinking of a button in the report which would save the file automatically as CSV on that specific location under a specific name.
    has anyone done that before..
    is it do-able?? in Web also?
    or are there other alternatives
    grtz
    rogier

    pete,
    thank you for your fast reply..
    it is not exactly what i am looking for.
    the file has to be saved as a CSV
    and the file has to be saved in a folder on the server so, not the workbookfolders
    But a method, for example to, to, from the report, trigger a processchain  to run the query again and save the outcome on the server would also be ok. if anyone has any suggestions?
    grtz
    rogier

  • No data found when adding column link to classic report

    Hi,
    Oracle 11g r2, APEX 4.1.1.00.23.
    I have some classic reports.
    I go to Report Attributes, then I click Add Column Link in the "Tasks" right menu, it adds me a column link, I just add some text for the link and a page to go to.
    Then I run the report and I get :
    report error:
    ORA-01403: no data foundTested with several classic reports on multiple pages.
    Debug mode shows me :
    0.43816     0.00240     ...Execute Statement: select distinct [...] order by 3,11 ,4
    0.44056     0.00162     print column headings
    0.44218     0.04816     rows loop: 25 row(s)
    0.49037     0.00141     report error: ORA-01403: aucune donnée trouvée
    0.49175     0.00078     Computation point: After Box BodyWhen I run the query in my favorite tool, I get expected results.
    Did I missed something ?
    Thank you.
    Yann.

    Yann39 wrote:
    <font size="4">Is it an APEX bug ?</font>
    - Create a new Region of type Classic Report, then set Region source as :
    begin
    return test_return_query;
    end;- Run the page, the report works as expected
    - Go to Report Attributes and click Add Column Link (and just specify a text for the link and a page to go to).
    - Run the page, you should get the error !This might be unorthodox but try wrapping your returned query within an SQL statement, like so:
       begin
          return 'SELECT t.* FROM ('||test_return_query||') t';
       end;
    I can reproduce it on oracle.apex.com if needed...If my suggestion doesn't work, I think this might be the only option. You could create a new forum posting with the word "BUG" in the title, along with a link to this thread and the relevant workspace details (with guest developer credentials).

  • Adding update and delete buttons to a  Report from SQL Query

    There is an option when creating a QBE to add update and delete
    links which i find quite useful, but this option doesn't seem to
    be possible on a Report from SQL Query. Do i need to do
    something special to add them? is the option located in a
    different place?

    Hi,
    You can only add Update ,Delete in QBE Reports,
    there is no option in Portal which can be used to
    have these buttons in the Reports from Query Wizard or
    Report from SQL Query.
    Thanks
    Vineet

  • Adding print button to interactive report

    For now I have the downloaded to PDF option checked so the user can print an interactive report via the widget.
    I would like to have a print button on the report also.
    Has anyone got any of the java script stuff working off of a button?

    Hi willjamu ,
    All you should have to do is call the 'PDF' request to download the same report the drop down will create.
    f?p=355:14:3381437251536222:PDF::::
    I hope I was able to answer your question let me know.
    Mike

  • Exporting Classical Report to Excel

    Hi,
         I have a classical report in which I am adding a Button "Export to Excel". Now, if I click that button, I should be able to export my Classical Report to excel. Can somebody please help me on this.
    Thanks,
    Venkat.

    You can do it with the FM GUI_DOWNLOAD.
    Do like this:
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'EXCEL'.
    DATA: BEGIN OF it_fieldnames occurs 0, "saving the log file structure
    l_f(256) TYPE c,
    END OF it_fieldnames.
    it_fieldnames = 'Field1'.
    Append it_fieldnames.
    it_fieldnames = 'Field2'.
    append it_fieldnames.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = P_FNAME
    filetype = 'DATE'
    TABLES
    data_tab = IT_DATA    " << data tab
    fieldnames = it_fieldnames    " << for header
    EXCEPTIONS
    file_open_error = 1
    file_write_error = 2
    invalid_filesize = 3
    invalid_table_width = 4
    invalid_type = 5
    no_batch = 6
    unknown_error = 7
    OTHERS = 8.
    IF sy-subrc <> 0.
    MESSAGE e999 WITH 'Error File Write Error: ' sy-subrc.
    ENDIF.
    ENDCASE.
    Regards,
    Naimesh Patel

  • Add buttons in ALV Report output

    Dear Friends,
    I am developing one ALV report in PP moule for calculating Shelf Life. The output is coming properly in ALV.
      But my additional requirement is ADD coustomise buttons in ALV Reports.
    Please give me an idea how can I insert buttons in my alv report?
    Thanks & Regards
    Vasu

    Hi vasu,
    consider the code given below.
          FORM F4200_PF_STATUS_SET                                      *
    FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
      REFRESH i_extab.
      PERFORM f4210_exclude_fcodes CHANGING i_extab.
    The PF status is an exact copy of the PF status 'STANDARD' of program
    SAPLSALV but with command 'CHNG' added to it.
      SET PF-STATUS 'ZSOM_STANDARD' EXCLUDING i_extab.
    ENDFORM.
    *&      Form  f4210_exclude_fcodes
    FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
      DATA: ws_fcode TYPE slis_extab.
      CLEAR ws_fcode.
      ws_fcode = '&EB9'.            " Call up Report.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&ABC'.            " ABC Analysis.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&NFO'.            " Info Select.
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&LFO'.            " Information.
      APPEND ws_fcode TO i_extab.
    ENDFORM.                    " f4210_exclude_fcodes
    *&      Form  f4300_user_command
    FORM f4300_user_command USING ucomm LIKE sy-ucomm
                                             selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.                              "Double Click line Item
          READ TABLE i_data INDEX selfield-tabindex.
          IF i_data-qmnum NE space.
            SET PARAMETER ID 'IQM' FIELD i_data-qmnum.
            CALL TRANSACTION 'IW52' AND SKIP FIRST SCREEN.
            CLEAR ucomm.
          ENDIF.
        WHEN 'CHNG'.                          " Change Notification Icon
          READ TABLE i_data INDEX selfield-tabindex.
          IF i_data-qmnum NE space.
            SET PARAMETER ID 'IQM' FIELD i_data-qmnum.
            CALL TRANSACTION 'IW52' AND SKIP FIRST SCREEN.
          CLEAR ucomm.
          ENDIF.
      ENDCASE.
      CLEAR ucomm.
    ENDFORM.                    " f4300_user_command
    EXPLANATION
    In this program, first we created a PF status (ZSOM_STANDARD), which was an exact copy of STANDARD of program SAPLSALV through transaction SE41 (Menu Painter). Then we added another button to it,with a new fcode called ‘CHNG’.  After this this we set this PF status instead of STANADRD.
    We initialize a third event USER_COMMAND and associate a form with it. In this form we can capture the function codes and write any functionality under it. If we write functionality for an existing fcode, then this gets precedence over the default functionality that might be associated with it.
    In this example, we capture a standard fcode ‘&IC1’ that is nothing but double clicking a line of the report.  We are capturing the notification number of that line and calling transaction IW52 with it. We are also doing the same when a user clicks on the new ‘Change Notification’ button.
    When the user clicks the “Back’ button in IW52, it comes back to the report.
    Please reward for the same.
    Message was edited by: Prakhar Saxena

Maybe you are looking for

  • Satellite U400-15E - Upgraded to Windows 7 32-bit now NO sound through HDMI

    I upgraded from vista to windows 7 32-bit, now i have no HDMI device shown under playback devices, i have installed new windows 7 drivers but still no luck. Under device manager/sound a HDMI device is shown as enabled and when connected to an externa

  • Severe Network Password issues

    Hi all, this is my first post here. Of the four computers accessing our router, 3 of them work fine (2 PCs and 1 x Apple PowerBook on OS 10.3.9 over airport). The machine with the internet connection that no longer works well is my G5. I recently upd

  • IPad 3 charging slowly

    I bought my new iPad Wi-Fi + 4G yesterday (in Portugal) and i've been having difficulties charging it via USB (I'm connecting it to my MBP late 2010). It seems to charge 1% per hour, or something like that. I've been reading the threads and found tha

  • Master/detail issue

    I have a tricky if convoluted implementation issue and hope you can assist with resolution. I have a form with a master/detail relationship. The master block has a primary key called master_id and the detail block has three foreign keys (caller_id, r

  • TBB1 T.Code Error

    Dear All, while Posting post flows in T.Code TBB1 i am getting an error Balancing field "Business Area" in line item 001 not filled. I had assigned the business area in step Allocate Additional Account Assignments to Account Assignmen Use. what else