Regarding Date format in ALV Report

Dear All,
              In ALV Reoport I have inserted Field BSTDK table VBKD by comparing vbeln my Date is getting displayed, but Problem is that  i want my date in this format for ex: 29.10.2008 but it is diaplaying as 20081029. this is an ex. same is repeating for all the dates against respective vbeln. 
code as follows.
LOOP AT GT_OUT1.
   SELECT SINGLE BSTDK INTO GT_OUT1-BSTDK
         FROM VBKD WHERE VBELN = GT_OUT1-AUBEL.
     MODIFY GT_OUT1.
ENDLOOP.

Moderator message - Please see How to post code in SCN, and some things NOT to do... before posting (date question) - post locked
Rob

Similar Messages

  • Date format in ALV report

    Hi all,
    I want to change date format in ALV list that is displayed in wrong format.
    I use this piece of code:
    CALL METHOD r_alv_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZSTANJEKOMISIONARA'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = it_stanja
        EXCEPTIONS
          OTHERS           = 4.
    Problematic field of structure ZSTANJEKOMISIONARA is defined like this:
    VRIJEDI_DO     ZEVO_VRIJEDI_DO     DATS     8
    Now, date is displayed like this: 09.20.3009 insted it should be like this: 30.09.2009.
    How can I change this? Thanks.

    The data is internally stored in an external format. Go back to the program that filled this field, there is something missing there.
    Look at FM like
    - CONVERT_DATE_TO_INTERN_FORMAT
    - CONVERSION_EXIT_PDATE_INPUT
    You only keep date in external format when filling a BDC, for most other input mode (BAPI and the like) data must be converted to internal format.
    Regards,
    Raymond

  • How to change date format in alv report

    hi ,
    i wanna change date format which is in yyyy.mm.dd to mm/dd/yyyy in alv report.
    plz advise.
    thanks
    sudheer

    Hi sudheer,
    There is no direst Fm fro that.
    But u can follw the below way. it worked for me. kindly chk it.
    [code]DATA: V_DATE_IN(10) TYPE C,
    V_DATE_SAP TYPE SY-DATUM.
    V_DATE_IN = '01.01.2005.'.
    CONCATENATE V_DATE_IN+6(4) "<--for Year
    V_DATE_IN+3(2) "<--for month
    V_DATE_IN+0(2) "<--for Day
    INTO V_DATE_SAP.
    now V_DATE_SAP will have value like 20060101.
    now use.
    CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY[/code]
    regards
    anver
    <b><i>if hlped pls mark points</i></b>

  • Regarding Date format in Reports.

    Hi All,
    I want to change the Date format in BEx reports. Currently I am getting MM DD YYYY. But I need it as DD MM YYYY. I had gone thru numerous posting on this issue. I changed the Date Settings in SU3. But still I am not getting the Date in correct format. Is there any other place that I have to correct the Date format???
    Regards
    Jay

    Jayanth,
    I feel in your case, going to the System (in menu)-User Profile-Own data then, you get, Maintain user profile. Here you have the option of Maintaining, Date format.
    Hope this helps....

  • Formatting in ALV report

    Hi All,
    I wanted to do the formatting in ALV report output. How I can do that?
    Formatting means colour the field, & all.
    If possible send me any sample code..
    Regards,
    Poonam

    hi
    Coloring a row is a bit (really a bit) more complicated. To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, let’s modify declaration of our list data table “gt_list”.
    Code Part 13 – Adding the field that will contain row color data
    As you guess, you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by 1/0: intensifiedon/off - - 1/0: inverseon/off
    Color numbers
    Internal table holding list data
    DATA BEGIN OF gt_list OCCURS 0 .
    INCLUDE STRUCTURE SFLIGHT .
    DATA rowcolor(4) TYPE c .
    DATA END OF gt_list .
    Passing the name of the field containing color codes to the field “INFO_FNAME” of the layout structure.
    e.g. ps_layout-info_fname = <field_name_containing_color_codes>. “e.g. ‘ROWCOLOR’
    You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs. You can color an entire row as described in the next section. However, this method is less time consuming.
    Here is a sample program.
    report zrich_0002 .
    Use of colours in ALV grid (cell, line and column)            *
    Table
    tables : mara.
    Type
    types : begin of ty_mara,
              matnr         like mara-matnr,
              matkl         like mara-matkl,
              counter(4)    type n,
              free_text(15) type c,
              color_line(4) type c,           " Line color
              color_cell    type lvc_t_scol,  " Cell color
    end of ty_mara.
    Structures
    data  : wa_mara     type ty_mara,
            wa_fieldcat type lvc_s_fcat,
            is_layout   type lvc_s_layo,
            wa_color    type lvc_s_scol.
    Internal table
    data : it_mara     type standard table of ty_mara,
           it_fieldcat type standard table of lvc_s_fcat,
           it_color    type table          of lvc_s_scol.
    Variables
    data : okcode like sy-ucomm,
           w_alv_grid          type ref to cl_gui_alv_grid,
           w_docking_container type ref to cl_gui_docking_container.
    parameters : p_column as checkbox,
                 p_line   as checkbox,
                 p_cell   as checkbox.
    at selection-screen output.
      perform get_data.
      perform fill_catalog.
      if w_docking_container is initial.
        perform create_objects.
      endif.
    *&      Form  create_objects
    form create_objects.
      create object w_docking_container
        exporting
          ratio                       = 60
        exceptions
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
      create object w_alv_grid
        exporting
          i_parent          = w_docking_container.
    Field that identify color line in internal table
      move 'COLOR_LINE' to is_layout-info_fname.
    Field that identify cell color in inetrnal table
      move 'COLOR_CELL' to is_layout-ctab_fname.
      call method w_alv_grid->set_table_for_first_display
        exporting
          is_layout                     = is_layout
        changing
          it_outtab                     = it_mara
          it_fieldcatalog               = it_fieldcat
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
    endform.
    *&      Form  get_data
    form get_data.
      select * from mara up to 5 rows.
        clear : wa_mara-color_line, wa_mara-color_cell.
        move-corresponding mara to wa_mara.
        add 1                   to wa_mara-counter.
        move 'Blabla'           to wa_mara-free_text.
        if wa_mara-counter = '0002'
        and p_line = 'X'.
    Color line
          move 'C410' to wa_mara-color_line.
        elseif wa_mara-counter = '0004'
        and p_cell = 'X'.
    Color cell
          move 'FREE_TEXT' to wa_color-fname.
          move '6'         to wa_color-color-col.
          move '1'         to wa_color-color-int.
          move '1'         to wa_color-color-inv.
          append wa_color to it_color.
          wa_mara-color_cell[] = it_color[].
        endif.
        append wa_mara to it_mara.
      endselect.
    endform.
    *&      Form  fill_catalog
    form fill_catalog.
    Colour code :                                                 *
    Colour is a 4-char field where :                              *
                 - 1st char = C (color property)                  *
                 - 2nd char = color code (from 0 to 7)            *
                                     0 = background color         *
                                     1 = blue                     *
                                     2 = gray                     *
                                     3 = yellow                   *
                                     4 = blue/gray                *
                                     5 = green                    *
                                     6 = red                      *
                                     7 = orange                   *
                 - 3rd char = intensified (0=off, 1=on)           *
                 - 4th char = inverse display (0=off, 1=on)       *
    Colour overwriting priority :                                 *
      1. Line                                                     *
      2. Cell                                                     *
      3. Column                                                   *
      data : w_position type i value '1'.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATNR'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATNR'    to wa_fieldcat-ref_field.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATKL'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATKL'    to wa_fieldcat-ref_field.
    Color column
      if p_column = 'X'.
        move 'C610'     to wa_fieldcat-emphasize.
      endif.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'COUNTER'  to wa_fieldcat-fieldname.
      move 'N'        to wa_fieldcat-inttype.
      move '4'        to wa_fieldcat-intlen.
      move 'Counter'  to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position  to wa_fieldcat-col_pos.
      move 'FREE_TEXT' to wa_fieldcat-fieldname.
      move 'C'         to wa_fieldcat-inttype.
      move '20'        to wa_fieldcat-intlen.
      move 'Text'      to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
    endform.
    Copy and paste this program, click a checkbox from the right and click execute. The program will color the line, column, or cell.
    chk this 4 more info...
    Re: add color in alv need help
    regards
    Satish

  • How to get this output format in ALV report

    Hi.
    Can any one pls let me know how to get the following output format in ALV report.Following are the outputfields
    companycode   location     position     approver
    300    800       01    watson
    null   null        03     candy
    null   null        04     smith
    null   null        05     michael
    one empty line after this again
    300     800     01     ryant
    null      null    02     gyan
    null      null    03     fermi
    null      null    04     ogata
    *Note: Null     indicates  empty space .( i.e I need to get empty space in  output where ever null is there.)
            Thanks in advance.
    Kind Regards,
    samiulla.

    hi,
    u can use 'REUSE_ALV_LIST_DISPLAY'
                           or
    'REUSE_ALV_GRID_DISPLAY'  function modules.
    SAMPLE CODE :
    *& Report  Y101982CHD
    *                         TABLES
    TABLES: vbak.    " standard table
    *                           Type Pools                                 *
    TYPE-POOLS: slis.
    *                     Global Structure Definitions                     *
    *-- Structure to hold data from table CE1MCK2
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    *--Display option - block
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS: alv_list RADIOBUTTON GROUP g1,
                alv_grid RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF  BLOCK b2.
    *file download - block
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: topc AS CHECKBOX,
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF  BLOCK b3.
    *                      Initialization.                                *
    *                      At Selection Screen                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
        EXPORTING
          dynpfield_filename = 'P_FILE'
          dyname             = sy-cprog
          dynumb             = sy-dynnr
          filetype           = 'P'      "P-->Physical
          location           = 'P'     "P Presentation Srever
          server             = space.
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM vbeln_validate.
    *                           Start Of Selection                         *
    START-OF-SELECTION.
    *-- Fetching all the required data into the internal table
      PERFORM select_data.
    *                           End Of Selection                           *
    END-OF-SELECTION.
      IF t_itab1[] IS NOT INITIAL.
        IF topc IS NOT INITIAL.
          PERFORM download.
          MESSAGE 'Data Download Completed' TYPE 'S'.
        ENDIF.
        PERFORM display.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    *                           Top Of Page Event                          *
    TOP-OF-PAGE.
    *& Form           :      select_data
    * Description     : Fetching all the data into the internal tables
    *  parameters    :  none
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE t_itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " select_data
    *& Form        : display
    *  decription  : to display data in given format
    * parameters   :  none
    FORM display .
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
    **        it_events                = t_alv_events[]*
            *it_fieldcat              = i_fieldcat[]*
          *TABLES*
            *t_outtab                 = t_itab1[]*
          *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.*
      ENDIF.
      IF alv_grid = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                                 USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
         'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
         'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
         'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
         'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
            *it_fieldcat              = i_fieldcat*
          *TABLES*
            *t_outtab                 = t_itab1[]*
        *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.*
      *ENDIF.*
    ENDFORM.                    " display
    *& Form        : vbeln_validate
    *  description : to validate sales document number
    * parameters   :  none
    FORM vbeln_validate .
      DATA: l_vbeln TYPE vbak-vbeln.
      SELECT SINGLE vbeln
        FROM vbak
        INTO l_vbeln
        WHERE vbeln IN s_vbeln.
      IF sy-subrc NE 0.
        MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " vbeln_validate
    *& Form       :build_fieldcat
    * Description : This routine fills field-catalogue
    *  Prameters  : none
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.                    "build_fieldcat
    *& Form        : download
    *  description : To Download The Data
    *  Parameters  :  none
    FORM download .
      DATA: l_file TYPE string.
      l_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
        TABLES
          data_tab                = t_itab1
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " download
    HOPE IT WILL HELP YOU
    REGARDS
    RAHUL SHARMA

  • Changing date format in bw report

    Hi,
    Could anybody pls Explain How can I change date format in bw report from 19-03-2008 to 19 mar 2008.Is there any setting we need to do. Else do i need to write some ABAP code to get desired format.
    Regards,
    Sarath

    Hi Sarath,
    I could have the routine enabled and its wrk for my DATS obj ...
    else pls go through the following code
    Check this example of how to get this format..
    TABLES: T247.
    DATA: V_DATE TYPE SYDATUM.
    DATA: V_STRING(20).
    V_DATE = SY-DATUM.
    SELECT SINGLE * FROM T247
    WHERE SPRAS = SY-LANGU
    AND MNR = V_DATE+4(2).
    IF SY-SUBRC = 0.
    CONCATENATE V_DATE+6(2) '-' T247-KTX '-' V_DATE(4)
    INTO V_STRING.
    WRITE: / V_STRING.
    ENDIF.
    or make use of the routine make use of the FM
    CONVERSION_EXIT_IDATE_OUTPUT
    hope it helps you out...
    regards,
    pradeep
    Assign points if useful.

  • Date Format Display on report

    Is there a way to set a custom date format on a report column? I am trying to use a format mask and it doesn't appear to be working. Maybe someone can spot my mistake:
    Query: Hours Worked = Clock_IN - Clock_OUT
    Format mask for Clock In/Clock Out - DD-MON-YYYY HH24:MI (from list)
    Format mask for Hours Worked column: HH:MI (hand typed)
    actual display (Timecard ID is edit link):
    Timecard     Employee     Vehicle     Clock IN     Clock OUT     Hours Worked
    6     20044     26045     30-JUN-2006 13:28     30-JUN-2006 13:31     +000000000 00:03:43.000000
    28     20044     144     06-JUL-2006 10:11     06-JUL-2006 10:39     +000000000 00:28:43.000000
    48     20044     144     07-JUL-2006 09:03     07-JUL-2006 16:30     +000000000 07:27:50.000000
    108     20044     26045     18-JUL-2006 15:35          
    128     20044     144     19-JUL-2006 14:57     19-JUL-2006 15:02     +000000000 00:05:06.000000

    These programs also..
    GFW_PROG_BAR : Bar chart example
    GFW_PROG_PIE: Pie chart example

  • Application Date Format in Interactive Reports

    Hi,
    What should we define in Number/Date Format in interactive reports column attributes such that it will use application level date format?
    Thanks

    Hi,
    You do not need define anything , then it use application date format
    Br,Jari

  • Display output fields in Hierarchy format in ALV report

    Hi,
    I have a requirement to display the output fileds in ALV report, the output format is like this . The output field should be in ALV format, under each purchase order its corresponding line item should appear.
    Pruchase Order  4700000581  
    company code        item
            9001                     10
            9001                     20.
            9001                     30.
    Pruchase Order  4700000174  
            9001                     10
            9001                     20.
    Can any one please help me how to do this in ALV report.

    Hi
    This can be achieved using the Heirarchial ALV list
    see the sample and do it
    REPORT ZALV5_OBJECTS.
    TABLES : EKKO.
    TYPE-POOLS : SLIS.
    TYPES : BEGIN OF TY_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 TY_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
    IT_EKPO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
    IT_EMPTYTAB TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
    WA_EKKO TYPE TY_EKKO,
    WA_EKPO TYPE TY_EKKO.
    DATA: OK_CODE LIKE SY-UCOMM, "OK-Code
    SAVE_OK LIKE SY-UCOMM.
    *ALV data declarations
    DATA: FIELDCATALOG TYPE LVC_T_FCAT WITH HEADER LINE.
    DATA: GD_FIELDCAT TYPE LVC_T_FCAT,
    GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
    GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *ALVtree data declarations
    CLASS CL_GUI_COLUMN_TREE DEFINITION LOAD.
    CLASS CL_GUI_CFW DEFINITION LOAD.
    DATA: GD_TREE TYPE REF TO CL_GUI_ALV_TREE,
    GD_HIERARCHY_HEADER TYPE TREEV_HHDR,
    GD_REPORT_TITLE TYPE SLIS_T_LISTHEADER,
    GD_LOGO TYPE SDYDO_VALUE,
    GD_VARIANT TYPE DISVARIANT.
    *Create container for alv-tree
    DATA: GD_TREE_CONTAINER_NAME(30) TYPE C,
    GD_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    *Includes
    *INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
    *INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
    *INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
    *Start-of-selection.
    START-OF-SELECTION.
    ALVtree setup data
    PERFORM DATA_RETRIEVAL.
    PERFORM BUILD_FIELDCATALOG.
    PERFORM BUILD_LAYOUT.
    PERFORM BUILD_HIERARCHY_HEADER CHANGING GD_HIERARCHY_HEADER.
    PERFORM BUILD_REPORT_TITLE USING GD_REPORT_TITLE GD_LOGO.
    PERFORM BUILD_VARIANT.
    Display ALVtree report
    CALL SCREEN 100.
    *& Form data_retrieval
    text
    --> p1 text
    <-- p2 text
    FORM DATA_RETRIEVAL .
    SELECT EBELN
    UP TO 10 ROWS
    FROM EKKO
    INTO CORRESPONDING FIELDS OF TABLE IT_EKKO.
    LOOP AT IT_EKKO INTO WA_EKKO.
    SELECT EBELN EBELP STATU AEDAT MATNR MENGE MEINS NETPR PEINH
    FROM EKPO
    APPENDING TABLE IT_EKPO
    WHERE EBELN EQ WA_EKKO-EBELN.
    ENDLOOP.
    ENDFORM. " data_retrieval
    *& Form build_fieldcatalog
    text
    --> p1 text
    <-- p2 text
    FORM BUILD_FIELDCATALOG .
    Please not there are a number of differences between the structure of
    ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
    For example the field seltext_m is replace by scrtext_m in ALVtree.
    FIELDCATALOG-FIELDNAME = 'EBELN'. "Field name in itab
    FIELDCATALOG-SCRTEXT_M = 'Purchase Order'. "Column text
    FIELDCATALOG-COL_POS = 0. "Column position
    FIELDCATALOG-OUTPUTLEN = 15. "Column width
    FIELDCATALOG-EMPHASIZE = 'X'. "Emphasize (X or SPACE)
    FIELDCATALOG-KEY = 'X'. "Key Field? (X or SPACE)
    fieldcatalog-do_sum = 'X'. "Sum Column?
    fieldcatalog-no_zero = 'X'. "Don't display if zero
    APPEND FIELDCATALOG TO GD_FIELDCAT.
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'EBELP'.
    FIELDCATALOG-SCRTEXT_M = 'PO Iten'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 1.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'STATU'.
    FIELDCATALOG-SCRTEXT_M = 'Status'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 2.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'AEDAT'.
    FIELDCATALOG-SCRTEXT_M = 'Item change date'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 3.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'MATNR'.
    FIELDCATALOG-SCRTEXT_M = 'Material Number'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 4.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'MENGE'.
    FIELDCATALOG-SCRTEXT_M = 'PO quantity'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 5.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'MEINS'.
    FIELDCATALOG-SCRTEXT_M = 'Order Unit'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 6.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'NETPR'.
    FIELDCATALOG-SCRTEXT_M = 'Net Price'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 7.
    FIELDCATALOG-DATATYPE = 'CURR'.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'PEINH'.
    FIELDCATALOG-SCRTEXT_M = 'Price Unit'.
    FIELDCATALOG-OUTPUTLEN = 15.
    FIELDCATALOG-COL_POS = 8.
    APPEND FIELDCATALOG TO GD_FIELDCAT..
    CLEAR FIELDCATALOG.
    ENDFORM. " build_fieldcatalog
    *& Form build_layout
    text
    --> p1 text
    <-- p2 text
    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 build_hierarchy_header
    text
    <--P_GD_HIERARCHY_HEADER text
    FORM BUILD_HIERARCHY_HEADER CHANGING
    P_HIERARCHY_HEADER TYPE TREEV_HHDR.
    P_HIERARCHY_HEADER-HEADING = 'Hierarchy Header'(013).
    P_HIERARCHY_HEADER-TOOLTIP = 'This is the Hierarchy Header !'(014).
    P_HIERARCHY_HEADER-WIDTH = 30.
    P_HIERARCHY_HEADER-WIDTH_PIX = ''.
    ENDFORM. " build_hierarchy_header
    *& Form build_report_title
    text
    -->P_GD_REPORT_TITLE text
    -->P_GD_LOGO text
    FORM BUILD_REPORT_TITLE USING PT_REPORT_TITLE TYPE SLIS_T_LISTHEADER
    P_GD_LOGO TYPE SDYDO_VALUE.
    DATA: LS_LINE TYPE SLIS_LISTHEADER,
    LD_DATE(10) TYPE C.
    List Heading Line(TYPE H)
    CLEAR LS_LINE.
    LS_LINE-TYP = 'H'.
    ls_line-key "Not Used For This Type(H)
    LS_LINE-INFO = 'PO ALVTree Display'.
    APPEND LS_LINE TO PT_REPORT_TITLE.
    Status Line(TYPE S)
    LD_DATE(2) = SY-DATUM+6(2).
    LD_DATE+2(1) = '/'.
    LD_DATE3(2) = SY-DATUM4(2).
    LD_DATE+5(1) = '/'.
    LD_DATE+6(4) = SY-DATUM(4).
    LS_LINE-TYP = 'S'.
    LS_LINE-KEY = 'Date'.
    LS_LINE-INFO = LD_DATE.
    APPEND LS_LINE TO PT_REPORT_TITLE.
    Action Line(TYPE A)
    CLEAR LS_LINE.
    LS_LINE-TYP = 'A'.
    CONCATENATE 'Report: ' SY-REPID INTO LS_LINE-INFO SEPARATED BY SPACE.
    APPEND LS_LINE TO PT_REPORT_TITLE.
    ENDFORM. " build_report_title
    *& Form build_variant
    text
    --> p1 text
    <-- p2 text
    FORM BUILD_VARIANT .
    Set repid for storing variants
    GD_VARIANT-REPORT = SY-REPID.
    ENDFORM. " build_variant
    Reward points for useful Answers
    Regards
    Anji

  • Re: Display format in ALV report

    Hi Expert,
    I have develop an alv report with some like lifnr,name1,dmbtr,budat,zterm, But my requiremnt is output should come in
    the below format like
    vendor number   vendor name   payment tern     jan          feb                mar            april       ...................... upto december.
                                                                               no  value   no  value     no value    no value ..................
    Abouce is my report format below jan i have two fields  no and value for  i have written code output is comming in alv but it
    is not commig in the above format
    My code is
    TYPE-POOLS: SLIS.
    TABLES: LFA1,BSAK,BSIK.
    TYPES: BEGIN OF TY_LFA1,
           LIFNR TYPE LFA1-LIFNR,   "VENDOR NUMBER
           NAME1 TYPE LFA1-NAME1,   "VENDOR NAME
           END OF TY_LFA1.
    TYPES: BEGIN OF TY_BSIK,
           LIFNR TYPE BSIK-LIFNR,    "VENDOR NUMBER
           DMBTR TYPE BSIK-DMBTR,    "AMOUNT IN  LOCAL CURRENCY
          WMWST TYPE BSIK-WMWST,    "TAX AMOUNT IN DOCUMENT CURRENCY
           BUDAT TYPE BSIK-BUDAT,    "POSTING DATE
           ZTERM TYPE BSIK-ZTERM,    "TERM OF PAYMENT
           END OF TY_BSIK.
    TYPES: BEGIN OF TY_OUTPUT,
            LIFNR TYPE LFA1-LIFNR,
            NAME1 TYPE LFA1-NAME1,
            DMBTR TYPE BSIK-DMBTR,
            BUDAT TYPE BSIK-BUDAT,
            ZTERM TYPE BSIK-ZTERM,
            NEW TYPE SY-DATUM,
            END OF TY_OUTPUT.
    SELECT T1~LIFNR
           T1~NAME1
           T2~DMBTR
           T2~BUDAT
           T2~ZTERM
              INTO TABLE GT_OUTPUT FROM LFA1 AS T1 INNER JOIN BSIK AS T2
               ON T1LIFNR = T2LIFNR
               WHERE T1~LIFNR IN S_LIFNR
               AND T2~BUDAT IN S_BUDAT
               AND ZTERM NE ' '.
    and then i have use alv function module REUSE_ALV_GRID_DISPLAY..........................
    How to display the report in the above format
    can any one throw some light in this..............
    Regards,
    Addu

    Dear Koolspy,
    You are correct i have check in the table BSIK their is one field called SHKZG for credit and debt please can you let me know how to wrtie this in my code my main logic is below.
    SELECT T1~LIFNR
           T1~NAME1
           T2~DMBTR
           T2~BUDAT
           T2~ZTERM
            INTO TABLE GT_OUTPUT FROM LFA1 AS T1 INNER JOIN BSIK AS T2
               ON T1LIFNR = T2LIFNR
               WHERE T1~LIFNR IN S_LIFNR
               AND T2~BUDAT IN S_BUDAT
               AND ZTERM NE ' '.
       LOOP AT GT_OUTPUT INTO WT_OUTPUT.
       WT_FINAL-LIFNR = WT_OUTPUT-LIFNR.
       WT_FINAL-NAME1 = WT_OUTPUT-NAME1.
       WT_FINAL-DMBTR = WT_OUTPUT-DMBTR.           "Amount
       WT_FINAL-NEW   = WT_OUTPUT-BUDAT+4(2).      "posting date
       WT_FINAL-ZTERM = WT_OUTPUT-ZTERM.
        APPEND WT_FINAL TO IT_FINAL.
        CLEAR WT_FINAL.
        ENDLOOP.
    LOOP AT IT_FINAL INTO WT_FINAL.
    COLLECT WT_FINAL INTO GT_OUTPUT5.
    ENDLOOP.
    LOOP AT GT_OUTPUT5 INTO WT_OUTPUT5.
      WT_OUTPUT2-LIFNR = WT_OUTPUT5-LIFNR.
      WT_OUTPUT2-NAME1 = WT_OUTPUT5-NAME1.
    WT_OUTPUT2-DMBTR = WT_OUTPUT5-DMBTR.
    WT_OUTPUT2-NEW   = WT_OUTPUT5-NEW.
      WT_OUTPUT2-ZTERM = WT_OUTPUT5-ZTERM.
      IF WT_OUTPUT5-NEW = '01'.                                "2
      MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JAN.
                     "2
      ELSEIF WT_OUTPUT5-NEW = '02'.
        MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-FEB.
        ELSEIF WT_OUTPUT5-NEW = '03'.
         MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-MAR.
          ELSEIF WT_OUTPUT5-NEW = '04'.
            MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-APR.
          ELSEIF WT_OUTPUT5-NEW = '05'.
             MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-MAY.
          ELSEIF WT_OUTPUT5-NEW = '06'.
             MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JUN.
          ELSEIF WT_OUTPUT5-NEW = '07'.
             MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JUL.
           ELSEIF WT_OUTPUT5-NEW = '08'.
             MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-AUG.                  "5
             ELSEIF WT_OUTPUT5-NEW = '09'.                             "
               MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-SEP.
                ELSEIF WT_OUTPUT5-NEW = '10'.
                  MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-OCT.
                ELSEIF WT_OUTPUT5-NEW = '11'.
                  MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-NOV.
                  ELSEIF WT_OUTPUT5-NEW = '12'.
                    MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-DEC.
                 MODIFY GT_OUTPUT2 FROM  WT_OUTPUT2.
        ENDIF.
    APPEND WT_OUTPUT2 TO GT_OUTPUT2.
    collect WT_OUTPUT2 inTO GT_OUTPUT2.
    COLLECT WT_FINAL INTO GT_OUTPUT5.
    clear : wt_output2.
      ENDLOOP.
    Please let me know where to insert that SHKZG field.
    Regards,
    Am

  • Date format in obiee reports

    HI guys
    i got two obiee server running in our env . both are identical . on one server when ever we rite any report with date column in it it comes up with dd/mm/yyyy output on another server if we right any report all the date column comes with dd mon yyyy format .. i want both of them should show date like dd mon yyyy format .. i checked all the conf files are both are looking same still not able to figure out where should i change for this to work .
    please let me know if you need more info from my end.
    Regards,
    Dev

    HI Kishore
    Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
    1. nqsconfig date format
    its same for both the two installations
    DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
    DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
    TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
    2. make sure that you didn't save date format in column properties from front-end
    Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
    3. Did you mention anything in connection pool settings to set date format.
    no we havan't mention anything in connection pool
    4. Make sure that you are connecting to same database, and date format set for date is same here and there
    yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
    " hw i can check this
    finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
    no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
    please let me know if you need more info
    Regards,
    Dev

  • Date format in Discovere Reports

    We have created a workbook with a parameter which is supposed to show up an LOV for a parameter in the MON-RR format. Now this LOV shows up
    correctly in the Discoverer Desktop edition as MON-RR format, but when we view
    the same in Discoverer Viewer it shows up as DD-MON-RRRR.
    Earlier we had got a partial resolution on this issue (TAR 3891425.996), wherein by changing the ICX
    profile value in Oracle Applications, we are able to set the date mask to MON-R
    R.
    But now the above profile applies to all the reports and all the dates show up as MON-RR, whereas we want to continue showing the date in DD-MON-RRRR forma
    t in some of the reports.
    How can this be achieved ?

    HI Kishore
    Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
    1. nqsconfig date format
    its same for both the two installations
    DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
    DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
    TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
    2. make sure that you didn't save date format in column properties from front-end
    Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
    3. Did you mention anything in connection pool settings to set date format.
    no we havan't mention anything in connection pool
    4. Make sure that you are connecting to same database, and date format set for date is same here and there
    yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
    " hw i can check this
    finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
    no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
    please let me know if you need more info
    Regards,
    Dev

  • Regarding excel download from ALV report tree

    Hi Experts,
    I have a ALV report tree program. In that i need the functionality to download report output in excel file.
    Can any body suggest how can i achieve download to excel functionality in it.
    Any useful suggestion will be appreciated.
    Thanks in advance,
    Akash

    The data for the tree exist in the NODE table in a different format. So, even you download that table, it will not be downloaded in the TREE format. So, the user will not be able to understand the data unlike the case of a ALV GRID.
    Whether it is a TREE / GRID, ultimately its the data of a internal table, that gets downloaded. But in case a TREE, we don't have the data in a straight forward way . i thnk it is not possible . i am not sure too for this .

  • Regarding download of the ALV report to excel

    Hi experts,
    I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
    There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
    Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
    But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
    regards,
    charles.

    Actually now I think there is another way to do this, storing file on application server can create problems as sometimes the users don't have directory write access or things like that.
    Instead you should export your data to a memory or database cluster and import it back using abother program.
    The proposed changes would be
    1: At the point you are calling your alv grid function, check if the sy-batch is 'X' for background job, if yes than export to database table INDX or you can create your own. suppose your data is in internal table ITAB than in case of background job, you will do
    data: keyf like indx-srtfd.
    *We just assign username, date time to this
    concatenate sy-uname sy-datum sy-uzeit into keyf.
    EXPORT itab TO DATABASE indx(ZZ) ID keyf.
    check for subrc if export is successfull.
    Now you have stored your itab in database for later processing. remember to have keyf. In case of background job you can have it write in the output so from spool output you can check what was the keyf to use.
    You have to write another program to import itab from database and download it or display it.....
    This program will have keyf as input parameter and you must define ITAB same as the orignal program.
    parameters: p_keyf like like indx-srtfd.
    import itab from database indx(ZZ) id keyf.
    *Now you have itab. do whatever you want with it. download it using GUI_DOWNLOAD function or display it in an ALV grid.......
    Hope you got the overall idea.

