Selective Sorting in ALV OOPS

Hi
Can you have 'selective sorting' in a single ALV OOPS grid?
like i want only some specific rows to be sorted based on a condition.
Any ideas?
Thanks
Pushpraj

Problem Solved.
Thanks
Pushpraj

Similar Messages

  • Selection-screen in alv oops

    Hi All,
    Am creating am alv report in oops .,., but am facing an unusual problem ,,,am unable to display selection-screen ..,
    its really unusual which i never came across
    Kindly provide me suggestions to fix it up..
    thanks
    jack

    Please provide the solution.
    Regards,
    Sumit Nene.

  • Sorting issues in alv oops

    Hi All,
    Greetings for the Day!!!
    am using alv oops for displaying output..
    BEFORE sorting my internal table  looks like below in the output.....
    for example
    A
    B
    C
    D
    E
    F
    AFTER sorting  the internal table in the output .display.,, the internal table shows like below
    F
    E
    D
    C
    B
    A
    but when i call the method set_table_for_first_display ,after sorting the in the output display ....,the internal table remains as like before
    A
    B
    C
    D
    E
    F....
    it should be lke
    F
    E
    D
    C
    B
    A .....
    kindly suggest me the alternatives.pls
    Regards
    Jack

    For example....
    DATA: lo_alv_grid            TYPE REF TO cl_gui_alv_grid.
    DATA: lo_form_alv_container  TYPE REF TO cl_gui_custom_container.
    * Create Controls
        IF lo_form_alv_container IS INITIAL.  "<-- Check if already created
          CREATE OBJECT lo_form_alv_container
            EXPORTING
              container_name = 'FORMULA_CONTAINER'.
    * Create control based ALV grid
          CREATE OBJECT lo_alv_grid
            EXPORTING
              i_parent = lo_form_alv_container.
    * set for first display
          lo_alv_grid->set_table_for_first_display(
                    EXPORTING
                       is_layout            = ls_layout
                       it_toolbar_excluding = lt_exclude
                    CHANGING
                       it_outtab            = lt_formulas[]
                       it_fieldcatalog      = lt_fieldcat[] ).
        ELSE.
          lo_alv_grid->refresh_table_display( ).    "<-- If so, just refresh
        ENDIF.
    Regards,
    Rich Heilman

  • ALV OOPS report - Need help

    Hi Friends,
    I just want to convert a normal alv grid report to ALV OOPS report using classes,methods and objects, can you please help me on it.
    *I have sent a sample ALV grid report program.
    REPORT  YSDB_ALV_ECC NO STANDARD PAGE HEADING LINE-SIZE 260 LINE-COUNT 58.
    TABLES:
                    VBRK,
                    VBRP.
    TYPE-POOLS: SLIS.
    TYPES:
                  BEGIN OF Y_VBRK_STRUCT ,
                        VBELN TYPE VBRK-VBELN,
                        FKART TYPE VBRK-FKART,
                        FKDAT TYPE VBRK-FKDAT,
                        BUKRS TYPE VBRK-BUKRS,
                        NETWR TYPE VBRK-NETWR,
                  END OF Y_VBRK_STRUCT.
    TYPES:
                     BEGIN OF Y_VBRP_STRUCT,
                            VBELN TYPE VBRP-VBELN,
                            POSNR TYPE VBRP-POSNR,
                            MATNR TYPE VBRP-MATNR,
                            FKIMG TYPE VBRP-FKIMG,
                            AUBEL TYPE VBRP-AUBEL,
                            KOSTL TYPE VBRP-KOSTL,
                            PS_PSP_PNR TYPE VBRP-PS_PSP_PNR,
                            ARKTX TYPE VBRP-ARKTX,
                     END OF Y_VBRP_STRUCT.
    TYPES:
                  BEGIN OF Y_DISPLAY_STRUCT,
                        VBELN TYPE VBRK-VBELN,
                        FKART TYPE VBRK-FKART,
                        FKDAT TYPE VBRK-FKDAT,
                        BUKRS TYPE VBRK-BUKRS,
                        NETWR TYPE VBRK-NETWR,
                        POSNR TYPE VBRP-POSNR,
                        MATNR TYPE VBRP-MATNR,
                        FKIMG TYPE VBRP-FKIMG,
                        AUBEL TYPE VBRP-AUBEL,
                        KOSTL TYPE VBRP-KOSTL,
                        PS_PSP_PNR TYPE VBRP-PS_PSP_PNR,
                        ARKTX TYPE VBRP-ARKTX,
                  END OF Y_DISPLAY_STRUCT .
    DATA: W_INDEX LIKE SY-TABIX.
    DATA:  W_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV.
    DATA:  T_FIELDCATALOG1 TYPE SLIS_T_FIELDCAT_ALV.
    DATA:  W_REPID TYPE SY-REPID.
    DATA: T_VBRK_ITAB TYPE STANDARD TABLE OF Y_VBRK_STRUCT .
    DATA: T_VBRP_ITAB TYPE STANDARD TABLE OF Y_VBRP_STRUCT .
    DATA: T_DISPLAY_ITAB TYPE STANDARD TABLE OF Y_DISPLAY_STRUCT.
    DATA: E_DISPLAY TYPE Y_DISPLAY_STRUCT.
    SELECT-OPTIONS S_VBELN FOR VBRK-VBELN.
    SELECT-OPTIONS S_BUKRS FOR VBRK-BUKRS.
    SELECT-OPTIONS S_FKDAT FOR VBRK-FKDAT.
    START-OF-SELECTION.
      PERFORM F_GET_DATA1.
      PERFORM F_PROCESS_DATA.
      PERFORM F_FIELDCATLOG.
      PERFORM F_DISPLAY_DATA.
      PERFORM F_CLEAR_FIELDS.
    *&      Form  get_data1
          text
    FORM F_GET_DATA1 .
      SELECT VBELN  FKART FKDAT BUKRS NETWR
        FROM VBRK
        INTO  TABLE T_VBRK_ITAB
       WHERE BUKRS IN S_BUKRS
         AND FKDAT IN S_FKDAT
         AND VBELN IN S_VBELN.
      IF SY-SUBRC NE 0.
        FREE: T_VBRK_ITAB.
      ENDIF.
      IF NOT T_VBRK_ITAB IS INITIAL.
        SELECT VBELN POSNR MATNR FKIMG AUBEL
               KOSTL PS_PSP_PNR ARKTX
          FROM VBRP
          INTO TABLE T_VBRP_ITAB
          FOR ALL ENTRIES IN T_VBRK_ITAB
         WHERE VBELN EQ T_VBRK_ITAB-VBELN.
        IF SY-SUBRC NE 0.
          FREE: T_VBRK_ITAB.
        ENDIF.
      ENDIF.
    ENDFORM.                                                    " GET_DATA1
          text
    -->  p1        text
    <--  p2        text
    FORM F_PROCESS_DATA .
      SORT T_VBRK_ITAB  BY VBELN.
      SORT T_VBRP_ITAB  BY VBELN.
      CLEAR: W_INDEX.
      UNASSIGN <FS_STRUCT1>.
      UNASSIGN <FS_STRUCT2>.
      LOOP AT T_VBRK_ITAB ASSIGNING <FS_STRUCT1>.
        READ TABLE T_VBRP_ITAB ASSIGNING <FS_STRUCT2> WITH KEY VBELN = <FS_STRUCT1>-VBELN BINARY SEARCH.
        IF SY-SUBRC EQ 0.
          MOVE  SY-TABIX TO W_INDEX.
          WHILE SY-SUBRC  IS INITIAL AND <FS_STRUCT1>-VBELN = <FS_STRUCT2>-VBELN.
    *Header Items Moving
            MOVE:
                   <FS_STRUCT1>-FKART TO E_DISPLAY-FKART,
                   <FS_STRUCT1>-FKDAT TO E_DISPLAY-FKDAT,
                   <FS_STRUCT1>-BUKRS TO E_DISPLAY-BUKRS,
                   <FS_STRUCT1>-NETWR TO E_DISPLAY-NETWR.
    *Line items Moving
            MOVE: <FS_STRUCT2>-VBELN TO E_DISPLAY-VBELN,
                  <FS_STRUCT2>-POSNR TO E_DISPLAY-POSNR,
                  <FS_STRUCT2>-MATNR TO E_DISPLAY-MATNR,
                  <FS_STRUCT2>-FKIMG TO E_DISPLAY-FKIMG,
                  <FS_STRUCT2>-AUBEL TO E_DISPLAY-AUBEL,
                  <FS_STRUCT2>-KOSTL TO E_DISPLAY-KOSTL,
                  <FS_STRUCT2>-PS_PSP_PNR TO E_DISPLAY-PS_PSP_PNR,
                  <FS_STRUCT2>-ARKTX TO E_DISPLAY-ARKTX.
            APPEND E_DISPLAY TO T_DISPLAY_ITAB.
            CLEAR  E_DISPLAY.
                      ADD 1 TO W_INDEX.
            READ TABLE T_VBRP_ITAB ASSIGNING <FS_STRUCT2> INDEX  W_INDEX.
            IF SY-SUBRC NE 0.
              EXIT.
            ENDIF.
          ENDWHILE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                                                    " GET_DATA3
    *&      Form  Fieldcatlog
          text
    -->  p1        text
    <--  p2        text
    FORM F_FIELDCATLOG .
      W_FIELDCATALOG-FIELDNAME = TEXT-001.
      W_FIELDCATALOG-SELTEXT_L = TEXT-002.
      MOVE : 1 TO W_FIELDCATALOG-COL_POS,
             20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-003.
      W_FIELDCATALOG-SELTEXT_L = TEXT-004.
      MOVE : 2 TO W_FIELDCATALOG-COL_POS,
               20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-005.
      W_FIELDCATALOG-SELTEXT_L = TEXT-006.
      MOVE : 3 TO W_FIELDCATALOG-COL_POS,
              20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-007.
      W_FIELDCATALOG-SELTEXT_L = TEXT-008.
      MOVE : 4 TO W_FIELDCATALOG-COL_POS,
             20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-009.
      W_FIELDCATALOG-SELTEXT_L = TEXT-010.
      MOVE : 5 TO W_FIELDCATALOG-COL_POS,
              20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-011.
      W_FIELDCATALOG-SELTEXT_L = TEXT-012.
      MOVE : 6 TO W_FIELDCATALOG-COL_POS,
             20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-013.
      W_FIELDCATALOG-SELTEXT_L = TEXT-014.
      MOVE : 7 TO W_FIELDCATALOG-COL_POS,
            20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-015.
      W_FIELDCATALOG-SELTEXT_L = TEXT-016.
      MOVE : 8 TO W_FIELDCATALOG-COL_POS,
             20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-FIELDNAME = TEXT-017.
      W_FIELDCATALOG-SELTEXT_L = TEXT-018.
      MOVE : 9 TO W_FIELDCATALOG-COL_POS,
             20 TO W_FIELDCATALOG-OUTPUTLEN.
      APPEND W_FIELDCATALOG TO T_FIELDCATALOG1.
      CLEAR W_FIELDCATALOG.
    ENDFORM.                    " Fieldcatlog
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM F_DISPLAY_DATA .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = W_REPID
          I_CALLBACK_TOP_OF_PAGE = 'AAAAAAAAADDAADA' "TEXT-021
          I_GRID_TITLE           = TEXT-020
          IT_FIELDCAT            = T_FIELDCATALOG1
        TABLES
          T_OUTTAB               = T_DISPLAY_ITAB.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
      CLEAR: W_REPID.
      CLEAR: T_FIELDCATALOG1.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  F_Clear_fields
          text
    -->  p1        text
    <--  p2        text
    FORM F_CLEAR_FIELDS .
      FREE: T_VBRK_ITAB.
      FREE: T_VBRP_ITAB.
      FREE: T_DISPLAY_ITAB.
      CLEAR: W_FIELDCATALOG.
    ENDFORM.                    " F_Clear_fields
    Regards
    Dinesh

    In ALV oops,
    1. You need screen on which you must create a custom container. - screen 100
    2. In PBO of 100, create module for displaying ALV
    MODULE DISPLAY_ALV OUTPUT
    PERFORM CREATE_CONTAINER "IN WHICH YOU USE THE CREATE OBJECT METHOD OF CL_GUI_CUSTOM_CONTAINER
    PERFORM CREATE_ALV "IN WHICH YOU USE CREATE_OBJECT METHOD OF CL_GUI_ALV_GRID.
    PERFORM PREPARE_FIELDCAT "creating fcat using LVC_S_FCAT structure
    PERFORM DISPLAY "here you use the SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID class,
    where you provide the internal table name and fieldcat internal table
    ENDMODULE

  • How to do it in ALV OOPS

    Hi
    Im using ALV OOPS.o/p I have 10 records with checkbox(at user command I have to select record selected by check box). Now on the menu bar I hav a button for "SELECT ALL". If "selected all" 10 recored will be selected. If I filter upon some criteria no. of records will be 3..Now in GUI if I select SELECT all it will display 3 records r selected, but I have to process further internally ,,,but internally 10 records are selected. So how to write code for that is after filterring 3 records r selected and I "select all"..only 3 records will be selected instead of 10?
    Part of my code like this..
    SELECT all
      CALL METHOD G_GRID->CHECK_CHANGED_DATA
        IMPORTING
          E_VALID = L_VALID.
      IF L_VALID EQ 'X'.
        LOOP AT PT_OUTTAB INTO LS_OUTTAB.
      DATA LS_CELLTAB TYPE LVC_S_STYL.
      LOOP AT PS_OUTTAB-CELLTAB INTO LS_CELLTAB.
        IF LS_CELLTAB-FIELDNAME = 'CHECKBOX'.
          IF LS_CELLTAB-STYLE EQ CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
            P_LOCKED = 'X'.
          ELSE.
            P_LOCKED = SPACE.
          ENDIF.
        ENDIF.
      ENDLOOP.
          IF L_LOCKED IS INITIAL
             AND NOT LS_OUTTAB-CHECKBOX EQ '-'.
            LS_OUTTAB-CHECKBOX = 'X'.
          ENDIF.
          MODIFY PT_OUTTAB FROM LS_OUTTAB.
        ENDLOOP.
        CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY.
    ENDIF.

    Hello Kaushik
    Using method go_grid->GET_FILTERED_ENTRIES you get an index list of the filtered entries.
    DATA: lt_filtered     TYPE lvc_t_fidx,
              ld_indx        LIKE LINE OF lt_filtered.
      CALL METHOD go_grid->GET_FILTERED_ENTRIES
         IMPORTING
           ET_FILTERED_ENTRIES = lt_filtered.
      LOOP AT lt_filtered INTO ld_indx.
        READ TABLE gt_outtab INTO ls_outtab INDEX ld_indx.
      ENDLOOP.
    Regards
      Uwe

  • To set HOTSPOT for a field in ALV-oops and when clecked should call transac

    Hi,
    I need to set HOTSPOT for a field in O/P list using ALV-oops and when clecked should take me to Transaction VA01. Please help....
    Thanks,
    Prabhu

    Hi,
         Please go through this code it may help u.
    REPORT zcls_alv_oops MESSAGE-ID z1.
    TABLES : mara.
    Types Declaration..\
    TYPES :
    BEGIN OF t_mara,
    matnr TYPE matnr,
    mtart TYPE mtart,
    maktx TYPE maktx,
    END OF t_mara,
    BEGIN OF t_marc,
    matnr TYPE matnr,
    werks TYPE werks_d,
    mtart TYPE mtart,
    maktx TYPE maktx,
    END OF t_marc.
    Internal Tables Declaration..\
    DATA :
    i_mara TYPE TABLE OF t_mara,
    i_marc TYPE TABLE OF t_marc,
    i_fcat1 TYPE lvc_t_fcat,
    i_fcat2 TYPE lvc_t_fcat.
    Constants Declaration..\
    CONSTANTS :
    c_cont1 TYPE scrfname VALUE 'CONT1',
    c_cont2 TYPE scrfname VALUE 'CONT2'.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    SELECT-OPTIONS:
    s_matnr FOR mara-matnr NO INTERVALS.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS :
    p_hotspt RADIOBUTTON GROUP r1 DEFAULT 'X',
    p_bttn RADIOBUTTON GROUP r1.
    SELECTION-SCREEN END OF BLOCK b1.
    \* Class forward referncing.
    CLASS lcl_rcvr_class DEFINITION DEFERRED.
    \* Pointers Declaration..
    DATA :
    lp_rcvr TYPE REF TO lcl_rcvr_class,
    lp_cont1 TYPE REF TO cl_gui_custom_container,
    lp_cont2 TYPE REF TO cl_gui_custom_container,
    lp_grid1 TYPE REF TO cl_gui_alv_grid,
    lp_grid2 TYPE REF TO cl_gui_alv_grid.
    \* Local Class Definiton.
    CLASS lcl_rcvr_class DEFINITION.
    PUBLIC SECTION.
    METHODS :
    hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id es_row_no,
    handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING e_row e_column.
    ENDCLASS.
    \* Local Class Implementation.
    CLASS lcl_rcvr_class IMPLEMENTATION.
    METHOD hotspot_click.
    DATA :
    wa_mara TYPE t_mara,
    wa_marc TYPE t_marc.
    DATA :
    l_index TYPE sy-tabix.
    READ TABLE i_mara INTO wa_mara INDEX e_row_id-index.
    IF sy-subrc EQ 0.
    REFRESH i_marc.
    SELECT matnr
    werks
    INTO TABLE i_marc
    FROM marc
    WHERE matnr EQ wa_mara-matnr.
    IF sy-subrc EQ 0.
    LOOP AT i_marc INTO wa_marc.
    l_index = sy-tabix.
    wa_marc-mtart = wa_mara-mtart.
    wa_marc-maktx = wa_mara-maktx.
    MODIFY i_marc FROM wa_marc INDEX l_index
    TRANSPORTING mtart maktx.
    ENDLOOP.
    CALL SCREEN 200.
    ELSE.
    MESSAGE e121 WITH text-005 wa_mara-matnr.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    METHOD handle_double_click.
    DATA :
    wa_mara TYPE t_mara,
    wa_marc TYPE t_marc.
    DATA :
    l_index TYPE sy-tabix.
    READ TABLE i_mara INTO wa_mara INDEX e_row-index.
    IF sy-subrc EQ 0.
    REFRESH i_marc.
    SELECT matnr
    werks
    INTO TABLE i_marc
    FROM marc
    WHERE matnr EQ wa_mara-matnr.
    IF sy-subrc EQ 0.
    LOOP AT i_marc INTO wa_marc.
    l_index = sy-tabix.
    wa_marc-mtart = wa_mara-mtart.
    wa_marc-maktx = wa_mara-maktx.
    MODIFY i_marc FROM wa_marc INDEX l_index
    TRANSPORTING mtart maktx.
    ENDLOOP.
    CALL SCREEN 200.
    ELSE.
    MESSAGE e121 WITH text-005 wa_mara-matnr.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    ENDCLASS.
    \* Start of Selection
    START-OF-SELECTION.
    \* Extract the Material Master data for the Input Material.
    SELECT a~matnr
    a~mtart
    b~maktx
    INTO TABLE i_mara
    FROM mara AS a
    INNER JOIN makt AS b
    ON a~matnr EQ b~matnr
    WHERE a~matnr IN s_matnr
    AND b~spras EQ sy-langu.
    END-OF-SELECTION.
    IF NOT i_mara\[\] IS INITIAL.
    \* Call Screen to display the Material Master data.
    CALL SCREEN 100.
    ELSE.
    MESSAGE s121 WITH text-006.
    ENDIF.
    \*& Module DISP_GRID OUTPUT
    \* text
    MODULE disp_grid OUTPUT.
    \* Build the Field catelog for Material Master data.
    PERFORM build_fcat.
    \* Display the Material Master data using ALV.
    PERFORM disp_alv.
    ENDMODULE. " DISP_GRID OUTPUT
    \*& Module USER_COMMAND_0100 INPUT
    \* text
    MODULE user_command_0100 INPUT.
    \*when exit or cancel is clicked program has to come out
    CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    \*& Form build_fcat
    \* text
    \* \--> p1 text
    \* <-\- p2 text
    FORM build_fcat.
    DATA : ws_fcat TYPE lvc_s_fcat.
    ws_fcat-fieldname = 'MATNR'.
    ws_fcat-scrtext_m = text-001.
    ws_fcat-tabname = 'I_MARA'.
    IF p_hotspt EQ 'X'.
    ws_fcat-hotspot = 'X'.
    ENDIF.
    APPEND ws_fcat TO i_fcat1.
    CLEAR ws_fcat.
    ws_fcat-fieldname = 'MTART'.
    ws_fcat-scrtext_m = text-002.
    ws_fcat-tabname = 'I_MARA'.
    APPEND ws_fcat TO i_fcat1.
    CLEAR ws_fcat.
    ws_fcat-fieldname = 'MAKTX'.
    ws_fcat-scrtext_m = text-003.
    ws_fcat-tabname = 'I_MARA'.
    APPEND ws_fcat TO i_fcat1.
    CLEAR ws_fcat.
    ENDFORM. " build_fcat
    \*& Form disp_alv
    \* text
    \* \--> p1 text
    \* <-\- p2 text
    FORM disp_alv.
    IF lp_cont1 IS INITIAL.
    \* Create the Container Object of Material Master.
    CREATE OBJECT lp_cont1
    EXPORTING
    container_name = c_cont1
    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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    \* Create the Object for Grid of Material Master.
    CREATE OBJECT lp_grid1
    EXPORTING
    i_parent = lp_cont1
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    others = 5.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    \* Dipslay Material Master data by calling method.
    CALL METHOD lp_grid1->set_table_for_first_display
    CHANGING
    it_outtab = i_mara
    it_fieldcatalog = i_fcat1
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    \* Set Handler for the Hot Spot Event.
    CREATE OBJECT lp_rcvr.
    IF p_hotspt EQ 'X'.
    SET HANDLER lp_rcvr->hotspot_click FOR lp_grid1.
    ELSE.
    SET HANDLER lp_rcvr->handle_double_click FOR lp_grid1.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. " disp_alv
    \*& Module STATUS_0100 OUTPUT
    \* text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'MAIN_STAT'.
    SET TITLEBAR 'T_100'.
    ENDMODULE. " STATUS_0100 OUTPUT
    \*& Module STATUS_0200 OUTPUT
    \* text
    MODULE status_0200 OUTPUT.
    SET PF-STATUS 'PLANT_STAT'.
    SET TITLEBAR 'T_200'.
    ENDMODULE. " STATUS_0200 OUTPUT
    \*& Module DISP_GRID_plant OUTPUT
    \* text
    MODULE disp_grid_plant OUTPUT.
    \* Build the Field catelog for Material Plant data.
    PERFORM build_fcat_plant.
    \* Display the Material Master Plant data using ALV.
    PERFORM disp_alv_plant.
    ENDMODULE. " DISP_GRID_plant OUTPUT
    \*& Module USER_COMMAND_0200 INPUT
    \* text
    MODULE user_command_0200 INPUT.
    \*when exit or cancel is clicked program has to come out
    CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0200 INPUT
    \*& Form build_fcat_plant
    \* text
    \* \--> p1 text
    \* <-\- p2 text
    FORM build_fcat_plant.
    DATA : ws_fcat TYPE lvc_s_fcat.
    ws_fcat-fieldname = 'MATNR'.
    ws_fcat-scrtext_m = text-001.
    ws_fcat-tabname = 'I_MARC'.
    APPEND ws_fcat TO i_fcat2.
    CLEAR ws_fcat.
    ws_fcat-fieldname = 'WERKS'.
    ws_fcat-scrtext_m = text-004.
    ws_fcat-tabname = 'I_MARC'.
    APPEND ws_fcat TO i_fcat2.
    CLEAR ws_fcat.
    ws_fcat-fieldname = 'MTART'.
    ws_fcat-scrtext_m = text-002.
    ws_fcat-tabname = 'I_MARC'.
    APPEND ws_fcat TO i_fcat2.
    CLEAR ws_fcat.
    ws_fcat-fieldname = 'MAKTX'.
    ws_fcat-scrtext_m = text-003.
    ws_fcat-tabname = 'I_MARC'.
    APPEND ws_fcat TO i_fcat2.
    CLEAR ws_fcat.
    ENDFORM. " build_fcat_plant
    \*& Form disp_alv_plant
    \* text
    \* \--> p1 text
    \* <-\- p2 text
    FORM disp_alv_plant.
    IF lp_cont2 IS INITIAL.
    \* Create the Container Object of Material Plant data.
    CREATE OBJECT lp_cont2
    EXPORTING
    container_name = c_cont2
    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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    \* Create the Object for Grid of Material Plant data.
    CREATE OBJECT lp_grid2
    EXPORTING
    i_parent = lp_cont2
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    others = 5.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    \* Dipslay Material Plant data by calling method.
    CALL METHOD lp_grid2->set_table_for_first_display
    CHANGING
    it_outtab = i_marc
    it_fieldcatalog = i_fcat2
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDIF.
    ENDIF.
    ELSE.
    \* Call method 'REFRESH_TABLE_DISPLAY' to refresh the grid data.
    CALL METHOD lp_grid2->refresh_table_display.
    ENDIF.
    ENDFORM. " disp_alv_plant

  • ALV: Issue with double  click event after sorting the ALV

    Hello Experts,
    I have an internal table that populates an ALV grid. When the user doubleclicks a row, my method HANDLE_DOUBLE_CLICK returns the e_row-index value from the ALV Grid. I use this index value to read the internal table, then retrieve additional data.
    My problem is the user may sort the ALV grid before double clicking on a line. If this happens my internal table is not sorted to match the ALV grid, so reading the internal table with the e_row-index value returns the wrong information.
    When the double click event occurs, is it possible to capture the value in column 1 instead of a value for e_row-index?
    There is one more paramter in HANDLE_DOUBLE_CLICK for row id.   It is coming blank in debugging .  what is the purpose of this parameter and how i can make use of it ?
    Regards
    Vivek

    Hi,
    I am Posting The Code Which Uses Double Click Event.
    And This Code will provide the total information to you.
    REPORT  ZALVGRID_PG.
    TABLES: SSCRFIELDS.
    DATA: V_BELNR TYPE RBKP-BELNR.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: IRNO FOR V_BELNR.
    PARAMETERS: P_GJAHR TYPE RBKP-GJAHR.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA: WA TYPE ZALVGRID_DISPLAY,
          ITAB TYPE STANDARD TABLE OF ZALVGRID_DISPLAY.
    DATA: IDENTITY TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_IDENTITY TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: L_TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE.
    TYPE-POOLS: SLIS,SDYDO.
    DATA: L_LOGO TYPE SDYDO_VALUE,
          L_LIST TYPE SLIS_T_LISTHEADER.
    END-OF-SELECTION.
    CLASS CL_LC DEFINITION.
      PUBLIC SECTION.
        METHODS: DC FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IMPORTING E_ROW E_COLUMN.
    ENDCLASS.
    CLASS CL_LC IMPLEMENTATION.
      METHOD DC.
        DATA: WA1 TYPE ZALVGRID_DISPLAY.
        READ TABLE ITAB INTO WA1 INDEX E_ROW-INDEX.
        BREAK-POINT.
        SET PARAMETER ID 'BLN' FIELD WA1-BELNR.
        CALL TRANSACTION 'FB02'.
      ENDMETHOD.                    "DC
    ENDCLASS.
    DATA: OBJ_CL TYPE REF TO CL_LC.
    START-OF-SELECTION.
      PERFORM SELECT_DATA.
      IF SY-SUBRC = 0.
        CALL SCREEN 100.
      ELSE.
        MESSAGE E000(0) WITH 'DATA NOT FOUND'.
      ENDIF.
      INCLUDE ZALVGRID_PG_STATUS_0100O01.
      INCLUDE ZALVGRID_PG_LOGOSUBF01.
      INCLUDE ZALVGRID_PG_SELECT_DATAF01.
    INCLUDE ZALVGRID_PG_USER_COMMAND_01I01.
    ***INCLUDE ZALVGRID_PG_STATUS_0100O01 .
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'AB'.
    *  SET TITLEBAR 'xxx'.
      IF IDENTITY IS INITIAL.
        CREATE OBJECT IDENTITY
        EXPORTING
          CONTAINER_NAME = 'ALVCONTROL'.
        CREATE OBJECT GRID
        EXPORTING
          I_PARENT = IDENTITY.
        CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
             I_STRUCTURE_NAME              = 'ZALVGRID_DISPLAY'
          CHANGING
            IT_OUTTAB                     = ITAB.
        CREATE OBJECT OBJ_CL.
        SET HANDLER OBJ_CL->DC FOR GRID.
        ENDIF.
        IF L_IDENTITY IS INITIAL.
          CREATE OBJECT L_IDENTITY
          EXPORTING
            CONTAINER_NAME = 'LOGO'.
          CREATE OBJECT L_TREE
          EXPORTING
            I_PARENT = L_IDENTITY.
          PERFORM LOGOSUB USING L_LOGO.
          CALL METHOD L_TREE->CREATE_REPORT_HEADER
            EXPORTING
              IT_LIST_COMMENTARY    = L_LIST
              I_LOGO                = L_LOGO.
          ENDIF    .
    ENDMODULE.                 " STATUS_0100  OUTPUT
    ***INCLUDE ZALVGRID_PG_LOGOSUBF01 .
    FORM LOGOSUB  USING    P_L_LOGO.
      P_L_LOGO = 'ERPLOGO'.
    ENDFORM.                    " LOGOSUB
    ***INCLUDE ZALVGRID_PG_SELECT_DATAF01 .
    FORM SELECT_DATA .
      SELECT RBKP~BELNR
             RBKP~BLDAT
             RSEG~BUZEI
             RSEG~MATNR
             INTO TABLE ITAB
             FROM RBKP INNER JOIN RSEG
        ON RBKP~BELNR = RSEG~BELNR
        WHERE RBKP~BELNR IN IRNO
        AND RBKP~GJAHR = P_GJAHR.
    ENDFORM.                    " SELECT_DATA
    ***INCLUDE ZALVGRID_PG_USER_COMMAND_01I01 .
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
           EXIT.
           ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Warm Regards,
    PavanKumar.G
    Edited by: pavankumar.g on Jan 19, 2012 5:30 AM

  • Problem while placing a button in the Output using ALV OOPs

    Hi,
    I am using ALV OOPs to display  report output.
    In the toolbar i have to palce an update button  and if i click on that update it should then call the selection screen 500 .
    So,please  help me to achieve this using ALV OOPs.
    THANKS & REGARDS,
    Kiranmai.

    Hi,
    you can use set pf-status statement with the OOPs' concept where in you will have to give this in the events table and pass it to the method to display the alv ...
    Regards,
    Siddarth

  • Event handling in alv oops With buttons

    Hi Experts
             I have some doubt in ALV OOPS using Events. Could any one please tell me the procedure to how to handle events in oops ( Like  interactive reports using events ).
                                     Thank you                                                                               
    Satyendra.

    Hello Satyendra
    The following sample report shows you how to handle the event HOTSPOT_CLICK and BUTTON_CLICK.
    DATA:  gd_okcode TYPE ui_func,
      gt_fcat TYPE lvc_t_fcat,
      go_docking TYPE REF TO cl_gui_docking_container,
      go_grid1 TYPE REF TO cl_gui_alv_grid.
    DATA:   gt_knb1 TYPE STANDARD TABLE OF knb1.
    PARAMETERS: p_bukrs TYPE bukrs  DEFAULT '2000'  OBLIGATORY.
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender,  " grid instance that raised the event
          handle_button_click FOR EVENT button_click OF cl_gui_alv_grid
            IMPORTING
              es_col_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CASE e_column_id-fieldname.
          WHEN 'KUNNR'.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'ERNAM'.*       
             SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
            CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
        ENDCASE.
    *   Set active cell to field BUKRS otherwise the focus is still on
    *   field KUNNR which will always raise event HOTSPOT_CLICK
        ls_col_id-fieldname = 'BUKRS'.
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
            is_row_id    = e_row_id
            is_column_id = ls_col_id.
    ENDMETHOD.                    "handle_hotspot_click
    METHOD handle_button_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX es_row_no-row_id.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
        SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
        CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
      ENDMETHOD.                    "handle_button_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = p_bukrs
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_hotspot_click FOR go_grid1,
        lcl_eventhandler=>handle_button_click  FOR go_grid1.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = gt_knb1
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    LOOP AT gt_fcat INTO ls_fcat
              WHERE ( fieldname = 'KUNNR'  OR
                      fieldname = 'ERNAM'  OR
                      fieldname = 'BUKRS' ).
        IF ( ls_fcat-fieldname = 'BUKRS' ).
          ls_fcat-style = cl_gui_alv_grid=>mc_style_button.  " column appears as button
        ELSE.
          ls_fcat-hotspot = abap_true.
        ENDIF.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    Regards
      Uwe

  • Dynamic sort in ALV

    hi all,
    HOw can we write the dynamic sort in ALV.
    regards,
    AJ

    Hi,
    Please find the sample code for dynamic sort in OO ALV
      perform built_sort_table.
    form built_sort_table.
      data ls_sort_wa type lvc_s_sort.
      ls_sort_wa-spos = 1.
      ls_sort_wa-fieldname = 'MATNR'.    "<< here your pass fieldname to sort dynamically
      ls_sort_wa-up = selected.
      ls_sort_wa-subtot = ''.
      append ls_sort_wa to gt_sort.
      ls_sort_wa-spos = 2.
      ls_sort_wa-fieldname = 'STATUS'.  "<< here your pass fieldname to sort dynamically
      ls_sort_wa-up = selected.
      ls_sort_wa-subtot = ''.
      append ls_sort_wa to gt_sort.
    endform.                               " BUILT_SORT_TABLE
        call method grid1->set_table_for_first_display
          exporting
            is_layout                     = gs_layout
            is_variant                    = gs_variant
            i_save                        = 'A'
            it_toolbar_excluding          = i_exclude[]
          changing
            it_outtab                     = i_output[]
            it_fieldcatalog               = i_fieldcat[]
            it_sort                       = gt_sort[]
          exceptions
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            others                        = 4.
    aRs

  • F4 link in ALV OOPs

    I am using ALV OOPs. I need to link F4 help to field in Selection Screen, Instead of normal method F4IF_INT_TABLE_VALUE_REQUEST, I need to implement this in ALV OOPs. Can anybody help on this.
    Regards,
    Naseer.

    Hi Naseer!
    At Selection Screen you don't call method to create the ALV OO yet.
    So you can you the FM 'F4IF_INT_TABLE_VALUE_REQUEST'  in the event AT SELECTION-SCREEN ON VALUE-REQUEST FOR your_parameter.
    I hope its helpful.

  • Adding new rows at run time in alv oops

    HI ALL,
    I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
    for example let us suppose i have the following row in the alv output.
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
    MATNR                          DESCRIPTION                             NAME                             DATE
    001                                 TEST                                        MATRIKS                      10092001
    001                                 TEST                                        MATRIKS                      10092001 -> NEW ROW.
    can we do it in alv oops? pls let me know the soln or any helpful links
    thanks
    john

    Hi John,
       I dont think, you can find any method for that,
    one way what I can suggest is
    Get the selected row index.
    Insert the blank row in your internal table at this index
    Refresh the container.
    Hope  this will help.
    Thanks,
    Anmol.

  • Displaying selection criteria in ALV report output

    Hello,
    I’ve been using REUSE_ALV_GRID_DISPLAY function module to display my report content in ALV.
    My report’s selection criteria has parameters, select options, checkboxes and radio buttons.  As part of the ALV output, I want to display the criteria that the user had selected in the selection screen.  I was hoping to do that via parameter "i_callback_top_of_page" and fill the selection criteria in the header area.  I'm using REUSE_ALV_COMMENTARY_WRITE to fill the header area. 
    However, the header area takes too much of view space in the output if I put all the selection screen information in it.
    Is there a way to make the header area scrollable?  What is a good way of displaying the selection criteria information as part of the report output?
    Appreciate your help.
    ss

    Hi SS,
    1. The purpose of displaying / writring
       selection information
       in alv is
       for identifying what the user has seleccted,
       directly from the report (when its printed)
    2. So, the option of priting/writing
       it on the TOP of alv, is ok.
    3. However, U can also choose to WRITE
      it at the BOTTOM (instead of top)
    4. Try to utilise maximum spacing (horizontally)
       field1 : abcd      fidl2 = xyz  field3 = ppp
       field4 : mnc       etc.         etc.
    regards,
    amit m.

  • How To Edit Selected Row In ALV Table

    Hello Experts,
    In My Webdynpro Application, I am displaying records from database table into an ALV Table.
    I want to edit only selected record from  ALV table.
    Please Suggest How to achieve this.
    Thanks,
    Pratibha

    The link given above is for the UI element 'Table' and does not pertain to ALV.
    To Make an ALV Editable on lead selection for that particular lead selected row.
    1. The ALV should be made lead selectable, when initializing
    2. The ON_LEAD_SELECT function should be invoked.
    3. Withing this function the index has to be retrieved to know which row was selected.
    4. Based on the index retrived all the columns have to pass FALSE to read_only in the column properties.
    Regards,
    Pramod

  • Select Sorting in prompt level

    I have below requirement from user.
    Prompts:     Loan Id
              Loan Type
              Sort by Account Number/Sale Type
    Basically when user run the report, it should prompt below three fields.
    Loan Id
    Loan Type
    Sort order with a drop down list which has values Account Number/ Sale Type.
    i.e., user should be able to select sort order he wants for both Account Number/ Sale Type before running the report at
    prompt level.
    Does anyone know the best way to accomplish this?.
    Thanks,
    ven
    Edited by: Ven Men on Jan 21, 2009 8:32 PM

    Hi Deb,
    Thanks for your reply. I need little more clarification from you regarding Ascending/Descending and group by.
    Please see my comments below.
    1) Created a prompt at the universe level where users can choose their sorting option, ie. Ascending or Descending.
        How did you create this. What I did is I created a derived table in Universe with below code.
       "Select distinct table.Account_Number from table order by 1". It just does only Ascending.
       Then I created a prompt, called Sort_Order, in designer as 
       '1'!=@Prompt('Sort_Order','A',{'Account_Number'},mono,Not_Persistent))
      It is not parsed with a Parsing Result as Parse failed: Exception: DBD, ORA-00903: invalid table     name   State: N/A
    Since I am not taking this value from database table, I went ahead and created this prompt and exported universe.
      What I understood from your point is I need to create two different prompts, once for Ascending and one for Descending. Please
      let me know if I am going wrong.
    2) In the WebI report, create two variables, one for Ascending and Descending. The formulas would be something like:
       cv_Ascending: if(userresponse("Sort order prompt text here")="Ascending";MyField)
       cv_Descending: if(userresponse("Sort order prompt text here")="Descending";MyField)
       I created variable as Sort_Act_Num =if(UserResponse("Sort_Order") = "Account_Number"; [Account Number]; 0).  This just sorts in Ascending order only and when I want to change it to descending, it is not working.
    3) Put the cv_Ascending variable in column one set to sort ascending and put cv_Descending variable in column two set to sort descending. (The column with the value that isn't selected is always null so it's sorted on nothing)
    4) Since you can't really "hide" columns in WebI, you have to fake it. Set the font color to white (or whatever color your background is) and the width to zero (0) - unfortunately, it won't let you set it to 0, it will default to .02. Turn off the borders. The columns will in effect be "hidden" and disappear.
    I've done the same thing with grouping, by creating a variable and using it as a section break. Works like a charm.
    For grouping, do I need to create any prompts or variables in designer level? Also in report level, is the code same as above to create variable for grouping.
    Please let me know..
    Thanks,
    Ven Men

