Register Login

Date Field is not displayed in ALV report.

Updated May 18, 2018

Hi guys,
 
I need little help please. I create ALV report but date field is not displayed
correctly.
When I debug it has value 30092009 and it is displayed on screen like 09.20.3009
 
It should look like this on screen 30.09.2009, (in debug it should have value 20090930)
 
Do you know how to solve this?


Comments

  • 01 Nov 2009 5:09 am rekha
    incude a character field of length 10 in your final internal table.
    data: wrk_date(10) .

    then in the loop.. endloop of the final internal table

    suppose sy-datum is varibale which need conversion.

    ** USE THE BELOW CODE FOR CONVERSION.

    WRITE sy-datum TO wrk_date USING EDIT MASK '__.__.____' .
  • 01 Nov 2009 5:11 am saperpguru
    u should change the variable value -> '20090930' (type datum)
    and the ALV screen report should be like 30.09.2009
  • 01 Nov 2009 5:12 am rekha
    dear Nihad,
    use the following codeing

    day = po_date+0(2) .
    year = po_date+6(4) .

    month = po_date+3(2) .

    and finally concatenate all as day year month u will get required o/p.
  • 01 Nov 2009 5:12 am saperpguru
    I use the following 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.
    In table it_stanja is date field. I need to change its value.
  • 01 Nov 2009 5:12 am rekha
    you need to use the standard SAP date conversion routines.. which take into account your local settings also..

    Loop at ASSIGNING
    CALL FM for date conversion
    MOVE to -
    ENDLOOP.

    that should work..
    • 01 Nov 2009 5:16 am rekha
      put it_stanja-date instead of po_date in my coding
      u will get required result.

    ×