Home > Default > ALV grid with 2 labels on the output

ALV grid with 2 labels on the output

October 11Hits:1
Advertisement
Hi,
I am trying ALV  Grid with two labels using Function modules.
in the output, it should appear like...
Header1 | Header2 | Header3 | Header4 |
T21
T22
T31
T32
First line is for Header lable and second line is for item lable under corresponding Header labels.
Pls. can any suggest me a solution for this..
Thanks
PRa

Answers

Using the Gird Functions it is not possible, you can get the with the help of ALV list function.
If you use this aproach you will loose some Functionalities, Your Report Output will Distorted.
cehck this image..
http://img100.imageshack.us/img100/3846/output6ef.th.gif
REPORT ZTEST_ALV 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) '***'(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.

Read other 6 answers

Tags:

Related Articles

  • ALV grid with 2 labels on the outputOctober 11

    Hi, I am trying ALV  Grid with two labels using Function modules. in the output, it should appear like... Header1 | Header2 | Header3 | Header4 | T21 T22 T31 T32 First line is for Header lable and second line is for item lable under corresponding Hea

  • ALV grid disply with edit columns in outputOctober 11

    Hi all,   i am using   CALL METHOD MY_GRID->SET_TABLE_FOR_FIRST_DISPLAY to display the output in alv format.there is  3 edit columns in output display.    if i fill one field & then put 'ENTER' then other two fields of that row should be filled wit

  • How to add radiobuttons in ALV GridOctober 11

    Hi, I refered the threads in SDN but i am not able to get proper solution for my requirement. I am displaying output in ALV Grid format. After displaying the output i mean in the output screen i need few buttons and radio buttons . when user selects

  • Want to display more than 300 charcters in a column using ALV grid displayNovember 30

    Hi Guru's, I am trying to display more than 500 charcters in a column using alv grid display but it in the output it is showing only 128 characters. Can you help me to display all the characters in particular column Or is there any limitation in maxi

  • ALV Grid Report using OOPSNovember 30

    Hi Friends, I have to develop the ALV Grid report using the Classes ie OOPS, as i am new to OOPS and know little bit of ALV,  so it will be little bit tough to develop the object so plz try to solve my query. I'm sending the Functional specs: The pro

  • Displaying Total Text in an ALV GridNovember 30

    Hi Experts,               Please suggest me how to display the Total text in the alv grid using CL_SALV_FACTORY method.              Example Output:              Field1            Field2         Field3              a                    b             

  • FIeld headings in ALV Grid by labelOctober 11

    Hi I want disply the headings in alv grid display like this format. I want write my own label in the output. (not in Normal LIST DISPLAY) Sno |      Sname |    Marks     |           |     M1 |  M2  | M3 How it is possible? Edited by: Krishna Bommiset

  • Need to add Header  and footer in an alv grid display output.October 11

    How can I add header and footer in an alv grid dispay output. For the grid display, I am using the function module "REUSE_ALV_GRID_DISPLAY".HI, call function 'REUSE_ALV_GRID_DISPLAY'        exporting             i_callback_program      = gd_repi

  • F4 - Help for field in ALV Grid OutputOctober 11

    Hi, I generated a report which gives output in ALV Grid output. In the output, 1 of the field is editable.Here, for this field I need to have my own F4-Help. I think the procedure to be followed is:-- Create a Search Help in SE11. Link the Search Hel

  • How to send the ALV GRID output to spool by using the print button in std tOctober 11

    How to send the ALV GRID output to spool by using the print button in standard tool bar. We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid outpu

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.773 s.