ALV Report Displaying QUAN field different in systems

Hi Guys,
I have a field of type QUAN (quantity) on an ALV report that is displaying differently on the Devlopment and QA systems.
If I enter the value '5' in this field in Development and press enter, the value displays as '5.000'.  If I enter the value in the QA field, however, the value displayes as '0.005'.
I have looked at domains and everything, but they seem simmilar.
Please advise fi there is something I have overlooked,
Thank you,
Christiaan

Hi,
Check in system default parameter settings. It works based on system default parameter settings.
System => User Profile => Own Data
In *Defaults* tab check the *Decimal Notaion* field.
Regards,
Shankar.

Similar Messages

  • ALV report using the field catalog

    which is the quickest way to generate an ALV report using the field catalog merge.  without needing to build the field catalog manually .
    is it easier to create a structure and passe it in the field catalog merge .  if yes can i have an example plzzzz

    hI
    Supports the creation of the field catalog for the ALV function modules
    based either on a structure or table defined in the ABAP Data
    Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its
    Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for
    rapid prototyping since the following restrictions apply:
    o Performance is affected since the code of the table definition must
    always be read and interpreted at runtime.
    o Dictionary references are only considered if the keywords LIKE or
    INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields
    are output in the list by default whereas the remaining fields are only
    available in the field selection.
    If the field catalog is passed with values, they are merged with the
    'automatically' found information.
    Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
    display it using the basic ALV grid functionality(including column total). The example details the main
    sections of coding required to implement the ALV grid functionality:
                             Data declaration
                             Data retrieval
                             Build fieldcatalog
                             Build layout setup
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
    *            i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
    *            IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
    *            is_variant              = z_template
           tables
                t_outtab                = it_ekko
           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_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL

  • Create a Procedural ALV Report with editable fields and save the changes

    Hi,
    I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDIT_02
    BCALV_TEST_GRID_EDIT_04_FORMS
    BCALV_TEST_GRID_EDITABLE
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    BCALV_FULLSCREEN_GRID_EDIT
    But all these are using OO Concepts.
    Please help.
    Regards,
    Smruthi

    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      line_color(4) TYPE c,     "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
    fieldcatalog-edit             = 'X'
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_pf_status_set = 'STATUS'
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           TABLES
                t_outtab                = it_ekko
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      DATA: ld_color(1) TYPE c.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      LOOP AT it_ekko INTO wa_ekko.
        ld_color = ld_color + 1.
        IF ld_color = 8.
          ld_color = 1.
        ENDIF.
        CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
        MODIFY it_ekko FROM wa_ekko.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM top-of-page                                              *
    FORM top-of-page.
      WRITE:/ 'This is First Line of the Page'.
    ENDFORM.
          FORM status                                                   *
    FORM status USING rt_extab TYPE slis_t_extab.  .
      SET PF-STATUS 'ALV'.
    ENDFORM.
          FORM USER_COMMAND                                          *
    -->  RF_UCOMM                                                      *
    -->  RS                                                            *
    FORM user_command USING rf_ucomm LIKE sy-ucomm
                             rs TYPE slis_selfield.            
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      CASE rf_ucomm.
    when 'SAVE'.
    get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
    endcase.
    endform.
    ENDFORM.
    here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
    create a custom PF status and create push buttons and assign your ok codes in your PF status.
    if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
    Hope this will help you.
    Regards,
    phani.

  • ALV Report displays space instead of '0.00' for qty field. why?

    Hello friends,
    I am facing a problem to display 0 value for the field
    field - ZZQTY (Predefined Type at Domain level)
         QUAN 21,2
    In the program I am clearing the field and I can see its value as 0.00 while debugging.
    As soon as field ZZQTY is displayed on ALV, it becomes blank (Space).
    My requirement is to display '0.00' on ALV report.
    What should I do?
    Regards,
    Ronny Hanks

    Hello
    Search for
    LS_FIELDCAT-NO_ZERO = 'X'.
    for this field in programm and comment this.

  • ALV Report - displaying column name in two fields.

    Dear All,
                 I am working on ALV report , report is ready but now i have to format it according to client requirment, in which have to show column name in two row like.
    supppose there is field by name
    "Date of receipt of processed Goods"
    can i display it like
    "Date of receipt of
    processed Goods "
    Assured points for suitable answer.
    Looking foward to your response.
    Best Regards,
    Gulrez Alam

    Hi Ellery,
    As Philipp said, there is no need for populating the field using PL/SQL. You would just need to go to the Paper Layout in the Reports Editor, click on "Text" in the Drawing toolbar, drag it to the appropriate place in your layout to create the field, and write what you want in that field. Below that, you can create the field(s) which will display the actual totals. I'm assuming that creating the totals field is not a problem.
    Navneet.

  • Urgent: regarding ALV  report display problem

    hi,
    There are 3 problems:-
    1.) I had made a ALV report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as  PERIOD :- _______  to _______ on alv report ..
    2.)the 2nd problem is dat when i use the '  wa_fieldcat-no_zero = 'X'.  It eliminates all the leading zeros which are present which is okay when i it displays material no.. but the problem is dat it also deletes the other fields where the values are to be zeros.
    i had used this FM:-
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
    so that only matnr field are to be 0's.
    3.) I want to delete the rows which use to contain the values 0's as there are no calculations are performing as these are displayed .
    ANYbody having solution of this problem ,plzzzz provide the soluion of it as it is most urgent to me and dat person will definately rewarded.
    regards,
    ric.s

    hi kiran,
    thanks for ur response. here is d code which i am using it and plzz help me to figure out where i have to make changes:-
    REPORT  ZTEST03.
    TABLES: ISEG,MARA.
    TYPE-POOLS : SLIS.
    INTERNAL TABLE FOR INVENTORY STOCK *****************
    DATA: BEGIN OF ITS1 OCCURS 0,
          MATNR LIKE ISEG-MATNR,
          MEINS LIKE ISEG-MEINS,
          MENGE LIKE ISEG-MENGE,
          WRTZL LIKE ISEG-WRTZL,
          BUCHM LIKE ISEG-BUCHM,
          WRTBM LIKE ISEG-WRTBM,
          WERKS LIKE ISEG-WERKS,
          BUDAT LIKE ISEG-BUDAT,
          MTART LIKE MARA-MTART,
          ITEMDESC LIKE MAKT-MAKTX,
          DIFFQTY LIKE ISEG-BUCHM,
          DIFFVALUE LIKE ISEG-WRTBM,
          END OF ITS1.
    data: t_heading type slis_t_listheader.
    SELECTION-SCREEN BEGIN OF BLOCK PAR1 WITH FRAME TITLE TEXT-001.
    *********PARAMETERS*********
    PARAMETERS : PLANT LIKE ISEG-WERKS OBLIGATORY.
    *********SELECTION SCREEN OPTIONS*********
    SELECT-OPTIONS : R_DATE FOR ISEG-BUDAT,
                     M_TYPE  FOR MARA-MTART,
                     IT_M FOR MARA-MATNR.
    *********DEFINING VARIABLES*********
      SELECTION-SCREEN END OF BLOCK par1.
    TOP-OF-PAGE.
         PERFORM PG_HEADER.
    START-OF-SELECTION.
    SELECT DISTINCT A~MATNR A~MEINS A~MENGE A~WRTZL A~BUCHM A~WRTBM A~WERKS A~BUDAT B~MTART
       FROM ISEG AS A INNER JOIN MARA AS B ON B~MATNR = A~MATNR
         INTO CORRESPONDING FIELDS OF TABLE ITS1 WHERE B~MATNR = A~MATNR  AND B~MEINS = A~MEINS AND A~WERKS = PLANT AND A~BUDAT IN R_DATE AND B~MTART IN M_TYPE AND B~MATNR IN IT_M.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
      SORT ITS1 BY MATNR.
      DELETE ADJACENT DUPLICATES  FROM  ITS1 WHERE MENGE = 0 AND BUCHM = 0.
    LOOP AT ITS1.
         ITS1-DIFFQTY = ITS1-MENGE - ITS1-BUCHM.
         ITS1-DIFFVALUE = ITS1-WRTZL - ITS1-WRTBM.
         SELECT SINGLE MAKTX FROM MAKT INTO ITS1-ITEMDESC WHERE MATNR = ITS1-MATNR.
         MODIFY ITS1.
    ENDLOOP.
    PERFORM PRN_SMSTOCK_ALV.
    WRITING DATA FROM D TABLES**********
    FORM PG_HEADER.
    WRITE : 'PHYSICAL INVENTORY AUDIT REPORT             PLANT : ', PLANT.
    ENDFORM.
    *&      Form  PRN_SMSTOCK_ALV
          text
    -->  p1        text
    <--  p2        text
    form PRN_SMSTOCK_ALV .
    data: w_title   type lvc_title,
          w_repid   type syrepid,
          w_comm    type slis_formname,
          w_status  type slis_formname,
          x_layout  type slis_layout_alv,
          t_event    type slis_t_event,
          t_fieldcat type slis_t_fieldcat_alv,
          t_sort     type slis_t_sortinfo_alv.
    refresh t_fieldcat.
    refresh t_event.
    refresh t_sort.
    clear x_layout.
    clear w_title.
      perform set_fieldcat2 using:
    1  'MTART'     'MTART'     'MARA'  '15'  space 'MATERIAL TYPE'        space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    2  'MATNR'     'MATNR'     'MARA'  '13'  space 'MATERIAL NO. '        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    3  'ITEMDESC'  'MAKTX'     'MAKT'  '25'  space 'MATERIAL DESCRIPTION' space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    4  'MEINS'     'MEINS'     'MARA'  '5'   space 'UOM'                  space  space  space space space space space space SPACE t_fieldcat 'C' 'C',
    5  'MENGE'     'MENGE'     'ISEG'  '13'  space 'ORG.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    6  'WRTZL'     'WRTZL'     'ISEG'  '13'  space 'ORG.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    7  'BUCHM'     'BUCHM'     'ISEG'  '13'  space 'PHY.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    8  'WRTBM'     'WRTBM'     'ISEG'  '13'  space 'PHY.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    9  'DIFFQTY'   'MENGE'     'ISEG'  '13'  space 'DIFF.INV.QTY'         space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    10 'DIFFVALUE' 'WRTZL'     'ISEG'  '13'  space 'DIFF.INV.VALUE'       space  space  space space space space space space SPACE t_fieldcat SPACE 'P'.
    x_layout-zebra = 'X'.
    perform set_top_page_heading using t_heading t_event.
    perform set_events using t_event.
      w_status = ''.
      w_repid = sy-repid.
      w_comm   = 'USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = w_repid
          it_fieldcat              = t_fieldcat
          i_Callback_top_of_page   = 'Top-of-page'
          is_layout                = x_layout
          it_sort                  = t_sort
          i_callback_pf_status_set = w_status
          i_callback_user_command  = w_comm
          i_save                   = 'X'
          it_events                = t_event
          i_grid_title             = w_title
          tables
          t_outtab                 = ITS1
        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.
    FORM set_fieldcat2 USING
          p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv
          P_JUST
          P_FTYPE.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
    wa_fieldcat-no_zero = 'X'.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-hotspot = p_hotspot.
      wa_fieldcat-checkbox = p_checkbox.
      wa_fieldcat-icon = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
    IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
    ENDIF.
    IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
    ENDIF.
    IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
    ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
    IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
    ENDIF.
      IF NOT P_JUST IS INITIAL.
        WA_FIELDCAT-JUST = P_JUST.
      ENDIF.
    Set as editable or not.
      IF NOT p_edit IS INITIAL.
        wa_fieldcat-input     = 'X'.
        wa_fieldcat-edit     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    ======================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
         exporting
              it_list_commentary = t_heading.
    ENDFORM.
    form set_top_page_heading using t_heading type slis_t_listheader
                                    t_events  type slis_t_event.
    data: x_heading type slis_listheader,
          x_event   type line of slis_t_event.
    Report title
      clear t_heading[].
      clear x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'PHYSICAL INVENTORY AUDIT REPORT'.
      append x_heading to t_heading.
    Plant Name
    clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'PLANT: '.
      x_heading-info = its1-werks.
      append x_heading to t_heading.
    Posting Date
    *clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'POSTING DATE: '.
    x_heading-info = ITS1-BUDAT.
    append x_heading to t_heading.
    Control Date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL No: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    Control date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL DATE: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    User who is running the report
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'User: '.
    x_heading-info = sy-uname.
    append x_heading to t_heading.
    Date of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Date: '.
      write sy-datum to x_heading-info.
      append x_heading to t_heading.
    Time of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Time: '.
      write sy-uzeit to x_heading-info.
      append x_heading to t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      append x_event to t_events.
    endform.
    form set_events using t_events type slis_t_event.
    data: x_event   type line of slis_t_event.
    endform.
    plzzz help me out as it is most urgent to me.
    regards,
    ric.s

  • ALV report for individual fields (urgent...........)

    Hi all,
    using this ZUS_SDN_THREE_ALV_GRIDS program structure i have generated the all the fields from table.
    could you please guide me how to generate the ALV report for splecific fileds from  individual tables.
    if i click in click on grid1 (that is sales header details) we need populate the item details in grid2 and paralally customer details in grid3.
    please guide me how to resolve the issuee..
    thanks in advance
    Srinivas...

    Hi,
    I have done an example, like on 1st grid it displays header data (EKKO) and when you double click on any record, for that PO you will get item details (EKPO) on 2nd grid,
    In the similar way, you can add one more grid and populate it with your own data simultaneously along with 2nd grid.
    *& Report  ZOOABAP1_SOW
    report  zabap2.
    *                     TABLES
    tables:ekko.
    *                     DATA DECLARATIONS
    data: grid1 type ref to cl_gui_alv_grid,
          grid2 type ref to cl_gui_alv_grid,
          container1 type ref to cl_gui_custom_container,
          container2 type ref to cl_gui_custom_container,
          flag.
    *                     INTERNAL TABLES
    data: it_ekko type table of ekko.
    data: wa_ekko like line of it_ekko.
    data: it_ekpo type table of ekpo.
    data: it_fcat1 type lvc_t_fcat,
          wa_fcat1 type lvc_s_fcat,
          it_fcat2 type lvc_t_fcat,
          wa_fcat2 type lvc_s_fcat,
          wa_layout1 type lvc_s_layo,
          wa_layout2 type lvc_s_layo,
          wa_variant type disvariant.
    *                     SELECTION-SCREEN
    selection-screen begin of block b with frame title text-s01.
    select-options: s_ebeln for ekko-ebeln.
    selection-screen end of block b.
    *       CLASS lcl1 DEFINITION
    class lcl1 definition.
      public section.
        methods:
          handler_dbl_clk for event double_click
                                      of cl_gui_alv_grid
                                         importing e_row.
    endclass.                    "lcl1 DEFINITION
    *       CLASS lcl1 IMPLEMENTATION
    class lcl1 implementation.
      method handler_dbl_clk.
        read table it_ekko into wa_ekko index e_row-index.
        if sy-subrc = 0.
          perform get_ekpo.
        endif.
      endmethod.                    "handler_dbl_clk
    endclass.                    "lcl1 IMPLEMENTATION
    *                     START_OF_SELECTION
    start-of-selection.
    * Get PO header data
      perform get_ekko.
    * screen for container
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
      set pf-status 'PFS'.
      set titlebar 'TIT'.
      data: obj type ref to lcl1.
      if flag is initial.
        create object container1
          exporting
            container_name = 'CONT1'.
        create object container2
          exporting
            container_name = 'CONT2'.
        create object grid1
          exporting
            i_parent = container1.
        create object grid2
          exporting
            i_parent = container2.
        create object obj.
        set handler obj->handler_dbl_clk for grid1.
        perform build_fcat.
        perform build_layout.
        call method grid1->set_table_for_first_display
           exporting
    *        i_buffer_active               =
    *        i_bypassing_buffer            =
    *        i_consistency_check           =
    *          i_structure_name              = 'EKKO'
    *        is_variant                    = wa_variant
            i_save                        = 'X'
    *        i_default                     = 'X'
            is_layout                     = wa_layout1
    *        is_print                      =
    *        it_special_groups             =
    *        it_toolbar_excluding          =
    *        it_hyperlink                  =
    *        it_alv_graphics               =
    *        it_except_qinfo               =
    *        ir_salv_adapter               =
              changing
                it_outtab                     = it_ekko
                it_fieldcatalog               = it_fcat1
    *        it_sort                       =
    *        it_filter                     =
    *      EXCEPTIONS
    *        invalid_parameter_combination = 1
    *        program_error                 = 2
    *        too_many_lines                = 3
    *        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.
        flag = 'X'.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Form  get_ekko
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form get_ekko .
      select ebeln bsart lifnr
             from ekko
             into corresponding fields of table it_ekko
             where ebeln in s_ebeln.
    endform.                    " get_ekko
    *&      Form  GET_EKPO
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form get_ekpo .
      select ebeln ebelp menge meins peinh from ekpo
       into corresponding fields of table it_ekpo
       where ebeln = wa_ekko-ebeln.
      if not it_ekpo[] is initial.
        call method grid2->set_table_for_first_display
      exporting
    *    i_buffer_active               =
    *    i_bypassing_buffer            =
    *    i_consistency_check           =
    *    i_structure_name              =
    *    is_variant                    =
    *    i_save                        =
    *    i_default                     = 'X'
        is_layout                     = wa_layout2
    *    is_print                      =
    *    it_special_groups             =
    *    it_toolbar_excluding          =
    *    it_hyperlink                  =
    *    it_alv_graphics               =
    *    it_except_qinfo               =
    *    ir_salv_adapter               =
          changing
            it_outtab                     = it_ekpo
            it_fieldcatalog               = it_fcat2
    *    it_sort                       =
    *    it_filter                     =
    *  EXCEPTIONS
    *    invalid_parameter_combination = 1
    *    program_error                 = 2
    *    too_many_lines                = 3
    *    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.
      endif.
    endform.                    " GET_EKPO
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK' or 'EXIT' or 'CANC'.
          call method container1->free.
          call method container2->free.
          leave to screen 0.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Form  build_fcat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form build_fcat .
    * fieldcatalog for EKKO table
      wa_fcat1-col_pos = '1'.
      wa_fcat1-fieldname = 'EBELN'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'PO No.'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
      wa_fcat1-col_pos = '2'.
      wa_fcat1-fieldname = 'BSART'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'PO Type'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
      wa_fcat1-col_pos = '3'.
      wa_fcat1-fieldname = 'LIFNR'.
      wa_fcat1-tabname = 'EKKO'.
      wa_fcat1-coltext = 'Vendor No.'.
      append wa_fcat1 to it_fcat1.
      clear wa_fcat1.
    * fieldcatalog for EKPO table
      wa_fcat2-col_pos = '1'.
      wa_fcat2-fieldname = 'EBELN'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'PO No.'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '2'.
      wa_fcat2-fieldname = 'EBELP'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'PO Item'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '3'.
      wa_fcat2-fieldname = 'MENGE'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'Quantity'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '4'.
      wa_fcat2-fieldname = 'MEINS'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'UOM'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
      wa_fcat2-col_pos = '5'.
      wa_fcat2-fieldname = 'PEINH'.
      wa_fcat2-tabname = 'EKPO'.
      wa_fcat2-coltext = 'Price Unit'.
      append wa_fcat2 to it_fcat2.
      clear wa_fcat2.
    endform.                    " build_fcat
    *&      Form  build_layout
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form build_layout .
      clear wa_layout1.
      wa_layout1-grid_title = 'Header data'.
    *  wa_layout-sel_mode = 'A'.             "allow to select multiple lines
      clear wa_layout2.
      wa_layout2-grid_title = 'Item Data'.
    endform.                    " build_layout
    If you have any poblems while doing this, post it.
    Do reward points for all helpful answers
    Regards,
    Sowjanya

  • ALV report display

    Can the fields on the ALV report be displayed in a certain column or is it can only be displayed left justified for alpha field and right justified for numeric field?

    Use COL_POS to set the position and use JUST to justify the field in field catalog
    (R)ight
    (L)eft
    (C)ent.

  • ALV report without using field catalogue manually

    I am looking for alv report in which I will not create fieldcatalogue manually but pass the structure as it is and display the alv. Please provide me sample code.
    Moderator message: Please do not use all upper case in the future.
    Edited by: Thomas Zloch on Apr 1, 2010 12:31 PM - converted to lower case

    Use the function module "REUSE_ALV_FIELDCATALOG_MERGE" to create the field catalog of all the fields in a structure
    eg :
    data :    xfieldcat           type slis_t_fieldcat_alv.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = sy-repid
          i_internal_tabname     = <internal table structure>
          i_bypassing_buffer     = 'X'
          i_buffer_active        = ' '
        changing
          ct_fieldcat            = xfieldcat
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
    call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program      = sy-repid
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = xfieldcat[]
        tables
          t_outtab                = <internal table>.
    Regards
    Vinod
    Edited by: Vinod Kumar on Apr 1, 2010 3:45 PM

  • Report Builder: ContentType Field shows always "System.Byte[]"

    Hello Community!
    I use the following systems:
    SharePoint 2013
    SQL Server 2012 Report Builder 3.0
    So, I have a SharePoint List with some columns (Responsible Person, Serial Number, Content Type).
    Responsible Person and Serial Number is displayed correctly. But in the field Content Type, I have seen "System.Byte[]" instead of the realy value of Content Type.
    When I execute query, I have seen realy value of the field Content Type!
    Could anybody help me?
    Thanks a lot und greets from austria!
    Daniel

    Hi Daniel ,
    According to your description, when you use SharePoint list as data source, the Content Type display as "System.Byte[]" instead of real value when running the report.
    As we tested in our environment, Content Type can display correctly both in query designer and preview results. Please refer to our test results below to check if you design the report correctly:
    1. Type the query in dataset like below:
    2. Run the report:
    Besides, it has reported the same issue with Content Type. In your scenario, please also try to use XML data source to connect to SharePoint list to retrieve data. For more information, please refer to this similar thread:
    Reporting: ContentType Field Value always "System.Byte[]". If issue persists, please create the same report in SSDT and run the report, then check if there are warning messages in output.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • ALV report display online and generate in spool

    Dear expert,
    I have created an ALV report. I want to run this report online. After executed, the report is displayed. After display this report, I also want to generate the output report in the spool. Is there any way to do this? Thank you.
    I have tried to use submit...to SAP Spool. in this way, it will generate the spool, but it will not display the report online. I want it both display online and generate a spool.

    well forget yout the new-page print on thingie, since you use ALV.
    if you had a write list this trick would be cool since you just could do following:
    Do 2 times.
      if sy-index GT 1.
        new page print on.
      endif.
      loop at itab into wa.
        write stuff....
      endloop.
      if sy-index GT 1.
        new page print off.
      endif.
    enddo.
    /edit arrrgh forgot to write further...
    with your ALV you could process a write list as well after displaying but you will have layout differences between your display and your spool then and i dont think that this is what you want/need.
    you could however after display process your programm a second time, in background task and give it a printer where to print to. Since ALV wont get executed in background task you will get a spool instead.
    Edited by: Florian Kemmer on Sep 15, 2010 2:40 PM

  • ALV Report to have two different Reports

    Hi All,
    I have a need to display two different reports for the same set of data selections, (Successful data and Error Data) in a Single ALV Layout using a Application tool bar Button. Does anyone have a sample code for this kind of requirement. Preferably using Objects.
    Also, how can we check if an object is already created? In other words, how to check for a null reference?
    Thanks in advance.
    Jr.

    Sample code for split alv using OOABAP.
    this would help you in ur requirement.
    go through this program where the screen is divided in two for two alv in different containers.
    DATA: save_ok LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'CC1',
          g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          g_max TYPE i VALUE 100.
    declarations for top of page event
    Data:  gv_c_split type ref to cl_gui_splitter_container,
           gv_c_ptv type ref to cl_gui_container,
           gv_alv_ptv type ref to cl_gui_alv_grid,
           o_dd_doc TYPE REF TO cl_dd_document,
           text TYPE sdydo_text_element,
           o_split type ref to cl_gui_easy_splitter_container,
           o_top type ref to cl_gui_container,
           o_bot type ref to cl_gui_container,
           gv_c_vp type ref to cl_gui_container.
    end of declaration for top of page.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    *class lcl_application_dc definition deferred.
    DATA: o_event_receiver TYPE REF TO lcl_event_receiver.
         g_dc type ref to lcl_application_dc.
    DATA: gt_outtab TYPE TABLE OF sbook.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS: handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid
                   IMPORTING e_fieldname
                             es_row_no
                             er_event_data
                             et_bad_cells
                             e_display,
                handle_top_of_page FOR EVENT top_of_page OF cl_gui_alv_grid
                   IMPORTING e_dyndoc_id.
        METHODS: reset.
        METHODS: show_f4.
      PRIVATE SECTION.
    attributes for creating an own F4-Help
    (using a second ALV Grid Control
        DATA: f4_grid TYPE REF TO cl_gui_alv_grid,
              f4_custom_container TYPE REF TO cl_gui_custom_container.
        TYPES: BEGIN OF ty_f4.
        TYPES: value TYPE s_class.
        TYPES: descr(20) TYPE c.
        TYPES: END OF ty_f4.
        DATA: f4_itab TYPE TABLE OF ty_f4.
        DATA: f4_fieldcatalog TYPE lvc_t_fcat.
    attributes to store event parameters
    (after the CALL SCREEN command, the event parameters
    are not accessible)
        TYPES: BEGIN OF onf4_event_parameters_type.
        TYPES: c_fieldname     TYPE lvc_fname.
        TYPES: cs_row_no       TYPE lvc_s_roid.
        TYPES: cr_event_data   TYPE REF TO cl_alv_event_data.
        TYPES: ct_bad_cells    TYPE lvc_t_modi.
        TYPES: c_display       TYPE char01.
        TYPES: END OF onf4_event_parameters_type.
        DATA: f4_params TYPE onf4_event_parameters_type.
    Methods to create own F4-Help
    (This is done using a second ALV Grid Control)
        METHODS: init_f4.
        METHODS: build_fieldcatalog.
        METHODS: fill_f4_itab .
        METHODS: on_double_click FOR EVENT double_click OF cl_gui_alv_grid
                        IMPORTING es_row_no.
    ENDCLASS.                    "lcl_application_f4 DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    *§2. Implement an event handler method for event ONF4.
      METHOD handle_f4.
    Save event parameter as global attributes of this class
    (maybe solved differently if you use a function module!)
        f4_params-c_fieldname = e_fieldname.
        f4_params-cs_row_no = es_row_no.
        f4_params-cr_event_data = er_event_data.
        f4_params-ct_bad_cells = et_bad_cells.
        f4_params-c_display = e_display.
    *§3. Call your own f4 help. To customize your popup check
       first if the cell is ready for input (event parameter E_DISPLAY).
    (parameter E_DISPLAY is checked later in method on_double_click)
    (Probably, you would call a function module at this point,
    pass the needed event parameter and call the popup screen
    within that function module. This is not done in this example
    to avoid scattering its code).
        CALL SCREEN 101 STARTING AT 10 10.
    *§7. Inform the ALV Grid Control that an own f4 help has been processed
       to suppress the standard f4 help.
        er_event_data->m_event_handled = 'X'.
      ENDMETHOD.                                                "on_f4
      METHOD show_f4.
       DATA: ls_outtab TYPE sbook.
    initialize own f4 help if needed
        IF f4_custom_container IS INITIAL.
          CALL METHOD init_f4.
        ENDIF.
        CALL METHOD fill_f4_itab.
    refresh list of values in f4 help and show it
        CALL METHOD f4_grid->refresh_table_display.
    CAUTION: Do not use method REFRESH_TABLE_DISPLAY for
    your editable ALV Grid instances while handling events
    DATA_CHANGED or ONf4. You would overwrite intermediate
    values of your output table on frontend.
    'f4_grid' is a non-editable ALV Grid Control for the
    application specific F4-Help. Therefore, calling
    REFRESH_TABLE_DISPLAY for this instance has no
    negative effect.
        CALL METHOD cl_gui_cfw=>flush.
      ENDMETHOD.                                                "show_f4
      METHOD init_f4.
        DATA: ls_f4_layout TYPE lvc_s_layo.
    build fieldcatalog entries for f4
        CALL METHOD build_fieldcatalog.
    create controls
        CREATE OBJECT f4_custom_container
                  EXPORTING container_name = 'CC_ONF4'.
        CREATE OBJECT f4_grid
                  EXPORTING i_parent = f4_custom_container.
    hide toolbar
        ls_f4_layout-no_toolbar = 'X'.
        CALL METHOD f4_grid->set_table_for_first_display
          EXPORTING
            is_layout       = ls_f4_layout
          CHANGING
            it_fieldcatalog = f4_fieldcatalog
            it_outtab       = f4_itab.
    register event double click on backend
        SET HANDLER me->on_double_click FOR f4_grid.
    flush since 'ls_layout' is local!
        CALL METHOD cl_gui_cfw=>flush.
      ENDMETHOD.                                                "init_f4
      METHOD fill_f4_itab.
        DATA ls_f4_itab TYPE ty_f4.
    Delete all entries in f4_itab to determine
    offered values dynamically
        CLEAR f4_itab[].
        ls_f4_itab-value = 'C'.
        ls_f4_itab-descr = text-t03. "Business Class
        APPEND ls_f4_itab TO f4_itab.
        ls_f4_itab-value = 'Y'.
        ls_f4_itab-descr = text-t04. "Economie Class
        APPEND ls_f4_itab TO f4_itab.
        ls_f4_itab-value = 'F'.
        ls_f4_itab-descr = text-t05. "First Class
        APPEND ls_f4_itab TO f4_itab.
      ENDMETHOD.                    "fill_f4_itab
      METHOD build_fieldcatalog.
        DATA: ls_fcat TYPE lvc_s_fcat.
        CLEAR ls_fcat.
        ls_fcat-fieldname = 'VALUE'.
        ls_fcat-coltext = text-t02.
       ls_fcat-inttype = 'S_CLASS'.
        ls_fcat-outputlen = 5.
        APPEND ls_fcat TO f4_fieldcatalog.
        CLEAR ls_fcat.
        ls_fcat-fieldname = 'DESCR'.
        ls_fcat-coltext = text-t01.
        ls_fcat-inttype = 'C'.
        ls_fcat-outputlen = 20.
        APPEND ls_fcat TO f4_fieldcatalog.
      ENDMETHOD.                    "build_fieldcatalog
      METHOD on_double_click.
    *§5. If not already caught by your own f4 help, check whether
       the triggered cell was ready for input by using E_DISPLAY
       and if not, exit.
        IF f4_params-c_display EQ 'X'.
          LEAVE SCREEN.
        ENDIF.
    *§6. After the user selected a value, pass it to the ALV Grid Control:
    *§  6a. Define a field symbol of type: LVC_T_MODI and a structure of
          type LVC_S_MODI to pass the value later on.
        FIELD-SYMBOLS  TYPE lvc_t_modi.
        DATA: ls_modi TYPE lvc_s_modi,
              ls_f4_itab TYPE ty_f4.
    *§  6b. Dereference attribute M_DATA into your field symbol and add
          the selected value to the table to which this symbol points to.
        ASSIGN f4_params-cr_event_data->m_data->* TO .
        LEAVE TO SCREEN 0.
      ENDMETHOD.                    "on_double_click
      METHOD reset.
        FIELD-SYMBOLS display_document
                 EXPORTING parent = o_top.
      ENDMETHOD.                    "handle_top_of_page
    ENDCLASS.                    "lcl_application_f4 IMPLEMENTATION
    END-OF-SELECTION.
      CALL SCREEN 100.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF g_custom_container IS INITIAL.
        PERFORM create_and_init_alv CHANGING gt_outtab[]
                                             gt_fieldcat.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      save_ok = sy-ucomm.
      CLEAR sy-ucomm.
      CASE save_ok.
        WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
          PERFORM exit_program.
        WHEN 'SWITCH'.
          PERFORM switch_edit_mode.
        WHEN OTHERS.
        do nothing
      ENDCASE.
    ENDMODULE.                    "pai INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    *&      Form  build_fieldcat
          text
         -->PT_FIELDCAT  text
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SBOOK'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
    Exchange smoker field with invoice field - just to
    make the dependance between SMOKER and CLASS more transparent
    (Smoking is only allowed in the first class).
        IF ls_fcat-fieldname EQ 'SMOKER'.
          ls_fcat-col_pos = 11.
          ls_fcat-outputlen = 10.
          ls_fcat-edit = 'X'.
    Field 'checktable' is set to avoid shortdumps that are caused
    by inconsistend data in check tables. You may comment this out
    when the test data of the flight model is consistent in your system.
          ls_fcat-checktable = '!'.        "do not check foreign keys
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF ls_fcat-fieldname EQ 'INVOICE'.
          ls_fcat-col_pos = 7.
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF    ls_fcat-fieldname EQ 'CLASS'.
          ls_fcat-edit = 'X'.
          ls_fcat-outputlen = 5.
          ls_fcat-checktable = '!'.        "do not check foreign keys
          MODIFY pt_fieldcat FROM ls_fcat.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  create_and_init_alv
          text
         -->PT_OUTTAB    text
         -->PT_FIELDCAT  text
    FORM create_and_init_alv CHANGING pt_outtab TYPE STANDARD TABLE
                                      pt_fieldcat TYPE lvc_t_fcat.
      DATA: lt_exclude TYPE ui_functions,
            ls_layout TYPE lvc_s_layo.
      CREATE OBJECT g_custom_container
              EXPORTING container_name = g_container.
    CREATE OBJECT g_grid
            EXPORTING i_parent = g_custom_container.
      CREATE OBJECT gv_c_split
         EXPORTING
          link_dynnr        = lv_dynnr
          link_repid        = lv_repid
          parent            = g_custom_container
          rows              = 2
          columns           = 1
         EXCEPTIONS
           cntl_error        = 1
           cntl_system_error = 2
           others            = 3    .
      CALL METHOD gv_c_split->set_border
       EXPORTING
         border            = space.
      CALL METHOD gv_c_split->get_container
         EXPORTING
           row       = 1
           column    = 1
         RECEIVING
           container = gv_c_ptv.
      CALL METHOD gv_c_split->set_row_height
        EXPORTING
          id                = 1
          height            = 20
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 6 .
      CALL METHOD gv_c_split->get_container
         EXPORTING
           row       = 2
           column    = 1
         RECEIVING
           container = gv_c_vp .
      CALL METHOD gv_c_split->set_row_height
        EXPORTING
          id                = 2
          height            = 10
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3 .
       CREATE OBJECT o_split
         EXPORTING
          parent            = gv_c_ptv
          with_border       = 1
         EXCEPTIONS
           cntl_error        = 1
           cntl_system_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.
    o_top = o_split->top_left_container.
    o_bot = o_split->bottom_right_container.
    CREATE OBJECT gv_alv_ptv
         EXPORTING
           i_parent          = o_bot
         EXCEPTIONS
           error_cntl_create = 1
           error_cntl_init   = 2
           error_cntl_link   = 3
           error_dp_create   = 4
           others            = 5    .
    CREATE OBJECT g_grid
            EXPORTING
              i_parent          = gv_c_vp
            EXCEPTIONS
              error_cntl_create = 1
              error_cntl_init   = 2
              error_cntl_link   = 3
              error_dp_create   = 4
              others            = 5    .
      PERFORM build_fieldcat CHANGING pt_fieldcat.
    Optionally restrict generic functions to 'change only'.
      (The user shall not be able to add new lines).
      PERFORM exclude_tb_functions CHANGING lt_exclude.
      PERFORM build_data CHANGING pt_outtab.
      ls_layout-grid_title = 'F4 help implemented for field CLASS'.
      CREATE OBJECT o_event_receiver.
      SET HANDLER o_event_receiver->handle_top_of_page FOR gv_alv_ptv.
      SET HANDLER o_event_receiver->handle_top_of_page FOR g_grid.
      CREATE OBJECT o_dd_doc EXPORTING style = 'ALV_GRID'
                                       no_margins = 'X'.
      CALL METHOD gv_alv_ptv->set_table_for_first_display
       EXPORTING
         is_layout                    = ls_layout
      CHANGING
        it_outtab                     = pt_outtab[]
        it_fieldcatalog               = pt_fieldcat
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding = lt_exclude
          is_layout            = ls_layout
        CHANGING
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
      CALL METHOD gv_alv_ptv->list_processing_events
        EXPORTING
          i_event_name      = 'TOP_OF_PAGE'
           i_dyndoc_id       = o_dd_doc.
    register f4 for field CLASS
      PERFORM register_events.
    Set editable cells to ready for input initially
      CALL METHOD g_grid->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  exclude_tb_functions
          text
         -->PT_EXCLUDE text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    Only allow to change data not to create new entries (exclude
    generic functions).
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_data
          text
    -->  p1        text
    <--  p2        text
    FORM build_data CHANGING pt_outtab TYPE STANDARD TABLE.
      DATA: ls_sbook TYPE sbook,
            l_index TYPE i.
      SELECT * FROM sbook INTO TABLE gt_outtab UP TO g_max ROWS.
      IF sy-subrc NE 0.
        PERFORM generate_entries CHANGING pt_outtab.
      ENDIF.
      LOOP AT pt_outtab INTO ls_sbook.
        l_index = sy-tabix.
        CLEAR ls_sbook-class.
    Alternate between smoker and non smoker to make
    it more obvious what this example is about
        l_index = l_index MOD 2.
        IF l_index EQ 1.
          ls_sbook-smoker = 'X'.
        ELSE.
          ls_sbook-smoker = ' '.
        ENDIF.
        MODIFY pt_outtab FROM ls_sbook.
      ENDLOOP.
    ENDFORM.                               " build_data
    *&      Form  generate_entries
          text
         -->PT_SBOOK   text
    FORM generate_entries CHANGING pt_sbook TYPE STANDARD TABLE.
      DATA: ls_sbook TYPE sbook,
            l_month(2) TYPE c,
            l_day(2) TYPE c,
            l_date(8) TYPE c,
         l_prebookid TYPE i.
      ls_sbook-carrid = 'LH'.
      ls_sbook-connid = '0400'.
      ls_sbook-forcurkey = 'DEM'.
      ls_sbook-loccurkey = 'USD'.
      ls_sbook-custtype = 'B'.
      DO 110 TIMES.
        l_prebookid = sy-index.
        ls_sbook-forcuram = sy-index * 10.
        ls_sbook-loccuram = ls_sbook-loccuram * 2.
        ls_sbook-customid = sy-index.
        ls_sbook-counter = 18.
        ls_sbook-agencynum = 11.
        l_month = sy-index / 10 + 1.
        DO 2 TIMES.
          l_day = 3 + l_month + sy-index * 2.
          l_date+0(4) = '2000'.
          l_date+4(2) = l_month.
          l_date+6(2) = l_day.
          ls_sbook-fldate = l_date.
          SUBTRACT 3 FROM l_day.
          ls_sbook-order_date+0(6) = l_date+0(6).
          ls_sbook-order_date+6(2) = l_day.
          ls_sbook-bookid = l_prebookid * 2 + sy-index.
          IF sy-index EQ 1.
            ls_sbook-smoker = 'X'.
          ELSE.
            ls_sbook-smoker = space.
          ENDIF.
          ls_sbook-luggweight = l_prebookid * 10.
          IF ls_sbook-luggweight GE 1000.
            ls_sbook-wunit = 'G'.
            ls_sbook-class = 'C'.
          ELSE.
            ls_sbook-wunit = 'KG'.
            ls_sbook-class = 'Y'.
          ENDIF.
          IF ls_sbook-bookid > 40 AND ls_sbook-wunit EQ 'KG'.
            ls_sbook-invoice = 'X'.
          ENDIF.
          IF ls_sbook-bookid EQ 2.
            ls_sbook-cancelled = 'X'.
            ls_sbook-class = 'F'.
          ENDIF.
          APPEND ls_sbook TO pt_sbook.
        ENDDO.
      ENDDO.
    ENDFORM.                               " generate_entries
    *&      Form  register_events
          text
    FORM register_events.
    *§1. Register event ONF4 at frontend using method
       register_f4_for_fields. For this purpose, you pass a table
       with all fields, for which you want to implement your own
       f4 help.
    remark: If you want to use an own f4 help for fields where
            no standard f4 help exists set field F4AVAILABL for
            this field in the fieldcatalog.
      DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
      CLEAR lt_f4.
      lt_f4-fieldname = 'CLASS'.
    If you would like to deregister the field again,
    pass value SPACE with field 'register'.
      lt_f4-register = 'X'.
    *§  1b. If the value range in your f4 help depends on other
          values of cells that are input enabled, set the
          GETBEFORE parameter.
    The consequence is that the ALV Grid Control raises
    event DATA_CHANGED before the f4 help is called to
    check values that the f4 help depends on.
      lt_f4-getbefore = 'X'.
    The next parameter is used to change values after onf4 has
    been processed. The ALV Grid Control will raise
    event DATA_CHANGED afterwards, if you set it.
      lt_f4-chngeafter = space.
      INSERT TABLE lt_f4.
      CALL METHOD g_grid->register_f4_for_fields
        EXPORTING
          it_f4 = lt_f4[].
    register events for abap objects (backend)
      SET HANDLER o_event_receiver->handle_f4 FOR g_grid.
    ENDFORM.                    " register_events
    MODULE status_0101 OUTPUT
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'POPUP'.
      SET TITLEBAR 'POPUP'.
      CALL METHOD o_event_receiver->show_f4.
    ENDMODULE.                 " STATUS_0101  OUTPUT
    *&      Module  USER_COMMAND_0101  INPUT
          text
    MODULE user_command_0101 INPUT.
      PERFORM user_command.
    ENDMODULE.                 " USER_COMMAND_0101  INPUT
    *&      Form  user_command
          text
    FORM user_command.
      DATA: save_ok TYPE sy-ucomm.
      save_ok = sy-ucomm.
      CLEAR sy-ucomm.
      CASE save_ok.
        WHEN 'CANCEL'.
          CALL METHOD o_event_receiver->reset.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  switch_edit_mode
          text
    FORM switch_edit_mode.
      IF g_grid->is_ready_for_input( ) EQ 0.
    set edit enabled cells ready for input
        CALL METHOD g_grid->set_ready_for_input
          EXPORTING
            i_ready_for_input = 1.
      ELSE.
    lock edit enabled cells against input
        CALL METHOD g_grid->set_ready_for_input
          EXPORTING
            i_ready_for_input = 0.
      ENDIF.
    ENDFORM.                    "switch_edit_mode

  • Report displays date field on server as timestamp, despite format

    I formatted a date field in my report as 01/03/2009.
    This looks ok when testing in Crystal Reports.
    On the server the date displays as 01/03/2009 12:00:00 AM.
    I really want to get rid of the time, as it doesn't fit in the report.
    I noticed that in an older report the field of the same date is typed as timestamp. In this case the server display correctly.
    The problem is, I cannot figure out how/why the date is typed differently in the 2 reports, e.g. date vs timestamp.
    Help!?

    Ah, that explains it. Some JDBC drivers handle date field types differently.
    Be sure you are using the latest JDBC jars from Oracle and make sure you have the correct Java path in the PATH statement.
    Other than that it is likely a limitation of the driver itself.
    Try using the native Oracle driver in the database wizard and see if you get the same results.
    And as suggested go into the Report Options and see if any of the those switches help. Also right click on the field and select Format and see if those option also help you.
    Thank you
    Don

  • Simple alv  report displaying double click on that goto application

    HI Experts,
    i will working for that simple alv display the report . when ever user double click on that go to next scren . i will work for ECC 6.0 and function module is REUSE_ALV_LIST_DISPLAY   i will write the logic is
    at user-command
    SET PARAMETER ID 'LIF' VALUE FVAL.
    CALL TRANSACTION 'LF03' AND SKIP FIRST SCREEN.
    so any body plz help me.
    advance thanking u.

    Hi
    try this code...
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = W_PROG
    I_CALLBACK_USER_COMMAND = 'PICK'
    I_STRUCTURE_NAME = 'EKKO'
    TABLES
    T_OUTTAB = T_EKKO
    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 pick
    * -->UCOMM text
    * -->SELFIELD text
    FORM PICK USING COMMAND LIKE SY-UCOMM
    SELFIELD TYPE SLIS_SELFIELD.
    READ TABLE T_EKKO INTO FS_EKKO INDEX SELFIELD-TABINDEX.
    CASE COMMAND.
    WHEN '&IC1'.
    SET PARAMETER ID 'LIF' VALUE FS_EKKO-EBELN. "here write your field name
    CALL TRANSACTION 'LF03' AND SKIP FIRST SCREEN.

  • Popup with generic ALV to display all fields of a structure

    Hello WebDynpro Experts,
    I have developed a WebDynpro application using an ALV control to display all the search results in a table.
    The number of columns shown in this table is reduced by a default view, that is preset for all users.
    In the SAP GUI there is a standard feature to show all the details of a record in a pop up window.
    E.g. in WE02 you see a few fields in the ALV table, and when you click on the details button, you get a popup with all the fields of the selected line.
    Is there something similar in the ALV table for WebDynpro?
    I want to show all the fields of the selected structure in a generic table with two columns: Field label and value.
    Can anybody help?
    Regards,
    Jürgen

    Hello Jurgen,
                    When you select a particular row in ALV table, you can get the data in that row by using ONLEADSELECT
            method from used component(SALV_WD_TABLE).
                   And i Guess you can get all the field names of that structure from DD03L table and you can display them
            in a generic table.
        Regards,
        Harry

Maybe you are looking for

  • HELP!! Using a vba script in Outlook to copy attachments to c:\temp folders automatically

    Hi I'm brand new to Visual Basic really - you will be able to tell that I am a complete beginner. I wouldn't be posting here but I had tried asking other Forums but have not got any responses. This is the problem:- I've found a basic VB script to cop

  • Key Figure Monitor in Prod Superviosr business package

    hi, I am trying to set up Key Figure monitor in the Production supervioser business package. I am getting the below error Invalid/No Context ID The application 'Generic Key Figure Monitor' requires a unique context ID. The context ID is a four-charac

  • Windows Installer Doesn't Recognize BOOT CAMP Partition

    Hello, I need help and cannot find the answer anywhere on the Internet. I created a 15 gig Windows partition through boot camp successfully. My macbook restarted to run windows installer and I got through all of the screens except where it asks which

  • Getting Tin no's  for PLD

    Hi,       I am in need of displying Bill-to address tinno and also ship to address tinno in my PLD. For that where to enter this values and how to retrieve the values. Reg R.Vijai

  • Bugget billing plan-billing doc creation

    Hi experts, For a resential customer that is monthy charged for 50$(BBP) a billing doc. is created with different billing lines. The tarrif contains differents components: Fixed amount, distirbution cost, transaport cost, energy cost, rental cost, et