Destroy ALV which is using Screen as container

<b>What I did:</b>
*In the PBO of screen <b>200</b>
*Created a l_alv of type alv grid which is using screen as container
    CREATE OBJECT l_alv EXPORTING i_parent = cl_gui_container=>screen0.
*filling it with data
*--Transfer data to ALV
  CALL METHOD l_alv->set_table_for_first_display
Expor . . .
When user is pressing F3 on screen <b>200</b>, i m going back to sel-screen
leave to screen 1000
or
call selection-screen 1000
<b>Problem Statement:</b>
Though I am landing up to screen 1000 as i can see the menu of sel screen, but my ALV is still visible on top of screen 1000
<b>What I did:</b>
to destroy it, i m using these lines before <i>Call selection-screen 1000</i>
call method cl_gui_container=>screen0->free.
call method l_alv->free.

* Internal Tables:
DATA: i_exclude TYPE ui_functions,   " Function button table definitions
      i_fieldcat TYPE lvc_t_fcat,    " Field catalogue
      i_output TYPE STANDARD TABLE OF ZLIGHT_STRUC,
      i_groups  TYPE lvc_t_sgrp,
* Work Areas:
       w_variant TYPE disvariant,          " Enable variant saving
       w_layout  TYPE lvc_s_layo,          " Define the layout structure
       w_output TYPE MARA.
* Constants Declaration
CONSTANTS:  c_a       TYPE c VALUE 'A'.          "All Layouts
* Object Declarations
DATA : o_alvgrid          TYPE REF TO cl_gui_alv_grid,
       o_dockingcontainer TYPE REF TO cl_gui_docking_container.
In PBO,
FORM f9000_objects_create.
* Check to see if we are runnng on online
  IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    CREATE OBJECT o_dockingcontainer
      EXPORTING
        ratio                       = '95'
     EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      others                      = 6.
    IF sy-subrc NE 0.
*      MESSAGE i001 WITH text-e01.
      LEAVE LIST-PROCESSING.
    ENDIF.
  ENDIF.
  CREATE OBJECT o_alvgrid
    EXPORTING
      i_parent = o_dockingcontainer.
ENDFORM.                    " f9000_objects_create
FORM f9200_build_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat
                      USING value(p_structure).
  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
            i_structure_name       = p_structure
       CHANGING
            ct_fieldcat            = p_fieldcat[]
       EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
  IF sy-subrc <> 0.
*    MESSAGE i277.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " f9200_build_field_cat
FORM f9400_layout USING    value(ptitle)
                     value(pzebra)
                     value(pmode)
                     value(pwidth)
                     value(pvariant).
  w_layout-grid_title = ptitle.
  w_layout-zebra      = pzebra.
  w_layout-sel_mode   = pmode.
  w_layout-cwidth_opt = pwidth.
  w_variant-handle    = pvariant.
  w_variant-report    = sy-repid.
ENDFORM.                    " f9400_layout
FORM f9500_display_data TABLES p_output
                         p_groups
                         p_exclude
                         p_fieldcat
                  USING value(p_layout).
  CALL METHOD o_alvgrid->set_table_for_first_display
     EXPORTING
       is_variant                    = w_variant
       i_save                        = c_a
       is_layout                     = p_layout
       it_special_groups             = p_groups[]
       it_toolbar_excluding          = p_exclude[]
    CHANGING
       it_outtab                     = p_output[]
       it_fieldcatalog               = p_fieldcat[]
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       OTHERS                        = 4.
  IF sy-subrc <> 0.
*    MESSAGE i278.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " f9500_display_data
FORM f9600_free_objects USING pobject
                    value(ptype)
                    value(ptext).
  DATA: l_objectalv TYPE REF TO cl_gui_alv_grid.
* Need to type the field symbol or it does not work
  CASE ptype.
    WHEN 'ALV'.
      l_objectalv = pobject.
      IF NOT ( l_objectalv IS INITIAL ).
        CALL METHOD l_objectalv->free
          EXCEPTIONS
            cntl_error        = 1
           cntl_system_error = 2
            OTHERS            = 3.
        CLEAR: pobject, l_objectalv.
        PERFORM f9700_error_handle USING ptext.
      ENDIF.
    WHEN 'DOCKING'.
      DATA: lobjectdock TYPE REF TO cl_gui_docking_container.
      lobjectdock = pobject.
      IF NOT ( lobjectdock IS INITIAL ).
        CALL METHOD lobjectdock->free
          EXCEPTIONS
            cntl_error        = 1
           cntl_system_error = 2
            OTHERS            = 3.
        CLEAR: pobject, lobjectdock.
        PERFORM f9700_error_handle USING ptext.
      ENDIF.
    WHEN 'CONTAINER'.
      DATA: lobjectcontainer TYPE REF TO cl_gui_container.
      lobjectcontainer = pobject.
      IF NOT ( lobjectcontainer IS INITIAL ).
        CALL METHOD lobjectcontainer->free
          EXCEPTIONS
            cntl_error        = 1
           cntl_system_error = 2
            OTHERS            = 3.
        CLEAR: pobject, lobjectcontainer.
        PERFORM f9700_error_handle USING ptext.
      ENDIF.
    WHEN OTHERS.
      sy-subrc = 1.
      PERFORM f9700_error_handle USING
                                text-e04.
  ENDCASE.
ENDFORM.                    " f9600_free_objects
*&      Form  f9700_error_handle
*       This form is used to handle errors
*      -->P_PTEXT - Text holding the messsage to be displayed as
*                   information
FORM f9700_error_handle USING    value(ptext).
  IF sy-subrc NE 0.
* Add your handling, for example
    CALL FUNCTION 'POPUP_TO_INFORM'
         EXPORTING
              titel = text-e03
              txt2  = sy-subrc
              txt1  = ptext.
  ENDIF.
ENDFORM.                    " f9700_error_handle
MODULE status_9001 OUTPUT.
  IF o_dockingcontainer IS INITIAL.
    SET PF-STATUS 'ZSTATUS'.
    SET TITLEBAR 'ZTITLE'.
*Create Objects
    PERFORM f9000_objects_create.
*Build field catalog
    PERFORM f9200_build_field_cat TABLES i_fieldcat
                             USING 'MARA.
*Layout
    PERFORM f9400_layout USING sy-title 'X' 'X' 'X' p_layout.
*Display data
    PERFORM f9500_display_data TABLES i_output
                                i_groups
                                i_exclude
                                i_fieldcat
                          USING w_layout.
  ENDIF.
ENDMODULE.                 " STATUS_9001  OUTPUT
*&      Module  USER_COMMAND_9001  INPUT
* This is used for PAI details
MODULE user_command_9001 INPUT.
  CASE sy-ucomm.
    WHEN 'EXIT' OR  'CANC'.
      PERFORM f9600_free_objects:
               USING o_alvgrid 'ALV' text-e02,
               USING o_dockingcontainer 'DOCKING'
                       text-e01.
      LEAVE PROGRAM.
    WHEN 'BACK'.
      PERFORM f9600_free_objects:
               USING o_alvgrid 'ALV' text-e02,
               USING o_dockingcontainer 'DOCKING'
                       text-e01.
      SET SCREEN '0'.
      LEAVE SCREEN.
    WHEN OTHERS.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_9001  INPUT
Hope this helps u.

