ALV Grid Column Issue

Hellow Experts,
i got the some code to genrate auto genrated column based on date my out put is as follow
StudentID        Day00  Day01  Day02 ......Day31
   178           20     30      40          50     
My Code  for genrate day is
LOOP AT gt_cols INTO gs_col.
TRY.
        CONCATENATE 'DATE' gs_col-date INTO g_col.      "Define Column name
        gr_column ?= gr_columns->get_column( g_col ).   "Get column
        CONCATENATE 'Day' gs_col-date+6(2) INTO g_txt.  "Define new label (Day01, .., Day31)
gr_column->set_long_text( g_txt ).              "Set label long text
      CATCH cx_salv_not_found.                          "#EC NO_HANDLER
    ENDTRY.
*      CATCH cx_salv_not_found.                          "#EC NO_HANDLER
*    ENDTRY.
  ENDLOOP.
My requirment is i dont need 'Day00' like follow
StudentID         Day01  Day02 ......Day31
   178              30      40          50     
PLz help me and Ammend my above code to remove Day00.Thanks

LOOP AT gt_cols INTO gs_col.
TRY.
     IF gs_col-date+6(2) NE '00'.      "Add this IF statement and see if it solves the problem
          CONCATENATE 'DATE' gs_col-date INTO g_col.      "Define Column name
          gr_column ?= gr_columns->get_column( g_col ).     "Get column
          CONCATENATE 'Day' gs_col-date+6(2) INTO g_txt.  "Define new label (Day01, .., Day31)
       gr_column->set_long_text( g_txt ).                           "Set label long text
     ENDIF.
      CATCH cx_salv_not_found.                          "#EC NO_HANDLER
    ENDTRY.
*      CATCH cx_salv_not_found.                          "#EC NO_HANDLER
*    ENDTRY.
  ENDLOOP.
-- Aniruddha