Maybe you are looking for

  • What are the expected implications in implentation of Fund Management.

    Dear All, We are in the live Environment of ECC 6.0, currently we have FICO and HR module Implemented. we have been gone live since January 2007. In FI, we have GL, AR, AP, Fixed Assets. Banking, IM and PS.In treasury we have loan management and Time

  • How to write 'into' a PDF-document ?

    hi there, i have a new small project to do with the following problem: i get a file (text-file) with invoices from an external system. I want to 'overlay' this file with a form, which is a PDF-document. the question is: is it possible to write 'into

  • Since installing Yosemite, my iMac isn't saving Notification preferences.

    Since installing Yosemite, my iMac isn't saving Notification preferences. I know it's an issue, because I've seen it in other forums. Any help?

  • Console won't Connect and wierd password prompt.

    Hi, I have a Nintendo DS Lite console and I am trying to access the internet. When I do access the internet my DS kept saying "connection error." Afterthat my game freezes. The game that I am using to connect to the internet is Pokemon Platinum. Also

  • Consulta sobre "Lightwindow"

    Amigos Antes que nada "Felices Fiestas" para todos, no pude mandar saludos antes ni escribir mucho al grupo porque (me imagino que como a todos en realidad) este fin de año me sorprendió con miles de cosas por terminar, y muy poco tiempo para cada un