Maybe you are looking for

  • Ipod Touch Overcapacity Error after Upgrade to itunes 11

    I just upgraded to itunes 11 and when I tried to connect my 32gb ipod touch it would not sync because it was over capacity by over 40gb. I have a 64 bit windows 7 os. What I have tried so far: 1) reboot ipod 2) reboot computer 3) Restore ipod 4) unin

  • How to Use logical schema in Variable

    Hi, I am using ODIFileCopy. I want to use the connection details configured in my Logical or Physical Schema, in ODIFileCopy. Please let me know i can use the topology connection in ODIFILECOPY. Thanks:)

  • Requirement in Web Analysis

    Hi Experts, We are designing a new Chart report in Web analysis, in "Rows" their are three members and the "Columns" contain two members. Our Client requirement is that Two specific Dimension members Of "Rows" should show Data specific to One dimensi

  • Can I organize my books on iBooks for Yosemite?

    Hi, I want to know how to organize my books on iBooks for Yosemite editing the details of each book. I wantt to edit some features like name of the books, genre, collections and other things. In Mountain Lion this was possible but in Mavericks or Yos

  • MTU and the UK and BT

    Now here is a poser. We all know that the recommended MTU for ADSL here in the UK is 1458 as recommended by BT. Now what I need to know is that an Macs the settings shown in System Prefs is set at 1500. So what I have discovered from Draytek who happ