Top of page in Block list ALV
HI,
I have a Requirement where i have a Block list ALV . I have 4 blocks to be Displayed in the output and the output has to be transfered to the PDF.
I am able to get the 4 blocks in the output and the Top of Page for the Report in each page.
But the Problem is when i download the output containing the top of page of output with 4 blocks into a PDF.
I want the Top of page of Report to be the Top of Page of the PDf also.
In PDF the Top of page of Report is coming in the center of the PDF also in some other places also.
How to make sure the Top of page of Report comes in the top of the PDf
Can you kinldy help me in this.
Thanks,
Gokul
Duplicate post.
Reported.
Similar Messages
-
Regarding Excel Download in Block list ALV
Hi Abaper's,
I am facing with one problem during downloading of the BlockList ALV.
<b>If I click on the standart toolbar 'local file button '( ctrl + shift + F9) it is downloading the ALV data into the excel file but the ALV header information starts from column 1 and ALV data information starts from the 2nd column.</b>
Please suggest me is it the expected functionality of the Block List ALV or I have written wrong code. Please suggest me.I think there is something wrong with the output...maybe you should check your fieldcatalog wheter it matches to the structure of your internal table of data you want to show.
Normally you should get an output per column with the fieldnames in the first line starting with 1st column and the data starting in 2nd line starting with 1st col.
hope that helps you off, please award if useful!
Clemens -
Hi All,
I want output in below format
***************************Page Heading****************
List heading 1********************
LIST 1
List Footer 1**********************
List heading 2********************
LIST 2
List Footer 2**********************
List heading 3********************
LIST 3
List Footer 3**********************
I am trying with below code for two list but the order of Page heading and List heading 1 is interchanged. Please tell me whats the problem or please correct the part of code cuz of with the order is not coming correct.
<b>code :</b>
*& Report ZTEST_IZHAR
REPORT ZTEST_IZHAR.
Declarations for BLOCK ALV DISPLAY
*--type pools
TYPE-POOLS:slis.
DATA:x_layout TYPE slis_layout_alv,
t_field TYPE slis_t_fieldcat_alv,
*--field catalog
x_fldcat LIKE LINE OF t_field,
*--to hold all the events
t_events TYPE slis_t_event,
x_events TYPE slis_alv_event,
t_sort TYPE slis_t_sortinfo_alv,
x_sort LIKE LINE OF t_sort ,
*--Print Layout
x_print_layout TYPE slis_print_alv.
*----Macro to add field catalog.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
DEFINE add_catalog.
clear x_fldcat.
x_fldcat-fieldname = &1.
x_fldcat-seltext_m = &2.
x_fldcat-outputlen = &3.
x_fldcat-tech = &4.
x_fldcat-col_pos = &5.
x_fldcat-no_zero = 'X'.
x_fldcat-ddictxt = 'M'.
x_fldcat-datatype = &6.
x_fldcat-ddic_outputlen = &7.
if &6 = 'N'.
x_fldcat-lzero = 'X'.
endif.
*--build field catalog
append x_fldcat to t_field.
END-OF-DEFINITION.
*----- data declerations.
data: v_repid like sy-repid.
data: begin of itab occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
meins like mara-meins,
end of itab.
data: begin of jtab occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of jtab.
select matnr ernam meins
up to 20 rows
from mara
into table itab.
select matnr maktx
up to 20 rows
from makt
into table jtab.
v_repid = sy-repid.
*DISPLAY alv
Initialize Block
call function 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
*Block 1:
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '18' '' '1' 'C' '18',
'ERNAM' 'Created By' '12' '' '2' 'C' '12',
'MEINS' 'Unit' '5' '' '3' 'C' '3'.
*--build table for events TOP OF PAGE.
x_events-form = 'TOP_OF_PAGE'.
x_events-name = slis_ev_top_of_page.
append x_events to t_events.
*--build table for events TOP OF LIST1.
x_events-form = 'TOP_OF_LIST1'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
*--build table for events END OF LIST1.
x_events-form = 'END_OF_LIST1'.
x_events-name = slis_ev_end_of_list.
append x_events to t_events.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'ITAB'
it_events = t_events
it_sort = t_sort
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*--BLOCK 2(SUMMARY REPORT)
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '20' '' '1' 'C' '18',
'MAKTX' 'Description' '40' '' '2' 'C' '40'.
*--build table for events TOP OF LIST2.
x_events-form = 'TOP_OF_LIST2'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
*--build table for events END OF LIST2.
x_events-form = 'END_OF_LIST2'.
x_events-name = slis_ev_end_of_list.
append x_events to t_events.
Append table block.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'JTAB'
it_events = t_events
TABLES
t_outtab = jtab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*--CALL FM TO DISPLAY THE BLOCK REPORT.
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exporting
is_print = x_print_layout
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
text
form top_of_page.
skip 1.
WRITE: / '*******************************************'.
WRITE : /10 'TOP OF PAGE'.
WRITE: / '*******************************************'.
skip 1.
perform sub_display_heading.
format reset.
endform. "top_of_list2
*& Form top_of_list1
text
form top_of_list1.
skip 3.
write: /5 'TOP OF LIST 1'.
skip 1.
format reset.
endform. "top_of_list1
*& Form end_of_list2
text
form end_of_list1.
skip 1.
write: /5 'END OF LIST 1'.
skip 1.
format reset.
endform. "top_of_list2
*& Form top_of_list2
text
form top_of_list2.
skip 1.
write: /5 'TOP OF LIST 2'.
skip 1.
format reset.
endform. "top_of_list2
*& Form end_of_list2
text
form end_of_list2.
skip 1.
WRITE: /5 'END OF LIST 2'.
skip 1.
format reset.
endform. "top_of_list2
*& Form sub_display_heading
text
FORM sub_display_heading .
ENDFORM. " sub_display_headingHi ABAP related,
Why dont you debug and see the scene yourself?
Do not accumulate with this record.
Total Questions: 77 (37 unresolved)
Cheers -
Top Of Page not triggering in ALV
Hi
I am using ALV List Disaply. I have a itab that has 2000 Rows. When i scoll down, the header appears at the top always. Now i added the following code to trigger a Top of Page Event.
FORM xevents.
CLEAR xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'XTOP_OF_PAGE'.
APPEND xs_event TO gt_xevents.
CLEAR xs_event.
ENDFORM.
FORM xtop_of_page.
BREAK-POINT.
WRITE: / 'X_TOP_OF_PAGE'.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = st_layout
it_fieldcat = fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
it_filter = filttab[]
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = gt_xevents
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = alv_tab[]
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.this may be help u ....
t_gt_events type slis_t_event,
form display_alv.
v_repid = sy-repid.
sort vit_final by flag vbeln .
perform get_top_of_page using t_gt_events[].
gs_keyinfo-header01 = 'DISPO'.
gs_keyinfo-item01 = 'DISPO'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = vfl_layout
it_fieldcat = vit_fieldcat
IT_EXCLUDING =
it_special_groups =
it_sort = vit_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = ' '
IT_EVENTS = t_gt_events[]
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
tables
t_outtab = vit_final
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.
endform. " DISPLAY_ALV
*& Form get_top_of_page
text
--> p1 text
<-- p2 text
form get_top_of_page using t_gt_events type slis_t_event.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = t_gt_events.
read table t_gt_events with key name = slis_ev_top_of_page
into ls_event.
move c_formtop to ls_event-form.
append ls_event to t_gt_events.
endform. " get_top_of_page -
To display the typ, key field,info in the top-of -page event in OO ALV
Hi all,
I need to display the heading and the other select option details in the top-of-page event in ooalv.How can the key ,typ and the info of top of event in alv grid be passed in ooalv grid display.
Regards,
ArpitaCheck the blog.
TOP_OF_PAGE in ALV Using CL_GUI_ALV_GRID
Now you have to use the method ADD_TEXT to populate the Select options details.
I hope you know the Function to get the selection details
RS_REFRESH_FROM_SELECTOPTIONS,. it will give into a table. so use that table and populate the TOP_OF_PAGE uisng the class CL_DD_DOCUMENT. -
Getting Top odf page in REUSE_ALV_HIERSEQ_LIST_DISPLAY List
Hi
I am using FM: REUSE_ALV_HIERSEQ_LIST_DISPLAY to display the list..
But i didn't get top of page on the same. Can any know abt the same please
give ans with sample code. I would appreciate your prompt help..
thanks,You have to use the EVENTS parameter in this case. Here is a complete example.
report zrich_0001 .
type-pools: slis.
data: begin of head occurs 0,
matnr type afpo-matnr,
maktx type makt-maktx,
expand type c,
end of head.
data: begin of detail occurs 0,
matnr type marc-matnr,
werks type marc-werks,
dispo type marc-dispo,
end of detail.
data: events type slis_t_event,
list_top_of_page type slis_t_listheader,
top_of_page type slis_formname value 'TOP_OF_PAGE'.
start-of-selection.
select matnr maktx from makt
into table head
up to 100 rows.
if not head[] is initial.
sort head ascending by matnr.
select matnr werks dispo into table detail
from marc
for all entries in detail
where matnr = detail-matnr.
endif.
perform call_alv.
* FORM call_alv *
form call_alv.
data: gt_fieldcat type slis_t_fieldcat_alv,
gs_keyinfo type slis_keyinfo_alv,
gs_layout type slis_layout_alv.
data: ls_fieldcat type slis_fieldcat_alv.
clear gs_keyinfo.
gs_keyinfo-header01 = 'MATNR'.
gs_keyinfo-item01 = 'MATNR'.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-reptext_ddic = 'Material'.
ls_fieldcat-tabname = 'HEAD'.
ls_fieldcat-outputlen = 18.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'MAKTX'.
ls_fieldcat-reptext_ddic = 'Description'.
ls_fieldcat-tabname = 'HEAD'.
ls_fieldcat-outputlen = 40.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-reptext_ddic = 'Plant'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 4.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-fieldname = 'DISPO'.
ls_fieldcat-reptext_ddic = 'MRP Controller'.
ls_fieldcat-tabname = 'DETAIL'.
ls_fieldcat-outputlen = 5.
append ls_fieldcat to gt_fieldcat.
gs_layout-expand_fieldname = 'EXPAND'.
perform eventtab_build using events[].
perform comment_build using list_top_of_page[].
data: repid type sy-repid.
repid = sy-repid.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = repid
it_fieldcat = gt_fieldcat[]
is_layout = gs_layout
i_tabname_header = 'HEAD'
i_tabname_item = 'DETAIL'
it_events = events[]
is_keyinfo = gs_keyinfo
tables
t_outtab_header = head
t_outtab_item = detail.
endform.
* EVENTTAB_BUILD
form eventtab_build using events type slis_t_event.
* Registration of events to happen during list display
data: tmp_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = events.
read table events with key name = slis_ev_top_of_page
into tmp_event.
if sy-subrc = 0.
move top_of_page to tmp_event-form.
append tmp_event to events.
endif.
endform.
* COMMENT_BUILD
form comment_build using list_top_of_page type
slis_t_listheader.
data: tmp_line type slis_listheader.
clear tmp_line.
tmp_line-typ = 'H'.
tmp_line-info = 'Here is a line of text'.
append tmp_line to list_top_of_page.
clear tmp_line.
tmp_line-typ = 'S'.
tmp_line-key = 'Key1'.
tmp_line-info = 'Here is a value'.
append tmp_line to list_top_of_page.
clear tmp_line.
tmp_line-typ = 'S'.
tmp_line-key = 'Key2'.
tmp_line-info = 'Here is another value'.
append tmp_line to list_top_of_page.
endform.
* TOP_OF_PAGE
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = list_top_of_page.
endform.
Regards,
RIch Heilman -
Block List ALV Output Send As Email Attachment
Hi, All The ABAP Gurus,
I have made a block ALV Report. I want that this output should be converted into .xls with HTML format and this should be send in email as attachment. This all will be made in a background job which will be scheduled daily.
How can I achieve this? I know that the output of classical report can be attached as pdf in email.But I want in Block ALV.
Thanks in Advance.
Regards,
Bharti Jain
Edited by: Bharti Jain on Jun 28, 2011 10:20 AMHi
Not 100 percent sure what you want to do here. I am confused by the .xls in html format. If you want the output in html you can submit the program and export the list to memory, Then retrieve the list and convert it to html. i have done this with the program 1sdbf12l/rv14akzy . see code below. This converts the output to html, you are left with a binary itab and size at the end of the routine and this can be attached to an email.
Submit Program and export the list to Memory
SUBMIT /1sdbf12l/rv14akzy USING SELECTION-SCREEN '1000'
WITH SELECTION-TABLE lt_params_new EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
Convert the List to html
IF sy-subrc = 0.
DATA: it_html TYPE TABLE OF bapihtml WITH HEADER LINE,
it_html_out TYPE TABLE OF bapihtml WITH HEADER LINE,
lt_html TYPE TABLE OF bapihtml WITH HEADER LINE,
lv_html LIKE LINE OF it_html,
lv_html_out TYPE string.
DATA: lv_html_tab_wide(50000) TYPE c.
DATA: lineno TYPE i, length TYPE i, size TYPE i.
DATA: gui_codepage(4) TYPE n, " added for message 500824
is_unicode TYPE rststype-sel_ok.
DATA: convert_output TYPE xstring,
convert_buffer TYPE xstring.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = lt_list.
CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
EXPORTING
REPORT_NAME =
template_name = 'WEBREPORTING_REPORT'
TABLES
html = it_html
listobject = lt_list.
DESCRIBE TABLE it_html LINES lineno .
DESCRIBE FIELD it_html LENGTH length IN BYTE MODE.
size = length * lineno.
CALL 'CUR_LCL' ID 'GUICP' FIELD gui_codepage.
CALL FUNCTION 'SCP_GET_CODEPAGE_PROPERTIES'
EXPORTING
codepage = gui_codepage
IMPORTING
can_unicode = is_unicode
EXCEPTIONS
codepage_unknown = 1.
IF sy-subrc <> 0.
CLEAR gui_codepage.
ENDIF.
IF is_unicode EQ 'X'. "in case of unicode, always use utf-8
gui_codepage = '4110'.
ENDIF.
CLEAR: convert_output, convert_buffer.
LOOP AT it_html INTO lv_html.
REPLACE ALL OCCURRENCES OF c_bg_def IN lv_html WITH c_bg_white.
CALL FUNCTION 'SCP_TRANSLATE_CHARS'
EXPORTING
inbuff = lv_html
outcode = gui_codepage
csubst = 'X'
substc_space = 'X'
IMPORTING
outbuff = convert_output
EXCEPTIONS
invalid_codepage = 1
internal_error = 2
cannot_convert = 3
fields_bad_type = 4
OTHERS = 5.
IF sy-subrc <> 0.
message i020 raising download_error.
ENDIF.
CONCATENATE convert_buffer convert_output INTO convert_buffer IN
BYTE MODE.
CONCATENATE lv_html_out lv_html INTO lv_html_out.
ENDLOOP.
ev_html_string = lv_html_out.
i = 0.
DESCRIBE FIELD html_tab_converted LENGTH tablength IN BYTE MODE.
WHILE i < XSTRLEN( convert_buffer ).
dummy = XSTRLEN( convert_buffer ) - i.
IF tablength > dummy.
html_tab_converted-line = convert_buffer+i(dummy).
ELSE.
html_tab_converted-line = convert_buffer+i(tablength).
ENDIF.
i = i + tablength.
APPEND html_tab_converted.
ENDWHILE.
et_bin[] = html_tab_converted[].
ev_bin_size = size. -
Top-of-page for list display thru ALV
Hi All,
I was suppose to write a detail report thru ALV, this I have handled thru hotspot and in the user_command,I am have the below code.. for ALv I am using FM REUSE_ALV_GRID_DISPLAY
FORM User_command.
WHEN '&IC1'.
PERFORM LIST_DISPLAY using RS_SELFIELD-tabindex.
ENDFORM.
FORM LIST_DISPLAY USING P_INDEX.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 500.
SET PF-STATUS space.
SUPPRESS DIALOG.
Read table g_t_sum index p_index.
loop at g_t_emp where code = g_t_sum-code and
keyfld = g_t_sum-keyfld
write :/ g_t_emp-pernr, 10(25) g_t_emp-sname.
endloop.
ENDFORM.
The above write statment is not trigerring either top-of-page ot top-od-page during line-selection.
I have even tried pushing the event and form name into it it_events..
Kindly suggest how to go about this, I need to get top-of-page for this list-display.
Thanks in advance
Regards,
Mangalagi S VHi All,
Thanks for all your replies.
I am not looking at top_of_page for GRID, it's working for me but I need top_of_page for the list display that is for the list which I am generating when the users double click it particular row.
By default I am getting the below header automatically.
Dynamic data selection 1
Though I have coded the header in top-of-page during line selection since I am writing the list under USER_COMMAND, I thought I will get the header but it's not..
The FM is attached below..
Ausgaberoutine mit FB REUSE_ALV_GRID_DISPLAY
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_f_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = g_r_layout
it_fieldcat = g_t_fcat
i_save = 'A'
is_variant = s_variant "70492INF0039
is_variant = g_f_variant "70492INF0039
is_events = it_events[]
TABLES
t_outtab = g_t_sum.
FORM USER_COMMAND *
Callbackroutine: Ausgabe Fehlerliste XDGL9CK069538 *
FORM USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'OK'.
WHEN '&IC1'.
PERFORM LIST_DISPLAY using RS_SELFIELD-tabindex.
endcase.
ENDFORM.
Kindly suggest
Thanks in advance.
Regards,
Mangalagi S V -
How to download a Block List based ALV report to PDF file?
Hi Everyone,
I need to display a report in block list alv format using REUSE_ALV_BLOCK_LIST_DISPLAY... I have done this. But my problem comes next.
1. I need to download this report to a pdf file in the user given directory - in presentation server. How can I download this in PDF format.
2. My report has TOP_OF_LIST and END_OF_LIST events. The body of the report contains a table with some material data. There should be 1 table for each material no. There are around 50 records for each material no. So I am looping at the material no. and calling REUSE_ALV_BLOCK_LIST_APPEND.
Now my problem is that I should have only 20 records in each page. How can I determine this? How do I put a page-break?
Please anyone help me.Hi Anwesha
You can send the report output to spool using the IS_PRINT parameter of REUSE_ALV_BLOCK_LIST_DISPLAY FM. Then read the spool number generated and pass it to CONVERT_ABAPSPOOLJOB_2_PDF to get the pdf content which could be downloaded to presentation server.
The splitting of records on count could be done by calling above method with different internal table filtered as per your requirement.
Regards
Ranganath -
To display posting date in alv top of page area for transaction KOB1
I want to display posting date given on selection screen of transaction KOB1 to the alv top of page area on final alv output .
what are the possible solutions ?I want to display posting date given on selection screen of transaction KOB1 to the alv top of page area on final alv output .
what are the possible solutions ? -
Hi All,
I am having a ALV report .Once i execute the report there will be ALV output once i click on the Material no((Hot spot)) in the output it ll take to the another ALV report.The problem is how to get the top of page in the second alv...The top of page in the second ALV should be different..
Is it possible to do this?Pls reply asap.
Thanks
Raj.Hi Arun,
It is not working in the way you have given.
Hi All,
Is there any way to do this ???
Thanks
Raj. -
How to display horizontal line in top-of-page by using object oriented ALV?
How to display horizontal line in top-of-page by using object oriented ALV.
I am created top-of-page in object oriented alv.
But not be successes in showing horizontal line in it.
Can any one pls give solution for this..
Thanks and regards..Hi
Try like this
data: gt_list_top_of_page type slis_t_listheader. " Top of page text.
Initialization.
perform comment_build using gt_list_top_of_page[].
form top_of_page.
* Note to self: the gif must be loaded into transaction OAOR with
* classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions.
* I Loaded NOVALOGO2 into system.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
* I_LOGO = 'NOVALOGO2'
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = gt_list_top_of_page.
endform. " TOP_OF_PAGE
form comment_build using e04_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'A'.
ls_line-info = 'Special'(001).
fgrant = xgrant.
concatenate ls_line-info fgrant
'Stock Option Report to the board'(002)
into ls_line-info separated by space.
condense ls_line-info.
append ls_line to e04_lt_top_of_page.
endform. " COMMENT_BUILD
Use following syntex for footer print in alv:
* For End of Page
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
* For End of Report
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
check this link
http://abapprogramming.blogspot.com/
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
Changing width of a custom container dynamically
Display Page numbers in ALV
Insert picture in selection screen.
Logo in OO ALV Grid
Reward all helpfull answers
Regards
Pavan -
I want define a header like Top Of Page proprty of Reuse ALV in my OO ALV. But I can give only grid title. Can I define a logo and a few subheader in my OO ALV? (Set_Table_For_First_Display)
ThanksHi Mehmet,
i did one sample code, just check it, i documented all required things.
REPORT ZTEST1234_ALV_TOP MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: IT_ROW_NO TYPE LVC_T_ROID,
X_ROW_NO TYPE LVC_S_ROID.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
CELLCOLOR TYPE LVC_T_SCOL, "required for color
DROP(10),
END OF ITAB.
"The Below Definitions Must.....
DATA:
* Reference to document
DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
* Reference to split container
DG_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
* Reference to grid container
DG_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,
* Reference to html container
DG_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER,
* Reference to html container
DG_PARENT_HTML TYPE REF TO CL_GUI_CONTAINER.
"up to here
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO,
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE "event handler
OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
* END_OF_LIST FOR EVENT end_of_list "event handler
* OF CL_GUI_ALV_GRID
* IMPORTING E_DYNDOC_ID.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
* MESSAGE I000 WITH V_ROW 'clicked'.
CLEAR IT_ROW_NO[].
X_ROW_NO-ROW_ID = V_ROW.
APPEND X_ROW_NO TO IT_ROW_NO .
CALL METHOD G_GRID->SET_SELECTED_ROWS
EXPORTING
IT_ROW_NO = IT_ROW_NO.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW.
V_COLUMN = E_COLUMN.
V_ROW_NUM = ES_ROW_NO.
IF E_COLUMN = 'VBELN'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
IF E_COLUMN = 'POSNR'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
ENDIF.
ENDMETHOD. "handle_double_click
* METHOD END_OF_LIST. "implementation
** Top-of-page event
* PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
* ENDMETHOD. "top_of_page
METHOD TOP_OF_PAGE. "implementation
* Top-of-page event
PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
GS_LAYOUT TYPE LVC_S_LAYO.
data: v_lines type i.
data: v_line(3) type c.
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
describe table itab lines v_lines.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
"attention.....from here
"split your container here...into two parts
"create the container
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
"this is for top of page
* Create TOP-Document
CREATE OBJECT DG_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
* Create Splitter for custom_container
CREATE OBJECT DG_SPLITTER
EXPORTING PARENT = G_CUSTOM_CONTAINER
ROWS = 2
COLUMNS = 1.
* Split the custom_container to two containers and move the reference
* to receiving containers g_parent_html and g_parent_grid
"i am allocating the space for grid and top of page
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_HTML.
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_GRID.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 2
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_HTML.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 1
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_GRID.
"you can set the height of it
* Set height for g_parent_html
CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
EXPORTING
ID = 1
HEIGHT = 5.
"from here as usual..you need to specify parent as splitter part
"which we alloted for grid
CREATE OBJECT G_GRID
EXPORTING I_PARENT = DG_PARENT_GRID.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
* SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
DATA: L_INDEX TYPE SY-TABIX.
"Here i am changing the color of line 1,5,10...
"so you can change the color of font conditionally
LOOP AT ITAB.
L_INDEX = SY-TABIX.
IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
LS_CELLCOLOR-FNAME = 'POSNR'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
PERFORM SET_DRDN_TABLE.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
"do these..{
* Initializing document
CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
* Processing events
CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = DG_DYNDOC_ID.
"end }
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-HOTSPOT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
X_FIELDCAT-FIELDNAME = 'DROP'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-DRDN_HNDL = '1'.
X_FIELDCAT-DRDN_ALIAS = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form SET_DRDN_TABLE
* text
FORM SET_DRDN_TABLE.
DATA:LT_DRAL TYPE LVC_T_DRAL,
LS_DRAL TYPE LVC_S_DRAL.
LOOP AT ITAB .
* First listbox (handle '1').
IF SY-INDEX = 1.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ' '.
LS_DRAL-INT_VALUE = ' '.
ELSE.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ITAB-POSNR.
LS_DRAL-INT_VALUE = ITAB-POSNR.
ENDIF.
APPEND LS_DRAL TO LT_DRAL.
ENDLOOP.
**Setting the Drop down table for Reason Code
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.
ENDFORM. " set_drdn_table
*& Form EVENT_TOP_OF_PAGE
* text
* -->DG_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
"this is more clear.....check it
"first add text, then pass it to comentry write fm
DATA : DL_TEXT(255) TYPE C. "Text
* Populating header to top-of-page
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Test Report'
SAP_STYLE = CL_DD_AREA=>HEADING.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move program ID
CONCATENATE 'Program Name :' SY-REPID
INTO DL_TEXT SEPARATED BY SPACE.
* Add Program Name to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move User ID
CONCATENATE 'User ID :' SY-UNAME INTO DL_TEXT SEPARATED BY SPACE
* Add User ID to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move count (no of records).
move v_lines to v_line.
CONCATENATE 'No of records :' v_line INTO DL_TEXT SEPARATED BY SPACE.
* Add Client to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move date
WRITE SY-DATUM TO DL_TEXT.
CONCATENATE 'Date :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Date to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move time
WRITE SY-UZEIT TO DL_TEXT.
CONCATENATE 'Time :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Time to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
* Populating data to html control
PERFORM HTML.
ENDFORM. " EVENT_TOP_OF_PAGE
*& Form ADD_TEXT
* To add Text
FORM ADD_TEXT USING P_TEXT TYPE SDYDO_TEXT_ELEMENT.
* Adding text
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = P_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING.
ENDFORM. " ADD_TEXT
*& Form HTML
* text
FORM HTML.
DATA : DL_LENGTH TYPE I, " Length
DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE. " Background_id
* Creating html control
IF DG_HTML_CNTRL IS INITIAL.
CREATE OBJECT DG_HTML_CNTRL
EXPORTING
PARENT = DG_PARENT_HTML.
ENDIF.
* Reuse_alv_grid_commentary_set
CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
EXPORTING
DOCUMENT = DG_DYNDOC_ID
BOTTOM = SPACE
IMPORTING
LENGTH = DL_LENGTH.
* Get TOP->HTML_TABLE ready
CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
* Set wallpaper
CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
EXPORTING
PICTURE_ID = DL_BACKGROUND_ID.
* Connect TOP document to HTML-Control
DG_DYNDOC_ID->HTML_CONTROL = DG_HTML_CNTRL.
* Display TOP document
CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = DG_PARENT_HTML
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
ENDIF.
ENDFORM. " HTML
Regards
vijay -
How to trigger top-of-page in ALV Grid
How to trigger Top-Of-Page in ALV Grid...
can any one plese send the sample code...
thanks.here is sample code. try this. u need to build an internal table and then call function commentary write and pass that internal table.
*& Form TOP_OF_PAGE
Top_of_page
FORM top-of-page. "#EC CALLED
*ALV Header declarations
DATA: lit_header TYPE slis_t_listheader,
lwa_header TYPE slis_listheader.
Title
lwa_header-typ = 'H'.
lwa_header-info = text-013.
APPEND lwa_header TO lit_header.
CLEAR lwa_header.
BOM Number
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_matnr
IMPORTING
output = gv_matnr.
Pass BOM number
lwa_header-typ = 'S'.
lwa_header-key = text-014.
lwa_header-info = gv_matnr .
APPEND lwa_header TO lit_header.
CLEAR: lwa_header ,
gv_matnr .
BOM description
lwa_header-typ = 'S'.
lwa_header-key = text-015 .
lwa_header-info = gv_maktx .
APPEND lwa_header TO lit_header.
CLEAR: lwa_header.
start/end date format MM/DD/YY
lwa_header-typ = 'S'.
lwa_header-key = text-016 .
CONCATENATE s_erdat-low+4(2) '/'
s_erdat-low+6(2) '/'
s_erdat-low(4) ' - '
s_erdat-high+4(2) '/'
s_erdat-high+6(2) '/'
s_erdat-high(4)
INTO lwa_header-info.
APPEND lwa_header TO lit_header.
CLEAR: lwa_header.
Run Date of Report format MM/DD/YY
lwa_header-typ = 'S'.
lwa_header-key = text-017 .
CONCATENATE sy-datum+4(2) '/'
sy-datum+6(2) '/'
sy-datum(4) INTO lwa_header-info .
APPEND lwa_header TO lit_header.
CLEAR: lwa_header.
call function REUSE_ALV_COMMENTARY_WRITE to use TOP_OF_PAGE event.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lit_header.
ENDFORM . " FORM top-of-page. -
Hi all,
Somebody Could tell me how can I create a top-of-page for my OO ALV report?
Please help...!
Thanks in advance.
regards Marisol.HI,
You should set the handler for the event :
SET HANDLER l_event->handle_top_of_page FOR grid.
And then call the set_table_for_first_display
CALL METHOD grid->set_table_for_first_display
EXPORTING
is_layout = gd_layout
CHANGING
it_outtab = outtab[]
it_fieldcatalog = gd_fieldcat[].
In The handle_top_of_page method you can then make some WRITE statemments.
Regards,
David Matias
Maybe you are looking for
-
Skype on Panasonic P50VT20B no longer able to log ...
I've had skype working fine on my TV since I first got it over 3 years ago with the official Panasonic camera, then the other day I checked and it wasn't logged in so re-enetered my account details and then it came up with the "Cannot sync contact li
-
MAC driver for HP Pholtosmart C4200
How do I get a download from Apple to allow HP Photosmart C4200 for my Snow Leapard
-
10.5.1 lost functions
Since my install on the iMac G5, I can no longer drag icons across my desktop and I cannot "Apple-c" to cut and paste anymore. Anyone else seen this?
-
App store ratings are... just wrong...
Find an app with a reasonably small number of ratings (less than 10) and average them. It is no where NEAR what the store claims... Here's just one screenshot of my point from iBear Brain... http://img509.imageshack.us/my.php?image=img0002qy0.png Any
-
How do I get gmail notifications on osx?
after finding out that mail does not support push mails from gmail I prefer to use the original online gmail client. Can anyone tell me how I can get desktop notifications for that?