Calling an existing ALV report in WD4A

Im going to try to call an existing ALV report using WD4A.
Was wondering if anybody has used the "SUBMIT <report> EXPORTING LIST TO MEMORY" option to get the results table, then after IMPORTING from memory, display this in ALV in Webdynpro abap?

I was able to acomplish the following way...
My WD4A component has an assistance class, has a method fetch_results, in that method, I pass my selection criteria which calls a function.
The function does this...
  SUBMIT  REPORTXYZ
  USING SELECTION-SET lv_variant
  AND RETURN
    WITH pnppernr IN pnppernr
    WITH pnpbegps EQ act_begda
    WITH pnpendps EQ act_endda
    WITH pnpbegda EQ act_begda
    WITH pnpendda EQ act_endda
    WITH pnptimed EQ blank
    WITH p_layout EQ '/MGR SEP'
    WITH p_portal EQ 'X'.
My p_portal parameter is a flag that REPORTXYZ will use to export the it_output to memory.
I then import that table to the function module which returns to WD4A alv.
  IMPORT zit_output TO tbl_output FROM MEMORY ID
    lv_flag.

Similar Messages

  • Creating header in printout of ALV report in WD4A

    Hi
    I have created one alv report in WD4A. When I click on the "print version" button, the report appears in pdf format.
    I want to create header on that pdf output. Please let me know how can i do that ? . it is coming on alv but not on pdf.
    The code follows:
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
    l_ref_cmp_usage =   wd_this->wd_cpuse_ztime( ).
    IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
      l_ref_cmp_usage->create_component( ).
    ENDIF.
    DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
    l_ref_interfacecontroller =   wd_this->wd_cpifc_ztime( ).
      DATA:
        l_value TYPE REF TO cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model(
    *set header for the table
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    data: lr_header type ref to CL_SALV_WD_HEADER.
    lr_table_settings ?= l_value.
    lr_header = lr_table_settings->get_header( ).
    lr_header->set_text( 'ATTANDENCE LIST' ).
    *PDF output header
    data: pdf_header TYPE REF TO IF_SALV_WD_PDF_SETTINGS.
    pdf_header ?= l_value.
    data: lv_head type abap_bool.
    call METHOD pdf_header->set_export_no_tol( 'X' ).
    lv_head = pdf_header->get_export_no_tol( ).
    regards
    Vishal kapoor
    Message was edited by:
            vishal kapoor

    if you're still having this problem, try this (given your own code sample):
    data:
      lv_header type string.
    pdf_header ?= l_value .
    CONCATENATE 'My header text' INTO lv_header RESPECTING BLANKS .
    pdf_header->set_header_left_freetext( lv_header ).
    pdf_header->set_header_left( if_salv_wd_c_pdf_settings=>text_free ).

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • Add multilple PO's to already existing ALV report

    hello all,
    i have an ALV Report requirement like below...
    serno network no       activity no  service code service text   units purchase requisition num     PR item    PR qty   Agreement num Agrmt item Agremt qty
    1     410000001401     0020          SCL10051      ****          KM    19000000461                        1              20         56000000199      1                 200
    2     410000001401     0030          SCL10052      ****          EA    19000000461                         2              30         56000000199      1                 500
    now my question is i have Purchase Order and PO qty(which i ahve taken from EKPO)...
    for a given purchase requisition number there are multiple PO's (say 10 Po's)...
    how do i add these PO's to above ALV report....
    thanks in advance....

    Dear Vinay,
    Please use these piece of code...........
    These report contains sending Mail & As per your layout comment the sending mail codes and use for your requirement...........
    Paste in a test program and check these is sales order based report..........
    Built field catalog & and sort your PO number as per in the field output display and field catalog....................................
    * Type Group Declaration
    TYPE-POOLS: slis,vrm.
    *  Tables Declaration
    TABLES : vbak.
    *  Structure Declaration
    TYPES: BEGIN OF  ty_vbakvbap,
       vbeln  TYPE vbak-vbeln,
       kunnr  TYPE vbak-kunnr,
       netpr  TYPE vbap-netpr,
       posnr  TYPE vbap-posnr,
       matnr  TYPE vbap-matnr,
       kwmeng TYPE vbap-kwmeng,
       arktx  TYPE vbap-arktx,
    END OF ty_vbakvbap,
    gt_t_vbakvbap TYPE STANDARD TABLE OF ty_vbakvbap.
    TYPES : BEGIN OF ty_kna1,
       kunnr TYPE kna1-kunnr,
       name1 TYPE kna1-name1,
       pstlz TYPE kna1-pstlz,
       stras TYPE kna1-stras,
       ort01 TYPE kna1-ort01,
       land1 TYPE kna1-land1,
    END OF ty_kna1,
    gt_t_kna1 TYPE STANDARD TABLE OF ty_kna1.
    TYPES : BEGIN OF ty_mara,
       mbrsh TYPE mara-mbrsh,
       matnr TYPE mara-matnr,
       mtart TYPE mara-mtart,
       matkl TYPE mara-matkl,
    END OF ty_mara,
    gt_t_mara TYPE STANDARD TABLE OF ty_mara.
    TYPES : BEGIN OF ty_final,
       vbeln  TYPE vbak-vbeln,
       kunnr  TYPE vbak-kunnr,
       netpr  TYPE vbap-netpr,
       posnr  TYPE vbap-posnr,
       matnr  TYPE vbap-matnr,
       kwmeng TYPE vbap-kwmeng,
       arktx  TYPE vbap-arktx,
       name1 TYPE kna1-name1,
       pstlz TYPE kna1-pstlz,
       stras TYPE kna1-stras,
       ort01 TYPE kna1-ort01,
       land1 TYPE kna1-land1,
       mbrsh TYPE mara-mbrsh,
       mtart TYPE mara-mtart,
       matkl TYPE mara-matkl,
    END OF ty_final,
    gt_t_final TYPE STANDARD TABLE OF ty_final.
    * Internal Table Declaration
    DATA: gt_vbakvbap TYPE gt_t_vbakvbap,
           gw_vbakvbap  TYPE  ty_vbakvbap,
           gt_kna1      TYPE  gt_t_kna1,
           gw_kna1      TYPE  ty_kna1,
           gt_mara      TYPE  gt_t_mara,
           gw_mara      TYPE  ty_mara,
           gt_final     TYPE  gt_t_final,
           gw_final     TYPE  ty_final,
           gt_fcat      TYPE slis_t_fieldcat_alv,
           gw_fcat      TYPE slis_fieldcat_alv,
           v_kunnr      TYPE vbak-kunnr,
    * Sub total based on the header details Sales order no. vbeln = 5006.
           gt_sort TYPE slis_t_sortinfo_alv,
           gw_sort TYPE slis_sortinfo_alv,
          g_tab_lines TYPE i,
          e(10) TYPE c,
          gv_selected_value(10) TYPE c,
    * DOC AND VRM DETAILS.
           tab          TYPE TABLE OF ty_final.
    SELECTION-SCREEN  BEGIN OF BLOCK name WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_vbeln FOR vbak-vbeln DEFAULT '5006' TO '5009'.
    PARAMETERS     : p_kunnr TYPE kna1-kunnr.
    SELECTION-SCREEN  END OF BLOCK name.
    SELECTION-SCREEN  BEGIN OF BLOCK name1 WITH FRAME TITLE text-002.
    PARAMETERS     : r1 RADIOBUTTON GROUP gr1 USER-COMMAND c,
                      r2 RADIOBUTTON GROUP gr1.
    * Selection Screen for Radio button 2
    SELECTION-SCREEN
      BEGIN OF BLOCK name3 WITH FRAME TITLE text-004.
    SELECTION-SCREEN END OF BLOCK name3.
    SELECTION-SCREEN  END OF BLOCK name1.
    INITIALIZATION.
       LOOP AT SCREEN .
         IF screen-group1 = 'ONE' .
           screen-input   = 0.
           screen-invisible = 1.
           MODIFY SCREEN.
         ENDIF.
       ENDLOOP.
    AT SELECTION-SCREEN OUTPUT.
       CASE 'X'.
         WHEN r1.
           LOOP AT SCREEN.
             IF
               screen-group1 = 'ONE' .
               screen-input = 0.
               screen-invisible = 1.
               MODIFY SCREEN.
             ENDIF.
           ENDLOOP.
           ENDCASE.
    START-OF-SELECTION.
       PERFORM f_fetch_ty_vbakbvbap.
       PERFORM f_fetch_ty_kna1.
       PERFORM f_fetch_ty_mara.
       PERFORM f_fetch_ty_final.
       PERFORM top_of_page.
    * Body of the Email.
       PERFORM f_customer_validation.
       CASE 'X'.
         WHEN r1.
           IF gt_final IS NOT INITIAL.
             PERFORM f_field_catalog.
             PERFORM  f_output_display.
           ELSE.
             MESSAGE 'No Records Exist for the radio button' TYPE 'I'.
           ENDIF.
       ENDCASE.
    *&      Form  f_fetch_ty_vbakbvbap
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_fetch_ty_vbakbvbap .
       SELECT vbak~vbeln
       vbak~kunnr
       vbap~netpr
       vbap~posnr
       vbap~matnr
       vbap~kwmeng
       vbap~arktx
       INTO TABLE gt_vbakvbap
       FROM vbak
       INNER JOIN vbap
       ON vbak~vbeln = vbap~vbeln
        WHERE vbak~vbeln IN s_vbeln.
    ENDFORM.                    " f_fetch_ty_vbakbvbap
    *&      Form  f_fetch_ty_kna1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_fetch_ty_kna1 .
       IF gt_vbakvbap[] IS NOT INITIAL.
         SELECT kunnr
         name1
         pstlz
         stras
         ort01
         land1
         INTO TABLE gt_kna1
         FROM kna1
         FOR ALL ENTRIES IN gt_vbakvbap
         WHERE kunnr = gt_vbakvbap-kunnr.
       ENDIF.
    ENDFORM.                    " f_fetch_ty_kna1
    *&      Form  f_fetch_ty_mara
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_fetch_ty_mara .
       IF gt_kna1[] IS NOT INITIAL.
         SELECT mbrsh
         matnr
         mtart
         matkl
         INTO TABLE gt_mara
         FROM mara
         FOR ALL ENTRIES IN gt_vbakvbap
         WHERE matnr = gt_vbakvbap-matnr.
       ENDIF.
    ENDFORM.                    " f_fetch_ty_mara
    *&      Form  f_fetch_ty_final
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_fetch_ty_final .
       SORT gt_kna1 BY kunnr.
       LOOP AT gt_vbakvbap INTO gw_vbakvbap.
         MOVE: gw_vbakvbap-vbeln  TO gw_final-vbeln,
         gw_vbakvbap-kunnr  TO gw_final-kunnr,
         gw_vbakvbap-netpr  TO gw_final-netpr,
         gw_vbakvbap-posnr  TO gw_final-posnr,
         gw_vbakvbap-matnr  TO gw_final-matnr,
         gw_vbakvbap-kwmeng TO gw_final-kwmeng,
         gw_vbakvbap-arktx  TO gw_final-arktx.
         READ TABLE gt_kna1 INTO gw_kna1 WITH KEY kunnr = gw_vbakvbap-kunnr BINARY SEARCH.
         IF sy-subrc = 0.
           MOVE:  gw_kna1-name1 TO gw_final-name1,
           gw_kna1-pstlz TO gw_final-pstlz,
           gw_kna1-stras TO gw_final-stras,
           gw_kna1-ort01 TO gw_final-ort01,
           gw_kna1-land1 TO gw_final-land1.
           READ TABLE gt_mara INTO gw_mara WITH KEY matnr = gw_vbakvbap-matnr.
           MOVE: gw_mara-mbrsh TO gw_final-mbrsh,
           gw_mara-mtart TO gw_final-mtart,
           gw_mara-matkl TO gw_final-matkl.
           APPEND gw_final TO gt_final.
           CLEAR gw_final.
         ENDIF.
       ENDLOOP.
    ENDFORM.                    " f_fetch_ty_final
    *&      Form  f_output_display
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_output_display .
       DATA:lv_repid TYPE sy-repid.
       lv_repid = sy-cprog.
       DATA:w_layout TYPE slis_layout_alv.
       w_layout-colwidth_optimize = 'X'.
       w_layout-zebra = 'X'.
       gw_sort-fieldname = 'VBELN'.
       gw_sort-tabname = 'GW_FINAL'.
       gw_sort-subtot = 'X'.
       APPEND gw_sort TO gt_sort.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = sy-cprog
    *   I_CALLBACK_PF_STATUS_SET          = ' '
          i_callback_user_command           = 'USER_COMMAND'
          i_callback_top_of_page            = 'TOP_OF_PAGE'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
           is_layout                         = w_layout
          it_fieldcat                       = gt_fcat
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
         it_sort                           = gt_sort
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
         TABLES
           t_outtab                          = gt_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.                    " f_output_display
    *&      Form  f_field_catalog
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_field_catalog .
       gw_fcat-fieldname = 'VBELN'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Sales Order No'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'KUNNR'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Customer Number'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'NETPR'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Net Price'.
       gw_fcat-do_sum = 'X'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'POSNR'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Item Number'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'MATNR'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Material Number'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'KWMENG'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Cumulative Order Quantity'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'ARKTX'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Short text for sales '.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'NAME1'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Customer Name'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'PSTLZ'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Postal Code'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'STRAS'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'House number and street'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'ORT01'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'City'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'LAND1'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Country Key'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'MBRSH'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Industry sector'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'MTART'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Material Type'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'MATKL'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Material Group'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
    ENDFORM.                    " f_field_catalog

  • How to resolve the error in bdc call transaction in ALV report

    Dear Experts, i am executing the alv report program and in alv report program one bdc is there..
    after executing output is showing in alv format but one button is there (update master)..when i am clicking update button the bdc is run but is not updated in the material master..after executing my bdc is not updated in mm02.
    how to resove it?
    CALL TRANSACTION 'MM02' USING BDCDATA MODE MODE
                                                              UPDATE 'S'
                                                      MESSAGES INTO MESSTAB.

    Hi Kaustav,
    Looking at the code you attached, it appears to me that your BDC (Form  USER_COMMAND) is not executed at all as you haven't passed the 'USER_COMMAND' in FM REUSE_ALV_GRID_DISPLAY for ALV display.
    You must pass the importing parameter  I_CALLBACK_USER_COMMAND of this FM as 'USER_COMMAND', only then this form will be executed and your BDC will run.
    Thereafter, in case your BDC update fails, you can put a break-point in the form (at CALL TRANSACTION statement) and analyze the message table MESSTAB.
    Hope it helps.
    Regards,
    Sapeksh

  • Call transaction in ALV report

    Dear Experts,
    I want to call transaction HUMO from my ALV report on double click on Handling unit no.
    I want to pass the Handling unit through my report and skip the first screen.
    I try it using Call Transaction but the filed Handling unit doesn't have a parameter ID.
    I also try it using Submit but the program is a function pool.
    Can anyone please help me out in solving the issue.
    Thanks in advance
    Best regards
    Ankur G.

    Hai,
    This can be achieved by creating custom parameter id.
    1.Go to the table maintenance generator of the table TPARA and go to the Maintain button through the transaction SM30. 
    Enter the table view name TPARA.
    2.Click on the maintain button. The following information will appear. Click on the Tick button or the ENTER button to go to the next screen.
    3.Enter the Set/Get parameter id as the parameter ID you want to create. Here, I will be creating the parameter Id as ZNAME_DATA1. Click on ENTER button.
    4.It will ask for the text of the parameter Id. Enter the text of the parameter ID and click on the Save button.
    5.Now go to the SE11 transaction for creating a data element and enter the parameter id at the Further Characteristics tab at the parameter Id section.
    6.Activate the data element and use it with the program. It will act the same good as a standard one.

  • Can we call screen from ALV report

    Hi All,
    I am in the process of creating a stand alone application. However I have stuck up here.
    Problem: Can we call any screen from ALV report? If yes then how??? Can anyone give some code snippet??
    All your help appreciated.
    Thanks,
    Jignesh

    Hello Jignesh,
    Here is an example, when you double click on a line, it pops with with another screen that holds details for the flight information.
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click FOR EVENT double_click
                            OF cl_gui_alv_grid
                            IMPORTING e_row
                                      e_column.
       ENDCLASS.                    "lcl_event_handler
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        READ TABLE it_flight INTO wa_flight INDEX e_row-index.
        IF sy-subrc EQ 0.
          SELECT * FROM sbook
                   INTO TABLE it_book
                   WHERE carrid EQ wa_flight-carrid AND
                         connid EQ wa_flight-connid.
          CALL SCREEN 101 STARTING AT 10 10.
        ENDIF.
      ENDMETHOD.                 "HANDLE_DOUBLE_CLICK
    ENDCLASS.                    "LCL_EVENT_HANDLER
    MODULE status_0101 OUTPUT.
    Variant to save the layout
      gv_repid = sy-repid.
      IF g_custom_container2 IS INITIAL.
    Create an instance for Custom Container 'ALV_GRID'
        CREATE OBJECT g_custom_container2
               EXPORTING container_name = gs_container2.
    Create an instance for ALV Grid
        CREATE OBJECT g_grid2
               EXPORTING i_parent = g_custom_container2.
    Variant to save the layout
        gs_layout-grid_title = 'Flight Bookings'.
        CALL METHOD g_grid2->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SBOOK'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = it_book[].
      ELSE.
        CALL METHOD g_grid2->refresh_table_display.
      ENDIF.                               "IF grid2 IS INITIAL.
    Setting focus for created grid control
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = g_grid2.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                 " status_0101  OUTPUT
    Refer to BC_ALV_GRID04 for ALV data declarations used in the above piece of code.

  • What r the main events called in an alv report.............

    what r the mandatory events called in an alv grid report ................pls lemme know
    Message was edited by:
            'GURU'

    Hi
    there are no mandatory events by default
    chk this prog
    Hi
    chk this sample programs
    report zkiran .
    Global ALV Data Declarations
    type-pools: slis.
    Internal Tables
    data: begin of ialv occurs 0,
    test1(10) type c,
    test2(10) type c,
    end of ialv.
    data: fieldcat type slis_t_fieldcat_alv.
    start-of-selection.
    perform get_data.
    perform call_alv.
    Form GET_DATA
    form get_data.
    ialv-test1 = 'ABC'.
    ialv-test2 = 'DEF'.
    append ialv.
    ialv-test1 = 'GHI'.
    ialv-test2 = 'JKL'.
    append ialv.
    ialv-test1 = '123'.
    ialv-test2 = '456'.
    append ialv.
    endform. "GET_DATA
    CALL_ALV
    form call_alv.
    perform build_field_catalog.
    Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    it_fieldcat = fieldcat
    tables
    t_outtab = ialv.
    endform. "CALL_ALV
    BUILD_FIELD_CATALOG
    form build_field_catalog.
    clear: fieldcat. refresh: fieldcat.
    data: tmp_fc type slis_fieldcat_alv.
    tmp_fc-reptext_ddic = 'Test1'.
    tmp_fc-fieldname = 'TEST1'.
    tmp_fc-tabname = 'IALV'.
    tmp_fc-outputlen = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'Test2'.
    tmp_fc-fieldname = 'TEST2'.
    tmp_fc-tabname = 'IALV'.
    tmp_fc-outputlen = '10'.
    append tmp_fc to fieldcat.
    endform. "BUILD_FIELD_CATALOG
    reward points to all helpful answers
    kiran.M

  • Calling script from ALV report

    there is button in my report(print) when click on this it needs to display the report output in a script (which is designed for this)
    Please help me how to declare my itab variables in Script....
    only the data and page number will change rest all text elments are constant for differnet pages.
    the code in the USER_COMMAND of reuse_GRID_DISPLAY is
        WHEN 'PRINT'.
          i_itcpo-tdimmed = 'X'.
          i_itcpo-tddelete = 'X'.
          CALL FUNCTION 'START_FORM'
           EXPORTING
      ARCHIVE_INDEX          =
             form                   = 'ZSCRIPT'
             language               = 'SY-LANGU'
             startpage              = 'FIRST'
           EXCEPTIONS
            form                    = 1
             format                 = 2
        unended                = 3
        unopened               = 4
             unused                 = 5
             spool_error            = 6
             OTHERS                 = 7.
           CALL FUNCTION 'OPEN_FORM'
        EXPORTING
                    application = 'TX'
                   device      = 'PRINTER'
                    dialog      = 'X'
                    form        = 'ZSCRIPT'
                 options     = i_itcpo
               language    = sy-langu.
           PERFORM print_data.
          CALL FUNCTION 'CLOSE_FORM'.
          MESSAGE s208(00) WITH ' Form Successfully Printed.'.
          CALL FUNCTION 'END_FORM'.
    THE PERFORM DETAILS................
    *Left logo
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'LLOGO'
           EXCEPTIONS
                OTHERS  = 1.
    *script header
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'HEADER'
           EXCEPTIONS
                OTHERS  = 1.
    *standard text
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'TEXT'
           EXCEPTIONS
                OTHERS  = 1.
    *dispos detials
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'DISPOSI'
           EXCEPTIONS
                OTHERS  = 1.
    *ECN number
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'ECN'
           EXCEPTIONS
                OTHERS  = 1.
    *out_tab headings and data
      LOOP AT it_rep_out INTO wa_rep_out.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  element = 'DETAIL_A'
             EXCEPTIONS
         OTHERS  = 1.
        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  element = 'MAIN'
             EXCEPTIONS
                  element = 1
                  window  = 2.
        IF sy-subrc NE 0.
        ENDIF.
      ENDLOOP.
    *Comments from selection screen
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
               element = 'FOOTER'
           EXCEPTIONS
                OTHERS  = 1.

    Hi,
    first store all the relevant data in internal table itab.
    loop at itab.
    call write form
    endloop.
    care should be taken that you write the itab in main window.
    in script just add
    &itab-var1& &itab-var2& and so on...
    Regards,
    sumit

  • Calling infotype 0002 in ALV  report for showing employee photo

    Hi all,
    The requirment from business side is a report in which employees personal data shuold be shown with employee photo, I had tried for employee photo in ALV report but it didnt sucessed, then I went for other solution like calling transaction in ALV report.
    In this case I am calling Infotype 0002 but the issue is that the transaction PA20 is coming with PERNR but I am not able to go directlly to infotype which shows employee Photo,please suggest any solution.
    Thaks.
    JAY

    Hi Jay,
    It is possible. Please refer the syntax for the CALL TRANSACTION
    CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
                        | [USING bdc_tab [bdc_options]] }.
    You can do a recording till the required page comes & call the transaction accordingly. Hope, you are aware about the same.
    For example, I just had a solution to go to the roles tab in the user profile and I did as below:
        CLEAR wa_bdcdata.
        wa_bdcdata-program  = 'SAPLSUU5'.
        wa_bdcdata-dynpro   = '0050'.
        wa_bdcdata-dynbegin = k_ok.
        APPEND wa_bdcdata TO it_bdcdata.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam  = 'BDC_CURSOR'.
        wa_bdcdata-fval   = 'USR02-BNAME'.
        APPEND wa_bdcdata TO it_bdcdata.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam  = 'USR02-BNAME'.
        wa_bdcdata-fval   = g_value.
        APPEND wa_bdcdata TO it_bdcdata.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam  = 'BDC_OKCODE'.
        wa_bdcdata-fval   = 'SHOW'.
        APPEND wa_bdcdata TO it_bdcdata.
        CLEAR wa_bdcdata.
        wa_bdcdata-program  = 'SAPLSUU5'.
        wa_bdcdata-dynpro   = '0100'.
        wa_bdcdata-dynbegin = k_ok.
        APPEND wa_bdcdata TO it_bdcdata.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam  = 'BDC_OKCODE'.
        wa_bdcdata-fval   = '=ACTG'.
        APPEND wa_bdcdata TO it_bdcdata.
        g_opt-dismode = 'E'.
        g_opt-defsize = k_ok.
    *** if user click on the User Name, call SU01
        CALL TRANSACTION 'SU01' USING it_bdcdata
                    OPTIONS FROM g_opt.
    Regards,
    Selva K.

  • Call alv report dynamically

    how to call 2 diff alv reports in 1 custom control dynamically

    Hi Naveen,
    REPORT ytest .
    * Based on: BCALV_GRID_DEMO.
    TYPE-POOLS: icon.
    TYPES: BEGIN OF ty_s_sflight.
    INCLUDE TYPE sflight.
    TYPES: button1 TYPE lvc_emphsz.
    TYPES: button2 TYPE lvc_emphsz.
    TYPES: button3 TYPE lvc_emphsz.
    TYPES: button4 TYPE lvc_emphsz.
    TYPES: END OF ty_s_sflight.
    DATA:
    gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
    gt_fcat TYPE lvc_t_fcat.
    DATA: ok_code LIKE sy-ucomm,
    * gt_sflight TYPE TABLE OF sflight,
    g_container TYPE scrfname VALUE ‘BCALV_GRID_DEMO_0100_CONT1′,
    grid1 TYPE REF TO cl_gui_alv_grid,
    g_custom_container TYPE REF TO cl_gui_custom_container.
    * CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
    PUBLIC SECTION.
    CLASS-DATA:
    md_cnt TYPE i.
    CLASS-METHODS:
    handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING
    e_row_id
    e_column_id
    es_row_no
    sender.
    ENDCLASS. “lcl_eventhandler DEFINITION
    * CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
    METHOD handle_hotspot_click.
    * define local data
    FIELD-SYMBOLS:
    TYPE ty_s_sflight,
    TYPE ANY.
    READ TABLE gt_sflight ASSIGNING INDEX es_row_no-row_id.
    CHECK ( IS ASSIGNED ).
    * Set all radio buttons “unselected”
    -button1 = ICON_CANCEL.
    -button2 = ICON_CANCEL.
    -button3 = ICON_CANCEL.
    -button4 = ICON_CANCEL.
    ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE
    TO .
    IF ( IS ASSIGNED ).
    * Set selected radio button “selected”.
    = ICON_OKAY.
    ENDIF.
    * Force PAI followed by refresh of table display in PBO
    CALL METHOD cl_gui_cfw=>set_new_ok_code
    EXPORTING
    new_code = ‘DUMMY’
    * IMPORTING
    * RC =
    ENDMETHOD. “handle_hotspot_click
    ENDCLASS. “lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
    * MAIN *
    PERFORM select_data.
    CALL SCREEN 100.
    * MODULE PBO OUTPUT *
    MODULE pbo OUTPUT.
    SET PF-STATUS ‘MAIN100′.
    IF g_custom_container IS INITIAL.
    CREATE OBJECT g_custom_container
    EXPORTING container_name = g_container.
    CREATE OBJECT grid1
    EXPORTING i_parent = g_custom_container.
    PERFORM build_fieldcatalog.
    CALL METHOD grid1->set_table_for_first_display
    * EXPORTING
    * i_structure_name = ‘SFLIGHT’
    CHANGING
    it_fieldcatalog = gt_fcat
    it_outtab = gt_sflight.
    * Set event handler for event TOOLBAR
    SET HANDLER:
    lcl_eventhandler=>handle_hotspot_click FOR grid1.
    else.
    CALL METHOD grid1->refresh_table_display
    * EXPORTING
    * IS_STABLE =
    * I_SOFT_REFRESH =
    EXCEPTIONS
    FINISHED = 1
    others = 2.
    IF sy-subrc 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDMODULE. “PBO OUTPUT
    * MODULE PAI INPUT *
    MODULE pai INPUT.
    * to react on oi_custom_events:
    CALL METHOD cl_gui_cfw=>dispatch.
    * CASE ok_code.
    CASE sy-ucomm.
    WHEN ‘EXIT’.
    PERFORM exit_program.
    WHEN OTHERS.
    * do nothing
    ENDCASE.
    CLEAR ok_code.
    ENDMODULE. “PAI INPUT
    * FORM EXIT_PROGRAM *
    FORM exit_program.
    * CALL METHOD G_CUSTOM_CONTAINER->FREE.
    * CALL METHOD CL_GUI_CFW=>FLUSH.
    LEAVE PROGRAM.
    ENDFORM. “EXIT_PROGRAM
    *& Form BUILD_FIELDCATALOG
    * text
    * –> p1 text
    * 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DELETE gt_fcat WHERE ( fieldname ‘EMPHASIZE’ ).
    CALL FUNCTION ‘LVC_FIELDCATALOG_MERGE’
    EXPORTING
    * I_BUFFER_ACTIVE =
    i_structure_name = ‘SFLIGHT’
    * I_CLIENT_NEVER_DISPLAY = ‘X’
    * I_BYPASSING_BUFFER =
    * I_INTERNAL_TABNAME =
    CHANGING
    ct_fieldcat = gt_fcat
    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.
    READ TABLE gt_fcat INTO ls_fcat
    WITH KEY fieldname = ‘EMPHASIZE’.
    IF ( syst-subrc = 0 ).
    DELETE gt_fcat INDEX syst-tabix.
    ENDIF.
    ls_fcat-fieldname = ‘BUTTON4′.
    ls_fcat-icon = ‘X’.
    ls_fcat-hotspot = ‘X’.
    INSERT ls_fcat INTO gt_fcat INDEX 4.
    ls_fcat-fieldname = ‘BUTTON3′.
    INSERT ls_fcat INTO gt_fcat INDEX 4.
    ls_fcat-fieldname = ‘BUTTON2′.
    INSERT ls_fcat INTO gt_fcat INDEX 4.
    ls_fcat-fieldname = ‘BUTTON1′.
    INSERT ls_fcat INTO gt_fcat INDEX 4.
    LOOP AT gt_fcat INTO ls_fcat.
    ls_fcat-col_pos = syst-tabix.
    MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
    ENDLOOP.
    ENDFORM. ” BUILD_FIELDCATALOG
    *& Form SELECT_DATA
    * text
    * –> p1 text
    Reward pts if found usefull
    Regards
    Sathish

  • Extra columns in ALV report

    Hi there,
    I added a column to an existing alv report which uses method 'set_table_for_first_display' to display the output.
    The method is called via:
    grid1              TYPE REF TO cl_gui_alv_grid,
        CALL METHOD grid1->set_table_for_first_display
              EXPORTING
                        i_structure_name     = 'MAT_DATA'
                        is_layout            = lt_layout
                        is_variant           = lt_variant
                        i_default            = lt_default
                        i_save               = 'A'
                        it_toolbar_excluding = lt_exclude[]
               CHANGING it_outtab            = mat_data[]
                        it_fieldcatalog      = w_fieldcat[]
             EXCEPTIONS
                        program_error        = 1.
    The extra columns are in the field catalog and mat_data.
    The lt_variant-report field has the report name in it.
    When I run the report the new column does NOT appear.
    I cleared out the lt_variant-report value and now the new column DOES appear.
    Any idea why this is happening?
    Is there some way I can leave the report name in there and see the new columns?
    Thanks.

    thanks.
    no_out is initial.
    But, in this case, I am not passing any variant.
    It works if I don't pass the report name in the
    is_variant-report
    field.The columns will not display if I pass the report name.

  • Using Reports in WD4A

    Hello again.
    I have a question regarding the use of existing reports in a WD4A application.
    I managed it to show the result of a report in an IFrame. This only works with Reports that produce Abaplist which I convert to HTML.
    But I also want to use Reports/Querries that produce ALV as result. Is there a way to get the result into the WDA ALV component? Or maybe an easy way to plug existing reports into a WD4A component?
    Regards,
    Sascha

    HI,
    You can convert reports to WD4A applications. But there is no easy plu-in for this.
    To achive this, you first have to either create a function module with the whole logic of your report or write the whole logic in the methods in WD4A application.
    You can provide select-options and parameters also in the screen.
    You need not to convert to HTML in order to show it in the WD4A application.
    You can even show ALV reports in WD4A.
    There are plenty of demo programs available in the ECC systems.
    Check the below links for more information about WD4A.
    http://help.sap.com/saphelp_nw04s/helpdata/en/74/fd4142646ab46be10000000a155106/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/webdynpro-abap/web%20dynpro%20for%20abap%20sneak%20preview.htm
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    Thanks
    Ramakrishna

  • New field category not display in ALV report

    Hi,
    Hi, I modifying an existing ALV report.
    I have a problem to insert the new field into the ALV report.
    The field and column title have been populated in alv field category correctly, but when FM 'REUSE_ALV_GRID_DISPLAY'  executed, the new field and column didn't appear.
    Anybody can help me.
    Regards
    Nislina

    hi
    Add that new field in the fieldcatalog and populate the value in the value in the internal table.
    loop at it_fieldcatalog into wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'NEW_FIELD'.
    wa_fieldcatalog-outputlen = '15'.
    append wa_fieldcatalog to it_fieldcatalog.
    clear wa_fieldcatalog,
    endloop.
    regards
    ravish
    <b>plz reward points if helpful</b>

  • Documents on ALV Reporting

    Hi,
    Could you please send me the detailed document links  and PDFs if you have any on <b>ALV reporting</b> to my email - [email protected]
    Thanks,
    Bobby.

    Here you go ...
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html
    http://www.sap-img.com/fu037.htm
    /people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls--part-i
    /people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls-control-layouts--part-ii
    /people/thomas.jung3/blog/2005/10/26/alv-om-template-program
    /people/sap.user72/blog/2005/09/14/a-new-approach-to-alv-programming
    /people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming
    /people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
    /people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
    /people/ravikumar.allampallam/blog/2005/12/05/need-a-way-to-change-appearance-of-a-standard-existing-alv-report
    Apart from these search for articles on ALV, you will get a quite a few.
    Regards,
    Ravi
    Note : Please mark the helpful answers

Maybe you are looking for

  • My Zoom in Gesture Doesn't Work on Safari How can i make it work?

    I just bought a mac book pro 2011 and i know that the zoom in gesture used to work on safari at first but it doesnt anymore how can i make it work again?

  • How can I change default OEM DataPump job?

    Greetings, I have successfully created a DataPump job to run out of OEM GC by choosing the target database I wish to export, then under the Data Movement tab selecting the Export to Export Files option. I then create the DataPump job and it runs succ

  • Stationary Signature and More Templates

    Three questions: 1. How can I get my custm signature to show up in stationary templates? 2. How can I get more stationary templates? I already downloaded the ones form Equinex but would like more. 3. I know that you can also create them (stationary t

  • CTR start trigger error - USB6343

    Hi- A digital pulse from a device in my system is connected to the gate of CTR0 (PFI9). CTR0 is used as a quadrature encoder. My code routes PFI9 to the gate of CTR1 (PFI4) and also defines PFI9 as a start trigger for CTR3. CTR3 is set to generate a

  • How do I log-in for Adobe CreatePDF Desktop Printer?

    I just downloaded and installed the Adobe CreatePDF Desktop Printer but cannot print. Where do I have to type in my log-in details to use it?