Transferring alv grid data to other program

Hi All,
We have two reports, report A is for displaying data using ALV GRID, we want to let user select some lines in A and then click a button to transfer selected records to report B and make relevant select-options value default to the selected records. I tried the statement "IMPORT XXX FROM MEMORY ID XXX" in report B but seems ALV will empty them while switching to new report so I cannot get any result. Because the selection conditions in report A are a bit complex, so I can neither use "SUBMIT A EXPORTING LIST TO MEMORY WITH SEL = 'X' AND RETURN." in report B. Is there any solution?
Thank you!
Best Regards,
Jeff

See the example below
REPORT  ZTEST.
TYPE-POOLS: SLIS.
DATA : IT_FIELDCAT  TYPE  SLIS_T_FIELDCAT_ALV.
DATA: WA_FIELDCAT TYPE  SLIS_FIELDCAT_ALV.
DATA: BEGIN OF TA_MARC OCCURS 0 ,
        CHBOX(1)." TYPE C.
        INCLUDE STRUCTURE MARC.
DATA:        END OF TA_MARC.
SELECT *
       FROM MARC
       INTO CORRESPONDING FIELDS OF TABLE TA_MARC
       UP TO 10 ROWS.
DATA: IS_LAYOUT TYPE  SLIS_LAYOUT_ALV.
DATA: I_GRID_SETTINGS TYPE  LVC_S_GLAY.
I_GRID_SETTINGS-EDT_CLL_CB = 'X'.
*IS_LAYOUT-box_fieldname = 'CHBOX'.
*IS_LAYOUT-box_tabname = 'TA_MARC'.
*IS_LAYOUT-edit = 'X'.
WA_FIELDCAT-SELTEXT_L  = 'Check'.
WA_FIELDCAT-FIELDNAME = 'CHBOX'.
WA_FIELDCAT-CHECKBOX = 'X'.
WA_FIELDCAT-EDIT = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT .
WA_FIELDCAT-SELTEXT_L  = 'Material'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
*WA_FIELDCAT-edit = 'X'.   If U want to Make Material as Editable Field
APPEND WA_FIELDCAT TO IT_FIELDCAT.
WA_FIELDCAT-SELTEXT_L  = 'Plant'.
WA_FIELDCAT-FIELDNAME = 'WERKS'.
WA_FIELDCAT-EDIT = ''.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM      = SY-CPROG
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IT_FIELDCAT             = IT_FIELDCAT
    IS_LAYOUT               = IS_LAYOUT
    I_GRID_SETTINGS         = I_GRID_SETTINGS
  TABLES
    T_OUTTAB                = TA_MARC.
*&      Form  USER_COMMAND
*       text
*      -->R_UCOMM    text
*      -->R_SELFIELD text
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                  R_SELFIELD TYPE SLIS_SELFIELD.
  RANGES : MATNR FOR MARA-MATNR.
  LOOP AT TA_MARC  WHERE CHBOX = 'X'.
    MATNR-SIGN  =   'I'.
    MATNR-OPTION = 'EQ'.
    MATNR-LOW    = TA_MARC-MATNR.
    MATNR-HIGH  = ''.
    APPEND MATNR.
  ENDLOOP.
  SUBMIT ZTEST1 VIA SELECTION-SCREEN WITH MATNR IN MATNR and RETURN.
ENDFORM.                    "USER_COMMAND
When u will select rows in ZTEST ALV and press submit button data will pass to ZTEST1 on selection screen.
REPORT  ztest1.
tables: mara.
select-OPTIONS: matnr for mara-matnr.
BREAK-POINT.
Hope u are looking for same.
Thanks,
Suyog.

