How to display LED lights in end of page of ALV(factory method)
Hello Experts,
How do I display the LED lights in my end-of-page(red, yellow and green).
Below is my code:
METHOD display_end_of_page.
CREATE OBJECT lcl_grid.
lv_string = text-t04.
lcl_label = lcl_grid->create_label(
row = 1
column = 1
text = lv_string
tooltip = lv_string ).
CLEAR lv_string.
lv_string = ICON_GREEN_LIGHT.
lcl_label = lcl_grid->create_label(
row = 2
column = 1
text = lv_string
tooltip = lv_string ).
lcl_label = lcl_grid->create_label(
row = 3
column = 1
text = lv_string
tooltip = lv_string ).
lcl_content = lcl_grid.
ENDMETHOD. "display_end_of_page
Hope you can help me guys.Thank you and take care!
Hi,
Use this code for Demo
*& Report ZMDEMO_ALV_04
*&Make an Exception field ( = Traffic lights)
*&There can be defined a column in the grid for display of traffic lights. This field is of type Char 1, and can contain the following values:
*& 1 Red
*& 2 Yellow
*& 3 Green
*&The name of the traffic light field is supplied inh the gs_layout-excp_fname used by method set_table_for_first_display.
report zmdemo_alv_04.
tables: sflight.
type-pools: icon.
types: begin of ty_sflight.
include structure sflight.
types: traffic_light type c,
lights LIKE icon_xml_doc,
lights(4),
icon type icon-id.
types: end of ty_sflight.
G L O B A L I N T E R N A L T A B L E S
data: t_sflight type standard table of ty_sflight.
G L O B A L D A T A
data: ok_code like sy-ucomm,
wa_sflight type ty_sflight.
Declare reference variables to the ALV grid and the container
data:
go_grid type ref to cl_gui_alv_grid,
go_custom_container type ref to cl_gui_custom_container.
data:
t_fcat type lvc_t_fcat,
wa_layout type lvc_s_layo.
S T A R T - O F - S E L E C T I O N.
start-of-selection.
perform build_fieldcat.
perform build_layout.
set screen '100'.
*& Module USER_COMMAND_0100 INPUT
module user_command_0100 input.
case ok_code.
when 'EXIT'.
leave to screen 0.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
module status_0100 output.
Create objects
if go_custom_container is initial.
create object go_custom_container
exporting container_name = 'ALV_CONTAINER'.
create object go_grid
exporting
i_parent = go_custom_container.
perform load_data_into_grid.
endif.
endmodule. " STATUS_0100 OUTPUT
*& Form load_data_into_grid
form load_data_into_grid.
data l_light type c value '1'.
Read data from table SFLIGHT
select *
from sflight
into table t_sflight.
o
+ Condition placing to the traffic_light Field
LOOP AT t_sflight INTO wa_sflight.
wa_sflight-traffic_light = l_light.
MODIFY t_sflight FROM wa_sflight.
IF l_light = '3'.
l_light = '1'.
ELSE.
l_light = l_light + 1.
ENDIF.
ENDLOOP.
o
+ Setting the Icon based on the traffic_light field value.
LOOP AT t_sflight INTO wa_sflight.
CASE wa_sflight-traffic_light.
WHEN '1'.
wa_sflight-lights = icon_red_light.
WHEN '2'.
wa_sflight-lights = icon_yellow_light.
WHEN '3'.
wa_sflight-lights = icon_green_light.
ENDCASE.
MODIFY t_sflight FROM wa_sflight.
ENDLOOP.
loop at t_sflight into wa_sflight.
case l_light.
when '1'.
wa_sflight-lights = icon_red_light.
when '2'.
wa_sflight-lights = icon_yellow_light.
when '3'.
wa_sflight-lights = icon_green_light.
endcase.
if l_light = '3'.
l_light = '1'.
else.
l_light = l_light + 1.
endif.
modify t_sflight from wa_sflight.
endloop.
Load data into the grid and display them
call method go_grid->set_table_for_first_display
exporting
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'SFLIGHT'
IS_VARIANT =
i_save = 'A'
I_DEFAULT = 'X'
is_layout = wa_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
changing
it_outtab = t_sflight[]
it_fieldcatalog = t_fcat
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
endform. " load_data_into_grid
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
form build_fieldcat .
data: w_fcat type lvc_s_fcat.
define macro_fcat.
w_fcat-fieldname = &1.
w_fcat-col_pos = &2.
w_fcat-coltext = &3.
append w_fcat to t_fcat.
clear w_fcat.
end-of-definition.
macro_fcat 'CARRID' 1 text-c01 .
macro_fcat 'CONNID' 2 text-c02 .
macro_fcat 'FLDATE' 3 text-c03 .
macro_fcat 'PRICE' 4 text-c04 .
macro_fcat 'SEATSMAX' 5 text-c05 .
macro_fcat 'SEATSOCC' 6 text-c06 .
macro_fcat 'LIGHTS' 7 text-c07 .
endform. " build_fieldcat
*& Form build_layout
text
--> p1 text
<-- p2 text
form build_layout .
wa_layout-cwidth_opt = 'X'.
wa_layout-excp_fname = 'TRAFFIC_LIGHT'.
wa_layout-excp_group = '1'.
endform. " build_layout
Regards,
Dhruv Shah
Similar Messages
-
End of page in ALV using METHODS
Hi Folks,
I have to display End of Page in an list which is using
CALL METHOD grid1->set_table_for_first_display for display.Is there any method in the same way so that I can totals at the end of page in that list.
For you info I am not using any of the REUSE_ALV_...... function modules in the program.So kindly let me know how to get it using methods.
Thanks,
K.Kiran.Hello Pratuysh,
Thanks for the answer
I know that report,but that doesn't help me.
Any other way
Thanks
Jai -
How doi print Any variable at the end of page in ALV report?
Hi,
Anyone can tell me that How do i print Any variable at the end of page in ALV report?
Exmale: at the ende of alv report i want to print total no of employee who has taken house loan or education loan.Hi,
Go through these links
Thread in sdn regarding FOOTER IN ALV
[ALV FOOTER;
Wiki in sdn regarding HEADER AND FOOTER IN ALV
[https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP%20Objects%20-%20ALV%20Model%20-%20Using%20Header%20and%20Footer]
Header and Footer in ALV
[http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm]
Hope this helps.
Thank you,
Pavan. -
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 -
How to display the header data on different position in alv report
hi all,
how to display the header data on different position in alv report.
for example ,
customer name
xxxx xxxx
vendor name street
xxxx xxxx xxxxx
pls help me .hi
as per my understanding you need to trnasfer header internal table data to pdf..
please check the following links for internal table to pdf..
Convertion of Internal table data to PDF
This link is related to ur issue
Re: how to insert the calling of the FM: OTF to PDF
Thanks -
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS
HI,
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?in ur script main window
/: IF &TTXSY-PAGE& = 15.
ur text or standard text
/: ENDIF.
use this.
hope it helps if any issues revert back -
How to display text on last but one page in SAPSCRIPTS
how to display text on last but one page in SAPSCRIPTS
u have create one Foooter window , this has to be called in only One Page.So hardcode /assign this window to only one PAGE number.
regards
Prabhu -
How to give colors to the top-of-page in ALV List Display
how to give colors to the top-of-page in ALV List Display....
Check this blog.........
It provides your required output...........
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
See the point 7 for complete code...
Regards,
Pavan -
How to display date and time on jsf page
Hi,
how to display date and time on jsf page
we are using 11.2.0.0 jdeveloper on windows.
thanks
Edited by: user12187801 on 26-Jul-2012 01:42Your question is certainly lacking some information.
If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
If you meant something else, then it's back to you to explain. -
Hi All,
I am generating the report output in ALV list and downloading in the PDF format. It is working fine.
But I am not able to print last line(AS SOME TEXT) on each page of the report. I think the output of report in ALV LIST does not show the END OF PAGE, But It should show once we take print out.
Please let me know.
Waiting for reply.
Thanks,
Rakesh SinghRakesh,
END OF PAGE can be found in ALV Printout, you can't see it in Display. So if you download as PDF without printing, it is normal not to display END-OF-PAGE.
You can print your report and you can see the END-OF-PAGE in spool and maybe you can convert this spool as PDF. Otherwise you won't use END-OF-PAGE.
Look at these links, same topic:
End of page in ALV reports
ALV - END_OF_PAGE event
http://help.sap.com/saphelp_webas630/helpdata/en/ee/c8e071d52611d2b468006094192fe3/content.htm
End of Page event not triggering in ALV report -
End of page in alv list output.
Hi All,
Can any body help me out for how to show end of page in alv list output.
Thanks,
Rakesh SinghRefer this link:
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
Regards,
Ravi -
Regarding END of PAGE in ALV's
hi guys,
Can you tell me which function module do i use to insert end of page in ALV's.
thanks
pavanHi Pavan,
check the format of End of page in this program.The page no will not be shown in the display,when you will take the printout you will see the content(pageno) that is written in the end of page event.
report ztest
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& 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
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
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_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
Build events table
form build_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_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form 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.
*& Form END_OF_LIST
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. -
How to give colors to the top-of-page in ALV Grid
How to give colors to the top-of-page in ALV Grid
in table GT_LIST_TOP_OF_PAGE i am filling 3 rows ,i need 3 different colors to be displyed on top-of-page(one color to one row)
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
please help meeHI Kranthi,
Check out teh foll. link,
http://www.sapfans.com/forums/viewtopic.php?t=52107
Hope this helps. -
23" HD Cinema Display LED light
I just received my 23" Cinema HD Display. I plugged it into the wall and the LED light never came on, or blinked. I got nothing. My tower has not arrived so I am waiting on the tower to get here. My question is: Should the LED light come on or blink when I plug the display into the wall? Please don't send me to that link that discusses how the LED light on the new monitors work because it didn't help me at all with my new monitor question.
I also tried plugging my IBM laptop to the monitor using the USB connection and still nothing happened. (I didn't think that would work anyway)I can understand the monitor screen not turning on. But shouldn't the LED light (the button on the right hand corner of the screen) at least light up or blink or something?
-
How to display trafic light red/yellow/green in web template
Hi All,
I would like to implement a traffic light display within BW web templates.
Please clarify how I can implement this.
Thanks
KarenHi,
Please check :
Displaying traffic light in a web template.
Display traffic lights for KPIs in a web-template (using thresholds)
-Vikram
Maybe you are looking for
-
Office 2013 patches not installing
I am trying to install some updates for office 2013 through Windows update and I keep on getting the error message 80070663 when installing these (8 so far). Other windows patches install fine. I am running Windows 7 Pro in a Domain environment and
-
Editing objects in a group or several at a time
hi is there any way of changing the fill colour of a shape if it is grouped with other shapes? is there any way of changing the fill colour of several shapes at the same time without using the default attributes route ( I need to have 2 colours in mh
-
Query Designer: calculate relative revenue
Hi, I would like to calculate the relative revenue (= revenue / revenue of the biggest market participant) in the BEx Query Designer. I have a key figure "revenue" and my market participant as characteristic. I first tried to create a formula like "r
-
Which of these would be the best iMac for video editing?
Hello, pretty simple question, which of these 2 iMac configurations would be best suited for video editing? I want to use Final Cut Pro X and Adobe After Effects (not cutting edge effects just simple stuff). Option 1 - 21.5 inch 3.1GHz Quad-core Inte
-
Migration tool for migrating Outlooksoft 4.2 to BPC 7.0 MS.
Hi, We are planning to do the migration from Outlooksoft 4.2 to BPC 7.0 MS version. We donu2019t have the migration tool with us, to do the migration. I have already registered with http://www.planningandconsolidationupgrade.com. Can someone let me k