Similar Messages

  • Export TO XXL from ALV Grid - Column order mismatch

    Hi All,
    The user is trying to download data from Option -> Export -> Spreadsheet which will create XXL.
    But while downloading there is mismatch in the order of columns displayed on the alv grid & columns downloaded.
    All character fields are displayed on left, then date fields then quantity fields are downloaded to XXL. but in ALV Grid user has chosen a layout in which date fields come first.
    Please help me to find solution

    Grid display using    'REUSE_ALV_GRID_DISPLAY'. From the alv grid output, user is trying to download data using export -> Excel . so for download there is no custom code.
    We have copied standard report and added few more fields to the custom report. strangely Standard report also has this issue.
    I searched for SAP notes also..no clue

  • Alv grid column name display

    alv grid column name could not be displayed fully.we manually want to drag the column,to see the column name fully.  for ex. if column name is 'COMPANYNAME'.it shows 'COMPA' alone.
    how could i solve this problem....?

    hI,
        Check the below code...
    *& Report  ZALV_PROGRAAM
    REPORT  ZALV_PROGRAAM.
    TYPE-POOLS SLIS.
    DATA : BEGIN OF WA_KNA1,
    KUNNR TYPE KUNNR,
    NAME1 TYPE NAME1,
    END OF WA_KNA1,
    IT_KNA1 LIKE TABLE OF WA_KNA1.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FCAT LIKE LINE OF IT_FCAT.
    SELECT KUNNR NAME1 INTO TABLE IT_KNA1 FROM KNA1 UP TO 5 ROWS.
    PERFORM FCAT USING '1' 'KUNNR' 'CUSTOMERNUMBER' '40'.
    PERFORM FCAT USING '2' 'NAME1' 'CUSTOMERNAME' '40'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = SY-CPROG
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      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                         =
       IT_FIELDCAT                       = IT_FCAT
      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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = IT_KNA1
    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.
    *&      Form  FCAT
          text
         -->P_0052   text
         -->P_0053   text
         -->P_0054   text
         -->P_0055   text
    form FCAT  using    FP_COL_POS
                        FP_FIELDNAME
                        FP_SELTEXT_M
                        FP_OUTPUTLEN.
    WA_FCAT-COL_POS = FP_COL_POS.
    WA_FCAT-FIELDNAME = FP_FIELDNAME.
    WA_FCAT-SELTEXT_M = FP_SELTEXT_M.
    WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.
    endform.                    " FCAT
    thanks,
    Thiru. R

  • Display 80 characters of PO text in ALV grid column?

    Hi Guys,
                 I just want to display only 80 characters of PO Header text in the ALV grid column and  the rest should appear when we move the Mouse on to the each ALV grid'd POtext column. So how is it possible 1st tell me how to display 80 characters of PO text.?
      in ME23n u can see the PO  header text.
    Thanks ,
    Gopi.

    Hi Gopi,
    Are you displaying ALV in your custom report and you want to show just 80 char in output?
    If this is yes:
    You can set ALV column width as 80 CHAR while building field catalog.
    Column cell will have complete text but when ALV appears it will first show first 80 char.
    thnx,
    ags.

  • Editable ALV Grid column behavior under ITS standalone

    Hello experts,
    I have a straight forward implementation of an ALV Grid with 3 columns. Two columns are display only and the third is editable. My question only involves the editable column and its behavior in a web browser served by a standalone ITS server. The underlying data type is CURR. The enterable amounts are restricted to a format of 9.99. Even so, a web user can accidentally enter a non-numeric value such as 1.x0 .  We have coded a data changed event handler to check the input value for expected amounts. The event handler logic readily identifies the non-numeric value and handles the exception. Although we have full control of the internal table value, there are two problems encountered within the web browser interface:
    1) We cannot return the cursor to the problem cell to prevent the user from continuing before correcting the problem.
    2) We cannot reset/change to displayed value to the original internal table value (it will only refresh after a save or refresh action). So the user has no visual cue that they've entered a bad value unless they pay close attention.
    Running the transaction in SAPGUI, we can force the cursor back to the erroneously cell using  "CALL METHOD alv_grid->set_scroll_info_via_id" . This technique does not appear to affect the cursor within the web browser.
    After searching SDN forums and SAP documentation it appears that there is no way to programmatically control the ALV Grid active cell within the web browser interface. I'm wondering if the experts can confirm this issue? If that is the way it works within the browser interface could members please suggest "user friendly" approaches to notifying the user of a data entry problem? For example, is POPUP_TO_INFORM to only option? Perhaps there is a JavaScript routine that can enforce the edit format? Please keep in mind that the standard ALV Grid techniques that work in SAPGUI don't necessarily behave the same way in the web browser. I'm most interested in advice regarding the web browser using standalone ITS as it will be another year before we can leverage WebDynPro in this scenario.
    Thanks and best regards,
    Gary

    Hi Gary,
    can you please create a short report which recreates the issue and post the ABAP here. The goal is that webgui and SAPGUI behaves the same way. If they don't we will try to fix it.
    Best regards,
    Klaus

  • The Visible attribute on alv grid column is not changed after Change Layout

    Setup:
    I have a program that displays output in an ALV grid (using cl_salv_table).
    The ALV grid is displayed within a custom control on a subscreen.
    I have 4 subscreens being used on a tabstrip control.  So I have 4 ALV grids total (one on each subscreen).
    On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
    I also allow the user to dowload the contents of all 4 grids to excel.  To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
    The Problem:
    As I said I have 4 grids being displayed via a tab control.  Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button.  And then the user navigates to tab 2.  If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet.  When I call is_visible() for a column that was unhid it still comes back as false. 
    The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata.  However, this is not the best option and requires training for the user that they have to do this for the download to work correctly. 
    The Question:
    1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end?  Is there a way to make it do this?
    2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid?  If there is a way to force the synchronization - where do I put that code?  As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
    Thanks in advance for any help.

    I was able to resolve this issue with a satisfactory solution.
    In my program I had a local class definition to handle the grids' events.  When the synchronization wasn't working I only had two events defined: for link_click and added_functions. 
    I created another definition for event after_salv_function:
                   on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
    There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done.

  • F1 on ALV Grid column

    Hello All,
    I have to give an F4 help on a column in ALV grid.
    I have used   fieldcatlog-REF_TABNAME   =  'MARA' and  fieldcatlog-rollname      =  'PSTAT_D' for F1 help in ALV report.
    This somehow is not working.Please guide me to resolve the issue so that the f1 help from MARA-PSTAT  is available in Report.
    Thank  you.
    Edited by: sanjay_123 on Nov 2, 2009 8:49 AM

    Try this sample:
    DATA: BEGIN OF itab OCCURS 0,
            matnr LIKE mara-matnr,
            pstat LIKE mara-pstat,
          END OF itab,
          fcat TYPE lvc_t_fcat,
          hcat TYPE lvc_s_fcat.
    START-OF-SELECTION.
      " Get data
      SELECT matnr pstat FROM mara INTO TABLE itab UP TO 20 ROWS.
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
    END-OF-SELECTION.
      " Create fieldcatalog
      CLEAR hcat.
      hcat-col_pos = 1.
      hcat-fieldname = 'MATNR'.
      hcat-scrtext_m = 'Material'.
      hcat-ref_table = 'MARA'.
      hcat-ref_field = 'MATNR'.
      APPEND hcat TO fcat.
      CLEAR hcat.
      hcat-col_pos = 2.
      hcat-fieldname = 'PSTAT'.
      hcat-scrtext_m = 'Status'.
      hcat-ref_table = 'MARA'.
      hcat-ref_field = 'PSTAT'.
      APPEND hcat TO fcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          it_fieldcat_lvc = fcat
        TABLES
          t_outtab        = itab.

  • ALV Grid - Columns Displays?

    Any way to display an ALV grid in different sections?
    Meaning, The top half of the report lines up columns differently then the bottom half of the report.
    For instance, The first two columns are always the same for all fields, but becuse the rest of the fields are not related to one another in any way the report breaks and displays te columns differently at a certain point in the output of the display?
                      Thank -You

    In the field catalog give the <b>emphasize</b>.
    For first 2 columns:
    ls_fcat-emphasize  = 'C310'.
    For all other columns:
      ls_fcat-emphasize  = 'C400'.
    These make the ALV columns in different colors.
    In case if u want to color a particular row or particular cell, do the below things:
    Assign  a variable celltab    TYPE lvc_t_styl, in the internal table which u dispaly the data.
    In the layout give,   wa_layout-stylefname = 'CELLTAB'.
    Modify the final internal table like this sample code:
      DATA : lt_celltab  TYPE lvc_t_styl,
             ls_celltab  TYPE lvc_s_styl.
      READ TABLE i_final_data INTO wa_final_data INDEX 1.
      ls_celltab-fieldname = 'LNG_TYPES'.
      ls_celltab-style = '00000060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'LNG_QUANTITY'.
      ls_celltab-style = '00003060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_TYPES'.
      ls_celltab-style = '00000666'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_QUANTITY'.
      ls_celltab-style = '00000066'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      wa_final_data-celltab[] = lt_celltab[].
      MODIFY i_final_data FROM wa_final_data INDEX 1.
      CLEAR: ls_celltab, lt_celltab, wa_final_data.
    Here   ls_celltab-style = '00003060' will make that particular cell in different color.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • Focus to a webdynpro alv grid column after report_element_t100_message

    Hi All,
    I have an alv grid on my view. When I click a button, I'm making some checks for editable cells and if necessary giving a message to the user by using  report_element_t100_message method. After the message, I'm setting focus to the alv grid cell . If I don't give a message, my  set_focus code works fine, but I must give  a message , so how can I achive this? Isn't it possible setting to a cell after a message?
    Followings are some parts from my source code .
    Thanks in advance,
    MERAL
    THESE CODES ARE IN MY VIEW -
    *-- GIVE MESSAGE
    CALL METHOD wd_assist->mesaj_ver
            EXPORTING
              in_api_controller = lo_api_controller
              in_el_context     = lo_el_context
              in_msgty          = 'E'
              in_msgno          = wd_assist->msg_boskalamaz
              in_msgv1          = cmsg
              in_msgv2          = 'Geçerlilik Başlama Tarihi'.
          strFocusColumn = 'GECERLIBASTARIH'.
    *-- SET FOCUS
    lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).
        lr_salv_wd_table->set_focus(
          index  = itabix
          column = strFocusColumn ).
    THIS METHOD IS IN MY ASSISTANCE CLASS -
    method MESAJ_VER.
      data lo_message_manager    type ref to if_wd_message_manager.
      data message type SYMSG.
    *-- Get message manager
      CALL METHOD in_api_controller->GET_MESSAGE_MANAGER
        RECEIVING
          MESSAGE_MANAGER = lo_message_manager.
      message-MSGTY = IN_MSGTY.
      message-MSGID = 'Z_BYY_CLS_AYYA_MSG'.
      message-MSGNO = IN_MSGNO.
      message-MSGV1 = IN_MSGV1.
      message-MSGV2 = IN_MSGV2.
      message-MSGV3 = IN_MSGV3.
      message-MSGV4 = IN_MSGV4.
    report message
      CALL METHOD lo_message_manager->report_element_t100_message
        EXPORTING
          msg     = message
          element = in_el_context
          cancel_navigation = in_cancel_navigation.
    endmethod.

    Thank you for your reply Vishal, but I already read context before I give message. Please have a look at my code below.
    Do you say something different from this?
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA lo_api_controller TYPE REF TO if_wd_controller.
      DATA:
        lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      DATA:
        lo_nd_tab_molekul_selected TYPE REF TO if_wd_context_node,
        lt_tab_molekul_selected TYPE wd_this->elements_tab_molekul_selected,
        lo_el_tab_molekul_selected TYPE REF TO if_wd_context_element,
        wa_selected TYPE zbyys020,
        strfocuscolumn TYPE string,
        cmsg  TYPE symsgv,
        nsure(6) TYPE n   ,
        itabix TYPE sy-tabix .
      DATA: itmp TYPE i,
                isure TYPE i..
      CLEAR ret_ready .
      lo_nd_tab_molekul_selected = wd_context->get_child_node(
           name = wd_this->wdctx_tab_molekul_selected ).
      lo_nd_tab_molekul_selected->get_static_attributes_table(
    IMPORTING table =   lt_tab_molekul_selected ).
      lo_el_context = wd_context->get_element( ).
      lo_api_controller ?= wd_this->wd_get_api( ).
      CLEAR:  strfocuscolumn, itabix.
      LOOP AT lt_tab_molekul_selected INTO wa_selected
        WHERE changed IS NOT INITIAL.
        itabix = sy-tabix.
        IF wa_selected-gecerlibastarih IS INITIAL.
          CALL METHOD wd_assist->mesaj_ver
            EXPORTING
              in_api_controller = lo_api_controller
              in_el_context     = lo_el_context
              in_msgty          = 'E'
              in_msgno          = wd_assist->msg_boskalamaz
              in_msgv1          = 'Geçerlilik Başlama Tarihi'.
          strfocuscolumn = 'GECERLIBASTARIH'.
          EXIT.
        ENDIF.
        lo_el_tab_molekul_selected =
    lo_nd_tab_molekul_selected->get_element( index = sy-tabix ).
        lo_el_tab_molekul_selected->set_attribute(
          EXPORTING
          value = ' '
          name =  'CHANGED' ).
      ENDLOOP.
      IF  strfocuscolumn IS NOT INITIAL.
        lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).
        lr_salv_wd_table->set_focus(
          index  = itabix
          column = strfocuscolumn ).
      ELSE.
        ret_ready =  'X'.
      ENDIF.

  • Web Dynpro ALV grid column width

    Hi,
    I have a web dynpro alv grid that has columns titles that are long.  What is the best way of displaying the data without taking up too much space with the titles? 
    For example is it possible to wrap the title into 2 or 3 rows
    Thanks,
    Samir

    Hi,
    DATA: lr_column type ref to cl_salv_wd_column,
    lr_colheader type ref to cl_salv_wd_column_header.
              CALL METHOD lrcolumn->get_header
                RECEIVING
                  value = lr_COLHEADER.
    lr_COLHEADER->set_ddic_binding_field( if_salv_wd_c_ddic_binding=>ddic_bind_short ).
    Refer this if_salv_wd_c_ddic_binding in se24 for more.
    Regards,
    Lekha.

  • ALV Grid Column name in multiple rows

    Hi,
    When ALV Grid is display columns are displayed horizontally in a single line.
    Is there ne way to display the column names in 2 rows
    e.g : Functional Location column should be shown as
         Functional 
          Location

    Hi,
    Actually it is not possible to disaply in multiple lines.
    ALV grid Multiple Header ... ?
    Re: Multiple lines in alv column headings
    This problem was discussed many times in this forum, u can search for more results.
    Message was edited by: Judith Jessie Selvi

  • ALV grid - column width doesn't get optimized

    Dear SAP friends,
    My program displays ALV grid in PBO:
      gs_layout-cwidth_opt = 'X'.   " optimize column width
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING
        i_structure_name      = 'IT_REPORT_X'
          is_layout            = gs_layout
          is_print             = gs_print
          it_toolbar_excluding = it_exclude
        CHANGING
          it_outtab        = it_report_x
          it_fieldcatalog  = gt_fcat.
    I have a custom button in the standard toolbar which I use to repopulate the grid if a certain criteria is met. To repopulate the grid  I am using method:
       CALL METHOD grid1->refresh_table_display.
    So on initial display the grid has column width  optimized.
    But when I  do refresh  - the columns don't get optimized.
    What is wrong?
    Thank you,
    Tatyana

    Hello Tatyana
    It seems that you have to call method go_grid->set_frontend_layout a second time but please do not ask me when and where (PBO vs. PAI, before/after REFRESH_TABLE_DISPLAY).
    However, you are definitely on the safe side if you simply call the entire
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING
        i_structure_name      = 'IT_REPORT_X'
          is_layout            = gs_layout
          is_print             = gs_print
          it_toolbar_excluding = it_exclude
        CHANGING
          it_outtab        = it_report_x
          it_fieldcatalog  = gt_fcat.
    again at PBO. Disadvantage: scroll positions get lost.
    Regards
      Uwe

  • ALV Grid - Alignment Issues in TOP OF PAGE.

    Hi,
    We have a requirement to right align text in the report header.
    We are using REUSE ALV GRID DISPLAY, but using TOP-OF-PAGE event - the whole text is left aligned.
    I tried using Class CL_DD_DOCUMENT which solved the alignment issue, but I am not able to see the header while printing/downloading to excel.
    I want the header to be available while downloading/printing the list. Any suggestions?
    Thanks in advance,
    Harveen.

    Hi
    The ALV download only the grid into the file, so not the data you're writing in TOP_OF_PAGE event.
    If you need to do that, you should create an your own buttom to download the file.
    Max

  • ALV grid display issue from radio buttons

    Hello,
    I have a radio button group in a selection screen. On select of the first radio button, I display an ALV grid below the radio button group.
    On selecting the next one, I want the grid to disappear which isn't happening currently.
    Please help.
    Thanks and Regards,
    Abhijnan

    Please check if this is what you needed or something else
    DATA: obj TYPE REF TO cl_gui_alv_grid,
          repid TYPE sy-repid,
          entered TYPE c,
          lv_structure TYPE tabname,
          dock TYPE REF TO cl_gui_docking_container,
          i_mara TYPE TABLE OF mara,
          i_marc TYPE TABLE OF marc.
    FIELD-SYMBOLS:<fs_tab> TYPE table.
    PARAMETERS: p_matnr TYPE matnr.
    PARAMETERS: p_mara RADIOBUTTON GROUP a USER-COMMAND abc.
    PARAMETERS: p_marc RADIOBUTTON GROUP a.
    AT SELECTION-SCREEN OUTPUT.
      CHECK NOT p_matnr IS INITIAL.
      IMPORT entered from memory id 'E'.
      CHECK NOT entered IS INITIAL.
      CHECK dock IS INITIAL.
      repid = sy-repid.
      CREATE OBJECT dock
           EXPORTING
             repid = repid
             dynnr = sy-dynnr
             ratio = 80
             side  = cl_gui_docking_container=>dock_at_bottom
             name  = 'DOCK_CONT'.
      CHECK  obj IS INITIAL.
      CREATE OBJECT obj
      EXPORTING
      i_parent          =  dock.
      IF p_mara = 'X'.
        IMPORT i_mara FROM MEMORY ID 'IMARA'.
        FREE MEMORY ID 'IMARA'.
        lv_structure = 'MARA'.
        ASSIGN i_mara TO <fs_tab>.
      ELSE.
        IMPORT i_marc FROM MEMORY ID 'IMARC'.
        FREE MEMORY ID 'IMARC'.
        lv_structure = 'MARC'.
        ASSIGN i_marc TO <fs_tab>.
      ENDIF.
      CALL METHOD obj->set_table_for_first_display
      EXPORTING
      i_structure_name = lv_structure
      CHANGING
      it_outtab = <fs_tab>.
    START-OF-SELECTION.
      entered = 'X'.
      EXPORT entered TO memory ID 'E'.
      IF p_mara = 'X'.
        SELECT * FROM mara UP TO 100 ROWS INTO TABLE i_mara
                 WHERE matnr = p_matnr.
        EXPORT i_mara TO MEMORY ID 'IMARA'.
      ELSE.
        SELECT * FROM marc UP TO 100 ROWS INTO TABLE i_marc
               WHERE matnr = p_matnr.
        EXPORT i_marc TO MEMORY ID 'IMARC'.
      ENDIF.

  • ALV Grid - Resource Issue?

    Morning All
    I have a situation where I have a standard selection screen displaying an ALV grid.  The user can then double click a line to see a drill down ALV.  My error occurs if the user executes the program multiple times i.e. displaying the grid time and time again.  Eventually the session does not display the grid and on a subsequent attempt the session either crashes or locks.
    I am currently destroying the 2 containers used every time the user exits the relevant screens using call method gr_alvgrid-> free but to no avail.
    Has anyone else had similar problems?  I am on a 46B machine running on NT4 (yes I know I'm in the dark ages!)
    Cheers
    Ian

    Hi,
    Have you did something like that before creating event receiver?
    IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    * Create the event reciever
        IF o_eventreceiver IS INITIAL.
          CREATE OBJECT o_eventreceiver.
        ENDIF.
      ENDIF.
    In PAI of the screen,just try this.
    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.
          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.
    * This leaves the program but you may need to re-call the
    * transaction to go back to the original screen
        when others.
      ENDCASE.
    endmodule.                 " USER_COMMAND_9001  INPUT
    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 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
    Message was edited by: Jayanthi Jayaraman

Maybe you are looking for

  • Difference in partner functions in normal and consignment sales

    hi, What is the major difference in partner functions in normal sales and consignment sales Processing? regards prabudh

  • Create intermedia index hang

    Hi I have table that contain XML in a CLOB datatype I'm trying to create this index with this section group: begin ctx_ddl.create_section_group ('feature_group','XML_SECTION_GROUP'); ctx_ddl.add_field_section('feature_group', 'Title', 'title', true);

  • Safari content width (NOT window width!)

    Okay, so that none of you are confused: I know how to make my Safari browser window as wide as my screen, and I do it for my own reasons. I like it that way. This is not a philosophical question: How do I make the content match the width of the windo

  • Adapter to use zen m with ipod accessori

    Does anyone know if there is an adapter out there that allows me to use my zen m with ipod accessories?Message Edited by spider4re on 0-24-200704:37 AM

  • Getting the Publisher Last Modified Date to show up in a snapshot query?

    Hello, I have been requested to create a Snapshot Query of the latest content to a Publisher 6.5 folder. I created a Publisher Crawler to output data to the Knowledge Directory (KD), then created a Snapshot Query to point at the KD folder. I set it t