Problem while displaying top of page in list display
Hi,
M facing problem in displaying top of page in list .
M using following methods:-
lr_outer_grid TYPE REF TO cl_salv_form_layout_grid,
lr_inner_grid TYPE REF TO cl_salv_form_layout_grid,
lr_label TYPE REF TO cl_salv_form_label,
lr_text TYPE REF TO cl_salv_form_text.
For displaying the top of page m using event TOP_OF_PAGE.
CREATE OBJECT lr_outer_grid.
*Outer grid
lr_inner_grid = lr_outer_grid->create_grid(
row = 1
column = 1 ).
*... create lable information in inner_grid
User ID
lr_label = lr_inner_grid->create_label(
row = 1
column = 1
text = text-h03 ).
*... create text information in inner_grid
lr_text = lr_inner_grid->create_text(
row = 1
column = 2
text = sy-uname ).
*... set label for text
lr_label->set_label_for( lr_text ).
But while m going to do same coding for second parameter its not intializing length so adding extra spaces while displaying second row.
e.g
USERID abcdefghjik
PLANT jhk to hjk
I want that output should look like
USERID abcdefghjik
PLANT jhk to hjk
Please tell me the solution what should i do for avoiding extra space
Hi Neelema,
You could try this sample code.
[http://sap-img.com/fu037.htm]
[http://sap-img.com/abap/sample-alv-heading-in-alv.htm]
Regards,
Amit.
Similar Messages
-
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 -
Problem in ALV top of page event
Hi,
Have created a report in ALV and used top of page event to display the header details, where i am doing some calculations and the value is appearing in top of page, but when i take print out (or see print preview), the top of page contents are not visible, is there any way so that i can print the top of page also.
Thanks in Advance
SantoshHi this might help u.
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
with regards,
Hema Sundara.
pls give points if u find it helpful. -
Problem in downloading top-of-page to excel
Hi All,
I have developed a report using OOALV. Im using split containers to display the data of Docking container.
The problem is when I'm downloading the report to excel, its only printing the main data from bottom container. Its not displaying the top-of-page data, which is printing in top container.
Here is the sample code, which Im using to print the top-of-page.
CALL METHOD o_document->new_line. (SAMPLE CODE)
***Fiscal Year
CLEAR:v_string.
CONCATENATE 'Run Date:'(143) v_print_date INTO v_string SEPARATED BY space.
CONDENSE v_string.
* Adding Text
CALL METHOD o_document->add_text
EXPORTING
text = v_string.
* Display the data
CALL METHOD o_document->display_document
EXPORTING
parent = o_top_container.
* Calling the method of ALV to process top of page
CALL METHOD alv_grid->list_processing_events
EXPORTING
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = o_document.
Please advise me how to download the data along with the top of page from OOALV output.
Thanks,
PriyaHi Priya,
Sorry for the delay.. here
Simple explanation...
ABAP - OLE Automation using MS-Excel - Code Gallery - SCN Wiki
You can find a detail doc here
http://www.heyiamonline.com/abap/pdf/ABAPOLEAUTOMATION.pdf
Regards -
Alv not displaying top-of-page
hi every buddy,
i am workiong on report where there is a requirment of dislpaying alv
with top of page having some details . the event function mudule is calling the top-of-page fm properly
but perform for top-of page is not called up
i.e. controls are not goin to that point of perform
please give me your valuable suggestions
regards
prashantHi,
please check this code it is working
type-pools: slis.
* Including icon for icon display
include <icon>.
* Including symbol
include <symbol>.
* Declaring structure for vbak
types: begin of t_vbak,
vbeln type vbeln_va,
auart type auart,
netwr type netwr,
vkorg type vkorg,
vtweg type vtweg,
erdat type erdat,
vbtyp type vbtyp,
augru type augru,
icon type icon-id,
end of t_vbak.
* Declaring structure for vbap
types: begin of t_vbap,
vbeln type vbeln_va,
posnr type posnr,
matnr type matnr,
arktx type arktx,
lsmeng type dzmeng,
auart type auart,
netwr type netwr,
vkorg type vkorg,
vtweg type vtweg,
erdat type erdat,
vbtyp type vbtyp,
augru type augru,
icon type icon-id,
end of t_vbap.
* Declaring variables
data: v_vbeln type vbeln,
my_tab type sy-tabix.
* Declaring internal table and wa for vbak and vbap
data: i_vbak type table of t_vbak,
wa_vbak type t_vbak,
i_vbap type table of t_vbap,
i_pbo type table of t_vbap,
wa_vbap type t_vbap.
* Declaring internal table and wa for alv components(fieldcatalog,layout,events,header)
data: i_fieldcat type slis_t_fieldcat_alv,
wa_fieldcat type slis_fieldcat_alv,
wa_layout type slis_layout_alv,
i_event type slis_t_event,
wa_event type slis_alv_event,
i_header type slis_t_listheader,
wa_header type slis_listheader,
wa_varient type disvariant,
wa_sort type slis_sortinfo_alv,
i_sort type slis_t_sortinfo_alv.
* Declaring selection-screen details
selection-screen: begin of block b1 with frame title text-001.
selection-screen skip.
select-options: s_vbeln for v_vbeln.
selection-screen: begin of block b2 with frame title text-008.
parameter: ch1 type c as checkbox, "check bos for Subtotal.
ch2 type c as checkbox. "check box for Grand total.
selection-screen: end of block b2.
selection-screen: end of block b1.
* Start of start-of-selection
start-of-selection.
* Fetching data from vbak table
select vbeln
auart
netwr
vkorg
vtweg
erdat
vbtyp
augru
from vbak into table i_vbak
where vbeln in s_vbeln.
if sy-subrc = 0.
* Fetching data for vbap table
select vbeln
posnr
matnr
arktx
lsmeng
from vbap into table i_vbap
for all entries in i_vbak
where vbeln = i_vbak-vbeln.
endif.
* Looping data for final output
loop at i_vbak into wa_vbak.
* checking conditiions for icon
if wa_vbak-netwr < 10000.
wa_vbak-icon = '@08@'.
elseif wa_vbak-netwr < 15000.
wa_vbak-icon = '@09@'.
else.
wa_vbak-icon = '@0A@'.
endif.
modify i_vbak from wa_vbak index sy-tabix .
endloop.
*Looping data for final output
loop at i_vbap into wa_vbap.
my_tab = sy-tabix.
read table i_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.
if sy-subrc = 0.
wa_vbap-auart = wa_vbak-auart.
wa_vbap-netwr = wa_vbak-netwr.
wa_vbap-vkorg = wa_vbak-vkorg.
wa_vbap-vtweg = wa_vbak-vtweg.
wa_vbap-erdat = wa_vbak-erdat.
wa_vbap-vbtyp = wa_vbak-vbtyp.
wa_vbap-augru = wa_vbak-augru.
wa_vbap-icon = wa_vbak-icon.
modify i_vbap from wa_vbap index my_tab transporting
auart netwr vkorg vtweg erdat vbtyp augru icon.
endif.
endloop.
* Preparing fieldcatalog for final output
perform main_fieldcat.
*Preparing final layout for final output
perform layout.
*Preparing list header for final output
perform list_header.
*Preaparing events for alv display
perform event.
*Getting subtotals for amount fields
if ch1 eq 'X'.
perform sub_total.
endif.
*Showing final output data
perform alv_display.
form main_fieldcat .
*Fieldcatalog for icon
wa_fieldcat-fieldname = 'ICON'.
* WA_FIELDCAT-TECH = 'X'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-icon = 'X'.
wa_fieldcat-seltext_l = 'ICON'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
* Fieldcatalog for salesorder
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-seltext_l = 'Sales order NO'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for salesordertype
wa_fieldcat-fieldname = 'AUART'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C610'.
wa_fieldcat-seltext_l = 'Sales order type'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for netamount
wa_fieldcat-fieldname = 'NETWR'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-emphasize = 'C501'.
* wa_fieldcat-input = 'X'.
wa_fieldcat-seltext_l = 'Net Amount'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for salesorg
wa_fieldcat-fieldname = 'VKORG'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C310'.
wa_fieldcat-seltext_l = 'Sales Organization'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for salesdistribution
wa_fieldcat-fieldname = 'VTWEG'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C210'.
wa_fieldcat-seltext_l = 'Sales Distribution'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for date
wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C110'.
wa_fieldcat-seltext_l = 'Sales OrderDate'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for salestype
wa_fieldcat-fieldname = 'VBTYP'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C410'.
wa_fieldcat-seltext_l = 'Sales type'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for orderreason
wa_fieldcat-fieldname = 'AUGRU'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C710'.
wa_fieldcat-seltext_l = 'Order reason '.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for itemnum
wa_fieldcat-fieldname = 'POSNR'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C110'.
wa_fieldcat-seltext_l = 'Item No '.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for materialnum
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C710'.
wa_fieldcat-seltext_l = 'Material No '.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C310'.
wa_fieldcat-seltext_l = 'Description'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
*Fieldcatalog for quantity
if ( ch1 = 'X' and ch2 = 'X' ) or ( ch1 = 'X' and ch2 = ' ' ) or ( ch2 = 'X' and ch1 = ' ' ).
wa_fieldcat-fieldname = 'LSMENG'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C510'.
wa_fieldcat-seltext_l = 'Quantity '.
* WA_FIELDCAT-edit = 'X'.
wa_fieldcat-do_sum = 'X'.
else.
wa_fieldcat-fieldname = 'LSMENG'.
wa_fieldcat-tabname = 'IT_VBAP'.
wa_fieldcat-emphasize = 'C510'.
wa_fieldcat-seltext_l = 'Quantity '.
* WA_FIELDCAT-edit = 'X'.
endif.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
endform. " MAIN_FIELDCAT
form alv_display .
wa_varient-report = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
i_callback_pf_status_set = 'PF_STATUS'
i_save = 'X'
is_variant = wa_varient
it_events = i_event
tables
t_outtab = i_vbap
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. " ALV_DISPLAY
form layout .
wa_layout-colwidth_optimize = 'X'.
wa_layout-subtotals_text = 'SUBTOTAL SUM'.
wa_layout-totals_text = 'TOTAL'.
wa_layout-zebra = 'X'.
endform. " LAYOUT
form event .
call function 'REUSE_ALV_EVENTS_GET'
importing
et_events = i_event
exceptions
list_type_wrong = 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.
read table i_event into wa_event with key name = 'USER_COMMAND'.
if sy-subrc = 0.
wa_event-form = 'USER_COMMAND'.
modify i_event from wa_event transporting form where name = 'USER_COMMAND'.
endif.
read table i_event into wa_event with key name = 'TOP_OF_PAGE'.
if sy-subrc = 0.
wa_event-form = 'TOP_OF_PAGE'.
modify i_event from wa_event transporting form where name = 'TOP_OF_PAGE' .
endif.
endform. " EVENT
form user_command using ucomm type sy-ucomm
selfield type slis_selfield.
data: gstring type c.
constants: l_c_repid type sy-repid value 'ZCOE_ALV_SIMPLE'.
data: l_i_seltab type table of rsparams.
case ucomm.
when '&IC1'.
if selfield-fieldname = 'VBELN'.
set parameter id 'AUN' field selfield-value.
call transaction 'VA02' and skip first screen.
endif.
* * CASE ok_code.
when 'SAVE'.
* *A pop up is called to confirm the saving of changed data
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = 'SAVING DATA'
text_question = 'Continue?'
icon_button_1 = 'icon_booking_ok'
importing
answer = gstring
exceptions
text_not_found = 1
others = 2.
if sy-subrc ne 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* *When the User clicks 'YES'
if ( gstring = '1' ).
message 'Saved' type 'S'.
*Now the changed data is stored in the it_pbo internal table
i_pbo = i_vbap.
else.
*When user clicks NO or Cancel
message 'Not Saved' type 'S'.
endif.
**When the user clicks the 'EXIT; he is out
when 'EXIT'.
leave program.
* Clicking on refresh button at toolbar
when 'REF'.
* Calling fm to get refresh data
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = l_c_repid
tables
selection_table = l_i_seltab
exceptions
not_found = 1
no_report = 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.
else.
* * Calling the screen after refreshing
submit zcoe_alv_simple with selection-table l_i_seltab.
endif.
endcase.
endform. " USER_COMMAND
form top_of_page .
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_header.
endform. " TOP_OF_PAGE
form list_header .
* Local data declaration
data: l_date type char10, "Date
l_time(8) type c. "Time
wa_header-typ = 'H'.
wa_header-info = 'Sales Order Information Report'.
append wa_header to i_header.
* Run date Display
clear l_date.
wa_header-typ = 'S'.
write: sy-datum to l_date dd/mm/yyyy.
wa_header-key = 'Run Date :'(002).
wa_header-info = l_date.
append wa_header to i_header.
clear: wa_header.
wa_header-typ = 'S'.
* WRITE: sy-uzeit TO l_time .
l_time+0(2) = sy-uzeit+0(2).
l_time+2(1) = ':'.
l_time+3(2) = sy-uzeit+2(2).
l_time+5(1) = ':'.
l_time+6(2) = sy-uzeit+4(2).
wa_header-key = 'Run Time :'(009).
wa_header-info = l_time.
append wa_header to i_header.
clear: wa_header.
endform. " LIST_HEADER
form pf_status using rt_extab type slis_t_extab.
set pf-status 'SSS'.
set titlebar 'MAIN100'.
endform. "pf_status
form sub_total .
wa_sort-fieldname = 'VBELN'.
wa_sort-tabname = 'I_VBAP'.
wa_sort-spos = 1.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
* wa_sort-group = 'X'.
* WA_SORT-EXPA = 'X'.
append wa_sort to i_sort.
endform. " SUB_TOTAL -
ALV Top of Page is not displaying
Hi,
in this program TOP OF PAGE is displaying as empty
* Tables
TABLES:/irm/ipsipart.
* Type pools
TYPE-POOLS slis.
* Types
TYPES:BEGIN OF typ_ipsipart,
depcode TYPE /irm/ip_depcode,
partid TYPE /irm/ip_ktonr,
endda TYPE /irm/ip_pedat,
begda TYPE /irm/ip_pbdat,
END OF typ_ipsipart.
TYPES:BEGIN OF typ_pa0000,
pernr TYPE persno,
endda TYPE endda,
begda TYPE begda,
massn TYPE massn,
massg TYPE massg,
stat2 TYPE stat2,
partid TYPE /irm/ip_ktonr,
END OF typ_pa0000.
TYPES:BEGIN OF typ_pa0001,
pernr TYPE persno,
endda TYPE endda,
ename TYPE ename,
END OF typ_pa0001.
TYPES:BEGIN OF typ_pernr,
pernr TYPE persno,
END OF typ_pernr.
TYPES:BEGIN OF typ_a942,
zzpersnr TYPE persno,
END OF typ_a942.
TYPES:BEGIN OF typ_a943,
zzpersnr TYPE persno,
END OF typ_a943.
TYPES:BEGIN OF typ_a976,
zzpersnr TYPE persno,
END OF typ_a976.
TYPES:BEGIN OF typ_final,
pernr TYPE persno,
ename TYPE ename,
begda TYPE begda,
statx(9) TYPE c,
mgtxt TYPE mgtxt,
depcode TYPE /irm/ip_depcode,
begda_c TYPE /irm/ip_pbdat,
endda_c TYPE /irm/ip_pedat,
END OF typ_final.
TYPES:BEGIN OF typ_t530t,
massn TYPE massn,
massg TYPE massg,
mgtxt TYPE mgtxt,
END OF typ_t530t.
* Internal Tables
DATA:it_a942 TYPE TABLE OF typ_a942,
it_a943 TYPE TABLE OF typ_a943,
it_a976 TYPE TABLE OF typ_a976,
it_pernr TYPE TABLE OF typ_pernr,
it_pa0000 TYPE TABLE OF typ_pa0000,
it_pa0001 TYPE TABLE OF typ_pa0001,
it_ipsipart TYPE TABLE OF typ_ipsipart,
it_final TYPE TABLE OF typ_final,
it_t530t TYPE TABLE OF typ_t530t.
* Work areas
DATA:wa_a942 TYPE typ_a942,
wa_a943 TYPE typ_a943,
wa_a976 TYPE typ_a976,
wa_pernr TYPE typ_pernr,
wa_pa0000 TYPE typ_pa0000,
wa_pa0001 TYPE typ_pa0001,
wa_ipsipart TYPE typ_ipsipart,
wa_final TYPE typ_final,
wa_t530t TYPE typ_t530t.
* Constants
CONSTANTS:c_stat2 TYPE stat2 VALUE '0',
c_statx(9) TYPE c VALUE 'Withdrawn',
c_endda TYPE endda VALUE '99991231',
c_ptype TYPE /irm/ip_patype VALUE 'PE',
c_kappl TYPE kappl VALUE 'V',
c_ysam TYPE kschl VALUE 'YSAM',
c_ysdm TYPE kschl VALUE 'YSDM',
c_yssm TYPE kschl VALUE 'YSSM',
c_ysse TYPE kschl VALUE 'YSSE',
c_sprsl TYPE spras VALUE 'E'.
* Variables
DATA:v_begda TYPE begda,
v_endda TYPE endda.
DATA:v_variant LIKE disvariant,
v_save(1) TYPE c,
v_repid TYPE sy-repid.
* ALV Declaraion Part
* FIELD CATALOG DECLARATION *****
DATA:it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv.
* ALV SORT INFORMATION *****
DATA:wa_sort TYPE slis_sortinfo_alv,
it_sort TYPE slis_t_sortinfo_alv.
*ALV LAYOUT INFORMATION *****
DATA:wa_layout TYPE slis_layout_alv.
*ALV TOOLBAR EXCLUDING *****
DATA:it_excluding TYPE slis_t_extab,
wa_excluding TYPE slis_extab.
* Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:s_pernr FOR /irm/ipsipart-partid,
s_date FOR /irm/ipsipart-begda OBLIGATORY NO-EXTENSION,
s_depcod FOR /irm/ipsipart-depcode.
SELECTION-SCREEN END OF BLOCK b1.
* At Selection Screen
AT SELECTION-SCREEN.
IF NOT s_date-low IS INITIAL AND s_date-high IS NOT INITIAL.
READ TABLE s_date INDEX 1.
v_begda = s_date-low.
v_endda = s_date-high.
ENDIF.
IF s_date-low IS INITIAL AND s_date-high IS NOT INITIAL.
READ TABLE s_date INDEX 1.
v_begda = s_date-high.
v_endda = s_date-high.
ENDIF.
IF s_date-low IS NOT INITIAL AND s_date-high IS INITIAL.
READ TABLE s_date INDEX 1.
v_begda = s_date-low.
v_endda = s_date-low.
ENDIF.
* Start of selection
START-OF-SELECTION.
break vkreddy1x.
PERFORM get_data.
PERFORM move_data_to_finalitab.
IF NOT it_final[] IS INITIAL.
PERFORM field_catalog TABLES it_final
USING it_fcat[]
wa_fcat.
PERFORM alv_sort_info USING it_sort[]
wa_sort.
PERFORM alv_layout_build USING wa_layout.
PERFORM alv_toolbar_excluding USING it_excluding[]
wa_excluding.
PERFORM load-variant USING v_variant v_repid v_save.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fcat
it_excluding = it_excluding
it_sort = it_sort
i_save = v_save
is_variant = v_variant
TABLES
t_outtab = it_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.
ELSE.
PERFORM info_msg.
ENDIF.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT zzpersnr FROM a942 INTO TABLE it_a942 WHERE kappl = c_kappl
AND kschl = c_ysdm
AND datbi >= v_begda
AND datab <= v_endda.
IF sy-subrc EQ 0.
SORT it_a942 BY zzpersnr.
DELETE ADJACENT DUPLICATES FROM it_a942 COMPARING zzpersnr.
LOOP AT it_a942 INTO wa_a942.
MOVE wa_a942-zzpersnr TO wa_pernr-pernr.
APPEND wa_pernr TO it_pernr.
CLEAR:wa_pernr,wa_a942.
ENDLOOP.
ENDIF.
SELECT zzpersnr FROM a943 INTO TABLE it_a943 WHERE kappl = c_kappl
AND ( kschl = c_ysam
OR kschl = c_ysse )
AND datbi >= v_begda
AND datab <= v_endda.
IF sy-subrc EQ 0.
SORT it_a943 BY zzpersnr.
DELETE ADJACENT DUPLICATES FROM it_a943 COMPARING zzpersnr.
LOOP AT it_a943 INTO wa_a943.
MOVE wa_a943-zzpersnr TO wa_pernr-pernr.
APPEND wa_pernr TO it_pernr.
CLEAR:wa_pernr,wa_a943.
ENDLOOP.
ENDIF.
SELECT zzpersnr FROM a976 INTO TABLE it_a976 WHERE kappl = c_kappl
AND kschl = c_yssm
AND datbi >= v_begda
AND datab <= v_endda.
IF sy-subrc EQ 0.
SORT it_a976 BY zzpersnr.
DELETE ADJACENT DUPLICATES FROM it_a976 COMPARING zzpersnr.
LOOP AT it_a976 INTO wa_a976.
MOVE wa_a976-zzpersnr TO wa_pernr-pernr.
APPEND wa_pernr TO it_pernr.
CLEAR:wa_pernr,wa_a976.
ENDLOOP.
ENDIF.
SORT it_pernr BY pernr.
DELETE ADJACENT DUPLICATES FROM it_pernr COMPARING pernr.
IF NOT it_pernr[] IS INITIAL.
SELECT pernr endda begda massn massg stat2 FROM pa0000
INTO TABLE it_pa0000
FOR ALL ENTRIES IN it_pernr
WHERE pernr = it_pernr-pernr
AND endda >= v_begda
AND begda <= v_endda
AND stat2 = c_stat2.
ENDIF.
LOOP AT it_pa0000 INTO wa_pa0000.
wa_pa0000-partid = wa_pa0000-pernr.
MODIFY TABLE it_pa0000 FROM wa_pa0000 .
ENDLOOP.
IF NOT it_pa0000[] IS INITIAL.
SELECT depcode partid endda begda FROM /irm/ipsipart
INTO CORRESPONDING FIELDS OF TABLE it_ipsipart
FOR ALL ENTRIES IN it_pa0000
WHERE nrart = c_ptype
AND partid = it_pa0000-partid
AND endda >= it_pa0000-begda
AND begda <= it_pa0000-endda.
SELECT pernr ename FROM pa0001 INTO TABLE it_pa0001
FOR ALL ENTRIES IN it_pa0000
WHERE pernr = it_pa0000-pernr
AND endda = c_endda.
SELECT mgtxt FROM t530t INTO TABLE it_t530t
FOR ALL ENTRIES IN it_pa0000
WHERE sprsl = c_sprsl
AND massn = it_pa0000-massn
AND massg = it_pa0000-massg.
ENDIF.
ENDFORM. " GET_DATA
*& Form MOVE_DATA_TO_ITAB
FORM move_data_to_finalitab .
LOOP AT it_pa0000 INTO wa_pa0000.
MOVE wa_pa0000-pernr TO wa_final-pernr.
MOVE wa_pa0000-begda TO wa_final-begda.
IF wa_pa0000-stat2 = c_stat2.
MOVE c_statx TO wa_final-statx.
ENDIF.
READ TABLE it_pa0001 INTO wa_pa0001 WITH KEY pernr = wa_pa0000-pernr.
IF sy-subrc EQ 0.
MOVE wa_pa0001-ename TO wa_final-ename.
ENDIF.
READ TABLE it_t530t INTO wa_t530t WITH KEY massn = wa_pa0000-massn
massg = wa_pa0000-massg.
IF sy-subrc EQ 0.
MOVE wa_t530t-mgtxt TO wa_final-mgtxt.
ENDIF.
READ TABLE it_ipsipart INTO wa_ipsipart WITH KEY
partid = wa_pa0000-partid.
IF sy-subrc EQ 0.
MOVE wa_ipsipart-depcode TO wa_final-depcode.
MOVE wa_ipsipart-begda TO wa_final-begda_c.
MOVE wa_ipsipart-endda TO wa_final-endda_c.
ENDIF.
APPEND wa_ipsipart TO it_ipsipart.
CLEAR wa_ipsipart.
ENDLOOP.
ENDFORM. " MOVE_DATA_TO_ITAB
*& Form FIELD_CATALOG
* text
* --> p1 text
* <-- p2 text
FORM field_catalog TABLES p_it_final LIKE it_final
USING p_it_fcat TYPE slis_t_fieldcat_alv
p_wa_fcat TYPE slis_fieldcat_alv.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '1'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'PERNR'.
p_wa_fcat-key = 'X'.
p_wa_fcat-seltext_l = 'Personnel Number'.
p_wa_fcat-seltext_m = 'Personnel No.'.
p_wa_fcat-seltext_s = 'Pers.No.'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '2'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'ENAME'.
p_wa_fcat-key = 'X'.
p_wa_fcat-seltext_l = 'Employee Name'.
p_wa_fcat-seltext_m = 'Emp Name'.
p_wa_fcat-seltext_s = 'Name'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '3'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'BEGDA'.
p_wa_fcat-key = ' '.
p_wa_fcat-seltext_l = 'Termination start date'.
p_wa_fcat-seltext_m = 'Term start date'.
p_wa_fcat-seltext_s = 'Term start date'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '4'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'MGTXT'.
p_wa_fcat-seltext_l = 'Reason f.action text'.
p_wa_fcat-seltext_m = 'Reason for action'.
p_wa_fcat-seltext_s = 'Act.reason'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '5'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'STATX'.
p_wa_fcat-seltext_l = 'Employment status text'.
p_wa_fcat-seltext_m = 'Employment status'.
p_wa_fcat-seltext_s = 'Employment status'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '6'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'DEPCODE'.
p_wa_fcat-seltext_l = 'Deployment Code'.
p_wa_fcat-seltext_m = 'Deployment Code'.
p_wa_fcat-seltext_s = 'Dep. Code'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '7'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'BEGDA_C'.
p_wa_fcat-seltext_l = 'Participation Start Date'.
p_wa_fcat-seltext_m = 'Participation Start'.
p_wa_fcat-seltext_s = 'Start Date'.
APPEND p_wa_fcat TO p_it_fcat.
CLEAR p_wa_fcat.
p_wa_fcat-col_pos = '8'.
p_wa_fcat-tabname = p_it_final.
p_wa_fcat-fieldname = 'ENDDA_C'.
p_wa_fcat-seltext_l = 'Participation End Date'.
p_wa_fcat-seltext_m = 'Participation End'.
p_wa_fcat-seltext_s = 'End Date'.
APPEND p_wa_fcat TO p_it_fcat.
ENDFORM. " FIELD_CATALOG
*& Form ALV_SORT_INFO
* text
* -->P_IT_SORT[] text
* -->P_WA_SORT text
FORM alv_sort_info USING p_it_sort TYPE slis_t_sortinfo_alv
p_wa_sort TYPE slis_sortinfo_alv .
p_wa_sort-fieldname = 'PERNR'.
p_wa_sort-up = 'X'.
APPEND p_wa_sort TO p_it_sort.
ENDFORM. " ALV_SORT_INFO
*& Form ALV_LAYOUT_BUILD
FORM alv_layout_build CHANGING p_wa_layout TYPE slis_layout_alv.
p_wa_layout-no_input = 'X'.
p_wa_layout-colwidth_optimize = 'X'.
ENDFORM. " ALV_LAYOUT_BUILD
*& Form ALV_TOOLBAR_EXCLUDING
* text
FORM alv_toolbar_excluding USING p_it_excluding TYPE slis_t_extab
p_wa_excluding TYPE slis_extab.
p_wa_excluding-fcode = '&GRAPH'.
APPEND p_wa_excluding TO p_it_excluding.
p_wa_excluding-fcode = '&ABC'.
APPEND p_wa_excluding TO p_it_excluding.
p_wa_excluding-fcode = '%SL'.
APPEND p_wa_excluding TO p_it_excluding.
ENDFORM. " ALV_TOOLBAR_EXCLUDING
*& Form LOAD-VARIANT
FORM load-variant USING p_v_variant STRUCTURE disvariant
p_v_repid
p_v_save.
CLEAR p_v_variant.
p_v_variant-report = p_v_repid.
p_v_save = 'A'.
ENDFORM. " LOAD-VARIANT
*& Form info_msg
* text
FORM info_msg .
MESSAGE i016(rp) WITH 'No Data Selected for the Selection Criteria'.
ENDFORM. "info_msg
*& Form top_of_page
* text
FORM top_of_page.
DATA:it_listhead TYPE slis_t_listheader.
DATA:wa_listhead TYPE slis_listheader.
wa_listhead-typ = 'H'.
wa_listhead-info = 'Withdrawn Employees Still Active on Commission Plan'.
APPEND wa_listhead TO it_listhead.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listhead.
ENDFORM. "top_of_pageHello,
You try in this way you will get the solution
data:
y_i_events TYPE STANDARD TABLE OF slis_alv_event,
constants:
y_k_top_of_page TYPE slis_alv_event-name VALUE 'TOP_OF_PAGE',
y_k_top_of_form TYPE slis_alv_event-form VALUE 'Y_F_TOP_OF_FORM'.
PERFORM y_f_build_events CHANGING y_i_events.
FORM y_f_build_events CHANGING y_li_events TYPE STANDARD TABLE.
DATA : y_lwa_events TYPE slis_alv_event.
y_lwa_events-name = y_k_top_of_page.
y_lwa_events-form = y_k_top_of_form.
APPEND y_lwa_events TO y_li_events.
CLEAR y_lwa_events.
ENDFORM. " y_f_BUILD_EVENTS
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = y_lv_progname
is_layout = y_wa_layout
it_fieldcat = y_i_fieldcat[]
it_events = y_i_events
TABLES
t_outtab = y_i_error
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 y_f_top_of_form .
*To display the date in dd mm yyyy formate
CLEAR y_v_date.
MOVE: sy-datum TO y_v_date.
y_wa_header-typ = y_k_h.
CONCATENATE text-h01 y_v_date+6(2)
y_v_date+4(2)
y_v_date+0(4)
INTO y_wa_header-info
SEPARATED BY space.
APPEND y_wa_header TO y_i_listheader.
CLEAR y_wa_header.
*Top of page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = y_i_listheader[].
REFRESH y_i_listheader[].
ENDFORM. " y_f_top_of_form
Try this you we get the top-of-page. -
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. -
hi all,
i have the leave request approval page linked to the workset and role Manager sel-service. im getting the preview of the page in the portal content administration. But when i login as MSS user, the role and workset are being displayed but the page is not being shown,im getting the following
"Critical error message" :
com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: The running application consciously caused an abort with short dump., error key: RFC_ERROR_SYSTEM_FAILURE
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101)
at com.sap.xss.hr.lea.form.FcForm.getCustomizing(FcForm.java:1019)
at com.sap.xss.hr.lea.form.FcForm.onInit(FcForm.java:417)
at com.sap.xss.hr.lea.form.wdp.InternalFcForm.onInit(InternalFcForm.java:2053)
at com.sap.xss.hr.lea.form.FcFormInterface.onInit(FcFormInterface.java:184)
at com.sap.xss.hr.lea.form.wdp.InternalFcFormInterface.onInit(InternalFcFormInterface.java:1911)
at com.sap.xss.hr.lea.form.wdp.InternalFcFormInterface$External.onInit(InternalFcFormInterface.java:2007)
at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:921)
at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPM.attachComponentToUsage(FPMComponent.java:890)
at com.sap.pcuigp.xssfpm.wd.FPMComponent$FPMProxy.attachComponentToUsage(FPMComponent.java:1083)
at com.sap.xss.hr.lea.worklist.VcWorkList.onInit(VcWorkList.java:267)
at com.sap.xss.hr.lea.worklist.wdp.InternalVcWorkList.onInit(InternalVcWorkList.java:363)
at com.sap.xss.hr.lea.worklist.VcWorkListInterface.onInit(VcWorkListInterface.java:164)
at com.sap.xss.hr.lea.worklist.wdp.InternalVcWorkListInterface.onInit(InternalVcWorkListInterface.java:144)
at com.sap.xss.hr.lea.worklist.wdp.InternalVcWorkListInterface$External.onInit(InternalVcWorkListInterface.java:220)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.doProcessEvent(FPMComponent.java:564)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.doEventLoop(FPMComponent.java:438)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.wdDoInit(FPMComponent.java:196)
at com.sap.pcuigp.xssfpm.wd.wdp.InternalFPMComponent.wdDoInit(InternalFPMComponent.java:110)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:754)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:289)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:733)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:668)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73)
at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:860)
at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.create(AbstractApplicationProxy.java:220)
at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1288)
at com.sap.portal.pb.PageBuilder.createPage(PageBuilder.java:355)
at com.sap.portal.pb.PageBuilder.init(PageBuilder.java:548)
at com.sap.portal.pb.PageBuilder.wdDoInit(PageBuilder.java:192)
at com.sap.portal.pb.wdp.InternalPageBuilder.wdDoInit(InternalPageBuilder.java:150)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:754)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:289)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Caused by: com.sap.aii.proxy.framework.core.BaseProxyException: The running application consciously caused an abort with short dump., error key: RFC_ERROR_SYSTEM_FAILURE
at com.sap.aii.proxy.framework.core.AbstractProxy.send$(AbstractProxy.java:150)
at com.sap.xss.hr.lea.model.LeaveRequestAdaptiveModel.pt_Arq_Customizing_Get(LeaveRequestAdaptiveModel.java:392)
at com.sap.xss.hr.lea.model.Pt_Arq_Customizing_Get_Input.doExecute(Pt_Arq_Customizing_Get_Input.java:137)
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:92)
... 66 more
Please help me resolve this...
thanks,
nandanif you leave configuration is done .
there will be some There was an incorrect data in your system . to do this please follow following process.
delete this request using
PTARQ> Delete documents (RPTARQDBDEl)
Please read the report documentation before
deleting the request but it should be safe as it is
a development system.
Please delete this with the above information or delete all
the records for the approver .
after there will be some incorrect workitem in appover inbox.
you need to clear that also by Tcode - SWWL.
Regards,
Vivek Jadhav -
Problem while uploading the file page is not forwarding
Hi,
Please tell me the solution for this.
I'm uploading the file, i'm getting the values very thing, but the page is not forwarding what happening i don't no.
Here is the code.
<HTML>
<%@ page language="java" import="javazoom.upload.*,java.util.*" %>
<%@ page errorPage="ExceptionHandler.jsp" %>
<HEAD>
<BODY style="font:'Bookman Old Style' size="3"">
<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
</jsp:useBean>
<%
// Uploading file code
if (MultipartFormDataRequest.isMultipartFormData(request))
// Uses MultipartFormDataRequest to parse the HTTP request.
MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
String todo = null;
if (mrequest != null) todo = mrequest.getParameter("todo");
if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
Hashtable files = mrequest.getFiles();
UploadFile file = (UploadFile) files.get("uploadfile");
if ((file != null) && (file.getFileSize() <= 82000))
{System.out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
// Uses the bean now to store specified by jsp:setProperty at the top.
upBean.store(mrequest, "uploadfile");
else
System.out.println("Not Uploaded");
if (mrequest != null)
String Schoolname= mrequest.getParameter("schoolname");
session.setAttribute("saSchoolname", Schoolname);
System.out.println("Schoolname "+Schoolname);
%>
<jsp:forward page="FileTransfer.jsp"/>
<%
else out.println("<BR> todo="+todo);
//System.out.println(session.getAttribute("saswrite"));
String amessage = request.getParameter("passmsg");
%>
<form name='subregiform' method="POST" onsubmit='return checkForm()' action ="FileSubmit2.jsp" ENCTYPE="multipart/form-data">
<table width="491" border="0" cellpadding="2" >
<tr>
<td width="171" align="right"><br> S.S.C :</td>
<td width="103" align="center">Institution Name
<input type="text" name="schoolname" size = 12 maxlength = 35 value = <%
if(session.getAttribute("saSchoolname")!= null){%>
<%=session.getAttribute("saSchoolname")%><%}%>> </td>
<tr><td width="165"><div align="right">Upload Resume :<br> <br> <br></div></td>
<td width="356"><input type="file" name="uploadfile" size = 20>
<font size=1><br> <I>(Only .doc,.rtf,.txt,.html)</I></font><BR>
<% if (amessage !=null){ %><FONT SIZE="" COLOR="RED"><strong><%= amessage %></strong></FONT><% }%> </td>
</tr>
<tr>
<td colspan="2">
<p align="center">
<input type="hidden" name="todo" value="upload">
<input type="submit" name="Submit" value="Submit">
</p>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>This code is a mess! Don't put your logic and control into your JSP; use the JSP only for display!
As for your error, it's because you can't forward after the response has been committed. An illegal state exception will be thrown except you can't see it in the browser because the server has already committed the response and can't change it now. You need to get rid of the forward action. Put in a link to that page instead. Or use a a meta tag to redirect.
But really, this code cannot be modified to get rid of the problem. It should be scrapped and you should rethink your design. Have a servlet do your control and all this uploading code should also be put into a servlet; never in a JSP
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
(Yes I know it's on JavaRanch but I think it applies everywhere)
Edited by: nogoodatcoding on Oct 5, 2007 2:56 PM -
ALV Top of Page Date format problem?
Dear All Abapper,
I have placed date(12.12.2007) format in ALV Top of Page, but it displayed
<u> <b> 20071212</b></u> in this format.
Pls, give me the suggestion to reclaim my problem.Hi,
Cjeck the following code:
V_DATE = 'Run Date:'.
CONCATENATE V_DATE SY-DATUM6(2) '.' SY-DATUM4(2) '.' SY-DATUM(4)
INTO V_DATE .
REFRESH ITHED.
CLEAR SHED.
SHED-TYP = 'A'.
SHED-INFO = V_DATE.
APPEND SHED TO ITHED.
CLEAR SHED.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = ITHED.
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
Hope this helps.
Reward if helpful.
Regards,
Sipra -
Top of page data is repeated while going back from alv report
Hi,
In my alv report , I call ed TOP_OF_PAGE. Data regatding top_of_page is stored in internal table.
After executing the report,while going back from report, a screen containing top_of_page data is appeaing.
Even though I cleared that table,still that data appeared.
Please resolve this.Hi all,
I cleared that table previously .
Still that screen appears.
This is my following code.
PERFORM top_of_page. " Subroutine for Top-of-page
*Display Report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = lv_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = lt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = it_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_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = lt_meter
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.
perform clear_data.
endif.
FORM top_of_page .
Declaration of local variables, structures and internal tables
Data : lv_count TYPE i,
lv_count_c(9) TYPE c,
lt_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
lt_line LIKE wa_header-info.
Title
clear lt_header[].
wa_header-typ = 'H'.
wa_header-info = 'Meter Readings Report'.
APPEND wa_header TO lt_header.
CLEAR wa_header.
Total No. of Records Selected
DESCRIBE TABLE lt_meter LINES lv_count.
lv_count_c = lv_count.
CONCATENATE 'Total Number of meters readed for given cycle: ' lv_count_c
INTO lt_line SEPARATED BY space.
wa_header-typ = 'A'.
wa_header-info = lt_line.
APPEND wa_header TO lt_header.
CLEAR: wa_header, lt_line.
*Display Top-of-page
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_header.
ENDFORM. " TOP_OF_PAGE
*& Form CLEAR_DATA
text
--> p1 text
<-- p2 text
form CLEAR_DATA .
data : lt_header TYPE slis_t_listheader.
clear lt_header[].
endform. -
How to display 3 alv with top-of-page using splitter container
Hi,
I want to display 3 different alv in a single container corresponding to the 3 check boxes on selection screen.
i.e.
If user selects 1 check box only one alv should be displayed, if 2 checkboxes selected by user 2 alv should be displayed and same for 3.
I cannot use 3 different containers bcoz if second checkbox is not selected then that place remains blank. So I am using single container and using splitter container dividing it into the no of rows corresponding to the no. of checkboxs selected by user.
Now I also want to display top-of-page for each alv. Please guide me how to achieve this.
Thanks & regards,
Harshadacreate with some IF_ELSE conditions as i have done below. in my case the same things are required. if error table is there only then it will be displayed, else only output will be displayed.
* First Main Container
CREATE OBJECT obj_main1
EXPORTING
container_name = 'CC_CONTAINER'
style = cl_gui_custom_container=>ws_maximizebox.
* create top-document
CREATE OBJECT obj_dyndoc_id
EXPORTING
style = 'ALV_GRID'.
IF pr_view EQ c_x OR pr_stat EQ c_x.
* First Splitter Container
CREATE OBJECT obj_splitter1
EXPORTING
parent = obj_main1
rows = 2
columns = 1.
* Place obj_parent_html in First row First column
* for Top_of_page
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = obj_parent_html.
* Place obj_container1 in Second row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = obj_container1.
* Set the height of Top of page
CALL METHOD obj_splitter1->set_row_height
EXPORTING
id = 1
height = 24.
ELSEIF pr_email EQ c_x.
* First Splitter Container
CREATE OBJECT obj_splitter1
EXPORTING
parent = obj_main1
rows = 3
columns = 1.
* Place obj_parent_html in First row First column
* for Top_of_page
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = obj_parent_html.
* Place obj_container1 in First row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = obj_container1.
* Place obj_container2 in Second row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 3
column = 1
RECEIVING
container = obj_container2.
* Set the height of Top of page
CALL METHOD obj_splitter1->set_row_height
EXPORTING
id = 1
height = 24.
ENDIF.
Please note there is no need to create a hEADER in the container, but create it for the 1st table only which is always displayed
ags.
Edited by: ags on Nov 4, 2009 4:49 PM
Edited by: ags on Nov 4, 2009 4:50 PM -
Xml page can't display in the first time
Hi everyone:
I want to read data from MySQL to web page using JDOM.I read the data from database successful and insert them into a xml file.But I can't open the xml page property.It will display after I refresh the page more than ten times!
I find that it become easy if I use JDOM to do this work.I write the logic in a servlet:
/////////////////////////the servlet code is:////////////////////////////////////////////
public void displayXml(){
SAXBuilder build=new SAXBuilder();
try{
Document doc=build.build(new FileInputStream("C:\\tomcat\\webapps\\ROOT\\xmlbook\\mysql.xml"));
Element root=doc.getRootElement();
List books=root.getChildren();
out.println("debug... ...");
while(rs.next()){
Element id=root.getChild("id");
id.setText(rs.getString("id"));
Element name=root.getChild("name");
name.setText(rs.getString("name"));
Element title=root.getChild("title");
title.setText(rs.getString("title"));
Element content=root.getChild("content");
content.setText(rs.getString("content"));
Element time=root.getChild("time");
time.setText(rs.getString("time"));
XMLOutputter xmlout=new XMLOutputter("",true,"GBK");
xmlout.output(doc,new FileOutputStream("C:\\tomcat\\webapps\\ROOT\\xmlbook\\mysqlnew.xml"));
}catch(Exception e){
out.println(e.toString());
System.out.println(e.toString());
//////////////////////////////index.html/////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Enter the title of your XHTML document here</title>
<link style="html/css" href="style.css" rel="stylesheet"/>
</head>
<body>
<h2>welcome to here</h2>
<form action="mainpageurl" method="post">
<p><input type="submit" value="CliCk To EnTEr" /></p>
</form>
</body>
</html>
//////////////////////////mysql.xml////////////////////////////////////////////////////
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href='mysqlxsl.xsl' type='text/xsl'?>
<rootpro>
<id/>
<name/>
<title/>
<content/>
<time/>
</rootpro>
/////////////////////////////End code///////////////////////////////////////////////////
I add a hyperlink to the xml in a web page.It will go to the xml page when user click the button.
But there is a problem puzzle me.The xml page will not display when the user first to come this page.The browser report error:"Can't display this page.The xml file must have a top element".It can display after I refresh this xml page more than ten times.Why?But the xml page already have a top element!~.I means the client must refresh the xml page more than ten times for display it.someone know why? :(sorry,My xsl file is:
////////////////////////////mysqlxsl.xsl//////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>WelcomE To thE MainPagE</title>
</head>
<body>
<table border="1" bgcolor="#eecc00">
<tr>
<td>User Information</td>
<td><xsl:apply-templates select="result/entry"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="entry">
<li><xsl:value-of select="ID"/></li>
<li><xsl:value-of select="Name"/></li>
<li><xsl:value-of select="Title"/></li>
<li><xsl:value-of select="Content"/></li>
<li><xsl:value-of select="Time"/></li>
</xsl:template>
</xsl:stylesheet>
I want to transform the xml file using the xsl. -
Top-of-page event is not triggered
Hi,
I have a problem with top-of-page event. I have a report that shows the results in ALV grid display. But I use "REUSE_ALV_GRID_DISPLAY" not OO alv and there is only one screen with number 1000. On the menu toolbar there is a button that prints the data of ALV in a list using "write" statement. While writing , "top of page" event is not triggered. I expect that it is triggered at the first "write" statement but isn't. Is there anyone who knows the cause of this problem?
The code is below.
Thanks.
Tables ...
TABLES : mara , makt , ekko , ekpo , zzith_yukh , lfa1 , t001w , lips ,
eket .
global variables
DATA : BEGIN OF list OCCURS 1,
zztahsk LIKE ekko-zztahsk ,
zterm LIKE ekko-zterm ,
txz01 LIKE ekpo-txz01 ,
name1 LIKE lfa1-name1 ,
menge LIKE ekpo-menge ,
meins LIKE ekpo-meins ,
fyukl LIKE zzith_yukh-zzdel_flag ,
" Yüklenmiş miktar var göstergesi ...
inco1 LIKE ekko-inco1 ,
netwr LIKE ekpo-netwr ,
waers LIKE ekko-waers ,
bedat LIKE ekko-bedat ,
zzontar LIKE ekko-zzontar ,
slfdt LIKE eket-slfdt ,
tname1 LIKE t001w-name1 ,
banfn LIKE ekpo-banfn ,
ebeln LIKE ekko-ebeln ,
ebelp LIKE ekpo-ebelp ,
lifnr LIKE ekko-lifnr ,
mtart LIKE mara-mtart ,
matkl LIKE mara-matkl ,
ekgrp LIKE ekko-ekgrp ,
matnr LIKE mara-matnr ,
eknam LIKE t024-eknam,
bukrs LIKE ekko-bukrs,
zzbltur LIKE ekko-zzbltur,
END OF list .
DATA temp LIKE list OCCURS 1 WITH HEADER LINE .
DATA total LIKE list OCCURS 1 WITH HEADER LINE .
ALV fields
TYPE-POOLS : slis.
DATA : gt_fields TYPE slis_fieldcat_alv OCCURS 1 WITH HEADER LINE .
DATA : gt_events TYPE slis_t_event.
DATA : gs_layout TYPE slis_layout_alv.
DATA : gv_title TYPE lvc_title VALUE 'Günlük Depo Sayım Miktarları'.
DATA : gt_top_of_page TYPE slis_t_listheader.
selection screen
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 .
*Satınalma organizasyonu
*Satınalma grubu
*Satıcı
*Tarih
*SAS no
*Dosya no
SELECT-OPTIONS:
s_bukrs FOR ekko-bukrs .
SELECTION-SCREEN SKIP .
SELECT-OPTIONS:
s_ekorg FOR ekko-ekorg OBLIGATORY MEMORY ID eko ,
s_ekgrp FOR ekko-ekgrp ,
s_lifnr FOR ekko-lifnr ,
s_ebeln FOR ekko-ebeln .
SELECTION-SCREEN END OF BLOCK a .
Define Katalog
DEFINE fill_catalog .
gt_fields-fieldname = &1.
gt_fields-tabname = &2.
gt_fields-seltext_l = &3.
gt_fields-seltext_m = &3.
gt_fields-seltext_s = &3.
gt_fields-checkbox = &4.
gt_fields-cfieldname = &5.
gt_fields-ref_tabname = &6.
gt_fields-ref_fieldname = &7.
gt_fields-edit = &8.
append gt_fields .
clear gt_fields .
END-OF-DEFINITION.
Modify Catalog
DEFINE modify_catalog .
gt_fields-seltext_m = &1 .
modify gt_fields transporting seltext_m where fieldname = &2 .
END-OF-DEFINITION .
TOP-OF-PAGE.
write 'top of page'.
PERFORM top-of-page.
start-of-selection
START-OF-SELECTION .
PERFORM get_data.
PERFORM listele .
*& Form listele .
FORM listele .
PERFORM get_events .
PERFORM alv_list_header.
PERFORM get_field_catalog USING 'LIST' .
PERFORM display_alv .
ENDFORM. " listele.
*& Form getfield_Catalog
FORM get_field_catalog USING p_tabname .
fill_catalog :
'EBELN' 'LIST' '' '' '' 'EKPO' 'EBELN' '' ,
'ZZTAHSK' 'LIST' '' '' '' 'EKKO' 'ZZTAHSK' '' ,
'ZZBLTUR' 'LIST' '' '' '' 'EKKO' 'ZZBLTUR' '' ,
'MATNR' 'LIST' '' '' '' 'MARA' 'MATNR' '' ,
'MATKL' 'LIST' '' '' '' 'MARA' 'MATKL' '' ,
'TXZ01' 'LIST' '' '' '' 'EKPO' 'TXZ01' '' ,
'NAME1' 'LIST' '' '' '' 'LFA1' 'NAME1' '' ,
'MENGE' 'LIST' '' '' '' 'EKPO' 'MENGE' '' ,
'MEINS' 'LIST' '' '' '' 'EKPO' 'MENGE' '' ,
'FYUKL' 'LIST' '' '' '' 'ZZITH_YUKH' 'ZZDEL_FLAG' '' ,
'INCO1' 'LIST' '' '' '' 'EKKO' 'INCO1' '' ,
'NETWR' 'LIST' '' '' '' 'EKPO' 'NETWR' '' ,
'WAERS' 'LIST' '' '' '' 'EKKO' 'WAERS' '' ,
'BEDAT' 'LIST' '' '' '' 'EKKO' 'BEDAT' '' ,
'ZZONTAR' 'LIST' '' '' '' 'EKKO' 'ZZONTAR' '' ,
'SLFDT' 'LIST' '' '' '' 'EKET' 'SLFDT' '' ,
'TNAME1' 'LIST' '' '' '' 'T001W' 'NAME1' '' ,
'BANFN' 'LIST' '' '' '' 'EKPO' 'BANFN' '' ,
'EKNAM' 'LIST' '' '' '' 'T024' 'EKNAM' '' .
gt_fields-ddictxt = 'M' .
MODIFY gt_fields TRANSPORTING ddictxt WHERE fieldname NE space.
modify_catalog 'Yükleme No' 'VBELN' .
modify_catalog 'Malzeme Türü' 'ZZBLTUR' .
modify_catalog 'Malzeme Tanımı' 'TXZ01' .
modify_catalog 'Satıcı' 'NAME1' .
modify_catalog 'Teslim Şekli' 'INCO1' .
modify_catalog 'Döviz Tutarı' 'ZZTOPLAM'.
modify_catalog 'Döviz Kodu' 'WAERS' .
modify_catalog 'Siparişi Veren' 'TNAME1' .
modify_catalog 'Tahmini İthalat Trh.' 'SLFDT' .
modify_catalog 'İthalata İntikal Trh.' 'BEDAT' .
modify_catalog 'Dosya Onay Tarihi' 'ZZONTAR' .
modify_catalog 'Talep No' 'BANFN' .
modify_catalog 'Dosya Sorumlusu' 'EKNAM' .
modify_catalog 'Yük.Göstergesi' 'FYUKL' .
ENDFORM. " getfield_Catalog
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
DATA lv_repid LIKE sy-repid .
lv_repid = sy-repid .
CLEAR gs_layout.
gs_layout-zebra = 'X'.
gs_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = gt_fields[]
it_events = gt_events[]
TABLES
t_outtab = list[].
ENDFORM. " display_alv
FORM set_pf_status USING iv_nodisplay TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' ."excluding iv_nodisplay.
ENDFORM. " SET_PF_STATUS
FORM user_command USING iv_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE iv_ucomm .
WHEN 'PRINT' . PERFORM print_data .
ENDCASE .
ENDFORM. "USER_COMMAND
FORM get_events .
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gt_events.
READ TABLE gt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE 'ALV_TOP_OF_PAGE' TO ls_event-form.
APPEND ls_event TO gt_events.
ENDIF.
ENDFORM. " getevents
FORM alv_list_header .
DATA: ls_line TYPE slis_listheader.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'Satınalma Org.:'.
CONCATENATE s_ekorg-low s_ekorg-high
INTO ls_line-info SEPARATED BY '/'.
APPEND ls_line TO gt_top_of_page.
ls_line-key = 'Satınalma Grubu.:'.
CONCATENATE s_ekgrp-low s_ekgrp-high
INTO ls_line-info SEPARATED BY '/'.
APPEND ls_line TO gt_top_of_page.
ls_line-key = 'Satıcı.:'.
CONCATENATE s_lifnr-low s_lifnr-high
INTO ls_line-info SEPARATED BY '/'.
APPEND ls_line TO gt_top_of_page.
ls_line-key = 'SAS No.:'.
CONCATENATE s_ebeln-low s_ebeln-high
INTO ls_line-info SEPARATED BY '/'.
APPEND ls_line TO gt_top_of_page.
ENDFORM. " alv_list_header
FORM alv_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_top_of_page.
ENDFORM. "TOP_OF_PAGE
FORM get_data .
DATA : BEGIN OF tr ,
menge LIKE eket-menge ,
dabmg LIKE eket-dabmg ,
END OF tr ,
zzfiilytar LIKE zzith_yukh-zzfiilytar .
*- Get data ...
SELECT *
INTO CORRESPONDING FIELDS OF TABLE list
FROM ekpo AS a
INNER JOIN ekko AS b ON bebeln = aebeln
WHERE b~ebeln IN s_ebeln AND
b~bukrs IN s_bukrs AND
b~loekz EQ space AND
b~lifnr IN s_lifnr AND
b~ekorg IN s_ekorg AND
b~ekgrp IN s_ekgrp AND
a~loekz EQ space AND
a~elikz EQ space .
LOOP AT list .
CLEAR tr .
SELECT menge dabmg
INTO tr
FROM eket
WHERE ebeln = list-ebeln AND
ebelp = list-ebelp.
tr-menge = tr-menge - tr-dabmg .
ENDSELECT.
IF tr-menge LE 0 .
DELETE list .
ELSE .
list-menge = tr-menge .
IF tr-dabmg GT 0 .
list-fyukl = '*' .
ENDIF .
SELECT SINGLE butxt INTO list-tname1 FROM t001
WHERE bukrs = list-bukrs .
SELECT SINGLE slfdt INTO list-slfdt FROM eket
WHERE ebeln = list-ebeln AND
ebelp = list-ebelp .
SELECT SINGLE name1 INTO list-name1 FROM lfa1 WHERE lifnr = list-lifnr.
SELECT SINGLE mtart matkl INTO (list-mtart,list-matkl)
FROM mara WHERE matnr = list-matnr .
SELECT SINGLE eknam INTO list-eknam FROM t024 WHERE ekgrp = list-ekgrp .
MODIFY list .
ENDIF .
ENDLOOP .
ENDFORM. " get_data
FORM print_data .
LEAVE TO LIST-PROCESSING .
NEW-PAGE NO-HEADING NO-TITLE LINE-SIZE 229 .
SET PF-STATUS SPACE .
PERFORM top-of-page .
malzeme türü 1005 ler yazdırılır
PERFORM yazdir_1005 .
malzeme türü 1005 olmayanlar yazdırılır
PERFORM yazdir_ne_1005 .
Satınalama grupları bilgisi yazdırılır
PERFORM yazdir_ekgrp .
ENDFORM. " print_data
FORM top-of-page .
WRITE : 'ÜLKER GRUBU KONSOLİDE' .
WRITE AT 40 'Sevkiyat Bekleyen Malzemeler' COLOR COL_HEADING .
WRITE : 180 sy-uname , sy-datum , sy-uzeit.
NEW-LINE .
ULINE 0(229) .
WRITE :/2 'Rapor Kodu..............:' , (10) sy-tcode .
WRITE :/2 'Satınalma Organizasyonu.:' , (10) s_ekorg-low, '/', (10) s_ekorg-high .
WRITE :/2 'Satınalma Grubu.........:' , (10) s_ekgrp-low, '/', (10) s_ekgrp-high .
WRITE :/2 'Satıcı..................:' , (10) s_lifnr-low, '/', (10) s_lifnr-high .
WRITE :/2 'Satınalma Sipariş No....:' , (10) s_ebeln-low, '/', (10) s_ebeln-high .
NEW-LINE .
ULINE 0(229) .
Başlıklar yazılır
FORMAT COLOR COL_HEADING .
WRITE :
/(10) 'SAS NO.' CENTERED,
(6) 'TAHSİS' CENTERED,
(5) 'ÖDEME' CENTERED,
(5) 'Bel.T' CENTERED,
(25) 'MALZEME' CENTERED,
(25) 'SATICI' CENTERED,
(12) 'MİKTAR' CENTERED,
(3) 'BRM' CENTERED,
(3) 'G' ,
(7) 'TES.ŞK.' CENTERED,
(16) 'DÖVİZ TUTARI' CENTERED,
(3) 'DB.' CENTERED,
(13) 'İTH.İNTK.TRH.' CENTERED,
(13) 'DOSYA ON.TRH.' CENTERED,
(10) 'TAHMİN.İTH.TRH.' CENTERED,
(20) 'SİPARİŞ VEREN' CENTERED,
(10) 'TALEP NO.' CENTERED,
(18) 'DOSYA SORUMLUSU' CENTERED.
ULINE 0(229) .
FORMAT RESET .
ENDFORM. " top-of-page
FORM yazdir_1005 .
DATA ebeln LIKE list-ebeln .
SORT list BY zzbltur matnr .
temp[] = list[] .
DELETE temp WHERE mtart <> '1005' .
LOOP AT list WHERE mtart = '1005' .
CLEAR list-netwr .
IF ebeln NE list-ebeln OR ebeln EQ space .
REFRESH total . CLEAR total .
ebeln = list-ebeln .
LOOP AT temp WHERE ebeln = list-ebeln .
list-netwr = list-netwr + temp-netwr .
CLEAR total .
total-txz01 = '*** TKNK.MLZ. TOPLAMI ****' .
total-meins = temp-meins .
total-menge = temp-menge .
COLLECT total .
ENDLOOP .
PERFORM write_list USING '1' .
LOOP AT total .
PERFORM write_list USING '2' .
ENDLOOP .
AT END OF zzbltur .
ULINE 0(229) .
ENDAT .
ENDIF .
ENDLOOP .
ENDFORM. " yazdir_1005
FORM write_list USING flag .
flag 1 1005 için yazdırma
flag 2 ise ara toplam
IF flag = '1' .
FORMAT COLOR COL_NORMAL .
WRITE :
/(10) list-ebeln ,
(6) list-zztahsk,
(5) list-zterm,
(5) list-zzbltur ,
(25) list-txz01,
(25) list-name1,
(12) list-menge,
(3) list-meins,
(3) list-fyukl,
(7) list-inco1,
(16) list-netwr,
(3) list-waers,
(13) list-bedat,
(13) list-zzontar,
(10) list-slfdt ,
(20) list-tname1,
(10) list-banfn ,
(18) list-eknam .
FORMAT RESET .
ELSEIF flag = '2' .
FORMAT COLOR COL_TOTAL .
WRITE :
/(10) '' ,
(6) '' ,
(5) '' ,
(5) '' ,
(25) total-txz01,
(25) '' ,
(12) total-menge,
(3) total-meins,
(3) '' ,
(7) '' ,
(16) '' ,
(3) '' ,
(13) '' ,
(13) '' ,
(10) '' ,
(20) '' ,
(10) '' ,
(18) '' .
FORMAT RESET .
ELSEIF flag = '3' .
FORMAT COLOR COL_TOTAL .
WRITE :
/(10) '' ,
(6) '' ,
(5) '' ,
(5) '' ,
(25) total-txz01,
(25) '' ,
(12) total-menge,
(3) '' ,
(3) '' ,
(7) '' ,
(16) total-netwr ,
(3) '' ,
(13) '' ,
(13) '' ,
(10) '' ,
(20) '' ,
(10) '' ,
(18) '' .
FORMAT RESET .
ENDIF .
ENDFORM. " write_list
FORM yazdir_ne_1005 .
DATA matnr LIKE list-matnr .
SORT list BY zzbltur matkl matnr .
temp[] = list[] .
DELETE temp WHERE mtart = '1005' .
LOOP AT list WHERE mtart <> '1005' .
Her yeni Malzeme için ara toplam yazılır
IF matnr NE list-matnr AND matnr NE space .
REFRESH total . CLEAR total .
Toplamlar alınır
LOOP AT temp WHERE matnr = matnr .
CLEAR total .
total-netwr = temp-netwr .
total-menge = temp-menge .
total-txz01 = '*** TOPLAM ****' .
COLLECT total .
ENDLOOP .
LOOP AT total . .
PERFORM write_list USING '3' .
ENDLOOP .
ULINE 0(229) .
ENDIF .
PERFORM write_list USING '1' .
matnr = list-matnr .
ENDLOOP .
Toplamlar alınır
LOOP AT temp WHERE matnr = matnr .
REFRESH total . CLEAR total .
total-netwr = temp-netwr .
total-menge = temp-menge .
total-txz01 = '*** TOPLAM ****' .
COLLECT total .
ENDLOOP .
LOOP AT total .
PERFORM write_list USING '3' .
ENDLOOP .
ULINE 0(229) .
ENDFORM. " yazdir_ne_1005
FORM yazdir_ekgrp .
DATA: BEGIN OF total OCCURS 1 ,
eknam LIKE list-eknam ,
zzbltur LIKE list-zzbltur ,
sayi TYPE i ,
END OF total .
DATA: BEGIN OF gtotal OCCURS 1 ,
eknam LIKE list-eknam ,
zzbltur LIKE list-zzbltur ,
sayi TYPE i ,
END OF gtotal .
DATA: bltur LIKE zzith_bltur OCCURS 1 WITH HEADER LINE .
DATA: len TYPE i .
DATA: wa LIKE total.
REFRESH temp .
SELECT * INTO TABLE bltur FROM zzith_bltur .
CLEAR bltur .
MOVE : 'ZZZZ' TO bltur-zzbltur , " Satır toplamı için ...
text-002 TO bltur-zztanim .
APPEND bltur .
CLEAR list .
SORT list BY eknam ebeln .
DELETE ADJACENT DUPLICATES FROM list COMPARING eknam ebeln .
LOOP AT list .
CLEAR : total, gtotal .
total-eknam = list-eknam .
total-zzbltur = list-zzbltur .
total-sayi = 1 .
COLLECT total .
total-eknam = list-eknam .
total-zzbltur = 'ZZZZ' .
total-sayi = 1 .
COLLECT total .
gtotal-eknam = text-001 .
gtotal-zzbltur = list-zzbltur .
gtotal-sayi = 1 .
COLLECT gtotal .
gtotal-eknam = text-001 .
gtotal-zzbltur = 'ZZZZ' .
gtotal-sayi = 1 .
COLLECT gtotal .
ENDLOOP .
FORMAT COLOR COL_HEADING.
ULINE AT /1(145).
WRITE :/
sy-vline , (15) 'Dosya Sorumlusu' , sy-vline .
LOOP AT bltur .
WRITE :(15) bltur-zztanim , sy-vline .
ENDLOOP .
ULINE AT /1(145).
FORMAT RESET .
total-zzbltur = '0001' .
MODIFY total TRANSPORTING zzbltur WHERE zzbltur = space .
gtotal-zzbltur = '0001' .
MODIFY gtotal TRANSPORTING zzbltur WHERE zzbltur = space .
SORT total BY eknam .
LOOP AT total .
AT NEW eknam .
WRITE :/
sy-vline , (15) total-eknam COLOR COL_HEADING ,
sy-vline .
LOOP AT bltur .
len = sy-tabix * 18 .
len = len + 3 .
CLEAR wa .
READ TABLE total INTO wa WITH KEY zzbltur = bltur-zzbltur
eknam = total-eknam .
WRITE AT len(15) wa-sayi NO-ZERO.
WRITE sy-vline .
ENDLOOP .
ENDAT .
ENDLOOP .
LOOP AT gtotal .
AT NEW eknam .
FORMAT COLOR COL_TOTAL .
WRITE :/
sy-vline , (15) gtotal-eknam ,
sy-vline .
LOOP AT bltur .
len = sy-tabix * 18 .
len = len + 3 .
CLEAR wa .
READ TABLE gtotal INTO wa WITH KEY zzbltur = bltur-zzbltur
eknam = text-001 .
WRITE AT len(15) wa-sayi NO-ZERO.
WRITE sy-vline .
ENDLOOP .
ENDAT .
ENDLOOP .
ULINE AT /1(145).
FORMAT RESET .
ENDFORM. " yazdir_ekgrpHi,
In the function use the top-of-page event as follows:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = 'ZRPMSLM'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
<b> I_CALLBACK_TOP_OF_PAGE = 'TOP'</b>
Define whatever to appear in top-of page in a subroutine named TOP.
Hope this helps.
Reward if helpful.
Regards,
Sipra -
Print and print priview of top-of-page event
Hi,
i used oops to display top of page using document class, i am printing or print priview, it is not showing. please tell how to print this html document. i am succesfully displaying html document in grid display, while printing the list, it will not printing, please tell me solution.
Thanks
Sudhakar
Sample code:
CREATE OBJECT g_document
EXPORTING
style = 'ALV_GRID'.
CREATE OBJECT g_docking
EXPORTING
repid = g_repid
dynnr = '0100'
ratio = 95.
extension = 700
side = cl_gui_docking_container=>dock_at_top.
IF sy-subrc <> 0.
ENDIF.
CREATE OBJECT g_splitter
EXPORTING parent = g_docking
rows = 2
columns = 1.
CALL METHOD g_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = g_htmlc.
CALL METHOD g_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = g_alvc.
CALL METHOD g_splitter->set_row_height
EXPORTING
id = 1
height = 14.
CREATE OBJECT g_grid0100
EXPORTING
i_parent = g_alvc.
CREATE OBJECT g_event_receiver.
SET HANDLER g_event_receiver->handle_top_of_page FOR g_grid0100.
SET HANDLER g_event_receiver->handle_top_of_list FOR g_grid0100.
CALL METHOD g_document->initialize_document.
CALL METHOD g_grid0100->list_processing_events
EXPORTING
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = g_document.
gs_print-reservelns = 2.
PERFORM build_fieldcatalog.
PERFORM build_layout.
g_save = 'A'.
gs_variant-report = g_repid.
CALL METHOD g_grid0100->set_table_for_first_display
EXPORTING
is_layout = gs_layout
is_variant = gs_variant
i_save = g_save
is_print = gs_print
CHANGING
it_outtab = gt_alv0100
it_fieldcatalog = gt_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
CLASS LCL_event_handler IMPLEMENTATION
CLASS lcl_event_reciever IMPLEMENTATION.
METHOD handle_top_of_page.
DATA: l_date(10) TYPE c,
l_text TYPE sdydo_text_element.
WRITE sy-datum TO l_date.
CONCATENATE 'Report Date: ' l_date INTO l_text.
CALL METHOD e_dyndoc_id->add_text
EXPORTING
text = l_text
sap_fontsize = cl_dd_area=>strong.
CALL METHOD e_dyndoc_id->new_line.
CALL METHOD e_dyndoc_id->add_gap
EXPORTING
width = 8.
IF g_htmlv IS INITIAL.
CREATE OBJECT g_htmlv
EXPORTING
parent = g_htmlc.
ENDIF.
CALL METHOD g_document->merge_document.
g_document->html_control = g_htmlv.
CALL METHOD e_dyndoc_id->display_document
EXPORTING
reuse_control = 'X'
parent = g_htmlc
EXCEPTIONS
html_display_error = 1.
ENDMETHOD. "handle_top_of_page
METHOD handle_top_of_list.
ENDMETHOD. "handle_top_of_list
ENDCLASS. "lcl_event_reciever IMPLEMENTATIONHi,
While using OOPS for ALV, the top-of-page and end-of-page will not show at display, but while printing it, then it will be printed properly, try to take the printout and observer.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 2:08 PM
Maybe you are looking for
-
Project renames sequence and all clips in the sequence when a clip is added
My project is renaming my sequences and the clips in those sequences whenever I add a clip. For example, I have a sequence called "dance section 2", which contains 20 some-odd clips with various names. When I add a clip named "drop from above", the n
-
Task Flow Based On Input Parameter
I am using JDev 11.1.1.6. I have an app that uses a Task Flow with "ExecuteWithParams" to get the parameter from a URL and display the appropriate records on a page. I do this by using a Bind Variable on the VO that corresponds to the InputParameter
-
How to send encrypted data through XI. Pls advice urgent
Hi All, There is some customer confidental information that I need to send from source system to XI and then to target system. So client wants that data to be encrypted.Source and Target system can be File System or can be wsdl files. Please send me
-
InDesign CS - Type is missing in exported PDF?
Hi, I am using InDesign CS. When I save my file as a .pdf and view and print it the type is missing. I am just using the default pdf export settings. To save the .pdf here's what I did. 1. I have an open InDesign project and I select (PDF Export Pres
-
iPod touch running 4.1 won't mount on iTunes 9.2.1 on my mac running 10.4.11