Viewing data kept in "services for object" for several objects in alv grid?

Dear Experts,
Is it possible to view the data kept in "services for object" (The Button at topleft side of title bar of Master data header screen of objects like Functional Location/Equipment/Notification/Order) for several objects in one list like ALV?
Please guide how to do it.
Thanks and Regards,
R N Sabat.

Hi,
The data stored in service object can be viewed latter on in change/display mode
Kapil

Similar Messages

  • Cannot view workflow log via Services for Object Workflow Overview

    We recently had an upgrade of R3/ECC and discovered a new issue.  For some reason we can no longer view workflow log via Services for Object > Workflow Overview for Material Master (transaction MM03).  We get the message "There are no workflows that have already worked with this object".  However, we have confirmed via SWEL and other t-codes that the workflow and log do exist.  This seems to be the only object we have this issue for after the upgrade.
    Anyone know what issue is and how to fix?   Or at least path to config in SPRO for "generic object services" where we can see if anything changed via upgrade for this object?
    Thanks,
    Matt
    Edited by: Matthew Huth on Apr 22, 2008 9:23 PM

    Found the solution.  See OSS note 553246.  This has been tested and works for us.   -Matt
    Note 553246
    Summary
    Symptom
    In the material master, the system no longer displays the attachments for the material or workflow items in the Generic Object Services.
    Other terms
    MM01, MM02, MM03
    Reason and Prerequisites
    As of Release 4.6B, business object BUS1001006 is valid for the material master. Until you have implemented Note 452424, the Generic Object Services is still published for the old BUS1001 business object. After implementing the note, all attachments, relationships, notes and workflow items that are assigned to business object BUS1001 are no longer displayed.
    Instead, all new attachments are assigned to business object BUS1001006. As a result, attachments cannot exist for both systems.
    For workflow items, the assignment to the business object occurs in the respective tasks. It may be very time consuming to convert the business object, depending on whether an individual subtype (assigned to BUS1001) is created.
    In other words, after you implement the note, the workflow items for business object BUS1001 can no longer be displayed in the material master.
    Solution
    With the following correction you can call the Generic Object Services for both business objects. When it is called, the system displays a dialog box in which you can choose the required business object, that is, BUS1001 ('Material') or BUS1001006 ('Standard material').
    This correction is delivered as a modification supported by SAP only. This is because the additional option means that attachments can be maintained as required in either of the business objects and users may therefore require extra training.
    However, the corrections enable you to display attachments and workflow items for both business objects without the need for a major conversion; this means that you do not get the impression that these have been lost.
    Alternatively, as of Release 4.70 (or Basis 6.20) you can, without making a modification, implement method ADD_OBJECTS of BAdI GOS_MULT_PUBLISH for filter attribute WF_OVERVIEW ('Workflow overview'), SRELATIONS ('Relationships') and VIEW_ATTA ('Attachment list'). The implementation should be similar to the following:
    METHOD if_ex_gos_mult_publish~add_objects .
      DATA:
        ls_lporb TYPE sibflporb.
      READ TABLE ct_lporb INTO ls_lporb INDEX 1.
      if ls_lporb-typeid = 'BUS1001006'.
        ls_lporb-typeid = 'BUS1001'.
        append ls_lporb to ct_lporb.
      endif.
    endmethod.

  • Add List box for one field in ALV GRID

    Hi All,
      I need to add drop down list box for one field in ALV Grid.
      If any body knows, please help.
    Thanks in advance.
    Regards
    Manglesh

    Hi,
    Here is the ex where i have used for date parameter in the sel screen
    type-pools: vrm.
    data: name type vrm_id,
          list type vrm_values,
          value like line of list.
    parameters :    p_date like p_date2
                                  as listbox visible length 15.
    at selection-screen output.
      name = 'P_DATE'.
      value-key = '1'.
      value-text = 'Today'.
      append value to list.
      value-key = '2'.
      value-text = 'Last 7 days'.
      append value to list.
      value-key = '3'.
      value-text = 'Last 30 days'.
      append value to list.
      value-key = '4'.
      value-text = 'Last 90 days'.
      append value to list.
      value-key = '5'.
      value-text = 'Last year'.
      append value to list.
    Call the ''VRM_SET_VALUES' to display the values in Listbox
      call function 'VRM_SET_VALUES'
        exporting
          id     = name
          values = list.
    at selection-screen.
      if sy-ucomm = 'CLI1'.
        sscrfields-ucomm = 'ONLI'(001).
      endif.
      if p_date = '1'.
        p_date11 =  sy-datum .
      elseif p_date = '2'.
        p_date11 = ( sy-datum - 7 ).
      elseif p_date = '3'.
        p_date11 = ( sy-datum - 30 ).
      elseif p_date = '4'.
        p_date11 = ( sy-datum - 90 ).
      elseif p_date = '5'.
        p_date11 = ( sy-datum - 365 ).
      endif.
    Hope this helps u..
    Please reward points if useful.
    Regards,
    Sreenivas

  • Possible to have vertical scroll bar for a cell in ALV Grid (using methods)

    Hi All,
    I have a field with length 100 characters on a ALV Grid (using methods)..User doesn't want to scroll all the 100 characters horizontally to see the whole text rather he wants to have a vertical scroll bar for the cell so that he can scroll vertically.
    Is it possible to have split the cell text into lines and have a vertical scroll bar for a cell in ALV Grid?
    Regards
    Jaker.

    Thanks for the suggestion Balu.I tried this , but while scrolling,headers also getting scrolled.
    Becoz of this , if i scroll down to the last row,headers are getting hidden.
    Headers should always be static.only the data should scroll.
    Since h:datatable is being rendered as one table , i can div tag for this table alone.
    If i have seperate datatable for headers alone i can do this .But i should not use two datatables.

  • How to change a color for a row in ALV grid display

    Hi,
       how to change a color for a row in ALV grid display based on a condition.Any sample code plz

    Hello Ramya,
    Did you check in [SCN|How to color a row of  alv grid]
    Thanks!

  • How to add F1 help for a field on ALV grid

    Hi All,
    When we execute a program, the output is displayed using ALV grid.
    on the ALV grid, if we press F1 on a field, it should popup the help document.
    How to add F1 help for a field on ALV grid.
    Thank you all in advance.

    fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
    A.

  • View workflow logs in services for object tab in transaction

    HI All ,
    Is there any settings that need to be done to see the workflow associated witha particular Tcode in Services for Objects  tab.
    Actually i  want to see the custom workflow logs other than using tcode swi1  .
    Regards ,
    Sijin K P
    Moderator message: not directly related to ABAP development, please see the Workflow forum.
    Edited by: Thomas Zloch on Jan 17, 2012

    Hi,
    You have to implement GOS (Generic Object service).
    Plenty of material available for it, you can reffer to meet your requirment.
    Regards,
    Manish

  • How to upload mass text data (note) on Service for Object

    There are 2 long text fields on this screen about equipment
    is Description and Intern.note which I can import long text by using LSMW tools.
    But I need more fields to upload 3 kinds of text (are long more than 500
    character), so I decide to use note on Service for Object as the image
    show.
    There are more than 5000 notes to upload into system , can you suggest or
    teach me any way to do this task.
    Many thanks and regards,
    More information: As I know, those text I want to import will store in table SOOD (SAPoffice: Object definition) and SRGBTBREL (Relationships in GOS Environment)

    Please check this thread:Mass Upload Image to Equipment Master
    Above speaks about uploading images but you will need to modify to upload text files, etc. Also, you need to be aware that if you use 'Service for Object', you are eating into the SAP Database space and is not a highly recommended approach.
    -Chaitanya

  • How to Acquire Data at High Rate for Several Seconds?

    Hello Everybody,
    I am using a PCI 5152 with 64Megs of memory per channel. I am also using Labview 7.1 in WinXP. My PC is a Quad Processor Computer with  2GB of Ram.
    I need to acquire data for several seconds as follows: I am triggering at 1ms and for each trigger I want to save the first 200us  of data at the highest possible rate (more than 200MHz).
    I have developed the code attached but I keep getting the error -1074116198 (buffer overwrite).  Any ideas or suggestions are welcome
    Thank you very much  in advance.
    Jhon.
    Attachments:
    Stream_To_Disk_ With_Queue.vi ‏170 KB

    Hi Jhon,
    Could you please provide a screenshot of the front panel for your VI when you run the program and receive the error (I want to know what each value is set to). Are you able to run the program without error when you decrease the record length and/or sample rate? Additionally, what are the values of the Records Fetched and Records Acquired indicators when you receive the error? Can you please provide a screenshot of the actual error message you are receiving as well? Finally, I am curious to know why you are taking your min record length value and dividing it by the period (reciprocal of min sample rate)? I look forward to hearing back from you soon and reproducing the issue you are seeing.
    Cheers!
    Daniel S.
    National Instruments

  • F4 help for a field in alv grid

    hello friends,
                        i want to make one of the fields of my alv grid as editable and i want f4 help option also available for it, can v do it, if yes how??? pls explain through code
                  thanks

    check this example
    REPORT  ztest440.
    TABLES : mara.
    TYPES: BEGIN OF t_mara,
            matnr TYPE mara-matnr,
            lvorm TYPE mara-lvorm,
            mtart TYPE mara-mtart,
            mbrsh TYPE mara-mbrsh,
            matkl TYPE mara-matkl,
            meins TYPE mara-meins,
            brgew TYPE mara-brgew,
            ntgew TYPE mara-ntgew,
            gewei TYPE mara-gewei,
           END OF t_mara.
    TYPES: BEGIN OF t_equk,
            matnr TYPE equk-matnr,
            werks TYPE equk-werks,
            bdatu TYPE equk-bdatu,
            vdatu TYPE equk-vdatu,
            qunum TYPE equk-qunum,
           END OF t_equk.
    CLASS : lcl_alv_grid DEFINITION DEFERRED.
    DATA : gi_mara TYPE STANDARD TABLE OF t_mara,
           gi_equk TYPE STANDARD TABLE OF t_equk,
           gs_mara TYPE t_mara,
           gs_equk TYPE t_equk.
    *-- Global data definitions for ALV
    *--- ALV Grid instance reference
    DATA : gw_alvgrid  TYPE REF TO cl_gui_alv_grid,
           gw_alvgrid1 TYPE REF TO cl_gui_alv_grid .
    *--- Custom container instance reference
    DATA gw_container      TYPE REF TO cl_gui_custom_container.
    DATA gw_event_handler  TYPE REF TO lcl_alv_grid.
    DATA gw_event_handler1 TYPE REF TO lcl_alv_grid.
    DATA gw_container1     TYPE REF TO cl_gui_custom_container.
    *--- Field catalog table
    DATA : gi_fieldcat  TYPE lvc_t_fcat,
           gi_fieldcat1 TYPE lvc_t_fcat,
           gs_fieldcat  TYPE lvc_s_fcat,
           gs_fieldcat1 TYPE lvc_s_fcat.
    *--- Layout structure
    DATA : gs_layout  TYPE lvc_s_layo,
           gs_layout1 TYPE lvc_s_layo.
          CLASS lcl_alv_grid DEFINITION
    CLASS lcl_alv_grid DEFINITION.
      PUBLIC SECTION.
        METHODS :
      Handle_double_click
          handle_double_click
             FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
      Handle_double_click
          handle_onf4
             FOR EVENT onf4 OF cl_gui_alv_grid
                IMPORTING e_fieldname,
      Handle_double_click
          handle_hotspot_click
             FOR EVENT hotspot_click OF cl_gui_alv_grid
                IMPORTING e_row_id.
      PRIVATE SECTION.
    ENDCLASS.                          " lcl_alv_grid DEFINITION
                    CLASS LCL_ALV_GRID IMPLEMENTATION                   *
    CLASS lcl_alv_grid IMPLEMENTATION.
                        METHOD handle_double_click                      *
      METHOD handle_double_click.
        READ TABLE gi_mara INTO gs_mara INDEX e_row.
        IF sy-subrc = 0.
          SELECT matnr
                 werks
                 bdatu
                 vdatu
                 qunum
            FROM equk
            INTO TABLE gi_equk
           WHERE matnr = gs_mara-matnr.
          IF sy-dbcnt NE 0.
            SORT gi_equk BY matnr werks bdatu.
          ENDIF.
          CALL SCREEN 0002.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
                        METHOD handle_onf4                              *
      METHOD handle_onf4.
        PERFORM f4_help USING e_fieldname.
      ENDMETHOD.                    "handle_double_click
                        METHOD handle_double_click                      *
      METHOD handle_hotspot_click.
        READ TABLE gi_mara INTO gs_mara INDEX e_row_id.
        IF sy-subrc = 0.
          SELECT matnr
                 werks
                 bdatu
                 vdatu
                 qunum
            FROM equk
            INTO TABLE gi_equk
           WHERE matnr = gs_mara-matnr.
          IF sy-dbcnt NE 0.
            SORT gi_equk BY matnr werks bdatu.
          ENDIF.
          CALL SCREEN 0002.
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                          " lcl_alv_grid IMPLEMENTATION
                      SELECTION SCREEN DEFINITION                       *
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS,
                     s_mtart FOR mara-mtart NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b1.
                           START-OF-SELECTION                           *
    START-OF-SELECTION.
      SELECT matnr
             lvorm
             mtart
             mbrsh
             matkl
             meins
             brgew
             ntgew
             gewei
             FROM mara
             INTO TABLE gi_mara
             WHERE matnr IN s_matnr
               AND mtart IN s_mtart.
      IF sy-dbcnt NE 0.
        SORT gi_mara BY matnr.
      ENDIF.
      CALL SCREEN 0001.
    *&      Module  STATUS_0001  OUTPUT
          text
    MODULE status_0001 OUTPUT.
      SET PF-STATUS '0001'.
      SET TITLEBAR  '001'.
      PERFORM build_alv_display.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
          text
    MODULE user_command_0001 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
        WHEN 'SAVE'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    *&      Form  build_alv_display
          text
    -->  p1        text
    <--  p2        text
    FORM build_alv_display .
      PERFORM build_fieldcat.
      PERFORM build_layout.
      PERFORM create_alv_grid.
      PERFORM display_alv_grid.
    ENDFORM.                    " build_alv_display
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat .
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATNR'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material Number'.
      gs_fieldcat-outputlen = '18'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '1'.
      gs_fieldcat-hotspot   = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'LVORM'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Deletion'.
      gs_fieldcat-outputlen = '8'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '2'.
      gs_fieldcat-checkbox  = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MTART'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material Type'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '3'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MBRSH'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Industry sector'.
      gs_fieldcat-outputlen = '15'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '4'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATKL'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Material group'.
      gs_fieldcat-outputlen = '14'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '5'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MEINS'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Base Unit of Measure'.
      gs_fieldcat-outputlen = '20'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '6'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'BRGEW'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Gross weight'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '7'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'NTGEW'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Net weight'.
      gs_fieldcat-outputlen = '13'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '8'.
      APPEND gs_fieldcat TO gi_fieldcat.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'GEWEI'.
      gs_fieldcat-tabname   = 'MARA'.
      gs_fieldcat-coltext   = 'Weight Unit'.
      gs_fieldcat-outputlen = '11'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '9'.
      APPEND gs_fieldcat TO gi_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout .
      gs_layout-sel_mode   = 'A'.
      gs_layout-edit       = ' '.
      gs_layout-no_toolbar = ' '.
      gs_layout-grid_title = 'Material Data'.
      gs_layout-no_headers = ' '.
      gs_layout-weblook    = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  create_alv_grid
          text
    -->  p1        text
    <--  p2        text
    FORM create_alv_grid .
      IF gw_container IS INITIAL.
        CREATE OBJECT gw_container
            EXPORTING
               container_name = 'CC_ALV'.
    Display ALV grid
        IF gw_alvgrid IS INITIAL.
          CREATE OBJECT gw_alvgrid
             EXPORTING
                i_parent = gw_container.
        ENDIF.
      ENDIF.
      IF gw_event_handler IS INITIAL.
        CREATE OBJECT gw_event_handler.
        SET HANDLER gw_event_handler->handle_double_click
                FOR gw_alvgrid.
        SET HANDLER gw_event_handler->handle_onf4
                FOR gw_alvgrid.
        SET HANDLER gw_event_handler->handle_hotspot_click
                FOR gw_alvgrid.
      ENDIF.
    ENDFORM.                    " create_alv_grid
    *&      Form  display_alv_grid
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_grid .
      CALL METHOD gw_alvgrid->set_table_for_first_display
        EXPORTING
          i_buffer_active    = ' '
          i_bypassing_buffer = ' '
          i_structure_name   = 'T_MARA'
          is_layout          = gs_layout
        CHANGING
          it_outtab          = gi_mara[]
          it_fieldcatalog    = gi_fieldcat[]
        EXCEPTIONS
          OTHERS             = 0.
    ENDFORM.                    " display_alv_grid
    *&      Module  STATUS_0002  OUTPUT
          text
    MODULE status_0002 OUTPUT.
      SET PF-STATUS '0002'.
      SET TITLEBAR '002'.
      PERFORM build_alv_display1.
    ENDMODULE.                 " STATUS_0002  OUTPUT
    *&      Module  USER_COMMAND_0002  INPUT
          text
    MODULE user_command_0002 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0002  INPUT
    *&      Form  build_alv_display1
          text
    -->  p1        text
    <--  p2        text
    FORM build_alv_display1 .
      PERFORM build_fieldcat1.
      PERFORM build_layout1.
      PERFORM create_alv_grid1.
      PERFORM display_alv_grid1.
    ENDFORM.                    " build_alv_display1
    *&      Form  build_fieldcat2
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'MATNR'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Material Number'.
      gs_fieldcat-outputlen = '18'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '1'.
      gs_fieldcat-f4availabl = 'X'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'WERKS'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Plant'.
      gs_fieldcat-outputlen = '4'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '2'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'BDATU'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Valid Untill'.
      gs_fieldcat-outputlen = '12'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '3'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'VDATU'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Valid From'.
      gs_fieldcat-outputlen = '10'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '4'.
      APPEND gs_fieldcat TO gi_fieldcat1.
      CLEAR gs_fieldcat.
      gs_fieldcat-fieldname = 'QUNUM'.
      gs_fieldcat-tabname   = 'EQUK'.
      gs_fieldcat-coltext   = 'Quota'.
      gs_fieldcat-outputlen = '10'.
      gs_fieldcat-edit      = ' '.
      gs_fieldcat-just      = 'C'.
      gs_fieldcat-col_pos   = '5'.
      APPEND gs_fieldcat TO gi_fieldcat1.
    ENDFORM.                    " build_fieldcat2
    *&      Form  build_layout2
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout1.
      gs_layout1-sel_mode   = 'A'.
      gs_layout1-edit       = ' '.
      gs_layout1-no_toolbar = ' '.
      gs_layout1-grid_title = 'Quota Header Data'.
      gs_layout1-no_headers = ' '.
    ENDFORM.                    " build_layout1
    *&      Form  create_alv_grid2
          text
    -->  p1        text
    <--  p2        text
    FORM create_alv_grid1.
      IF gw_container1 IS INITIAL.
        CREATE OBJECT gw_container1
            EXPORTING
               container_name = 'CC_ALV1'.
    Display ALV grid
        IF gw_alvgrid1 IS INITIAL.
          CREATE OBJECT gw_alvgrid1
             EXPORTING
                i_parent = gw_container1.
        ENDIF.
      ENDIF.
      IF gw_event_handler1 IS INITIAL.
        CREATE OBJECT gw_event_handler1.
        SET HANDLER gw_event_handler1->handle_onf4
                FOR gw_alvgrid1.
      ENDIF.
    ENDFORM.                    " create_alv_grid1
    *&      Form  display_alv_grid2
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_grid1 .
      DATA : li_f4 TYPE lvc_t_f4,
             ls_f4 TYPE lvc_s_f4.
      CALL METHOD gw_alvgrid1->set_table_for_first_display
        EXPORTING
          i_buffer_active    = ' '
          i_bypassing_buffer = ' '
          i_structure_name   = 'T_EQUK'
          is_layout          = gs_layout1
        CHANGING
          it_outtab          = gi_equk[]
          it_fieldcatalog    = gi_fieldcat1[]
        EXCEPTIONS
          OTHERS             = 0.
      IF li_f4[] IS INITIAL.
        MOVE 'MATNR' TO ls_f4-fieldname.
        MOVE 'X'     TO ls_f4-register.
        MOVE 'X'     TO ls_f4-getbefore.
        APPEND ls_f4 TO li_f4.
        CLEAR  ls_f4.
        CALL METHOD gw_alvgrid1->register_f4_for_fields
          EXPORTING
            it_f4 = li_f4.
      ENDIF.
    ENDFORM.                    " display_alv_grid1
    *&      Form  f4_help
          text
         -->P_FIELDNAME  text
    FORM f4_help  USING    p_fieldname.
      TYPES : BEGIN OF t_values,
                matnr TYPE mara-matnr,
              END OF t_values.
      DATA : li_fields        TYPE TABLE OF dfies,
             li_select_values TYPE TABLE OF ddshretval,
             li_values        TYPE TABLE OF t_values,
             ls_fields        TYPE dfies,
             ls_values        TYPE t_values.
      REFRESH : li_fields,
                li_select_values.
      SELECT matnr
        FROM equk
        INTO TABLE li_values.
      CASE p_fieldname.
        WHEN 'MATNR'.
          ls_fields-tabname    = 'EQUK'.
          ls_fields-fieldname  = 'MATNR'.
          APPEND ls_fields TO li_fields.
          CLEAR ls_fields.
          SORT li_values BY matnr.
          DELETE ADJACENT DUPLICATES FROM li_values COMPARING matnr.
          CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
            EXPORTING
              retfield   = 'MATNR'
            TABLES
              value_tab  = li_values
              field_tab  = li_fields
              return_tab = li_select_values.
          IF sy-subrc = 0.
           LOOP AT li_select_values WHERE fieldname = 'MATNR'.
             clear gs_mara.
             gs_mara in
          ENDIF.
      ENDCASE.
    ENDFORM.                                                    " f4_help

  • Folder for multiple details in ALV GRID DISPLAY

    Hi All,
    I am developing one ALV GRID DISPLAY report. Here I am displaying the material and production order details in the report. If we have the multiple production order details for one material , then in that case , we have to place one folder at the first material level, in that folder I need to show all the multiple production order details.
    I am using FUNCTION MODULE to develope the report, not using any Objects to develope this. 
    Thanks in advance.
    Ramesh.

    Here is a simple example of such an ALV.
    report zrich_0001.
    type-pools: slis.
    data: begin of head occurs 0,
           matnr type afpo-matnr,
           maktx type makt-maktx,
           EXPAND type c,
          end of head.
    data: begin of detail occurs 0,
           aufnr type afpo-aufnr,
           matnr type afpo-matnr,
           werks type aufk-werks,
           pwerk type afpo-pwerk,
           psmng type afpo-psmng,
          end of detail.
    start-of-selection.
      select * into corresponding fields of table detail
                   from afpo
                      inner join aufk
                        on afpo~aufnr = aufk~aufnr
                      inner join afko
                        on afpo~aufnr = afko~aufnr
                                  up to 500 rows
                                        where aufk~auart = 'PP01'.
      if not detail[] is initial.
        sort detail ascending by matnr.
        select distinct * into corresponding fields of table head
                  from makt
                     for all entries in detail
                        where matnr = detail-matnr
                          and spras = sy-langu.
      endif.
      perform call_alv.
    *       FORM call_alv                                                 *
    form call_alv.
      data: gt_fieldcat type slis_t_fieldcat_alv,
            gs_keyinfo  type slis_keyinfo_alv,
            gs_layout   type slis_layout_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
      clear gs_keyinfo.
      gs_keyinfo-header01 = 'MATNR'.
      gs_keyinfo-item01   = 'MATNR'.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'MATNR'.
      ls_fieldcat-reptext_ddic = 'Material'.
      ls_fieldcat-tabname      = 'HEAD'.
      ls_fieldcat-outputlen    = 18.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'MAKTX'.
      ls_fieldcat-reptext_ddic = 'Description'.
      ls_fieldcat-tabname      = 'HEAD'.
      ls_fieldcat-outputlen    = 40.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'AUFNR'.
      ls_fieldcat-reptext_ddic = 'Production Order'.
      ls_fieldcat-tabname      = 'DETAIL'.
      ls_fieldcat-outputlen    = 12.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'WERKS'.
      ls_fieldcat-reptext_ddic = 'Production Plant'.
      ls_fieldcat-tabname      = 'DETAIL'.
      ls_fieldcat-outputlen    = 4.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'PWERK'.
      ls_fieldcat-reptext_ddic = 'Planning Plant'.
      ls_fieldcat-tabname      = 'DETAIL'.
      ls_fieldcat-outputlen    = 4.
      append ls_fieldcat to gt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'PSMNG'.
      ls_fieldcat-reptext_ddic = 'Quantity'.
      ls_fieldcat-tabname      = 'DETAIL'.
      ls_fieldcat-outputlen    = 20.
      append ls_fieldcat to gt_fieldcat.
      gs_layout-expand_fieldname = 'EXPAND'.
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           exporting
                it_fieldcat      = gt_fieldcat[]
                is_layout        = gs_layout
                i_tabname_header = 'HEAD'
                i_tabname_item   = 'DETAIL'
                is_keyinfo       = gs_keyinfo
           tables
                t_outtab_header  = head
                t_outtab_item    = detail.
    endform.
    Regard,s
    RIch Heilman

  • ALV Grid: event for user return in ALV Grid Control

    Hi developers,
    i'm wanna do something after a user has pressed the return button in a alv grid control. For that i need probably a event. But i can not find a proper event in the documentation. Could one of you guys help me?
    Best regards christian

    Hi Christian
    ALV grid is an encapsulated object, so it seems there is no way, you ought to implement the data_changed event. So if you want to make bulk data input and after trigger the event by pressing the return key, you should make the ALV Grid get your changes after pressing the key but not after a cell change of a modified cell.
    To set this attribute:
    CALL METHOD gr_alvgrid->register_edit_event
         EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_enter .
    This way "data_changed" event will be triggered whenever you press the return key while editing.
    For some more information you can also refer to the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Function code for dropdown on OO ALV Grid to trigger user_command

    Hi Experts,
    I know we can add a dropdown to a column of an OO ALV Grid, set values to the dropdown list and allow the user to select some these values.
    However , what I'm not sure is that if we can *assign a function code to the dropdown * which would then trigger the event user_command ( PAI ) of the ALV class so I can handle the changes to when a particular value is selected from a dropdown list, just like we do in normal dialogs.
    Now I know that I can register the 'Enter' event and handle the data changes in data_changed event, but that is something I want to avoid the user from doing as far as possible to make the report more user friendly.
    Awaiting your valuable inputs and would really appreciate your help.
    Thanks & regards,
    Advait

    Hi Advait,
    No problem. Yes, this functionality requires changing the focus to other cell.
    I think there is other solution. As the dropdown is kind of F4 activity try this way:
    data: it_f4 type lvc_t_f4,
            wa_f4 type lvc_s_f4.
            wa_f4-FIELDNAME = 'CONNID'.
            wa_f4-REGISTER = 'X'.
            wa_f4-GETBEFORE = 'X'.
            wa_f4-CHNGEAFTER = 'X'.
            append wa_f4 to it_f4.
    "register F4 event
      CALL METHOD g_alv_grid_ref->register_f4_for_fields
        EXPORTING
          it_f4  = it_f4.
    "Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
    "Definition
         methods:
         handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
                                  IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
    "Implementation
    METHOD handle_data_changed .
        DATA: ls_mod_cells TYPE lvc_s_modi.
        IF e_onf4_before = 'X'.
          MESSAGE 'Data changed before F4' TYPE 'I'.
        ENDIF.
        IF e_onf4 = 'X'.   "if event triggered by F4
          MESSAGE 'Data changed on F4' TYPE 'I'.
        ENDIF.
        IF e_onf4_after = 'X'.
          MESSAGE 'Data changed after F4' TYPE 'I'.
        ENDIF.
       "here you know which cell was modified
        LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
         "just example test case, here you can implement your code for modified cells
          IF ls_mod_cells-value >=5.
            CALL METHOD er_data_changed->add_protocol_entry
              EXPORTING
                i_msgid     = 'SABAPDOCU'
                i_msgty     = 'E'
                i_msgno     = '888'
                i_msgv1     = 'Only numbers below 5 are possibe'
                i_msgv2     = 'Please correct'
                i_fieldname = ls_mod_cells-fieldname
                i_row_id    = ls_mod_cells-row_id.
            CALL METHOD er_data_changed->modify_cell
              EXPORTING
                i_fieldname = ls_mod_cells-fieldname
                i_row_id    = ls_mod_cells-row_id
                i_value     = space.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "handle_data_changed
    This approach works fine for picking value from input help. Never tried it for dropdown list. You have to try it out.
    Regards
    Marcin

  • How can we sum for the field on alv grid

    Dear Freinds,
                   I am having the field count .....in the ouput (iam using alv grid) .......which dispalys  the id's which are identical .
    i have scneario similar to the below in my ALV Output
    ID                count         total
    4000              3              100
                                          100
                                         200       Can i get count 3 also along with 200 in alv?
    i am using the code as follows for count can any one please let me know.
    my earlier question which i put was confusing.........so i am givin the qustion again
      clear ls_fieldcat.
      ls_fieldcat-col_pos      = 1.
      ls_fieldcat-fieldname    = 'ORGUNIT'.
      ls_fieldcat-seltext_l    =  text-015.  "'Orgunit'.
      ls_fieldcat-key          = 'X'.
      ls_fieldcat-key_sel      = 'X'.
    ls_fieldcat-no_out       = 'X'.
      append ls_fieldcat to fp_i_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-col_pos      = 2.
      ls_fieldcat-fieldname    = 'COUNT'.
      ls_fieldcat-seltext_l    = 'H.Count'.
      ls_fieldcat-outputlen    = 4.
      ls_fieldcat-do_sum       = 'X'.
    ls_fieldcat-datatype    = 'NUMC'.
      append ls_fieldcat to fp_i_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname   = 'TOTAL'.
      ls_fieldcat-seltext_m   = 'total'.
      ls_fieldcat-col_pos     = 3.
      ls_fieldcat-outputlen   = 17.
      ls_fieldcat-do_sum      = 'X'.
      ls_fieldcat-datatype    = 'CURR'.
      append ls_fieldcat to fp_i_fieldcat.
    Please let me know how can do if so what is the parameter i have to change for COUNT
    regards
    syamal

    Hi Shamala Kiran.
                          My name is also kiran.I have a develop a code for u.Actually i cant understand your code.But i know ur problem .Plz check that code.In that code i develop a subtotals and grandttotal.Plz observe the FORM "FIELD CATALOG" in that observe the NETWR FIELD and observe the FORM SORTCATALOG then ur problem will be solved.
    Copy the the below code and execute that code and the result.
    If u r Satisfied with the answer plz give the REWARD POINTS.
    CODE:
    Type Pools
    TYPE-POOLS:slis.
    Tables
    TABLES: vbak,vbap.
    Global Variable
    data: w_var type i.
    Global Data
    DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
         wa_fieldcat TYPE slis_fieldcat_alv,
         it_sortcat TYPE slis_t_sortinfo_alv,
         wa_sortcat  LIKE LINE OF it_sortcat.
    Internal Table
    data: BEGIN OF it_salesorder OCCURS 0,
            vbeln LIKE vbak-vbeln,    " Sales Document Number
            posnr like vbap-posnr,    " Sales Doc Item
            netwr like vbap-netwr,    " Net Value
          END OF it_salesorder.
    SELECT OPTIONS
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.   " Sales Document Number.
    SELECTION-SCREEN END OF BLOCK b1.
    Initialization
    INITIALIZATION.
      PERFORM initialization.
    *&      Form  initialization
          text
    -->  p1        text
    <--  p2        text
    form initialization .
      s_vbeln-sign   = 'I'.
      s_vbeln-option = 'BT'.
      s_vbeln-low    = '4969'.
      s_vbeln-high   = '5000'.
      APPEND s_vbeln.
    endform.                    " initialization
    Start Of Selection
    START-OF-SELECTION.
      PERFORM field_catalog.   "For Structure Creation
      PERFORM fetch_data.      "Get the Data From DB Table
      PERFORM sorting USING it_sortcat.
    End Of Selection
    END-OF-SELECTION.
      perform display_data.
    *&      Form  field_catalog
          text
    -->  p1        text
    <--  p2        text
    form field_catalog .
      wa_fieldcat-col_pos       = w_var.          " Column Position Variable
      wa_fieldcat-tabname       = 'IT_SALESORDER'. " Internal Table Name
      wa_fieldcat-fieldname     = 'VBELN'.         " Field Name
      wa_fieldcat-key           = 'X'.             " Blue Color
      wa_fieldcat-ref_tabname   = 'VBAK'.          " Table Name
      wa_fieldcat-ref_fieldname = 'VBELN'.         " Field Name
      wa_fieldcat-seltext_m     = 'Sales Doc No'.  " Display Text In Screen
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      ADD 1 TO w_var.
      wa_fieldcat-col_pos       = w_var.          " Column Position Variable
      wa_fieldcat-tabname       = 'IT_SALESORDER'. " Internal Table Name
      wa_fieldcat-fieldname     = 'POSNR'.         " Field Name
      wa_fieldcat-ref_tabname   = 'VBAP'.          " Table Name
      wa_fieldcat-ref_fieldname = 'POSNR'.         " Field Name
      wa_fieldcat-seltext_m     = 'Sales Doc Item'. " Display Text In Screen
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      ADD 1 TO w_var.
      wa_fieldcat-col_pos       = w_var.          " Column Position Variable
      wa_fieldcat-tabname       = 'IT_SALESORDER'. " Internal Table Name
      wa_fieldcat-fieldname     = 'NETWR'.         " Field Name
      wa_fieldcat-ref_tabname   = 'VBAP'.          " Table Name
      wa_fieldcat-ref_fieldname = 'NETWR'.         " Field Name
      wa_fieldcat-do_sum        = 'X'.             " Sum
      wa_fieldcat-seltext_m     = 'Net Value'.  " Display Text In Screen
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      ADD 1 TO w_var.
    endform.                    " field_catalog
    *&      Form  sorting
          text
         -->P_IT_SORTCAT  text
    form sorting using p_it_sortcat TYPE slis_t_sortinfo_alv.
      wa_sortcat-fieldname = 'VBELN'.
      wa_sortcat-up        ='X'.
      wa_sortcat-subtot    = 'X'.
      APPEND wa_sortcat TO p_it_sortcat.
    endform.                    " sorting
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    form display_data .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = SY-REPID
      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_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           = it_sortcat
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = it_salesorder
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.                    " display_data
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    form fetch_data .
    select a~vbeln
           posnr
           b~netwr
      from vbak as a
    inner join vbap as b on  avbeln = bvbeln
      into table it_salesorder
      where a~vbeln in s_vbeln.
    endform.                    " fetch_data

  • Custom F4 for a field in ALV GRID

    I am want to provide a custom f4 fro a field in alv gird
    similiar to the functionality of process on value request
    on a normal screen

    Hi Kaushik
    You can find some information at page 37 of the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
    *--Serdar

Maybe you are looking for