How to upload logo for alv grid when we are using classes
Hi am using cl_gui_alv_tree for displaying alv grid. i want to upload logo in the heade section. as we do in simple alvs using resuse_alv_commentary_write.
plz update me in this regard.
regards
venkat
Welcome to SDN.
Check the following threads -
How To use TOP OF PAGE event in OOPS ALV?
Logo & TOP_OF_PAGE in OO ALV
Regards,
Amit
Reward all helpful replies.
Similar Messages
-
How to display LOGO in ALV grid when using class CL_GUI_ALV_GRID
Hello everyone,
please let me know how to display Company logo as the header part in the report program with the class cl_gui_alv_grid.
Thanks and regards,
Padma.Hi,
Got this info from a site.
http://sap.ittoolbox.com/documents/document.asp?i=3213
In the transaction OAOR, you should be able to insert your company Logo.
GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
Try this one.
Also have a look at this link
http://www.sap-img.com/fu002.htm
Message was edited by: Judith Jessie Selvi -
How to upload logos in alv reports
how to upload logos in alv reports?
Hi Kishore,
ALV LOGO
Re: How do I insert a logo in ALV using Function Modules?
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
Steps for uploading Logo :-:
1. Goto the transaction OAER
2. Enter the class name as 'PICTURES'
3. Enter the class type as 'OT'
4. Enter the object key as the name of the logo you wish to give
5. Execute
6. Then in the new screen select Standard doc. types in bottom window
Click on the Screen icon
Now, it will ask for the file path where you have to upload the logo
7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
Here you go !!
*& Form TOP_OF_PAGE
text
FORM F_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
i_logo = Logo name
I_END_OF_LIST_GRID =.
ENDFORM. "TOP_OF_PAGE
Hope this helps.
Manish -
Field catalogue for ALV Grid when program is run in the background
Hi All,
I have an ALV report that contains approx 27 fields. Not all of these fields will be relevant for different Users, and many will want to change the order the fields appear in.
When running on line the User can set a variant to present the data as they wish. However, I need to email this report to the SAP Inbox with the fields displayed in the same Order with uncessary fields hidden as stated in the Field Catalogue.
On-line none of this is an issue, however GET_FRONTEND_FIELDCATALOG cannot be used in Background, and attribute MT_FIELDCAT_LOCAL is Private and cannot be accessed.
I have looked at using Class CL_ ALV_VARIANT to try to read the Variant being used, but couldn't get the information about the Variant coming back, instead I get an error in CL_ALV_VARIANT->LOAD_VARIANT.
Can anybody recommend how to the Field Cat for a Variant for background processing?
Thanks,
Tony.Hi.
You can not use an ALV report in Background or write to spool because it is a kind of dialog program.
You can write only a List report to spool so please find others sulotions.
Hope it helps.
Sayan. -
How to set variant for ALV grid from ABAP
Hello,
I have a program which displays some data with ALV grid. Then after some operation I would like to set different layout for the grid, but not by choosing it manually but by the program. I thought that it would be enough to use the method SET_VARIANT, so I'm setting DISVARIANT structure properly, using SET_VARIANT method and after that I'm calling REFRESH_TABLE_DISPLAY but layout is not changed. What else should I do? Is that possible?
Best regards,
MarcinHi,
Check this
* While declaring select-options
parameters: p_vari like ltdx-variant. " Layout
* then add the following code in
at selection-screen on value-request for p_vari.
perform f_variant_f4 using p_vari.
* Code for f_variant_f4
form f_variant_f4 using p_vari.
* private variables
data : v_exit type c.
clear gs_variantt.
v_variant_save = 'U'.
call function 'LVC_VARIANT_F4'
exporting
is_variant = gs_variant
i_save = v_variant_save
importing
e_exit = v_exit
es_variant = gs_variantt
exceptions
not_found = 1
program_error = 2
others = 3.
if sy-subrc ne c_0.
message i999(yscc) with text-064. " No Layout Available for F4
endif.
if v_exit is initial.
gs_variant-variant = gs_variantt-variant.
p_vari = gs_variantt-variant.
endif.
endform. " F_variant_f4
* In PBO
call method grid1->set_table_for_first_display
exporting
is_layout = gs_layout
is_variant = gs_variant
i_save = 'A'
it_toolbar_excluding = i_exclude[]
changing
it_outtab = i_output[]
it_fieldcatalog = i_fieldcat[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
a® -
How to upload price for a item in price list using DTW ?
hi all,
How to upload prices of all the items in price list using DTW ?
What are templates used for it ?
Item masters were already created.
JeyakanthanHi
Create two Excel templates 'Items.xls' and 'Items_Prices.xls'
Since you have already imported items, just have the record key and item code alone in the 'Items.xls' . For example:
RecordKey.......ItemCode
1.......................I0001
2.......................I0002
In the Items_Prices template, Fill Pricelist Number fromOPLN and Price of the Item
RecordKey....LineNum......Price
1......................1..............350.00 (Means for Item I001, Pricelist 1 is updated with 350)
1......................2..............300.00 (Means for Item I001, Pricelist 2 is updated with 300)
2......................1..............550.00 (Means for Item I002, Pricelist 1 is updated with 550)
2......................2..............600.00 (Means for Item I002, Pricelist 2 is updated with 600)
In step 4 of DTW, Choose
Check - Update Exisiting Object
Uncheck - Import New Object
This should update the pricelist alone for the items -
How to display logo in alv grid display
Hi, i am using 'REUSE_ALV_COMMENTARY_WRITE' to display logo. but i couldn't get in the output.
plain explain how use this functoin module.
DATA : it_listheader TYPE slis_t_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo = 'LOGO'.hi
i am doing month wise customer sale report.
the output should like that
month customer1 customer2 customer3 customer 4 total
jan 100 200 200 - 500
feb 300 300
mar
apr
total 100 200 500 800
i want to do this dynamicaly.
let me know how can i display customer as a header. -
Hi, I have a student who wants to match the color of a new layer to the exact color of an existing layer. He is using an adjustment layer to "eyeball" the color match, but is there a way to ensure that the match is perfect?
Depends, John.
If you're able to create a reasonable selection via Color Range, feathered masking, etc, then by matching one specific color, you'll also be correcting for that entire range of hue. It might have been needed anyway...or you use a color filter to correct the whole image, if it's needed.
As we all know, each image presents its own specific challenges and solutions. -
how do upload logo in ALV
Hi,just go thru this,so that u can easily understood how to add the logo to the header.
THIS IS TO DISPLAY THE HEADER WITH LOGO.
Follow the below step while uploading the image file:
Steps for uploading Logo :-:
1. Goto the transaction OAER
2. Enter the class name as 'PICTURES'
3. Enter the class type as 'OT'
4. Enter the object key as the name of the logo(e.g. tripodsm.gif) you wish to give
5. Execute
6. Then in the new screen select Standard doc. types in bottom window
Click on the Screen icon
Now, it will ask for the file path where you have to upload the logo
7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_header
i_logo = 'tripodsm.gif'.
This is the full code.
TABLES VBAK.
TYPE-POOLS SLIS.
Data Declaration
TYPES: BEGIN OF T_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
AUDAT TYPE VBAK-AUDAT,
VBTYP TYPE VBAK-VBTYP,
NETWR TYPE VBAK-NETWR,
VKORG TYPE VBAK-VKORG,
VKGRP TYPE VBAK-VKGRP,
LINE_COLOR(4) TYPE C,
END OF T_VBAK.
DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
WA_VBAK TYPE T_VBAK.
ALV Data Declaration
DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
GD_REPID TYPE SY-REPID.
I_EVENTS TYPE SLIS_T_EVENT,
W_EVENTS LIKE LINE OF I_EVENTS.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BLD_FLDCAT.
PERFORM BLD_LAYOUT.
PERFORM DISPLAY_ALV_REPORT.
Build Field Catalog for ALV Report
FORM BLD_FLDCAT.
FLDCAT-FIELDNAME = 'VBELN'.
FLDCAT-SELTEXT_M = 'Sales Document'.
FLDCAT-COL_POS = 0.
*FLDCAT-EMPHASIZE = 'C411'.
FLDCAT-OUTPUTLEN = 20.
FLDCAT-KEY = 'X'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERDAT'.
FLDCAT-SELTEXT_L = 'Record Date created'.
FLDCAT-COL_POS = 1.
FLDCAT-KEY = 'X'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'ERNAM'.
FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'AUDAT'.
FLDCAT-SELTEXT_M = 'Document Date'.
FLDCAT-COL_POS = 3.
FLDCAT-EMPHASIZE = 'C110'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'VBTYP'.
FLDCAT-SELTEXT_L = 'SD Document category'.
FLDCAT-COL_POS = 4.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'NETWR'.
FLDCAT-SELTEXT_L = 'Net Value of the SO in Document Currency'.
FLDCAT-COL_POS = 5.
FLDCAT-OUTPUTLEN = 60.
FLDCAT-DO_SUM = 'X'.
FLDCAT-DATATYPE = 'CURR'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'VKORG'.
FLDCAT-SELTEXT_L = 'Sales Organization'.
FLDCAT-COL_POS = 6.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
FLDCAT-FIELDNAME = 'VKGRP'.
FLDCAT-SELTEXT_M = 'Sales Group'.
FLDCAT-COL_POS = 7.
FLDCAT-EMPHASIZE = 'C801'.
APPEND FLDCAT TO FLDCAT.
CLEAR FLDCAT.
ENDFORM.
Build Layout for ALV Grid Report
FORM BLD_LAYOUT.
GD_LAYOUT-NO_INPUT = 'X'.
GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
*GD_LAYOUT-TOTALS_TEXT = 'GRAND TOTAL'.
ENDFORM.
Display report using ALV grid
FORM DISPLAY_ALV_REPORT.
DATA T_EVENT TYPE SLIS_T_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = T_EVENT.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
IS_LAYOUT = GD_LAYOUT
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = 'SALES DOCUMENT HEADER'
IT_FIELDCAT = FLDCAT[]
I_SAVE = 'X'
TABLES
T_OUTTAB = IT_VBAK
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.
Retrieve data from VBAK table and populate itab IT_VBAK
FORM DATA_RETRIEVAL.
DATA LD_COLOR(1) TYPE C.
SELECT VBELN ERDAT ERNAM AUDAT VBTYP NETWR VKORG
UP TO 20 ROWS
FROM VBAK
INTO TABLE IT_VBAK.
LOOP AT IT_VBAK INTO WA_VBAK.
LD_COLOR = LD_COLOR + 1.
IF LD_COLOR = 8.
LD_COLOR = 1.
ENDIF.
CONCATENATE 'C' LD_COLOR '10' INTO WA_VBAK-LINE_COLOR.
MODIFY IT_VBAK FROM WA_VBAK.
ENDLOOP.
ENDFORM.
FORM TOP_OF_PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
W_HEADER TYPE SLIS_LISTHEADER.
W_HEADER-TYP = 'H'.
W_HEADER-INFO = 'WELCOME HEADER LIST'.
APPEND W_HEADER TO T_HEADER.
W_HEADER-TYP = 'S'.
W_HEADER-KEY = 'REPORT:'.
W_HEADER-INFO = SY-REPID.
APPEND W_HEADER TO T_HEADER.
W_HEADER-TYP = 'S'.
W_HEADER-KEY = 'DATE:'.
CONCATENATE SY-DATUM6(2) ' / ' SY-DATUM4(2) ' / ' SY-DATUM(4) INTO W_HEADER-INFO.
APPEND W_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER
I_LOGO = TRIPODSM.GIF.
ENDFORM.
reward points,if it is useful to u. -
hi experts,
how can i insert logo in alv grid..can u send me some examples of alv that includes all the functionalities like user-command,commentary write n also logo insertion etc..
regards,
ramanhi ,
chk out this .....and try this ..
for getting the events ....
FORM ZVRPSALV_EVENT_CAT CHANGING RT_EVENT TYPE slis_t_event .
DATA : s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = RT_EVENT
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
CASE sy-subrc.
WHEN 1.
MESSAGE s000 WITH 'List type does not exist'(058).
LEAVE LIST-PROCESSING.
WHEN 2.
MESSAGE s000 WITH 'Error with List Type'(059).
LEAVE LIST-PROCESSING.
ENDCASE.
READ TABLE RT_EVENT WITH KEY NAME = slis_ev_top_of_page INTO s_event .
IF sy-subrc = 0.
MOVE 'TOP_OF_PAGE'(056) TO s_event-form.
APPEND s_event TO rt_event.
CLEAR s_event.
ENDIF.
ENDFORM. " EVENT_CAT
*& Form ZVRPSALV_GRIDDISPLAY1
text
--> p1 text
<-- p2 text
FORM ZVRPSALV_GRIDDISPLAY1 .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'DISPLAY_DOCUMENT '
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 = 'BASIC LIST'
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = T_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = RT_EVENT
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 = T_ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ZVRPSALV_GRIDDISPLAY1
SUBROTINE FOR DISPLAYING THE SECONDRY ALV GRID.
FORM DISPLAY_DOCUMENT USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
READ TABLE T_ITAB INDEX RS_SELFIELD-TABINDEX .
V_VBELN = T_ITAB-VBELN.
LOOP AT T_ITAB WHERE VBELN = V_VBELN.
Move: T_ITAB-POSNR to T_ITAB1-POSNR ,
T_ITAB-MATNR to T_ITAB1-MATNR ,
T_ITAB-MATKL to T_ITAB1-MATKL,
T_ITAB-ARKTX to T_ITAB1-ARKTX ,
T_ITAB-PSTYV to T_ITAB1-PSTYV ,
T_ITAB-SPART to T_ITAB1-SPART ,
T_ITAB-GSBER to T_ITAB1-GSBER ,
T_ITAB-KWMENG to T_ITAB1-KWMENG .
Append T_ITAB1.
ENDLOOP.
ENDIF.
*& Form ZVRPSALV_COMMENT
text
-->P_T_HEADER text
FORM ZVRPSALV_COMMENT USING P_T_HEADER type slis_t_listheader .
DATA : LS_LINE TYPE SLIS_LISTHEADER.
CLEAR LS_LINE .
LS_LINE-TYP = 'H'.
LS_LINE-INFO = 'HEADING LIST'.
APPEND LS_LINE TO P_T_HEADER.
CLEAR LS_LINE.
LS_LINE-typ = 'S'.
write sy-datum to LS_LINE-info MM/DD/YYYY.
CONCATENATE text-041 LS_LINE-info INTO LS_LINE-info separated by space .
APPEND LS_LINE TO P_T_HEADER.
ENDFORM. " ZVRPSALV_COMMENT
SUBROUINE FOR TOP OF PAGE.
FORM TOP_OF_PAGE.
clear t_header.
DATA: LV_HEADER TYPE SLIS_LISTHEADER.
LV_HEADER-TYP = 'S'.
WRITE SY-DATUM TO LV_HEADER-INFO MM/DD/YYYY.
CONCATENATE TEXT-041 LV_HEADER-INFO INTO LV_HEADER-INFO SEPARATED BY SPACE.
APPEND LV_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER
I_LOGO = ' ENJOYSAP_LOGO '
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
*& Form ZVRPSALV_EVENTTAB
text
<--P_T_EVENT text
FORM ZVRPSALV_EVENTTAB CHANGING P_T_EVENT 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 = P_T_EVENT.
SEARCH THE TOP OF PAGE EVENT.
READ TABLE P_T_EVENT WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT .
IF SY-SUBRC = 0 .
MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_T_EVENT.
ENDIF.
ENDFORM. " ZVRPSALV_EVENTTAB
thanks and regards
Priyank Dixit -
List header for alv grid using abap objects
Hai all,
I have displayed alv grid in container control using abap objects i.e. using method set_table_for_first_display.
now i need to display list header for this alv grid.
please help me how to create with a sample coding.
Thanks and regards,
Prabu S.Create a splitter using CL_GUI_EASY_SPLITTER_CONTAINER with a top and bottom half. Put the alv grid in the bottom half. Use cl_dd_document (documented in help.sap.com ) to build the header in the top half. Use events on CL_GUI_ALV_GRID to handle the top-of-list printing.
Or, if available, use CL_SALV_TABLE, and read the documentation on that. When I needed a header for my report, that's what I did. There's plenty of good documentation about if you'll search for it.
matt -
I need to print logo in alv grid
I need to print logo in alv grid .As of now its getting displayed but it cannot be printed .Kindly tell me wether there is any option to print it .Eitjer using ALV or Object oriented ALV.Please reply soon
Hi Deepti,
Refer the code below.
report sy-repid.
type-pools : slis.
*ALV Formatting tables /structures
data: gt_fieldcat type slis_t_fieldcat_alv.
data: gt_events type slis_t_event.
data: gs_layout type slis_layout_alv.
data: gt_page type slis_t_listheader.
data: gs_page type slis_listheader.
data: v_repid like sy-repid.
*ALV Formatting work area
data: w_fieldcat type slis_fieldcat_alv.
data: w_events type slis_alv_event.
data: gt_bsid type table of bsid with header line.
initialization.
perform build_events.
perform build_page_header.
start-of-selection.
*perform build_comment. "top_of_page - in initialization at present
select * from bsid into table gt_bsid up to 10 rows.
*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading
*OR
perform build_fieldcat.
gs_layout-zebra = 'X'.
*top of page event does not work without I_callback_program
v_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = v_repid
i_structure_name = 'BSID'
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'This is the grid title'
I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
tables
t_outtab = gt_bsid.
Form..............: populate_for_fm
Description.......: Populates fields for function module used in ALV
form populate_for_fm using p_row
p_col
p_fieldname
p_len
p_table
p_desc.
w_fieldcat-row_pos = p_row. "Row Position
w_fieldcat-col_pos = p_col. "Column Position
w_fieldcat-fieldname = p_fieldname. "Field name
w_fieldcat-outputlen = p_len. "Column Lenth
w_fieldcat-tabname = p_table. "Table name
w_fieldcat-reptext_ddic = p_desc. "Field Description
w_fieldcat-input = '1'.
append w_fieldcat to gt_fieldcat.
clear w_fieldcat.
endform. " populate_for_fm
*& Form build_events
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_user_command
into ls_event.
if sy-subrc = 0.
move slis_ev_user_command to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move slis_ev_top_of_page to ls_event-form.
append ls_event to gt_events.
endif.
endform. " build_events
*& Form USER_COMMAND
When user command is called it uses 2 parameters. The itab
passed to the ALV is in whatever order it currently is on screen.
Therefore, you can read table itab index rs_selfield-tabindex to get
all data from the table. You can also check r_ucomm and code
accordingly.
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
read table gt_bsid index rs_selfield-tabindex.
error checking etc.
set parameter id 'KUN' field gt_bsid-kunnr.
call transaction 'XD03' and skip first screen.
endform.
*& Form top_of_page
Your own company logo can go here if it has been saved (OAOR)
If the logo is larger than the size of the headings in gt_page,
the window will not show full logo and will have a scroll bar. Thus,
it is a good idea to have a standard ALV header if you are going to
use logos in your top of page.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_page
i_logo = 'ENJOYSAP_LOGO'.
endform.
*& Form build_fieldcat
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
form build_fieldcat.
w_fieldcat-fieldname = 'BUDAT'.
w_fieldcat-seltext_m = 'Dte pst'.
w_fieldcat-ddictxt(1) = 'M'.
Can change the position of fields if you do not want them in order
of the DDIC or itab
w_fieldcat-row_pos = '1'.
w_fieldcat-col_pos = '10'.
append w_fieldcat to gt_fieldcat.
clear w_fieldcat.
endform. " build_fieldcat
*& Form build_page_header
gt_page is used in top of page (ALV subroutine - NOT event)
*H = Header, S = Selection, A = Action
form build_page_header.
For Headers, Key is not printed and is irrelevant. Will not cause
a syntax error, but is not used.
gs_page-typ = 'H'.
gs_page-info = 'Header 1'.
append gs_page to gt_page.
gs_page-typ = 'H'.
gs_page-info = 'Header 2'.
append gs_page to gt_page.
For Selections, the Key is printed (bold). It can be anything up to 20
bytes. It gets printed in order of code here, not by key value.
gs_page-typ = 'S'.
gs_page-key = 'And the winner is:'.
gs_page-info = 'Selection 1'.
append gs_page to gt_page.
gs_page-typ = 'S'.
gs_page-key = 'Runner up:'.
gs_page-info = 'Selection 2'.
append gs_page to gt_page.
For Action, Key is also irrelevant.
gs_page-typ = 'A'.
gs_page-info = 'Action goes here'.
append gs_page to gt_page.
endform. " build_page_header
Settings for the Logo :
01) GOTO - OAOR (Business Document Navigator)
02) Give Class Name - PICTURES
Class Type - OT
Object type - whatever you want to call your area EG: OURCOMP.... then Execute
03) Top left will say PICTURES. Bottom left will have multi tab. Select Create and double-click on Screen.
04) Select your image from the appropriate directory.
05) Give the image an appropriate name (not Screen)
06) It will tell you document stored successfully.
07) You can now find your logo under the heading OURCOMP in top left window.
08) You can reference the logo in things like FM REUSE_ALV_COMMENTARY_WRITE or any other area which may reference these things. EG: I_LOGO = 'OURCOMP'. You can preview image by double-clicking it.
<b>Please reward points if it helps.</b>
Regards,
Amit Mishra
Message was edited by: Amit Mishra -
Not able to display logo on alv grid output
hi
can anybody guide me.
i have written code for displaying logo on alv grid report.
i uploaded bmp image using OAER
but even then i am not able to display logo on the report please help me
i am using 4.7 version..
code...
REPORT ZALVLOGO .
type-pools: slis.
data: i_sflight type table of sflight.
*data: begin of i_sflight occurs 10.
*include structure sflight.
*data: end of i_sflight.
data: it_events type slis_t_event,
wa_events type slis_alv_event.
select * from sflight into table i_sflight.
perform form_fill_table.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_TOP_OF_PAGE = 'top-of-page'
I_STRUCTURE_NAME = 'sflight'
TABLES
T_OUTTAB = i_sflight
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
--> p1 text
<-- p2 text
FORM top-of-page .
data: t_header type slis_t_listheader,
wa_header type slis_listheader.
wa_header-typ = 'h'.
wa_header-info = 'FLIGHT DETAILS'.
APPEND wa_header to t_header.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = t_header
I_LOGO = 'ENJOY'.
I_END_OF_LIST_GRID =.
ENDFORM. " top_of_page
*& Form form_fill_table
text
--> p1 text
<-- p2 text
FORM form_fill_table .
clear wa_events.
wa_events-name = 'top-op-page1'.
wa_events-form = 'top-of-page'.
append wa_events to it_events.
ENDFORM. " form_fill_tablehi ,
First upload images in SAP using transaction se78
http://www.howforge.com/step-by-step-upload-bitmap-images-to-sap
Then use that Image name to call using function module
in top of -page
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'KAL1_LOGO'
it_list_commentary = lt_top_of_page_no_sel.
Regards
Deepak. -
How to implement 'hypelink' in ALV GRID
Hi,everybody,please tell me how to implement 'hypelink' in ALV GRID?
I just try to design a ALV GRID report but I do not kown the way of using 'hypelink'. I refer to some documents but failsed. somebody can help me and give a example including entire code.1. Create a table where hyperlinks & corresponding handles are stored (TYpe LVC_T_HYPE)
DATA ls_hype TYPE lvc_s_hype .
data lt_hype type lvc_t_hype.
ls_hype-handle = '1' .
ls_hype-href = 'http://www.company.com/carrids/car1' .
APPEND ls_hype TO lt_hype .
2. In your list data table create additional field of type INT4 which will contain the handle of the hyper link (ex. '1' for above hyperlink)
DATA carrid_handle TYPE int4 .
3. For the field which shall contain the hyperlink, make an entry in the field catalog indicating the field name which contains handle for the hyperlink. This is done by setting the handle field name in WEB_FIELD.
ls_fieldcat-fieldname = 'CARRID'
ls_fieldcat-web_field = 'CARRID_HANDLE'.
4. While calling set_table_for_first_display, pass the hyperlink table created in step 1 to parameter 'it_hyperlink'
~Piyush Patil -
F.01 Summary Report for ALV grid
Hi all,
We have defined our financial statement version (FSV). We have been running tests in transaction F.01, when we choose ALV Tree output the transaction works perfectly.
However, if we choose ALV grid output and then choose "1" in the Summary Report field (highest summary level, only main points of Balance sheet P&L statement should be displayed) the output is not summarized at all.
In short, no matter what number we put in the Summary Report field we always get the same output.
What needs to be done in order to be able to use this summarization control?
Any help will be appreciated.
Juan
Edited by: Juan Carlos Mier Giraud on Jul 8, 2008 4:50 PMRenata,
Thanks for your help. I am going to need a bit of help to develop the solutions described in the notes you pointed out.
Have you successfully created a summarization for ALV grid output?
I just want to know if it is worthy to devote time to it or just use classic list or ALV tree when appropiate.
Regards
Maybe you are looking for
-
Transferring files from users mashines on the server. Uploading with applet
I'm trying to create applet that would do uploading of user file on the server. I'm woundering, Is there any ways to use java applet to open a file on user mashine into a stream and transfer it thought socket into server? Is there any good solution t
-
Hi, I have logical standby (broken ??) I started it, I got : alert.log: Archive log rejected (thread 1 sequence 9367) by RFS clients Thu Jul 04 15:06:09 2013 Archive log rejected (thread 1 sequence 9367) by RFS clients Thu Jul 04 15:07:09 2013 Archiv
-
Unable to process your transaction error in istore
Hi all, I am working on istore implementation process in R12. I had created the new business contact user, and login into the istore using the created contact user login. I got following error while selecting the item to adding the shopping cart. Err
-
IR, RWB,SLD - Opening in English & ID in German
Dear all, The XI Server which we are using has a peculiar problem. IR, RWB, SLD and all other applications open in English, where as Integration Directory (ID) opens up in German. What could be the problem here? Can anyone guide me with the step by s
-
Why not unify all drivers?
I know the question is stupid, but why don't unify all models of sound cards in a single package drivers ? I believe that would facilitate for the company and for users since we could only get a single model Drive and the installation recognize the t