2007 Apr 20 10:52 AM
Hi Guys,
I have to display 2 ALV List in a single display mode. Its coming as expected.
But the things is, i have to display 2 headers for 1 ALV display.
For Example : HLX1 HLX2....
HLY1 HLY2.....
V1 V2 .....
Where H ... is Header & V1 are Internal table values.
I have to display it ALV List. Is it possible to do so.
Apprciate your Help.
Regards,
Anbalagan
Hi Guys,
I have to display 2 ALV List in a single display mode. Its coming as expected.
But the things is, i have to display 2 headers for 1 ALV display.
For Example : HLX1 HLX2....
HLY1 HLY2.....
V1 V2 .....
Where H ... is Header & V1 are Internal table values.
I have to display it ALV List. Is it possible to do so.
Apprciate your Help.
Regards,
Anbalagan
2007 Apr 20 11:05 AM
Hi..
You must be passing two container to get two alv output.....
while buiding layoot setting for each of this alv...
u can pass grid-title separately...
hope this helps..
Thanks..
2007 Apr 20 11:05 AM
Hi,
Try with all these.
Check this link:
http://abap4.tripod.com/download/alvstub.txt
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_endlist.htm
data: o_html TYPE REF TO cl_dd_document,
o_event_receiver TYPE REF TO lcl_event_receiver.
CLASS lcl_event_receiver IMPLEMENTATION.
*-- Top of Page
METHOD handle_print_top_of_page.
ENDMETHOD. "handle_print_top_of_page
METHOD handle_top_of_page.
ENDMETHOD. "handle_top_of_page
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
CREATE OBJECT o_dockingcontainer
EXPORTING
ratio = '95'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-013. " Error in object creation
LEAVE LIST-PROCESSING.
ENDIF.
*--Create Splitter Container
CREATE OBJECT o_split
EXPORTING
parent = o_dockingcontainer
sash_position = 20
with_border = 0
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
*--Get the containers of the splitter control
o_container_top = o_split->top_left_container.-TOP
o_container_bot = o_split->bottom_right_container. -ALV
ENDIF.
CREATE OBJECT o_alvgrid
EXPORTING
i_parent = o_container_bot.
*-- Print Top of Page
DATA: lws_text TYPE sdydo_text_element.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
*-- Object for HTML top container
CREATE OBJECT o_html
EXPORTING style = 'ALV_GRID'
background_color = 35.
*-- Top of Page
CALL METHOD o_alvgrid->list_processing_events
EXPORTING
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = o_html.
*
*-- Total Record Text
CALL METHOD o_html->add_text
EXPORTING
text = text-014
sap_emphasis = text-017.
*
CALL METHOD o_html->add_gap
EXPORTING
width = 8.
**-- Total record Value
lws_text = cnt_total.
CALL METHOD o_html->add_text
EXPORTING
text = lws_text
sap_emphasis = text-017.
CLEAR lws_text.
CALL METHOD o_html->new_line
EXPORTING
repeat = 1.
*
**-- Total Success text
CALL METHOD o_html->add_text
EXPORTING
text = text-015
sap_emphasis = text-017
fix_lines = c_x.
*
CALL METHOD o_html->add_gap
EXPORTING
width = 12.
lws_text = cnt_success.
CALL METHOD o_html->add_text
EXPORTING
text = lws_text
sap_emphasis = text-017
fix_lines = c_x.
CLEAR lws_text.
CALL METHOD o_html->new_line
EXPORTING
repeat = 1.
*-- Total Failed text
CALL METHOD o_html->add_text
EXPORTING
text = text-016
sap_emphasis = text-017
fix_lines = c_x.
CALL METHOD o_html->add_gap
EXPORTING
width = 16.
lws_text = cnt_failed.
CALL METHOD o_html->add_text
EXPORTING
text = lws_text
sap_emphasis = text-017
fix_lines = c_x.
CLEAR lws_text.
*-- Display Report Header
CALL METHOD o_html->display_document
EXPORTING
parent = o_container_top.
ENDIF.
Don't forget to reward if useful...
2007 Apr 20 11:06 AM
Hi,
displaying 2 headers is not possible in ALV.
Instead you use 2 ALV grids/lists one after the other.
reward if useful
regards,
ANJI
2007 Apr 20 11:07 AM
2007 Apr 20 12:15 PM
HI,
Try this in the LISTHEADER
FORM Z_LISTHEADER USING P_I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: L_LISTHEADER TYPE SLIS_LISTHEADER.
REFRESH P_I_LISTHEADER.
CLEAR L_LISTHEADER.
L_LISTHEADER-TYP = 'H'.
L_LISTHEADER-INFO = TEXT-001.
APPEND L_LISTHEADER TO P_I_LISTHEADER.
CLEAR L_LISTHEADER.
L_LISTHEADER-TYP = 'H'.
L_LISTHEADER-INFO = TEXT-002.
APPEND L_LISTHEADER TO P_I_LISTHEADER.
and write the header texts in the text-001 and text-002 by double clicking.
Reward points if helpful,
Shreya.
2007 Apr 20 12:16 PM