Skip to Content
author's profile photo Former Member
Former Member

ALV

I HAVE AN ALV REPORT WHERE I AM DISPLAYING DATE AS ONE FIELD BUT I DONOT REQUIRE TO DISPLAY IT FULLY ONLY THE DAY AND MONTH SHOULD DISPLAY. CAN ANYONE PROVIDE ME SOLUTION FOR THIS.

THANKS IN ADVANCE

RAJESH.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Jun 19, 2006 at 11:09 AM

    Hi,

    Just check this Programm..

    REPORT  ZTEST_ALV_CHECK     message-id zz           .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT type slis_layout_alv.
    
    
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          erdat like vbap-erdat,
         END OF ITAB.
    
    SELECT VBELN
           POSNR
           erdat
           FROM VBAP
           UP TO 100 ROWS
           INTO TABLE ITAB.
    
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    
    X_FIELDCAT-FIELDNAME = 'ERDAT'.
    X_FIELDCAT-SELTEXT_L = 'ERDAT'.
    <b>X_FIELDCAT-edit_mask = '__.__'.</b>
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    
    
    
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
      TABLES
        T_OUTTAB                 = ITAB
      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.

    with the help of edit_mask you can do that...

    Regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 11:16 AM

    Use EDIT MASK option in the field catalog to specify a conversion exit that would format date

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2006 at 10:51 AM

    concatenate date+2(2)

    date+0(2)

    inro v_var.

    Use this v_var as the variable to be displayed.

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 10:51 AM

    You need to add two more fields to the field catalog and the internal table of CHAR type. Then you can get the data using the offset of the date.

    DAY = date+6(2)

    Month = date+4(2).

    Now you can display the day and month in the ALV report.

    Regards,

    Ravi

    Note : Please mark the helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 10:53 AM

    Hi ,

    u can use offset of date or fields like s031-spmon.

    Regards

    Prbahu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 10:57 AM

    Hi,

    data: date like sy-datum.

    data: date1 like sy-datum.

    data: date2(10) type c.

    date = 050102 (as your format).

    move: date to date_8.

    write date1 to date2.

    write: date2.

    Use the conversion.

    rgds,

    Jothi.

    Mark useful ans.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.