Similar Messages

  • Hi iam getting the alv grid data in excel format but iam facing one problem

    hi iam getting the alv grid data in excel format but iam facing one problem ,
    i.e., i want it read only  but iam getting it in edit mode i use layout default in excel iam getting in xl directly but in edit mode but i need it in read only mode
    what i have to do for that  and bdy knows reply me i need it urgently.

    there's always edit-mode if you choose excel-inplace - but noone can modify/rewrite the data
    A.

  • Reg alv grid  using module pool programming

    Dear Friends,
    I have a situation where i am using alv grid in module programming where in when i click the total button in the tool bar for any numeric column, the screen goes for a run time error.
    I have giving all conditions such as made the column in the field structure of lvc_field_catalog as do_sum = 'X',
    still goes for a dump...can anyone throw some hints to do more or the reason behind this and also have not excluded the function code for this total pushbutton while passing to the method set_table_for_first_display
    thanks...

    hi,
    check this up
    internal tables
    DATA: i_tab TYPE TABLE OF zchangereq,
    w_tab TYPE zchangereq.
    display field details
    DATA: w_field_cat_wa TYPE lvc_s_fcat. " Field Catalog work area
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-020.
    PARAMETERS: p_outs RADIOBUTTON GROUP g1,
    p_comp RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    *MACROS
    DEFINE add_field.
    &1 = FIELDNAME &2 = HEADING &3 = Key field flag
    clear w_field_cat_wa.
    w_field_cat_wa-fieldname = &1.
    lw_field_cat_wa-ref_table = p_ref_table.
    lw_field_cat_wa-inttype = p_inttype.
    lw_field_cat_wa-decimals = p_decimals.
    lw_field_cat_wa-coltext = p_coltext.
    lw_field_cat_wa-seltext = p_seltext.
    lw_field_cat_wa-do_sum = p_do_sum.
    lw_field_cat_wa-no_out = p_no_out.
    lw_field_cat_wa-col_pos = p_col_pos.
    lw_field_cat_wa-reptext = p_coltext.
    lw_field_cat_wa-colddictxt = p_colddictxt.
    w_field_cat_wa-scrtext_m = &2.
    w_field_cat_wa-key = &3.
    append w_field_cat_wa to i_field_cat.
    END-OF-DEFINITION.
    ALV specific Declarations...........................................
    ALV specific Internal table declarations.............................
    DATA: i_field_cat TYPE lvc_t_fcat, " Field catalogue
    i_alv_sort TYPE lvc_t_sort. " Sort table
    ALV variables........................................................
    DATA: w_alv_layout TYPE lvc_s_layo, " ALV Layout
    w_alv_save TYPE c, " ALV save
    w_alv_variant TYPE disvariant. " ALV Variant
    ALV Class definitions................................................
    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.
    METHODS: handle_hotspot
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id.
    ENDCLASS. " CLASS LCL_EVENT_HANDLER DEF..
    ALV Class implementation............................................
    In the Event of a Double Click drill down to the corresponding CHANGE REQUEST
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_double_click.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    not working yet - hotspot seems to stay in the gui!!
    METHOD handle_hotspot.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row_id-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row_id-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    ENDCLASS. " CLASS LCL_EVENT_HANDLER IMPL...
    ALV Grid Control definitions........................................
    DATA:
    ALV Grid Control itself
    o_grid TYPE REF TO cl_gui_alv_grid,
    Container to hold the ALV Grid Control
    o_custom_container TYPE REF TO cl_gui_custom_container,
    Event handler (defined in the class above)
    o_event_handler TYPE REF TO lcl_event_handler.
    INITIALIZATION.
    PERFORM create_field_catalogue. " Create ALV Field Catalog
    START-OF-SELECTION.
    Outstanding requests
    IF p_outs = 'X'.
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus < 99.
    ELSE.
    completed requests
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus = 99.
    ENDIF.
    END-OF-SELECTION.
    PERFORM list_output_to_alv. " Perform ALV Output operations
    FORM LIST_OUTPUT_TO_ALV *
    This subroutine is used to call the screen for ALV Output. *
    There are no interface parameters to be passed to this subroutine. *
    FORM list_output_to_alv.
    CALL SCREEN 100.
    ENDFORM. " LIST_OUTPUT_TO_ALV
    Module STATUS_0100 OUTPUT *
    This is the PBO module which will be processed befor displaying the *
    ALV Output. *
    MODULE status_0100 OUTPUT.
    SET PF-STATUS '0100'. " PF Status for ALV Output Screen
    IF p_outs = 'X'.
    SET TITLEBAR 'STD'.
    ELSE.
    completed requests
    SET TITLEBAR 'COMP'.
    ENDIF.
    CREATE OBJECT: o_custom_container
    EXPORTING container_name = 'SC_GRID',
    o_grid
    EXPORTING i_parent = o_custom_container.
    PERFORM define_alv_layout. " ALV Layout options definitions
    PERFORM save_alv_layout_options. " save ALV layout options
    PERFORM call_alv_grid. " Call ALV Grid Control
    ENDMODULE. " STATUS_0100 OUTPUT
    Module USER_COMMAND_0100 INPUT *
    This is the PAI module which will be processed when the user performs*
    any operation from the ALV output. *
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT' OR 'BACK' OR 'CANC'.
    may need to do this so display is refreshed if other report selected
    CALL METHOD o_custom_container->free.
    SET SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    FORM DEFINE_ALV_LAYOUT *
    This subroutine is used to Define the ALV layout. *
    FORM define_alv_layout .
    w_alv_layout-numc_total = 'X'. " Numc total line
    w_alv_layout-cwidth_opt = 'X'. " Optimal column width
    w_alv_layout-detailinit = 'X'. " Show values that are initial in
    " detail list.
    w_alv_layout-sel_mode = 'A'. " Column selection mode
    w_alv_layout-no_merging = 'X'. " No merging while sorting columns
    w_alv_layout-keyhot = 'X'.
    ENDFORM. " DEFINE_ALV_LAYOUT
    FORM SAVE_ALV_LAYOUT_OPTIONS *
    This subroutine is used to Save the ALV layout options. *
    FORM save_alv_layout_options.
    See the ALV grid control documentation for full list of options
    w_alv_save = 'A'.
    w_alv_variant-report = sy-repid.
    ENDFORM. " SAVE_ALV_LAYOUT_OPTIONS
    FORM CALL_ALV_GRID *
    This subroutine is used to call ALV Grid control for processing. *
    FORM call_alv_grid.
    CALL METHOD o_grid->set_table_for_first_display
    EXPORTING
    is_layout = w_alv_layout
    i_save = w_alv_save
    is_variant = w_alv_variant
    CHANGING
    it_outtab = i_tab[]
    it_sort = i_alv_sort
    it_fieldcatalog = i_field_cat.
    Link used Events and Event Handler Methods
    CREATE OBJECT o_event_handler.
    Set handler o_event_handler->handle_top_of_page for o_grid.
    SET HANDLER o_event_handler->handle_double_click FOR o_grid.
    ENDFORM. " CALL_ALV_GRID
    *& Form create_field_catalogue
    set up field catalogue
    FORM create_field_catalogue .
    Fieldname Heading Key?
    *eg add_field 'ZTYPE' 'Type' 'X'.
    ENDFORM. " create_field_catalogue

  • ALV Grid Traffic control Example  program implemented with function modules

    Hi Friends,
    Can any one please give me ALV Grid control traffic lights  example program implented using function modules instead of OOP ALV. It is very urgent,
    Thanks in advance,
    Santosh Kumar.

    Hi Santosh ,
    Here is a sampla code for the same
    TYPE-POOLS : SLIS.
    DATA : BEGIN OF IT_1 OCCURS 0 ,
               MATNR TYPE matnr ,
               FLAG TYPE C ,  " added for the traffic control
           END OF IT_1.
    SELECT MATNR INTO TABLE IT_1 " Select Data
    UP TO 10 ROWS
    FROM MARA.
    DATA : CATALOG TYPE SLIS_T_FIELDCAT_ALV ,
           WA_CATALOG TYPE SLIS_FIELDCAT_ALV ,
           LAYOUT TYPE SLIS_LAYOUT_ALV .
    *" create catalog
    WA_CATALOG-FIELDNAME = 'FLAG'.
    WA_CATALOG-TABNAME = 'IT_1'.
    APPEND WA_CATALOG TO CATALOG.
    WA_CATALOG-FIELDNAME = 'MATNR'.
    WA_CATALOG-TABNAME = 'IT_1'.
    APPEND WA_CATALOG TO CATALOG.
    DATA : FLAG_T TYPE I.
    *"assign value to traffic signal
    LOOP AT IT_1.
    FLAG_T = SY-TABIX MOD 2.
    IF FLAG_T = 0.
    IT_1-FLAG = '1'.
    ELSE.
    IT_1-FLAG = '2'.
    ENDIF.
    MODIFY IT_1.
    ENDLOOP.
    *"specify the traffic signal field in the layout
    LAYOUT-LIGHTS_FIELDNAME = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                =
    *   I_BUFFER_ACTIVE                   = ' '
    *   I_CALLBACK_PROGRAM                = ' '
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = ' '
    *   I_CALLBACK_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                         = LAYOUT
       IT_FIELDCAT                       = CATALOG
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_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
    *   IT_ALV_GRAPHICS                   =
    *   IT_ADD_FIELDCAT                   =
    *   IT_HYPERLINK                      =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    *   IT_EXCEPT_QINFO                   =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_1
    * 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.
    so rem all you need to do is add a feild in internal table for the traffic signal , assign values 0 , 1, 2 to it and last specify the name of this feild in the layout.
    Regards
    Arun

  • Setting ALV grid Graphic properties from program

    Hi all,
    Could any one tell me how to set the properties of the histogram generated by ALV output from program.
    I want to display the value on top of the bar, by setting this property from program.
    Manually i can do this by selecting the graph icon from the alv toolbar, and in the graph, right-click the bar, and from the context menu, select 'format data series', then choose 'Data labels' tab and then select 'Show value'.
    Thanks in advance.
    regards,
    Anup

    Hi Anup
    Yes, ALV Grid uses GFW for the graphics. However, it encapsulates the graphic object and let's your intervention to some extent. To do so, you can use the parameter at the interface of the method "<b>set_table_for_first_display</b>". Here is the information about the parameter:
    <u><b>IT_ALV_GRAPHICS</b></u>
    <i> Settings for displaying the ALV list as a diagram (for example, axis labels). The row type of the table has two fields (variables/value pairs):
    PROP_ID : Assign a constant attribute of the class CL_ALV_GRAPHICS_CU with prefix CO_PROPID_ to this field to determine the changes to be made to the graphic. Use the CL_ALV_GRAPHICS_CU=>CO_PROPID_TITLE attribute, for example, to refer to the title of the diagram.
    PROP_VAL : The value of the relevant topic, for example, 'My Title'.</i>
    You can also find <b>GFW</b> programs as "<b>GFW_DEMO_*</b>". If you want, you can prepare your own graphics and override the standard graphics function of the ALV Grid or add your own graphics functionality. For these you can refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    Kind regards...
    *--Serdar

  • Reg: Download alv grid data with top of page into excel sheet

    Hi All,
    I have a selection screen with radio button for download .
    If that radio button was selected then the data will download into excel sheet (like if we execute normal ALV grid display from there we can download top-of-page and body as it is).
    AOO : 2009P               
    Fiscal year : 2009               
    Posting period : 00               
    Local Currency : USD               
    CO Area Currency :               
    Accounting standard:               
    Sector : 23               
    BB code     Period Value LC     Periodic Quantity
    AHDKGKAJ   200                         0

    Did not get your question

  • Alv grid data

    Hi All,
       I developed alv grid.I passed data from it_final table into grid.In our it_final table, there is 10 rows and when I execute report then it comes 10 line item.It is perfect. Now I do subtotal in any field.Then In the
    grid total 15 line item comming.Now I want that 15 line item should come in a table.eithe it_final or
    either any defined table.is it possible?please help me.I want just output alv grid after subtotal(15 lines item) should come in table after pressing in any button.
    Thanks,
    Rakesh

    You will have to manually loop at it_final and calculate the subtotal for the fields and append this into the it_final while displaying.
    If you r calculating subtotal in sort table by subtos = 'X'. this entry cannot be put into final internal table.
    Regards,
    Mansi.

  • Re: ALV grid date format MM/DD/YYYY

    Hi All,
    i am craeting report in ALV grid, in that report i want to dispaly date like 'MM/DD/YYYY'. present its display like YYYYMMDD.
    can you give me some idea...
    Thanks
    zeni

    If you want to use the date type (this is the easiest way and it will be formatted according to the logon default of the master data of the current user):
    1. Be sure you are using a proper date type in the output table.
    2. Make sure that the following fields of the field catalog contain the following:
        LVC_S_FCAT-DATATYPE = 'DATS'.
        LVC_S_FCAT-INTTYPE = 'D'.
        LVC_S_FCAT-INTLEN = '000008'.
        LVC_S_FCAT-DD_OUTLEN = '000010'.
    However if you want to have a more generic approach that is independent on the user master data:
    Assuming output_tab-external_date is of type C and has 10 digits.
    data: date_int  type d value '20080808'.
    case date_format.
      when 'MM/DD/YYYY'.
        write date_int to output_tab-external_date MM/DD/YYYY.
       when 'MM/DD/YY'.
         write date_int to output_tab-external_date MM/DD/YY.
       when 'DD/MM/YYYY'.
         write date_int to output_tab-external_date DD/MM/YYYY.
       when 'DD/MM/YY'.
         write date_int to output_tab-external_date DD/MM/YY.
    endcase.
    append output_tab.
    Then make sure that the following fields of the field catalog contain the following:
        LVC_S_FCAT-DATATYPE = 'CHAR'.
        LVC_S_FCAT-INTTYPE = 'C'.
        LVC_S_FCAT-INTLEN = '000010'.
        LVC_S_FCAT-DD_OUTLEN = '000010'.

  • ALV Grid data transfer to Exel

    Hallo,
    When I transfer data from ALV-Grid to Exel then the summation row is not considerd or it is not there.What can I do that
    summation row also in EXEL appears.
    regards
    rana

    Check Mr. Naimesh Patel's blog for it [here >>>|http://help-abap.blogspot.com/2008/09/preserve-downloaded-data-formatting-in.html]

  • ALV Grid data changed

    Hello;
    i am using fm REUSE_ALV_GRID (not OO) to display an internal table. The user wants to change the data in a certain cell. I have marked this cell as editable and it works fine. I want to learn what to check in the event of data_changed. I have added this event in table ALV_EVENTS and directed to a subroutine. What parameters should i pass to the subroutine and what should i check to read the relevant line? Is it possible to control changes in more than one line?
    Thx
    Ali

    <i>Is it possible to control changes in more than one line?</i>
    yes.
    for usage of the method, and editable grid please refer the sample code.
    REPORT  ZTESTDFALV1                             .
    *Data Declaration
    DATA: BEGIN OF T_EKKO,
      EBELN TYPE EKPO-EBELN,
      EBELP TYPE EKPO-EBELP,
    END OF T_EKKO.
    DATA: BEGIN OF IT_EKKO OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_EKKO.
    DATA: BEGIN OF IT_BACKUP OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_BACKUP.
    *ALV data declarations
    TYPE-POOLS: SLIS.                                 "ALV Declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
      IT_BACKUP[] = IT_EKKO[].
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  build_fieldcatalog
    *       text
    FORM BUILD_FIELDCATALOG.
      REFRESH FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELN'.
      FIELDCATALOG-SELTEXT_M   = 'Purchase Order'.
      FIELDCATALOG-INPUT     = 'X'.
      FIELDCATALOG-EDIT     = 'X'.
      FIELDCATALOG-COL_POS     = 2.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELP'.
      FIELDCATALOG-SELTEXT_M   = 'PO Item'.
      FIELDCATALOG-COL_POS     = 3.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM BUILD_LAYOUT.
      "Permet d'ajuster les colonnes au text
    *  gd_layout-colwidth_optimize = 'X'.
      GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
    *  gd_layout-box_fieldname = 'SELECT'.
    *  gd_layout-box_tabname   = 'IT_EKKO'.
    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'
                I_CALLBACK_PF_STATUS_SET  = 'SET_PF_STATUS'
                I_CALLBACK_USER_COMMAND   = 'USER_COMMAND'
    *            i_grid_title             = 'My Title'
                IS_LAYOUT                 = GD_LAYOUT
                IT_FIELDCAT               = FIELDCATALOG[]
           TABLES
                T_OUTTAB                  = IT_EKKO
           EXCEPTIONS
                PROGRAM_ERROR             = 1
                OTHERS                    = 2.
      IF SY-SUBRC <> 0.
        WRITE:/ SY-SUBRC.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN EBELP
       UP TO 10 ROWS
        FROM EKPO
        INTO CORRESPONDING FIELDS OF TABLE  IT_EKKO.
    ENDFORM.                    " DATA_RETRIEVAL
    *                      FORM SET_PF_STATUS                              *
    FORM SET_PF_STATUS USING RT_EXTAB   TYPE  SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD_FULLSCREEN1' EXCLUDING RT_EXTAB.
    ENDFORM.                    "set_pf_status
    *&      Form  user_command
    *       text
    *      -->R_UCOMM    text
    *      -->RS_SELFIELDtext
    FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.
      <b>DATA: GD_REPID LIKE SY-REPID, "Exists
      REF_GRID TYPE REF TO CL_GUI_ALV_GRID. "new
    *then insert the following code in your USER_COMMAND routine...
      IF REF_GRID IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            E_GRID = REF_GRID.
      ENDIF.
      IF NOT REF_GRID IS INITIAL.
        CALL METHOD REF_GRID->CHECK_CHANGED_DATA
      ENDIF.</b>
      CASE R_UCOMM.
        WHEN '&IC1'.
          CHECK RS_SELFIELD-TABINDEX > 0.
          IF RS_SELFIELD-VALUE EQ '6000000001'.
            CALL TRANSACTION 'ZDF2'.
          ENDIF.
        WHEN 'ENTER'.
          READ TABLE IT_EKKO INDEX  RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            READ TABLE IT_BACKUP INDEX RS_SELFIELD-TABINDEX.
            IF SY-SUBRC = 0.
              IF IT_EKKO <> IT_BACKUP.
    *  then do your check
              ENDIF.
            ENDIF.
          ENDIF.
          PERFORM DATA_RETRIEVAL.
          RS_SELFIELD-REFRESH = 'X'.
      ENDCASE.
    ENDFORM.                    "user_command
    Regards
    Vijay

  • How to use two ALV grids in a single program (pl read below for details)?

    Please read thoroughly::
    I have an ALV report using REUSE_ALV_GRID_DISPLAY.
    On the output of this report, when I click on a "change" button, a couple of columns should be made editable.
    I achieved this by modifying the fieldcatalog and triggering the output with another REUSE_ALV_GRID_DISPLAY.
    When I click on the back button of this second report, it is still taking me to the first one.
    How to over come this?
    Note:
    I used custom containers etc but the default buttons on the container are not controllable. I added custom buttons but could not suppress the default ones. So I did not pursue this much even though this is more comfortable to use.
    I am not able to get into the code in debug to see how the default buttons like COPY, INSERT ROW etc are working.
    Can any body throw some inputs into this?
    Thanks,
    Ven.

    >I achieved this by modifying the fieldcatalog and triggering the >output with another REUSE_ALV_GRID_DISPLAY.
    >When I click on the back button of this second report, it is still >taking me to the first one.
    >How to over come this?
    For this there is a solution
    i am thinking you are using user_command and calling the second time ALV Grid if so check this.
    form user_command using r_ucomm type sy-ucomm selfield type slis_selfield.
    case r_ucomm.
    when 'CHANGE'.
    selfield-exit = 'X'.   "use this , this will solve the problem
    "i hope you are calling the Function here
    endform.

  • How can I read the raw data by other program?

    How can I use other program (such as C, MATLAB) to read the raw data acquired by biobench (*.bb)? Since the export function of biobench 1.0 is not convinient, I hope that I can read the data directly by decompressing the *.bb file. In other words, can one tells me the format of *.bb file?

    Take a look at Top BioBench Support Solutions>>BioBench Support Files>>bbfileio.zip,here is the link: http://digital.ni.com/public.nsf/websearch/3ABE21AD33DA83B0862569B400810BAE?OpenDocument

  • ALV GRID DATAS to TXT

    i wanted to write all data on grid to a txt file at the end of to program. this is my code. not all program but considered parts.
    Regrads.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           i_background_id    = 'ALV_BACKGROUND'
           i_buffer_active    = 'X'
           i_callback_program = g_repid
           it_fieldcat        = it_fieldcat
           is_layout          = gs_layout
           i_save             = g_save
           is_variant         = gs_variant
           it_events          = gt_events[]
         TABLES
           t_outtab           = it_vbak
         EXCEPTIONS
           program_error      = 1
           OTHERS             = 2.
       PERFORM save_file.
    FORM save_file.
       DATA: iv_filename TYPE string,
             iv_vbak1 TYPE TABLE OF vbak.
       iv_filename = 'C:\test\data1.txt'.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
           filename              = iv_filename
           filetype              = 'ASC'
           write_field_separator = 'X'
         TABLES
           data_tab              = it_fieldcat.
    ENDFORM.                    " save_file

    Hi,
    Pls look into below code
    TYPE-POOLS: slis,vrm.
    TABLES:vbak,vbrk,vbrp.
    TYPES:BEGIN OF gty_vbakvbap,
       vbeln TYPE vbak-vbeln,
       vkorg TYPE vbak-vkorg,
       audat TYPE vbak-audat,
       auart TYPE vbak-auart,
       kunnr TYPE vbak-kunnr,
       posnr TYPE vbap-posnr,
       matnr TYPE vbap-matnr,
       matkl TYPE vbap-matkl,
       kwmeng TYPE vbap-kwmeng,
    END OF gty_vbakvbap,
    gty_t_vbakvbap TYPE TABLE OF gty_vbakvbap.
    TYPES:BEGIN OF gty_kna1,
       kunnr TYPE kna1-kunnr,
       land1 TYPE kna1-land1,
       name1 TYPE kna1-name1,
       ort01 TYPE kna1-ort01,
    END OF gty_kna1,
    gty_t_kna1 TYPE TABLE OF gty_kna1.
    TYPES : BEGIN OF gty_vbrkvbrp,
             vbeln TYPE vbrk-vbeln,
             bukrs TYPE vbrk-bukrs,
             vkorg TYPE vbrk-vkorg,
             vtweg TYPE vbrk-vtweg,
             fkdat TYPE vbrk-fkdat,
             posnr TYPE vbrp-posnr,
             werks TYPE vbrp-werks,
       END OF gty_vbrkvbrp,
    gty_t_vbrkvbrp TYPE TABLE OF gty_vbrkvbrp.
    TYPES:BEGIN OF gty_final,
       vbeln TYPE vbak-vbeln,
       vkorg TYPE vbak-vkorg,
       audat TYPE vbak-audat,
       auart TYPE vbak-auart,
       kunnr TYPE vbak-kunnr,
       posnr TYPE vbap-posnr,
       matnr TYPE vbap-matnr,
       matkl TYPE vbap-matkl,
       kwmeng TYPE vbap-kwmeng,
       land1 TYPE kna1-land1,
       name1 TYPE kna1-name1,
       ort01 TYPE kna1-ort01,
       bukrs TYPE vbrk-bukrs,
       fkdat TYPE vbrk-fkdat,
       vtweg TYPE vbrk-vtweg,
       werks TYPE vbrp-werks,
    END OF gty_final,
    gty_t_final TYPE TABLE OF gty_final.
    TYPES:BEGIN OF gty_header,
       vbeln(15) TYPE c,
       vkorg(10) TYPE c,
       audat(15) TYPE c,
       auart(15) TYPE c,
       kunnr(15) TYPE c,
       posnr(10) TYPE c,
       matnr(15) TYPE c,
       matkl(10) TYPE c,
       kwmeng(10) TYPE c,
       land1(10) TYPE c,
       name1(10) TYPE c,
       ort01(10) TYPE c,
    END OF gty_header,
    gty_t_header TYPE TABLE OF gty_header.
    TYPES : t_document_data TYPE sodocchgi1,
             t_packing_list TYPE sopcklsti1,
             t_attachment TYPE solisti1,
             t_body_msg TYPE solisti1,
             t_receivers TYPE somlreci1.
    DATA: w_document_data TYPE t_document_data,
           w_packing_list TYPE t_packing_list,
           w_attachment TYPE   t_attachment,
           w_body_msg TYPE t_body_msg,
           w_receivers TYPE  t_receivers,
           e(10) TYPE c.
    DATA: i_document_data TYPE TABLE OF t_document_data,
           i_packing_list TYPE TABLE OF t_packing_list,
           i_attachment TYPE  TABLE OF t_attachment,
           i_body_msg TYPE TABLE OF t_body_msg,
           i_receivers TYPE TABLE OF t_receivers.
    DATA: e_mail TYPE somlreci1-receiver,
           date(10) TYPE c,
           time(8) TYPE c,
           dd(2) TYPE c,
           mm(2) TYPE c,
           yy(4) TYPE c,
           h(2) TYPE c,
           m(2) TYPE c,
           s(2) TYPE c,
           orders(10) TYPE c VALUE 'C:\Orders',
           gt_list TYPE vrm_values,
           gw_list TYPE vrm_value,
           gt_values TYPE TABLE OF dynpread,
           gw_values TYPE dynpread,
           gv_selected_value(10) TYPE c,
           g_tab_lines TYPE i,
           r_ucomm TYPE sy-ucomm,
    * 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.
       DATA : gv_qty TYPE string.
    DATA : gt_vbakvbap  TYPE gty_t_vbakvbap,
            gw_vbakvbap  TYPE gty_vbakvbap,
            gt_kna1      TYPE gty_t_kna1,
            gw_kna1      TYPE gty_kna1,
            gt_vbrkvbrp  TYPE gty_t_vbrkvbrp,
            gw_vbrkvbrp  TYPE gty_vbrkvbrp,
            gt_final     TYPE gty_t_final,
            gw_final     TYPE gty_final,
            gt_fcat      TYPE slis_t_fieldcat_alv,
            gw_fcat      TYPE slis_fieldcat_alv,
            tab          TYPE TABLE OF gty_final.
    data  zbomrnd.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text-010.
    SELECT-OPTIONS: s_fkdat FOR vbrk-fkdat,
                     s_bukrs FOR vbrk-bukrs,
                     s_vkorg FOR vbak-vkorg,
                     s_vtweg FOR vbak-vtweg,
                     s_werks FOR vbrp-werks,
                     s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF BLOCK blk.
    SELECTION-SCREEN BEGIN OF BLOCK selscr WITH FRAME TITLE text-001.
    PARAMETERS: p_rad1 RADIOBUTTON GROUP rad1 USER-COMMAND a ,
                 p_rad2 RADIOBUTTON GROUP rad1 .
    *-- Selection Screen for radio button 2
    SELECTION-SCREEN BEGIN OF BLOCK rad2 WITH FRAME TITLE text-001.
    PARAMETERS:p_file TYPE ibipparms-path MODIF ID one ,
    p_type(4) TYPE c AS LISTBOX VISIBLE LENGTH 20 MODIF ID one.
    SELECTION-SCREEN END OF BLOCK rad2.
    PARAMETERS: p_rad3   RADIOBUTTON GROUP rad1.
    *-- Selection Screen for radio button 3
    SELECTION-SCREEN BEGIN OF BLOCK rad3 WITH FRAME TITLE text-030.
    SELECT-OPTIONS : mail_id FOR e_mail NO INTERVALS MODIF ID two .
    SELECTION-SCREEN END OF BLOCK rad3.
    PARAMETERS:p_rad4   RADIOBUTTON GROUP rad1.
    *-- Selection Screen for radio button 4
    SELECTION-SCREEN BEGIN OF BLOCK rad4 WITH FRAME TITLE text-004.
    PARAMETERS: p_path TYPE rlgrap-filename MODIF ID tri.
    SELECTION-SCREEN END OF BLOCK rad4.
    SELECTION-SCREEN END OF BLOCK selscr.
    INITIALIZATION.
       LOOP AT SCREEN.
         IF  screen-group1 = 'TWO' OR
             screen-group1 = 'TRI'.
           screen-input = 0.
           screen-invisible = 1.
           MODIFY SCREEN.
         ENDIF.
       ENDLOOP.
       date = sy-datum.
       time = sy-uzeit.
       yy = date+0(4).
       mm = date+4(2).
       dd = date+6(2).
       h = time+0(2).
       m = time+2(2).
       s = time+4(2).
       date+0(2) = dd.
       date+2(1) = '-'.
       date+3(2) = mm.
       date+5(1) = '-'.
       date+6(4) = yy.
       time+0(2) = h.
       time+2(1) = '.'.
       time+3(2) = m.
       time+5(1) = '.'.
       time+6(2) = s.
       CONCATENATE  orders date time INTO p_file SEPARATED BY '_'.
       LOOP AT SCREEN.
         IF screen-group1 = 'ONE' OR
         screen-group1 = 'TWO' OR
         screen-group1 = 'TRI'.
           screen-input = 0.
           screen-invisible = 1.
           MODIFY SCREEN.
         ENDIF.
       ENDLOOP.
       gw_list-key = '.TXT'.
       gw_list-text = 'TXT'.
       APPEND gw_list TO gt_list.
       gw_list-key = '.CSV'.
       gw_list-text = 'CSV'.
       APPEND gw_list TO gt_list.
       gw_list-key = '.XLS'.
       gw_list-text = 'XLS'.
       APPEND gw_list TO gt_list.
       CALL FUNCTION 'VRM_SET_VALUES'
         EXPORTING
           id     = 'P_TYPE'
           values = gt_list.
       EXPORT tab TO MEMORY ID 'MESSAGE'.
    AT SELECTION-SCREEN OUTPUT.
       CASE 'X'.
         WHEN p_rad1 .
           LOOP AT SCREEN.
             IF screen-group1 = 'ONE' OR
             screen-group1 = 'TWO' OR
             screen-group1 = 'TRI'.
               screen-input = 0.
               screen-invisible = 1.
               MODIFY SCREEN.
             ENDIF.
           ENDLOOP.
         WHEN p_rad2.
           LOOP AT SCREEN.
             IF  screen-group1 = 'TWO' OR
             screen-group1 = 'TRI'.
               screen-input = 0.
               screen-invisible = 1.
               MODIFY SCREEN.
             ENDIF.
           ENDLOOP.
         WHEN p_rad3.
           LOOP AT SCREEN.
             IF screen-group1 = 'ONE' OR
             screen-group1 = 'TRI'.
               screen-input = 0.
               screen-invisible = 1.
               MODIFY SCREEN.
             ENDIF.
           ENDLOOP.
         WHEN p_rad4.
           LOOP AT SCREEN.
             IF screen-group1 = 'ONE' OR
             screen-group1 = 'TWO'.
               screen-input = 0.
               screen-invisible = 1.
               MODIFY SCREEN.
             ENDIF.
           ENDLOOP.
       ENDCASE.
    AT SELECTION-SCREEN ON p_type.
       CLEAR : gw_values,gt_values.
       REFRESH gt_values.
       gw_values-fieldname = 'P_TYPE'.
       APPEND gw_values TO gt_values.
       CALL FUNCTION 'DYNP_VALUES_READ'
         EXPORTING
           dyname             = sy-cprog
           dynumb             = sy-dynnr
           translate_to_upper = 'X '
         TABLES
           dynpfields         = gt_values.
       READ TABLE gt_values INDEX 1 INTO gw_values.
       IF sy-subrc = 0 AND gw_values-fieldvalue IS NOT INITIAL.
         READ TABLE gt_list INTO gw_list WITH KEY key = gw_values-fieldvalue.
         IF sy-subrc = 0.
           gv_selected_value = gw_list-text.
         ENDIF.
       ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
       CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name  = syst-cprog
           dynpro_number = syst-dynnr
           field_name    = 'P_FILE '
         IMPORTING
           file_name     = p_file.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
       CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name  = syst-cprog
           dynpro_number = syst-dynnr
           field_name    = 'P_PATH'
         IMPORTING
           file_name     = p_path.
    START-OF-SELECTION.
       CONCATENATE p_file p_type INTO p_file .
       PERFORM f_fetch_vbakvbap.
       PERFORM f_fetch_kna1.
       PERFORM f_fetch_vbrk.
       SORT BY gt_kna1.
       PERFORM f_fill_final.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
            EXPORTING
                 PERCENTAGE = sy-tabix
                 TEXT       = 'Extracting Data From Tables'.
    END-OF-SELECTION.
       CASE 'X'.
         WHEN p_rad1.
           IF gt_final IS NOT INITIAL.
             PERFORM f_fill_fcat.
             PERFORM f_display_alv.
           ELSE.
             MESSAGE 'No records exists for the selection' TYPE 'I'.
           ENDIF.
         WHEN p_rad2.
           IF p_type = ''.
             MESSAGE 'Enter the File Type' TYPE 'I'.
             EXPORT tab TO MEMORY ID 'MESSAGE'.
           ELSE.
             PERFORM f_gui_download.
           ENDIF.
         WHEN p_rad3.
           IF mail_id = ''.
             MESSAGE ' Enter the Email ID' TYPE 'I'.
           ELSE.
             PERFORM f_email.
           ENDIF.
         WHEN OTHERS.
           IF p_path = ''.
             MESSAGE 'Enter the Path' TYPE 'I'.
           ENDIF.
       ENDCASE.
    *&      Form  f_fetch_vbakvbap
    *       text
    FORM f_fetch_vbakvbap .
       SELECT vbak~vbeln vbak~vkorg vbak~audat vbak~auart vbak~kunnr
       vbap~posnr vbap~matnr vbap~matkl vbap~kwmeng
       INTO TABLE gt_vbakvbap
       FROM vbak
       INNER JOIN vbap
       ON vbak~vbeln = vbap~vbeln
       WHERE vbak~vtweg IN s_vtweg
       AND vbak~vkorg IN s_vkorg
       AND vbak~vbeln IN s_vbeln.
    ENDFORM.                    "f_fetch_vbakvbap
    *&      Form  f_fetch_kna1
    *       text
    FORM f_fetch_kna1 .
       IF NOT gt_vbakvbap[] IS INITIAL.
         SELECT kunnr land1 name1 ort01
         INTO TABLE gt_kna1
         FROM kna1
         FOR ALL ENTRIES IN gt_vbakvbap
         WHERE kunnr = gt_vbakvbap-kunnr.
       ENDIF.
    ENDFORM.                    "f_fetch_kna1
    *&      Form  f_fetch_vbrk
    *       text
    FORM f_fetch_vbrk .
       IF gt_vbakvbap[] IS NOT INITIAL.
         SELECT vbrk~vbeln vbrk~bukrs vbrk~vkorg vbrk~vtweg vbrk~fkdat vbrp~posnr vbrp~werks
           INTO TABLE gt_vbrkvbrp
         FROM vbrk
         INNER JOIN vbrp
       ON vbrk~vbeln = vbrp~vbeln
         WHERE fkdat IN s_fkdat
         AND   bukrs IN s_bukrs
         AND   werks IN s_werks
         AND   vtweg IN s_vtweg.
       ENDIF.
    ENDFORM. " f_fetch_vbrk
    *&      Form  f_fetch_vbrp
    *       text
    *  -->  p1        text
    *  <--  p2        text
    *&      Form  f_fill_final
    *       text
    FORM f_fill_final .
       CLEAR :gv_qty.
       LOOP AT gt_vbakvbap INTO gw_vbakvbap.
         MOVE : gw_vbakvbap-vbeln TO gw_final-vbeln,
         gw_vbakvbap-vkorg TO gw_final-vkorg,
         gw_vbakvbap-audat TO gw_final-audat,
         gw_vbakvbap-auart TO gw_final-auart,
         gw_vbakvbap-kunnr TO gw_final-kunnr,
         gw_vbakvbap-posnr TO gw_final-posnr,
         gw_vbakvbap-matnr TO gw_final-matnr,
         gw_vbakvbap-matkl TO gw_final-matkl,
         gw_vbakvbap-kwmeng TO gw_final-kwmeng.
         gv_qty = gv_qty + gw_final-kwmeng.
         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-land1 TO gw_final-land1,
                 gw_kna1-ort01 TO gw_final-ort01.
         ENDIF.
         READ TABLE gt_vbrkvbrp INTO gw_vbrkvbrp WITH KEY vkorg = gw_vbakvbap-vkorg.
         IF sy-subrc = 0.
           MOVE: gw_vbrkvbrp-fkdat TO gw_final-fkdat,
                 gw_vbrkvbrp-bukrs TO gw_final-bukrs,
                 gw_vbrkvbrp-vtweg TO gw_final-vtweg,
                 gw_vbrkvbrp-werks TO gw_final-werks.
         ENDIF.
         APPEND gw_final TO gt_final.
         CLEAR gw_final.
       ENDLOOP.
    ENDFORM.                    "f_fill_final
    *&      Form  f_fill_fcat
    *       text
    FORM f_fill_fcat .
       gw_fcat-fieldname = 'VBELN'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Sales Order'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'VKORG'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Sales Org.'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'VTWEG'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Distribution Channel'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'AUDAT'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Document Date'.
       APPEND gw_fcat TO gt_fcat.
       CLEAR gw_fcat.
       gw_fcat-fieldname = 'AUART'.
       gw_fcat-tabname = 'GT_FINAL'.
       gw_fcat-seltext_m = 'Document Type'.
       APPEND gw_fcat TO gt_fcat.

  • How to get  selected records from an ALV  Grid in some other internal table

    I am using a standard SAP program (RFKKMA02) in a Z program. Now i want to select some rows in ALV and after doing some modification, i want to store those records in some other internal table. I am not using OO concept.
    Thanks in advance.

    u create first internal table of structur of fields that u want to copy and then move taht values to internal table

  • ALV GRID DATA IDENTIFICATION

    Hi all,
    I am using FM : REUSE_ALV_GRID_DISPLAY to set up an ALV list.
    I have added a button to export the data to a particular format of text as a *.txt document.
    I cannot find out how to identify the data that is actually on the screen.
    I explain, if I have 5 colums and that I hide 3 of them, when I export to excel, I only get the two remaining colums.
    I would like to acheive the same data extraction to send to my txt file.
    Has anyone got an idea ?
    Nicolas

    Nicolas,
    The function REUSE_ALV_GRID_LAYOUT_INFO_GET will give you back the modified field catalog with the changes you have done. So the NO_OUT parameter will be set for the fields you have hidden.
    Identify those fields and transfer only those fields data into another internal table and export the data.
    Regards,
    Ravi
    Note : please mark the helpful answers

Maybe you are looking for

  • Hiding columns dynamically in a table control

    Hello all, Based on the selected value in a dropdown box, I want to hide some columns in a table control. The table control is generated using the wizard from a work area and itab in the program. I have tried things like loop at screen.   if screen-n

  • Finding Mailbox on hardrive with Mountain lion?

    I replaced the drive in my mac book pro. I would now like to now import mailboxes from the previous hard drive (that had Mountain Lion) mailboxes are hidden. How do I access them so I can import my mail?

  • I did a some reminders where do I find them on my mac

    I did a some reminders where do I find them on my mac

  • New page tb not loading correctly.

    Awhile ago, my grandson downloaded something to my computer that installed the Babylon search engine to my computer. It replaced the new page tabs. I have removed Babylon from my machine, at least everything I could find, but the new page tab still l

  • Bug in windows installer

    The windows installer for jmf seems to overwrite the CLASSPATH instead of appending, which you would expect. /Esben