Skip to Content

Column in ALV

Hi All,

In ALV, i want to display two columns within one column...

How do i do?

Plz help me to comeout from this issue...

Thanks,

Vimal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 01, 2010 at 09:16 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2010 at 04:38 AM

    hi

    i dont get you clearly. You are saying you need to have 3 coloumns only but 2nd column should be divided into two. Please explain little bit clear..

    Regards

    Vinodh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 02, 2010 at 07:11 AM

    Hi Vimal,

    With lot of formattings you can get the output like that ...

    Check the Following code which gives similar o/p, you can refer this to get better idea. Take a look of the snap shot also...

    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,
          x_events type slis_alv_event,
          it_events type SLIS_T_EVENT.
     
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          MALE type i,
          female type i,
         END OF ITAB.
     
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 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 = 'MALE'.
    X_FIELDCAT-SELTEXT_L = 'MALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'FEMALE'.
    X_FIELDCAT-SELTEXT_L = 'FEMALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
      x_events-NAME = SLIS_EV_TOP_OF_PAGE.
      x_events-FORM = 'TOP_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
     
      L_LAYOUT-NO_COLHEAD = 'X'.
     
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
        it_events                = it_events
      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.
     
    FORM TOP_OF_PAGE.
     
    *-To display the headers for main list
        FORMAT COLOR COL_HEADING.
            WRITE: / SY-ULINE(103).
        WRITE: /   SY-VLINE,
              (8) ' ' ,
                   SY-VLINE,
              (8)  ' ' ,
                   SY-VLINE,
              (19) 'SEX'(015) centered,
                   sy-vline.
     
        WRITE: /   SY-VLINE,
              (8) 'VBELN'(013) ,
                   SY-VLINE,
              (8) 'POSNR'(014) ,
                   SY-VLINE,
              (8) 'MALE'(016) ,
                   sy-vline,
               (8)  'FMALE'(017) ,
                   sy-vline.
     
        FORMAT COLOR OFF.
     
    ENDFORM.
    

    snap shot: [http://img100.imageshack.us/img100/3846/output6ef.th.gif]

    Regards,

    Anand

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 09:44 AM

    Hi,

    I think multi cells are available from 7.02.

    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.