Similar Messages

  • Multiple ALV display in one screen using SALV(Factory method)...

    Hello Experts,
    I tried using the old 'REUSE_ALV_BLOCK_LIST_APPEND' but it does not suit my
    requirement. So will it be possible to display multiple ALV display(block) using
    SALV?

    check the sample code..
    REPORT  zsalv_demo_multiple.
    DATA: salv1 TYPE REF TO cl_salv_table,
          salv2 TYPE REF TO cl_salv_table,
          salv3 TYPE REF TO cl_salv_table.
    DATA: g_custom TYPE REF TO cl_gui_custom_container,
    o_splitter    TYPE REF TO cl_gui_splitter_container,
    o_grid1 TYPE REF TO cl_gui_container,
    o_grid2  TYPE REF TO cl_gui_container,
    o_grid3  TYPE REF TO cl_gui_container.
    DATA: it_flight TYPE STANDARD TABLE OF sflight,
          it_carr  TYPE TABLE OF scarr,
          it_book TYPE TABLE OF sbook.
    START-OF-SELECTION.
      SELECT * FROM sflight
      INTO TABLE it_flight
      UP TO 20 ROWS.
      SELECT * FROM scarr
      INTO TABLE it_carr
      UP TO 20 ROWS.
      SELECT * FROM sbook
      INTO TABLE it_book
      UP TO 20 ROWS.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ABC'.
      CREATE OBJECT g_custom
      EXPORTING container_name = 'CONT'.
      CREATE OBJECT o_splitter
      EXPORTING parent  = g_custom
      rows    = 3
      columns = 1.
      CALL METHOD o_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = o_grid1.
      CALL METHOD o_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = o_grid2.
      CALL METHOD o_splitter->get_container
        EXPORTING
          row       = 3
          column    = 1
        RECEIVING
          container = o_grid3.
      cl_salv_table=>factory(
        EXPORTING
          r_container    = o_grid1
        IMPORTING
          r_salv_table   = salv1
        CHANGING
          t_table        = it_flight
      cl_salv_table=>factory(
        EXPORTING
          r_container    = o_grid2
        IMPORTING
          r_salv_table   = salv2
        CHANGING
          t_table        = it_carr
      cl_salv_table=>factory(
        EXPORTING
          r_container    = o_grid3
        IMPORTING
          r_salv_table   = salv3
        CHANGING
          t_table        = it_book
      CALL METHOD salv1->display.
      CALL METHOD salv2->display.
      CALL METHOD salv3->display.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Flow Logic..
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    in the Screen i placed a custom control and named it as CONT

  • Hi,I am developing an iphone app which is using camera device. When app comes from background to foregroung and when we switch on capture screen,the shutter is stuck,Can anyone help?

    Hi,
    I am developing an iphone app which is using camera device. When app comes from background to foreground and when we switch on screen for using camera, the shutter is stuck.
    Can anyone help?

    Post in the developer's forum.

  • HT201441 I recentley bought a second-hand iPad mini and a screen came up in which i needed to type in the apple Id which was used to set up the iPad.

    I recently bought an iPad mini online in which I had to type in the previous apple Id in which was used to set it up. I absolutely have no idea what to do and searched online to see what i can do and I was told to speak to apple.  Can you please reply as soon as you can and help me out!
    Thanks

    You bought brick, return it fast.

  • Filter is not working in ALV GRID output using FM 'REUSE_ALV_GRID_DISPLAY'

    Hello Experts,
    I have searched SCN before posting this thread.
    In my report output (by using 'REUSE_ALV_GRID_DISPLAY'), i am trying to filter values which is of type CHAR.
    Unable to filter by char30 field in the report output.
    Tried to filter using the following steps:
    Selected the column which i want to filter-> then selected filter symbol of ALV toolbar.
    Selection screen appeared where select-option of that field displayed.
    Selection screen only allows user to enter 1 character.
    Even though the field contains 30 characters the filed in selection screen appeared with 1char length.
    This is the same for all the fields in that ALV. Please suggest how can i change the field length to original field length.

    In field catalog pass:
    wa_alv_fieldcat-outputlen   = p_len
    Set p_len as 30.
    'FIELD'            text-001   '01' 'X'  '30'  'L'

  • Dynamic ALV that fits all screen sizes.

    Hi Pundits,
        Could you please help me with how i can modify an alv, which is created using OOPS, to fit all the screen sizes without having to change the container size.
    Thanks,
    Reson

    Hi Reson,
    For that u need to go for docking container,
    create an object of type ref to CL_GUI_DOCKING_CONTAINER.
    If u see the CONSTRUCTOR of that class, u have parameters like ratio, extension etc.
    ratio : Percentage of Screen, Takes Priority Over
            EXTENSION
    see this sample of code :
    data : o_dockingcontainer1 TYPE REF TO
           cl_gui_docking_container.
    CREATE OBJECT o_dockingcontainer1
          EXPORTING
    Ratio must be included in [5..95]
            ratio                     = '95'
         EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6.
        IF sy-subrc NE 0.
          MESSAGE i050 WITH text-026. " Error in object
                                        creation
          LEAVE LIST-PROCESSING.
        ENDIF.
    Here the ratio takes the value between 5 and 95.
    Please reward the helpful answers.

  • 3 ALV on a single screen.

    Hi,
    I need to display 3 alv on a single screen.
    There is a FM called 'REUSE_ALV_BLOCK_LIST_APPEND' which can do it but in the documentation its advised not to use it,since it has still not been released.
    Is there some other way to display 3 alvs on a screen

    hai chitrantan,
    check out whether this satisfies your condition.
    EXAMPLE:
    DEFINE m_fieldcat.
      ls_fieldcat-fieldname = &1.
      ls_fieldcat-ref_tabname = &2.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    DEFINE m_sort.
      ls_sort-fieldname = &1.
      ls_sort-up        = 'X'.
      append ls_sort to lt_sort.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '02' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
      gs_layout TYPE slis_layout_alv,
    1st Table
      BEGIN OF gt_kna1 OCCURS 0,           " Data displayed
        kunnr LIKE kna1-kunnr,             " Customer number
        ernam LIKE kna1-ernam,             " Name of Person who Created
        erdat LIKE kna1-erdat,             " Creation date
        name1 LIKE kna1-name1,             " Name 1
      END OF gt_kna1,
    2nd Table
      BEGIN OF gt_mara OCCURS 0,
        ernam LIKE mara-ernam,             " Name of Person who Created
        matnr LIKE mara-matnr,             " Material number
        ersda LIKE mara-ersda,             " Creation date
        brgew LIKE mara-brgew,             " Gross weight
      END OF gt_mara,
    3rd Table
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
        waerk LIKE vbak-waerk,             " SD document currency
      END OF gt_vbak.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
    Read data
      SELECT * FROM kna1
                 UP TO p_max ROWS
               INTO CORRESPONDING FIELDS OF TABLE gt_kna1.
      SELECT * FROM mara
                 UP TO p_max ROWS
               INTO CORRESPONDING FIELDS OF TABLE gt_mara.
      SELECT * FROM vbak
                 UP TO p_max ROWS
               INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
      PERFORM f_display_data.
          FORM USER_COMMAND                                             *
    FORM user_command USING i_ucomm     LIKE sy-ucomm
                            is_selfield TYPE slis_selfield.     "#EC CALLED
      CASE i_ucomm.
        WHEN '&IC1'.                       " Pick
          CASE is_selfield-sel_tab_field(7).
            WHEN 'GT_MARA'.
            WHEN 'GT_KNA1'.
            WHEN 'GT_VBAK'.
              READ TABLE gt_vbak INDEX is_selfield-tabindex.
              IF sy-subrc EQ 0.
                SET PARAMETER ID 'AUN' FIELD gt_vbak-vbeln.
                CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
          Form  f_display_data
    FORM f_display_data.
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
      gs_layout-group_change_edit = 'X'.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
      gs_layout-detail_popup      = 'X'.
      gs_layout-get_selinfos      = 'X'.
    Build field catalog and sort table
      m_fieldcat  'KUNNR' 'KNA1'.
      m_fieldcat  'ERNAM' 'KNA1'.
      m_fieldcat  'ERDAT' 'KNA1'.
      m_fieldcat  'NAME1' 'KNA1'.
      m_sort  'KUNNR'.
    Build Event Table
      MOVE        'TOP_OF_PAGE'        TO ls_event-name.
      MOVE        'TOP_OF_PAGE'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      MOVE        'END_OF_LIST'        TO ls_event-name.
      MOVE        'END_OF_LIST'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program      = sy-cprog
                i_callback_user_command = 'USER_COMMAND'
                it_fieldcat             = lt_fieldcat
                is_layout               = gs_layout
                it_events               = lt_events
                it_sort                 = lt_sort
           TABLES
                t_outtab                = gt_kna1.
    ENDFORM.                               " F_DISPLAY_DATA
          FORM top_of_page                                              *
    FORM top_of_page.                                           "#EC CALLED
      ULINE.
      WRITE : sy-uname, sy-title(56) CENTERED, sy-datum.
      ULINE.
    ENDFORM.                               " TOP_OF_PAGE
          FORM End_of_list                                              *
    FORM end_of_list.                                           "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'MATNR' 'MARA'.
      m_fieldcat 'ERNAM' 'MARA'.
      m_fieldcat 'ERSDA' 'MARA'.
      m_fieldcat 'BRGEW' 'MARA'.
      m_sort 'MATNR'.
    Build Event Table
      MOVE 'END_OF_LIST'   TO ls_event-name.
      MOVE 'END_OF_LIST_2' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program = sy-cprog
                it_fieldcat        = lt_fieldcat
                is_layout          = gs_layout
                it_sort            = lt_sort
                it_events          = lt_events
           TABLES
                t_outtab           = gt_mara.
    ENDFORM.                               " END_OF_LIST
          FORM End_of_list_2                                            *
    FORM end_of_list_2.                                         "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'VBELN' 'VBAK'.
      m_fieldcat 'VKORG' 'VBAK'.
      m_fieldcat 'KUNNR' 'VBAK'.
      m_fieldcat 'NETWR' 'VBAK'.
      m_fieldcat 'WAERK' 'VBAK'.
      m_sort 'VBELN'.
    Build Event Table
      MOVE 'TOP_OF_PAGE' TO ls_event-name.
      MOVE 'TOP_OF_PAGE' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program = sy-cprog
                it_fieldcat        = lt_fieldcat
                is_layout          = gs_layout
                it_sort            = lt_sort
                it_events          = lt_events
           TABLES
                t_outtab           = gt_vbak.
    ENDFORM.    
    HOPE THIS IS HELPFUL.
    regards,
    praba.

  • How to create a part selection and a part list ALV in the same screen

    Hello,
    I will want to realize in a screen a part lists ALV and a part selection for the list.
    I have created a container with  a splitter , but I do not know how to carry out the selection part.
    Thank you for your assistance.
    Regards

    Hello
    If you want to have the selections and the ALV list displayed on the same dynrpo then create a dynpro that contains in the upper part the selection/input fields and in the lower part place a custom container for the ALV grid.
    If you want to be more flexible then you could use a subscreen for the selection/input fields.
    There is no point in using a splitter container because we cannot place normal input fields into a container but only controls.
    Regards
      Uwe

  • ALV Report Development using OOPs concept

    complete details of " ALV Report Development using OOPs concept".
    Thanks in advance ...

    hi Sudharshan,
    please use these sample codes to understand about OOALV
    BC_ALV_GRID_CONTROL
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALV_DEMO_HTML_D0100
    BC_ALV_GRID_CONTROL
    BC_ALVEXCEL
    BC_ALVEXCEL_D100
    BC_ALVEXCEL_D210
    BC_ALVEXCEL_HIER
    BC_ALVEXCEL_SAP_TEMPL
    BC_ALVEXCEL_SAP_TEMPL_F01
    BC_ALVEXCEL_SAP_TEMPL_TOP
    BC_ALVEXCELTOP
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALVHIERTOP
    For learning OOPS-ALV in every SAP their is transaction named ZALV
    or try the following links:
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
    a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
    programs as detailed below:
    BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
    BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
    BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
    The report checks the input value(s) semantically and provides protocol messages in case of error
    BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
    implement the saving of the new data.
    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
    (1) how to define a column for editable checkboxes for an attribute of your list
    (2) how to evaluate the checked checkboxes
    (3) how to switch between editable and non-editable checkboxes
    BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
    Grid Control.
    BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
    BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
    are dealt with:
    (1) how to replace the standard f4 help
    (2) how to pass the selected value to the ALV Grid Control
    (3) how to build an f4 help, whose value range depend on a value of another cell.

  • Select-option + ALV on the same screen

    hi,
    how can we can get Select-option + ALV on the same screen.
    Thanks,
    Gaurav

    hi gaurav,
    Use the following code...It works...
    TABLES: vbrk.
    *CONSTANTS
    CONSTANTS :
    c_x(1)        TYPE c VALUE 'X',
    c_zxto        TYPE vbak-auart VALUE 'ZXTO',
    c_e           TYPE spras VALUE 'E',
    c_000000      TYPE posnr VALUE '000000',
    c_ship_to     TYPE parvw VALUE 'WE'.      "Ship To Party
    Table Types
    TYPES: BEGIN OF ty_vbrk_vbrp,
    vbeln TYPE vbrk-vbeln,    "Billing doc
    posnr TYPE vbrp-posnr,    "Billing item
    aubel TYPE vbrp-aubel,    "Sales order
    waerk TYPE vbrk-waerk,    "Doc currency
    mvgr1 TYPE vbrp-mvgr1,    "Material group 1
    mvgr3 TYPE vbrp-mvgr3,    "Material group 3
    mvgr4 TYPE vbrp-mvgr4,    "Material group 4
    matnr TYPE vbrp-matnr,    "Material no
    ntgew TYPE vbrp-ntgew,    "Net wt
    gewei TYPE vbrp-gewei,    "Wt unit
    kzwi1 TYPE vbrp-kzwi1,                             "Subtotal 1
    kursk TYPE vbrp-kursk,    "Exchange rate
    END   OF ty_vbrk_vbrp.
    TYPES: BEGIN OF ty_data,
    land1 TYPE vbpa-land1,
    landx TYPE t005t-landx,
    mvgr3 TYPE vbrp-mvgr3,
    mvgr4 TYPE vbrp-mvgr4,
    bezei3 TYPE tvm3t-bezei,
    bezei4 TYPE tvm4t-bezei,
    ntgew_tea_bag TYPE vbrp-ntgew,
    ntgew_pkt_tea TYPE vbrp-ntgew,
    ntgew_bulk_tea TYPE vbrp-ntgew,
    kzwi1_tea_bag TYPE vbrp-kzwi1,    "Subtotal 1 Tea Bag
    kzwi1_pkt_tea TYPE vbrp-kzwi1,    "Subtotal 1 Pkt Tea
    kzwi1_bulk_tea TYPE vbrp-kzwi1,   "Subtotal 1 Bulk Tea
    ntgew_tot TYPE vbrp-ntgew,
    kzwi1_tot TYPE vbrp-kzwi1,
    line_color(4) TYPE c,  "For line color
    END OF ty_data.
    TYPES: BEGIN OF ty_vbpa,
    vbeln TYPE vbpa-vbeln,
    land1 TYPE vbpa-land1,
    END OF ty_vbpa.
    TYPES: BEGIN OF ty_t005t,
    land1 TYPE t005t-land1,
    landx TYPE t005t-landx,
    END OF ty_t005t.
    TYPES: BEGIN OF ty_tvm3t,
    mvgr3 TYPE tvm3-mvgr3,
    bezei TYPE tvm3t-bezei,
    END OF ty_tvm3t.
    TYPES: BEGIN OF ty_tvm4t,
    mvgr4 TYPE tvm4-mvgr4,
    bezei TYPE tvm4t-bezei,
    END OF ty_tvm4t.
    DATA: it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp,
    wa_vbrk_vbrp TYPE ty_vbrk_vbrp,
    it_vbpa TYPE STANDARD TABLE OF ty_vbpa,
    wa_vbpa TYPE ty_vbpa,
    it_data TYPE STANDARD TABLE OF ty_data,
    wa_data TYPE ty_data,
    it_t005t TYPE STANDARD TABLE OF ty_t005t,
    wa_t005t TYPE ty_t005t,
    it_tvm3t TYPE STANDARD TABLE OF ty_tvm3t,
    wa_tvm3t TYPE ty_tvm3t,
    it_tvm4t TYPE STANDARD TABLE OF ty_tvm4t,
    wa_tvm4t TYPE ty_tvm4t.
    Global data for grand total
    DATA:
    w_tot_ntgew_tea_bag TYPE vbrp-ntgew,
    w_tot_ntgew_pkt_tea TYPE vbrp-ntgew,
    w_tot_ntgew_bulk_tea TYPE vbrp-ntgew,
    w_tot_ntgew_tot TYPE vbrp-ntgew,
    w_tot_kzwi1_tea_bag TYPE vbrp-kzwi1,
    w_tot_kzwi1_pkt_tea TYPE vbrp-kzwi1,
    w_tot_kzwi1_bulk_tea TYPE vbrp-kzwi1,
    w_tot_kzwi1_tot TYPE vbrp-kzwi1.
    Global data definitions for ALV
    DATA :
    ALV Grid container
    w_alv_container TYPE REF TO cl_gui_custom_container,
    ALV Grid
    w_alv_grid      TYPE REF TO cl_gui_alv_grid,
    w_layo          TYPE        lvc_s_layo,     "For layout
    wt_fieldcat     TYPE        lvc_t_fcat,     "For field catalog
    okcode          TYPE         okcode,        "OK Code
    w_to(2)         TYPE         c,
    w_title         TYPE        string.
    ---- START OF SELECTION SCREEN -
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    Billing Date
    SELECT-OPTIONS: s_fkdat FOR vbrk-fkdat MEMORY ID vf OBLIGATORY no intervals.
    SELECTION-SCREEN:SKIP 1.
    SELECTION-SCREEN: END OF BLOCK b1.
    ---- END OF SELECTION SCREEN -
    ----   EVENT START-OF-SELECTION  -
    START-OF-SELECTION.
    Get billing data from Delivery header(VBRK) and item (VBRP)
    PERFORM get_billing_data.
    Get ship-to country
    PERFORM get_ship_to_data.
    Get material group description 3
    PERFORM get_material_group_3.
    Get material group description 4
    PERFORM get_material_group_4.
    Form the ALV Grid title
    PERFORM form_title.
    Process data
    PERFORM process_data.
    Populate text descriptions
    PERFORM populate_description.
    ----   EVENT END-OF-SELECTION  -
    END-OF-SELECTION.
    Set the text to when date high is there
    IF NOT s_fkdat-high IS INITIAL.
    w_to = 'to'(c16).
    ENDIF.
    Call the scren 9000 for ALV Display
    CALL SCREEN 9000.
    *&      Form  get_billing_data
    Get billing data from Delivery header(VBRK) and item (VBRP)
    & store in internal table it_vbrk_vbrp
    FORM get_billing_data .
    REFRESH: it_vbrk_vbrp.
    Select Billing data by joining VBRK & VBRP and store in it_vbrk_vbrp
    SELECT a~vbeln
    b~posnr
    b~aubel
    a~waerk
    b~mvgr1
    b~mvgr3
    b~mvgr4
    b~matnr
    b~ntgew
    b~gewei
    b~kzwi1
    b~kursk
    FROM vbrk AS a INNER JOIN vbrp AS b
    ON avbeln = bvbeln
    INTO TABLE it_vbrk_vbrp
    WHERE a~fkdat IN s_fkdat
    Consider only non-deleted document
    AND fksto = space
    Billing doc type should be ZXTB
    AND fkart = 'ZXTB'
    AND pstyv = c_zxto.
    *IF sy-subrc <> 0.
    *MESSAGE i999(zttl) WITH 'No data is there'(m06).
    *LEAVE LIST-PROCESSING.
    *ENDIF.
    ENDFORM.                    " get_billing_data
    *&      Form  get_ship_to_data
    Get Ship-To party data
    FORM get_ship_to_data .
    DATA: l_it_vbpa TYPE STANDARD TABLE OF ty_vbpa.
    REFRESH: it_vbpa, it_t005t.
    IF NOT it_vbrk_vbrp[] IS INITIAL.
    SELECT vbeln
    land1
    FROM vbpa
    INTO TABLE it_vbpa
    FOR ALL ENTRIES IN it_vbrk_vbrp
    WHERE vbeln = it_vbrk_vbrp-aubel
    AND posnr = c_000000
    AND parvw = c_ship_to.
    IF sy-subrc <> 0.
    MESSAGE i999(zttl) WITH 'Exporter country not maintained'(m02).
    LEAVE LIST-PROCESSING.
    ELSE.
    SORT it_vbpa BY vbeln.
    Create an unique and sorted driver table
    l_it_vbpa[] = it_vbpa[].
    SORT l_it_vbpa BY land1.
    DELETE ADJACENT DUPLICATES FROM l_it_vbpa COMPARING land1.
    IF NOT l_it_vbpa[] IS INITIAL.
    Get the country description from T005t table
    SELECT land1
    landx
    FROM t005t
    INTO TABLE it_t005t
    FOR ALL ENTRIES IN l_it_vbpa
    WHERE spras = c_e
    AND  land1 = l_it_vbpa-land1.
    IF sy-subrc = 0.
    SORT it_t005t BY land1.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM.                    " get_ship_to_data
    *&      Form  get_material_group_3
    Get material group 3
    FORM get_material_group_3 .
    DATA: l_it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp.
    REFRESH: it_tvm3t.
    Create an unique and sorted driver table
    l_it_vbrk_vbrp[] = it_vbrk_vbrp[].
    SORT l_it_vbrk_vbrp BY mvgr3.
    DELETE ADJACENT DUPLICATES FROM l_it_vbrk_vbrp COMPARING mvgr3.
    IF NOT l_it_vbrk_vbrp[] IS INITIAL.
    SELECT mvgr3
    bezei
    FROM tvm3t
    INTO TABLE it_tvm3t
    FOR ALL ENTRIES IN l_it_vbrk_vbrp
    WHERE mvgr3 = l_it_vbrk_vbrp-mvgr3.
    IF sy-subrc = 0.
    SORT it_tvm3t BY mvgr3.
    ENDIF.
    ENDIF.
    ENDFORM.                    " get_material_group_3
    *&      Form  get_material_group_4
    Get material group 4
    FORM get_material_group_4 .
    DATA: l_it_vbrk_vbrp TYPE STANDARD TABLE OF ty_vbrk_vbrp.
    REFRESH: it_tvm4t.
    Create an unique and sorted driver table
    l_it_vbrk_vbrp[] = it_vbrk_vbrp[].
    SORT l_it_vbrk_vbrp BY mvgr4.
    DELETE ADJACENT DUPLICATES FROM l_it_vbrk_vbrp COMPARING mvgr4.
    IF NOT l_it_vbrk_vbrp[] IS INITIAL.
    SELECT mvgr4
    bezei
    FROM tvm4t
    INTO TABLE it_tvm4t
         FOR ALL ENTRIES IN l_it_vbrk_vbrp
         WHERE mvgr4 = l_it_vbrk_vbrp-mvgr4.
         IF sy-subrc = 0.
           SORT it_tvm4t BY mvgr4.
         ENDIF.
       ENDIF.
    ENDFORM.                    " get_material_group_4
    *&      Form  process_data
    Process the data and do summation and populate final display table
    FORM process_data .
       LOOP AT it_vbrk_vbrp INTO wa_vbrk_vbrp.
         CLEAR: wa_data, wa_vbpa.
         READ TABLE it_vbpa INTO wa_vbpa WITH KEY
                                      vbeln = wa_vbrk_vbrp-aubel
                                      BINARY SEARCH.
         IF sy-subrc = 0.
           wa_data-land1 = wa_vbpa-land1.
         ENDIF.
         wa_data-mvgr3 = wa_vbrk_vbrp-mvgr3.
         wa_data-mvgr4 = wa_vbrk_vbrp-mvgr4.
    Do an unit conversion of the quamtity
         CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
           EXPORTING
             input                      = wa_vbrk_vbrp-ntgew
         NO_TYPE_CHECK              = 'X'
         ROUND_SIGN                 = ' '
            unit_in                    = wa_vbrk_vbrp-gewei
            unit_out                   = 'TO' "Metric tonn
          IMPORTING
            output                     = wa_vbrk_vbrp-ntgew
          EXCEPTIONS
            conversion_not_found       = 1
            division_by_zero           = 2
            input_invalid              = 3
            output_invalid             = 4
            overflow                   = 5
            type_invalid               = 6
            units_missing              = 7
            unit_in_not_found          = 8
            unit_out_not_found         = 9
            OTHERS                     = 10.
         IF sy-subrc <> 0.
           wa_vbrk_vbrp-ntgew = wa_vbrk_vbrp-ntgew.
         ENDIF.
    Convert the currency from Customer currency to local
    currency by multiplying with kursk
         wa_vbrk_vbrp-kzwi1 =  wa_vbrk_vbrp-kzwi1 * wa_vbrk_vbrp-kursk.
    Convert the amount to Lacks by dividing with 100000
        wa_vbrk_vbrp-kzwi1 = wa_vbrk_vbrp-kzwi1 / 100000.       "DV1K905028
    When MVGR1 is between A to F use the amount as TEA_BAG
         IF wa_vbrk_vbrp-mvgr1 BETWEEN 'A' AND 'F'.
           wa_data-ntgew_tea_bag = wa_vbrk_vbrp-ntgew.
           wa_data-kzwi1_tea_bag = wa_vbrk_vbrp-kzwi1.
         ENDIF.
    When MVGR1 is between G to L use the amount as TEA_BAG
         IF wa_vbrk_vbrp-mvgr1 BETWEEN 'G' AND 'L'.
           wa_data-ntgew_pkt_tea = wa_vbrk_vbrp-ntgew.
           wa_data-kzwi1_pkt_tea = wa_vbrk_vbrp-kzwi1.
         ENDIF.
    When MVGR1 is between G to L use the amount as TEA_BAG
         IF wa_vbrk_vbrp-mvgr1 = 'M'.
           wa_data-ntgew_bulk_tea = wa_vbrk_vbrp-ntgew.
           wa_data-kzwi1_bulk_tea = wa_vbrk_vbrp-kzwi1.
         ENDIF.
         COLLECT wa_data INTO it_data.
       ENDLOOP.
    ENDFORM.                    " process_data
    *&      Form  populate_description
    Populate the description fields
    FORM populate_description .
       LOOP AT it_data INTO wa_data.
         CLEAR: wa_t005t.
         READ TABLE it_t005t INTO wa_t005t WITH KEY land1 = wa_data-land1
                                                BINARY SEARCH.
         IF sy-subrc = 0.
           wa_data-landx = wa_t005t-landx.
         ENDIF.
    Read description of Material group 3
         CLEAR wa_tvm3t.
         READ TABLE it_tvm3t INTO wa_tvm3t WITH KEY
                                  mvgr3 = wa_data-mvgr3
                                  BINARY SEARCH.
         IF sy-subrc = 0.
           wa_data-bezei3 = wa_tvm3t-bezei.
         ENDIF.
    Read description of Material group 4
         CLEAR wa_tvm4t.
         READ TABLE it_tvm4t INTO wa_tvm4t WITH KEY
                                  mvgr4 = wa_data-mvgr4
                                  BINARY SEARCH.
         IF sy-subrc = 0.
           wa_data-bezei4 = wa_tvm4t-bezei.
         ENDIF.
    Get the grand totals
         wa_data-ntgew_tot = wa_data-ntgew_tea_bag
                  + wa_data-ntgew_pkt_tea
                  + wa_data-ntgew_bulk_tea.
         wa_data-kzwi1_tot = wa_data-kzwi1_tea_bag
                  + wa_data-kzwi1_pkt_tea
                  + wa_data-kzwi1_bulk_tea.
         MODIFY it_data FROM wa_data TRANSPORTING landx
                                                  bezei3
                                                  bezei4
                                                  ntgew_tot
                                                  kzwi1_tot.
    Summattion of grand totals
         w_tot_ntgew_tea_bag  = w_tot_ntgew_tea_bag  + wa_data-ntgew_tea_bag.
         w_tot_ntgew_pkt_tea  = w_tot_ntgew_pkt_tea  + wa_data-ntgew_pkt_tea.
         w_tot_ntgew_bulk_tea  = w_tot_ntgew_bulk_tea  + wa_data-ntgew_bulk_tea.
         w_tot_ntgew_tot  = w_tot_ntgew_tot  + wa_data-ntgew_tot.
         w_tot_kzwi1_tea_bag  = w_tot_kzwi1_tea_bag  + wa_data-kzwi1_tea_bag.
         w_tot_kzwi1_pkt_tea  = w_tot_kzwi1_pkt_tea  + wa_data-kzwi1_pkt_tea.
         w_tot_kzwi1_bulk_tea  = w_tot_kzwi1_bulk_tea  + wa_data-kzwi1_bulk_tea.
         w_tot_kzwi1_tot  = w_tot_kzwi1_tot  + wa_data-kzwi1_tot.
       ENDLOOP.
    Append a grand Total row at the end
       CLEAR wa_data.
       wa_data-landx = 'Grand Total:'.
       wa_data-ntgew_tea_bag = w_tot_ntgew_tea_bag.
       wa_data-ntgew_pkt_tea = w_tot_ntgew_pkt_tea.
       wa_data-ntgew_bulk_tea = w_tot_ntgew_bulk_tea.
       wa_data-ntgew_tot = w_tot_ntgew_tot.
       wa_data-kzwi1_tea_bag = w_tot_kzwi1_tea_bag.
       wa_data-kzwi1_pkt_tea = w_tot_kzwi1_pkt_tea.
       wa_data-kzwi1_bulk_tea = w_tot_kzwi1_bulk_tea.
       wa_data-kzwi1_tot = w_tot_kzwi1_tot.
       wa_data-line_color    = 'C310'.
       APPEND wa_data TO it_data.
    ENDFORM.                    " populate_description
    *&      Module  STATUS_9000  OUTPUT
    Initialise PF-STATUS and title
    MODULE status_9000 OUTPUT.
       SET PF-STATUS 'MAIN9000'.
       SET TITLEBAR 'TITLE_9000'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  initialize_9000  OUTPUT
          text
    MODULE initialize_9000 OUTPUT.
    Call the ALV grid to display data
    SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE text-001.
      Billing Date
    SELECT-OPTIONS: s_fkdat1 FOR vbrk-fkdat MEMORY ID vf OBLIGATORY NO-EXTENSION.
    SELECTION-SCREEN:SKIP 1.
    SELECTION-SCREEN: END OF BLOCK B2.
       PERFORM display_alv_grid.
    ENDMODULE.                 " initialize_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    Module to handle User Command
    MODULE user_command_9000 INPUT.
       CASE okcode.
         WHEN 'BACK'.
           SET SCREEN 0.
           CLEAR okcode.
           LEAVE SCREEN.
         WHEN 'CANCEL'.
           SET SCREEN 0.
           CLEAR okcode.
           LEAVE SCREEN.
         WHEN 'EXIT'.
           CLEAR okcode.
           LEAVE PROGRAM.
         WHEN OTHERS.
       ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Form  display_alv_grid
    Display the data in ALV Grid
    FORM display_alv_grid .
       IF w_alv_container IS INITIAL.
    Create the alv container object
         CREATE OBJECT w_alv_container
           EXPORTING
             container_name = 'ALV_GRID'
           EXCEPTIONS
               cntl_error                  = 1
               cntl_system_error           = 2
               create_error                = 3
               lifetime_error              = 4
               lifetime_dynpro_dynpro_link = 5
               OTHERS                      = 6.
         IF sy-subrc <> 0.
           MESSAGE e999(zttl) WITH 'Problem in ALV display'(t04).
         ENDIF.
    Create the ALV grid object. The parent is the ALV container
         CREATE OBJECT w_alv_grid
           EXPORTING
             i_parent = w_alv_container
           EXCEPTIONS
             error_cntl_create = 1
             error_cntl_init   = 2
             error_cntl_link   = 3
             error_dp_create   = 4
             OTHERS            = 5.
         IF sy-subrc <> 0.
           MESSAGE e999(zttl) WITH 'Problem in ALV display'(t04).
         ENDIF.
    This subrotine creates the field catalog and
    store in internal table lt_fieldcat
         PERFORM prepare_fieldcat CHANGING wt_fieldcat.
    Layout design
         w_layo-no_toolbar = ''.
    Not to allow totaling feature
         w_layo-no_totline = c_x.
    Report title
       w_layo-grid_title = text-004.
         w_layo-grid_title = w_title.
         w_layo-zebra      = c_x.    "Alternating line color (striped)
         w_layo-cwidth_opt = c_x.    "Optimize column width
         w_layo-sel_mode   = 'A'.    "Selection Mode
    Name of the color field
         w_layo-info_fname = 'LINE_COLOR'."For row color
    Call the method to display the data in ALV grid
         CALL METHOD w_alv_grid->set_table_for_first_display
           EXPORTING
             i_save                        = 'A'
             is_layout                     = w_layo
           CHANGING
             it_outtab                     = it_data[]
             it_fieldcatalog               = wt_fieldcat
           EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
         IF sy-subrc <> 0.
           MESSAGE e999(zttl) WITH text-t04.
         ENDIF.
       ELSE.
    If the container & grid object is alreadt there reuse them
         CALL METHOD w_alv_grid->refresh_table_display
           EXCEPTIONS
             finished = 1
             OTHERS   = 2.
         IF sy-subrc <> 0.
           MESSAGE e999(zttl) WITH text-t04.
         ENDIF.
       ENDIF.
       IF okcode = 'CANCEL'.
         EXIT.
       ENDIF.
    ENDFORM.                    " display_alv_grid
    *&      Form  prepare_fieldcat
    Prepare the list of fields to be displayed                          *
         <--P_WT_FIELDCAT  text
    FORM prepare_fieldcat  CHANGING pt_fieldcat TYPE lvc_t_fcat.
       DATA : lx_fcat TYPE lvc_s_fcat.
       REFRESH: pt_fieldcat.
    **List of fields to be displayed should be added in pt_fieldcat
    Customer PO no
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'LANDX'.
       lx_fcat-ref_field = 'T005T'.
       lx_fcat-ref_table = 'T005T'.
       lx_fcat-coltext = 'Market Name'(c01).
       lx_fcat-seltext = text-c01.
       APPEND lx_fcat TO pt_fieldcat.
    Flavour type
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'BEZEI3'.
       lx_fcat-ref_field = 'BEZEI'.
       lx_fcat-ref_table = 'TVM3'.
       lx_fcat-coltext = 'Flavour Type'(c02).
       lx_fcat-seltext = text-c02.
       APPEND lx_fcat TO pt_fieldcat.
    Tea type
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'BEZEI4'.
       lx_fcat-ref_field = 'BEZEI4'.
       lx_fcat-ref_table = 'TVM4'.
       lx_fcat-coltext = 'Tea Type.'(c03).
       lx_fcat-seltext = text-c03.
       APPEND lx_fcat TO pt_fieldcat.
    Tea Bag Quantity in KG
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'NTGEW_TEA_BAG'.
       lx_fcat-ref_field = 'NTGEW'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Tea Bag(MT)'(c04).
       lx_fcat-seltext = text-c04.
       APPEND lx_fcat TO pt_fieldcat.
    PKT Tea  Quantity in KG
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'NTGEW_PKT_TEA'.
       lx_fcat-ref_field = 'NTGEW'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'PKT Tea(MT)'(c05).
       lx_fcat-seltext = text-c05.
       APPEND lx_fcat TO pt_fieldcat.
    Bulk Tea  Quantity in MT
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'NTGEW_BULK_TEA'.
       lx_fcat-ref_field = 'NTGEW'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Bulk Tea(MT)'(c06).
       lx_fcat-seltext = text-c06.
       APPEND lx_fcat TO pt_fieldcat.
    Total Quantity in MT
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'NTGEW_TOT'.
       lx_fcat-ref_field = 'NTGEW'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Total(MT)'(c07).
       lx_fcat-seltext = text-c07.
       APPEND lx_fcat TO pt_fieldcat.
    Tea Bag Quantity in KG
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'KZWI1_TEA_BAG'.
       lx_fcat-ref_field = 'KZWI1'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Tea Bag(FOB-Lacs)'(c08).
       lx_fcat-seltext = text-c08.
       APPEND lx_fcat TO pt_fieldcat.
    PKT Tea  Price in Lakh
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'KZWI1_PKT_TEA'.
       lx_fcat-ref_field = 'KZWI1'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'PKT Tea(FOB-Lacs)'(c09).
       lx_fcat-seltext = text-c09.
       APPEND lx_fcat TO pt_fieldcat.
    PKT Tea  Quantity in KG
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'KZWI1_BULK_TEA'.
       lx_fcat-ref_field = 'KZWI1'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Bulk Tea(FOB-Lacs)'(c10).
       lx_fcat-seltext = text-c10.
       APPEND lx_fcat TO pt_fieldcat.
    Total amount
       CLEAR lx_fcat.
       lx_fcat-fieldname = 'KZWI1_TOT'.
       lx_fcat-ref_field = 'KZWI1'.
       lx_fcat-ref_table = 'VBRP'.
       lx_fcat-coltext = 'Total(FOB-Lacs)'(c11).
       lx_fcat-seltext = text-c11.
       APPEND lx_fcat TO pt_fieldcat.
    ENDFORM.                    " prepare_fieldcat
    *&      Form  form_title
    Form the ALV Title
    FORM form_title .
       DATA: l_date(10) TYPE c.
       CONCATENATE s_fkdat-low6(2)  s_fkdat-low4(2)  s_fkdat-low(4)
       INTO l_date SEPARATED BY '/'.
       CONCATENATE 'TTD - Statement of Export' '-From' l_date INTO
    w_title SEPARATED BY space.
       CLEAR l_date.
       IF NOT s_fkdat-high IS INITIAL.
         CONCATENATE s_fkdat-high6(2)  s_fkdat-high4(2)  s_fkdat-high(4)
         INTO l_date SEPARATED BY '/'.
         CONCATENATE w_title 'to' l_date INTO w_title SEPARATED BY space.
       ENDIF.
    ENDFORM.                    " form_title

  • 2 alv grids in 1 screen with 2 different header

    Hi All,
    I have a requirement where in I need to display 2 alv grids in 1 screen and each has its own set of header information. If anybody has come across such a requirement then pls send the code. I can do this using BLOCKED list alv but I want to do in grids.
    Thanks in advance.
    Sutapa Sengupta

    thr u go with code..
    Code listing for: Z_011_ALV_GRID_EVENT
    Description: EXAMPLE OF ALV GRID CONTROL
    SCREEN 101 : FLOW LOGIC
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0101.
    MODULE GET_DATA.
    MODULE CREATE_OBJECTS.
    MODULE SHOW_ALV.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0101.
    MODULE POOL Z_011_ALV_GRID_EVENT
    PROGRAM Z_011_ALV_GRID_EVENT.
    CLASS CL_EVENT_HANDLER DEFINITION
    CLASS CL_EVENT_HANDLER DEFINITION.
    PUBLIC SECTION.
    METHODS: ON_DOUBLE_CLICK FOR EVENT
    DOUBLE_CLICK OF CL_GUI_ALV_GRID
    IMPORTING ES_ROW_NO E_COLUMN,
    ON_RIGHT_CLICK FOR EVENT
    RIGHT_CLICK OF CL_GUI_ALV_GRID.
    ENDCLASS. "CL_EVENT_HANDLER DEFINITION
    CLASS CL_EVENT_HANDLER IMPLEMENTATION
    CLASS CL_EVENT_HANDLER IMPLEMENTATION.
    METHOD ON_DOUBLE_CLICK.
    DATA: TEXT TYPE STRING,
    ES_ROW_STRING TYPE STRING.
    ES_ROW_STRING = ES_ROW_NO-ROW_ID.
    CONCATENATE 'ROW : ' ES_ROW_STRING 'COLUMN : '
    E_COLUMN-FIELDNAME INTO TEXT SEPARATED BY SPACE.
    MESSAGE TEXT TYPE 'I'.
    ENDMETHOD. "ON_DOUBLE_CLICK
    METHOD ON_RIGHT_CLICK.
    MESSAGE 'RIGHT MOUSE BUTTON HAS CLICKED !!!' TYPE 'I'.
    ENDMETHOD. "ON_RIGHT_CLICK
    ENDCLASS. "CL_EVENT_HANDLER IMPLEMENTATION
    INCLUDE PROGRAMS
    INCLUDE Z_011_ALV_GRID_EVENT_TOP. " Global Data
    INCLUDE Z_011_ALV_GRID_EVENT_O01. " PBO-Modules
    INCLUDE Z_011_ALV_GRID_EVENT_I01. " PAI-Modules
    INCLUDE Z_011_ALV_GRID_EVENT_F01. " FORM-Routines
    TOP INCLUDE Z_011_ALV_GRID_EVENT_TOP
    TYPES AND DATA DECLARATION
    TABLES: SFLIGHT.
    DATA: OK_CODE TYPE SY-UCOMM,
    IT_SFLIGHT TYPE STANDARD TABLE OF SFLIGHT,
    R_HANDLER TYPE REF TO CL_EVENT_HANDLER,
    R_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    PBO INCLUDE Z_011_ALV_GRID_EVENT_O01
    Module SHOW_ALV OUTPUT
    MODULE SHOW_ALV OUTPUT.
    CHECK OK_CODE IS INITIAL.
    CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'SFLIGHT'
    CHANGING
    IT_OUTTAB = IT_SFLIGHT.
    ENDMODULE. " SHOW_ALV OUTPUT
    Module GET_DATA OUTPUT
    MODULE GET_DATA OUTPUT.
    CHECK OK_CODE IS INITIAL.
    PERFORM GET_DATA
    USING
    SFLIGHT-CARRID.
    ENDMODULE. " GET_DATA OUTPUT
    Module CREATE_OBJECTS OUTPUT
    MODULE CREATE_OBJECTS OUTPUT.
    IF R_HANDLER IS NOT BOUND. "CHECKS WHETHER A REFERENCE
    "VARIABLE CONTAINS VALID REFERENCE
    CREATE OBJECT R_HANDLER.
    ENDIF.
    IF R_CONTAINER IS NOT BOUND. "CHECKS WHETHER A REFERENCE
    "VARIABLE CONTAINS VALID REFERENCE
    CREATE OBJECT R_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'CC_ALV'.
    ENDIF.
    IF R_GRID IS NOT BOUND.
    CREATE OBJECT R_GRID
    EXPORTING
    I_PARENT = R_CONTAINER.
    SET HANDLER R_HANDLER->ON_DOUBLE_CLICK
    R_HANDLER->ON_RIGHT_CLICK FOR ALL INSTANCES
    ENDIF.
    ENDMODULE. " CREATE_OBJECTS OUTPUT
    Module STATUS_0101 OUTPUT
    MODULE STATUS_0101 OUTPUT.
    SET PF-STATUS 'Z_010_STATUS'.
    "SET TITLEBAR 'xxx'.
    ENDMODULE. " STATUS_0101 OUTPUT
    PAI INCLUDE Z_011_ALV_GRID_EVENT_I01
    Module USER_COMMAND_0101 INPUT
    MODULE USER_COMMAND_0101 INPUT.
    CASE OK_CODE .
    WHEN 'SEARCH'.
    PERFORM GET_DATA
    USING
    SFLIGHT-CARRID.
    CALL METHOD R_GRID->REFRESH_TABLE_DISPLAY.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0101 INPUT
    FORM INCLUDE Z_011_ALV_GRID_EVENT_F01
    FORM : GET_DATA
    Created : 26.03.2008 12:34:09
    FORM GET_DATA USING VALUE(P_CARRID) TYPE SFLIGHT-CARRID.
    IF P_CARRID IS INITIAL.
    SELECT * FROM SFLIGHT INTO CORRESPONDING
    FIELDS OF TABLE IT_SFLIGHT.
    ELSE.
    SELECT * FROM SFLIGHT INTO CORRESPONDING
    FIELDS OF TABLE IT_SFLIGHT WHERE CARRID = P_CARRID.
    ENDIF.
    ENDFORM. "GET_DATA

  • Cannot destroy my flex session using FlexSessionListener

    Hi all,
    I have what I thought was a simple need: destroy a session once a user logs out of my application either via a logout button or by closing the browser.
    I have implemented the body ... onunload="disconnectAll()" .. method which I found numerous examples of on the net and have my logout button call the same disconnectAll() upon click.
    All this is good and my FlexSessionListener sessionDestroyed() gets called. However, I can see from my logs that a sessionCreated() also gets called straight after the call to sessionDestroyed!
    Has anybody seen this or have any idea why this is happening?
    Are there threads running or feeds from clients that are keeping my session alive through recreating another one?
    Any help would be greatly appreciated!

    I'm in the same boat. Using the latest version (8.0.12 build 25282). Can not connect to the console session on either OSX 10.9.5 or 10.10.1. This did indeed work previously. 
    Looked at the "Send log" output and find multiple instances of this:
    [2014-Dec-01 14:53:53] RDP (0): Final rdp configuration used: screen mode id:i:0
    desktopwidth:i:1920
    desktopheight:i:1200
    use multimon:i:1
    session bpp:i:24
    full address:s:guy
    audiomode:i:0
    username:s:juan
    disable wallpaper:i:0
    disable full window drag:i:0
    disable menu anims:i:0
    disable themes:i:0
    alternate shell:s:
    shell working directory:s:
    authentication level:i:2
    connect to console:i:1
    gatewayusagemethod:i:0
    disable cursor setting:i:0
    allow font smoothing:i:1
    allow desktop comredirectprinters:i:0
    bookmarktype:i:3
    use redirection server name:i:0
    The important part seems to be "connect to console:i:1". That seems to indicate that an integer value is set to 1 (True?). 
    Running "qwinsta" on the remote server show:
    Microsoft Windows [Version 5.2.3790](C) Copyright 1985-2003 Microsoft Corp.
    C:\Documents and Settings\juan>qwinsta 
    SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
     console                                     0  Conn    wdcon
     rdp-tcp                                 65536  Listen  rdpwd
    >rdp-tcp#452       juan                      1  Active  rdpwd
                       juan                      3  Disc    rdpwd
    C:\Documents and Settings\juan>
    Clearly, I'm not connected to the console. 
    Is there anything else that can be provided or checked?

  • Can I display EyeTV's live TV over HDMI-out and be able to see my desktop using screen-sharing on a headless mac-mini used as a media-box?

    Hi,
    I'm thinking of buying a new mac-mini to replace my current one which acts as an iTunes server and records TV programs using eyeTV. I connect using screen-sharing/VNC to be able to do stuff on it (like handbrake etc.)
    I have eyeTV with a satelite receiver and I want to change the setup so that:
    - the new mac-mini continues to work as an iTunes server (and handbrake workhorse)
    - I can use the HDMI output (inc. audio) to show eyeTV's live TV full-screen app
    - I can connect using screen-sharing/VNC to the mac-mini and see my normal desktop to be able to maintain it etc. but this is a headless display (no screen is connected to the display-port).
    - recorded media I'd play through the appleTV2 still + rentals etc. unless anyone knows if eyeTV software can offer up iTunes content? I don't like the eyeTV recordings in general as it seems very slow to me for access when there are lots of recordings and wouldn't be available in other apleTVs in the house AFAIK.
    The main benefit that this gives me is that I'd no longer need a seperate satelite box to watch live TV and can add more eyeTV hardware to get additional TV channels all through the same HUD on the TV for ease of access.
    Does this seem possible in theory & practice (ie are there any gotcha's to consider?)
    - can I force the HDMI output resolution to 1080i as I go via an amp to the TV and the appleTV2 drops to low-res in this configuration so I have had to find a workaround for that.
    - does the mac-mini have IR input that can be programmed?
    - Does eyeTV software remain stable for long periods?
    - Does the HDMI out have any handshake issues that would need a reset of the display (somehow)?
    thanks in advance for any thoughts/contributions
    Lee

    I think the easiest way to do this is to have the EyeTV app running in one user account and sent via HDMI to the TV, and use a separate user account for Screen Sharing. Both logins can be active at the same time and with Lion you can connect via screen sharing to which ever login you need.
    With regards to the Mac video resolution changing, when it is not the current input on your AV receiver. This is 'normal', if the Mac sees no signal it drops down the a lower level. What you need is to buy a HDMI Detective Plus which tricks the Mac in to always seeing a signal and hence it will not drop down the resolution. See http://www.gefen.com/kvm/dproduct.jsp?prod_id=8005
    The Mac mini does have an IR receiver. This can be used with the EyeTV app, iTunes, and similar. Yes I believe EyeTV would run for prolonged periods quite happily, it is has been around for a long time and had most of the rough edges polished off. However one issue you will have to deal with is that it does not automatically update its program guide data. For this you might have to write or modify an AppleScript. Elgato support or their user forums will be a lot of help.
    You can set EyeTV to convert recordings to an iTunes (Apple TV) compatible format and then delete them from EyeTV.
    The HDMI Detective should solve your handshaking problems.

  • Any way to keep track of which pages use templates in dreamweaver?

    So this site I am working on uses a template for most of the html pages but not all of them. A few of them have been detached from the template and will remain detached since they are not the same as the others. The only way I can see to check which ones use the template is to open the file. Once opened if it uses the template it says so in the upper right....but that would mean I would still have to mentally remember which ones use the document but there are 20 pages. I can not remember and I do not want to open 20 documents to see which ones use the template. Is there a way to see without opening? I wish it would tell me in the file manager which files are using the template......anything similar?? thanks

    You're welcome.
    Templates can make your life much easier, I believe.  I use the following scheme....
    First, I mentally separate the page layout into three sections:
    1.  Stuff that will not change for the life of the site (i.e., the basic
    structural elements)
    2.  Stuff that *could* change from time to time (e.g., navigation elements,
    burst advertisements, section-specific navigation, etc.)
    3.  Stuff that *will* change from one page to the next
    Then I create a template containing all class1 elements.  Next I create
    server-side include files containing all class 2 elements and place them on
    the template as needed.  Note - some of the class 2 elements may be
    "section-specific elements", and their placement on the template will be
    subject to the next item.  Finally, I insert editable regions to cover the
    class 3 items, INCLUDING the section-specific navigation.
    This allows me to just cookie-cut the rest of the site.  I estimate that
    even for fairly large sites, about 80% of my work goes into planning and
    creating this template file.

  • Jump from alv report to qa03 screen based on PRUEFLOS field

    Hi experts,
    I developed one alv report ,in that one field name is PRUEFLOS (inspection lot number).I want to jump from alv report
    to QA03 screen based on PRUEFLOS field.I wrote in this way but i didn't get.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
      CASE SELFIELD-FIELDNAME.
        WHEN 'PRUEFLOS'.
          READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
          SET PARAMETER ID  'QLS' FIELD T_FINAL-PRUEFLOS.
          CALL TRANSACTION 'QA03'   AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.
    what is the problem ?pls help me in this.

    Hi Ram,
    Recheck:
    1) You have passed 'FORM USER_COMMAND' in 'I_CALLBACK_USER_COMMAND' while calling f.m. for ALV displa, and
    2) You have checked the value of user command, i.e.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
    CASE SY-UCOMM.
    WHEN '&IC1'.
    CASE SELFIELD-FIELDNAME.
    WHEN 'PRUEFLOS'.
    READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
    SET PARAMETER ID 'QLS' FIELD T_FINAL-PRUEFLOS.
    CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
    ENDCASE.
    ENDCASE.
    ENDFORM.
    Regards,
    Birendra

Maybe you are looking for

  • Why can't I include a color profile when exporting to PDF?

    I've a basic RGB illustrator file - no embedded or linked images, just flat colors and gradients. I'm working in sRGB space and this is reported correctly in the info field at the lower left of the editing window. Some issues: 1. When I look at this

  • Is it possible to have a field in the form to insert an image, like in Adobe livecyle?

    Should I use Adobe livecyle, does it still exists?

  • Crash when installing AIR on Mac

    Here is my log for trying tio install Air. I have tried most everything that I have read and can not get this program to load. Jan 26 08:36:49 Pro-Eggz airportd[852]: _doAutoJoin: Already associated to "linksys". Bailing on auto-join. Jan 26 09:34:49

  • Conversion of Interval - Time

    Hi all, I am not able to convert this particular Interval 8d3h18m42.185s into MINUTES only.. I want the entire Interval to be converted into MINUTES only. I tried to find out certain methods in the Fuego API but none were really helpful.. Does anybod

  • Std::bad_alloc occurs only when using VS Graphics Debugger

    I'm using C# and SharpDX (a c# wrapper for directx) and I keep getting the following exception when using the Graphics Debugger in VS2012 and VS2013: First-chance exception at 0x7690c41f in Craft.exe: Microsoft C++ exception: std::bad_alloc at memory