F1 Documentation for ALV grid Field
Hi All,
I am working on ALV grid.I am able to dispaly the ALV grid.
It is working perfectly.
But client needs if i click on the 'F1' on field he needs the documentation of that field.
I have field documentaion.But i am not able to display.
Anybody please let me know how to make it.
Thanks,
Swapna.
Edited by: tarangini katta on Mar 12, 2009 12:43 PM
Hi,
Refer:
f1 help in alv grid
Re: Display F1 help in ALV
Hope this helps you.
Regards,
Tarun
Similar Messages
-
Supressing Std. SAP functions in F1 hep documentation of ALV grid Control
hello,
Could anyone tel me how to suppress the std. sub-headings in F1 help documentation of ALV grid fields(OO)? Like, "Shorttext","Definition" appearing as
sub-headings for short text & docu. declared in Data element of a field.
Note : i ' ve declared Data element for fields thru ROLLNAME attribute of fieldcatalog.
Thanks.
-Swaminathan.hI
I THINK IT MAY HELPFUL FOR YOU
*& Report ZAMIT_ALVOOPS
REPORT ZAMIT_ALVOOPS.
tables: mara,spfli.
types: begin of ty_tab,
matnr type mara-matnr,
ernam type mara-ernam,
ersda type mara-ersda,
end of ty_tab.
DATA ITAB1 TYPE TABLE OF SPFLI.
DATA WA1 LIKE LINE OF ITAB1.
DATA IO1 TYPE SPFLI-CARRID VALUE 'AA'.
data itab type table of ty_tab.
data wa like line of itab.
DATA OK_CODE TYPE SY-UCOMM.
DATA: GRID TYPE REF TO CL_GUI_ALV_GRID,
CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: GRID1 TYPE REF TO CL_GUI_ALV_GRID,
CONTA TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
CREATE OBJECT CONT EXPORTING CONTAINER_NAME = 'CONT1' .
CREATE OBJECT GRID EXPORTING I_PARENT = CONT .
CREATE OBJECT CONTA EXPORTING CONTAINER_NAME = 'CONT2' .
CREATE OBJECT GRID1 EXPORTING I_PARENT = CONTA .
selection-screen begin of block b1 with frame title text-100.
select-options: s_matnr for mara-matnr.
selection-screen end of block b1.
select matnr ernam ersda from mara into corresponding fields of table itab up to 15 rows
where matnr in s_matnr .
call selection-screen 100.
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
if ok_code = 'PB1'.
leave to screen 0.
else.
leave to screen 100.
endif.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
SELECT * FROM SPFLI INTO
CORRESPONDING FIELDS OF TABLE ITAB1 WHERE CARRID = IO1.
CALL METHOD grid->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'MARA'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = itab.
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SPFLI'
CHANGING
IT_OUTTAB = ITAB1.
ENDMODULE. " STATUS_0100 OUTPUT -
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 -
I need simple example for alv grid
hi
i need code for simple example for alv grid.
thanks.hi bharat,
this is report with most of the functionality.
report zus_alv_demo_grid .
tables: ekko.
type-pools: slis.
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,
line_color(4) type c, "Used to store row color
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.
Data declaration for EVENT and PRINT PARAMETER.
data: gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
data declaration for sorting.
data : it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
data : i_list_comments type slis_t_listheader.
start-of-selection.
perform data_retrieval.
perform user_command.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform build_sortcat.
perform display_alv_report.
end-of-selection.
*TOP-OF-PAGE.
PERFORM top-of-page.
end-of-page.
*& Form build_fieldcatalog
text
--> p1 text
<-- p2 text
form build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = '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.
fieldcatalog-do_sum = 'X'.
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-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
text
--> p1 text
<-- p2 text
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
Set layout field for row attributes(i.e. color)
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for
*when double
"click(press f2)*
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " build_layout
*& Form data_retrieval
text
--> p1 text
<-- p2 text
form data_retrieval.
data: ld_color(1) type c.
select ebeln ebelp statu aedat matnr menge meins netpr
peinh from ekpo into table it_ekko.
*Populate field with color attributes
loop at it_ekko into wa_ekko.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
ld_color = ld_color + 1.
Only 7 colours so need to reset color value
if ld_color = 8.
ld_color = 1.
endif.
concatenate 'C' ld_color '10' into wa_ekko-line_color.
wa_ekko-line_color = 'C410'.
modify it_ekko from wa_ekko.
endloop.
endform. " data_retrieval
*& Form display_alv_report
text
--> p1 text
<-- p2 text
form display_alv_report.
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_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
it_event = gt_events
is_print = gd_prntparams
it_fieldcat = fieldcatalog[]
it_sort = it_sortcat
i_save = 'X'
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 user_command
text
--> p1 text
<-- p2 text
*& Form top-of-page
text
--> p1 text
<-- p2 text
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 = 'GANESH_LOGO'.
endform. " top-of-page
FORM user_command *
--> R_UCOMM *
--> RS_SELFIELD *
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
if rs_selfield-fieldname = 'EBELN'.
read table it_ekko into wa_ekko index rs_selfield-tabindex.
set parameter id 'BES' field wa_ekko-ebeln.
call transaction 'ME23N' and skip first screen.
endif.
when 'ULHAS'.
if rs_selfield-fieldname = 'EBELN'.
read table it_ekko into wa_ekko index rs_selfield-tabindex.
set parameter id 'BES' field wa_ekko-ebeln.
call transaction 'ME23N' and skip first screen.
endif.
endcase.
endform.
FORM set_pf_status *
--> RT_EXTAB *
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'ZNEWSTATUS'.
endform.
*& Form build_events
text
--> p1 text
<-- p2 text
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[]
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 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
text
--> p1 text
<-- p2 text
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.
*& Form build_sortcat
text
--> p1 text
<-- p2 text
form build_sortcat.
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
append wa_sort to it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'EBELP'.
append wa_sort to it_sortcat.
endform. " build_sortcat
Rewards if helpfull
regards
vijay dwivedi -
Hi Experts,
I need to implement F4 help for ALV table field.
I my scenario, I am using two views. If we click on any record in fist view then it displays the popup window (second view) with relevant record details.
Here one of the columns having fieldnames corresponding values (old values), for correcting old values I have created new value editable column, we can enter new value for old value then we can save it. Till this functionality is ok.
Then I have included OVS help for new value field. Here I need to get f4 help for newvalue field relevant to fieldname.
For example: user clicks on f4 in cell (new value) then if corresponding fieldname is u2018WERKSu2019 then it shows the plant values
Here I can get fieldname, domain name and value table using method set_attribute ().
Same concept I have implemented in ALV using F4IF_FIELD_VALUE_REQUEST. It is working fine
Here I have little bit confusion. Please advise me how to implement in OVS.
Regards,
BBCHi,
you'll have to create a method for the OVS search help (define it in the "OVS component usage" field in the context).
Sample code (should work for WERKS):
method on_ovs .
declare data structures for the fields to be displayed and
for the table columns of the selection list, if necessary
types:
begin of lty_stru_input,
add fields for the display of your search input here
WERKS TYPE WERKS,
end of lty_stru_input.
types:
begin of lty_stru_list,
add fields for the selection list here
WERKS TYPE WERKS_D,
NAME1 type NAME1,
end of lty_stru_list.
data: ls_search_input type lty_stru_input,
lt_select_list type standard table of lty_stru_list,
ls_text type wdr_name_value,
lt_label_texts type wdr_name_value_list,
lt_column_texts type wdr_name_value_list,
lv_window_title type string,
lv_group_header type string,
lv_table_header type string,
lv_werks type werks_d.
field-symbols: <ls_query_params> type lty_stru_input,
<ls_selection> type lty_stru_list.
case ovs_callback_object->phase_indicator.
when if_wd_ovs=>co_phase_0. "configuration phase, may be omitted
in this phase you have the possibility to define the texts,
if you do not want to use the defaults (DDIC-texts)
Set label from Medium Description to something more logical...
ls_text-name = `NAME1`. "must match a field in list structure
ls_text-value = `Plant description`.
insert ls_text into table lt_label_texts.
Set col header from Medium Description to something more logical...
ls_text-name = `NAME1`. "must match a field in list structure
ls_text-value = `Plant description`.
insert ls_text into table lt_column_texts.
lv_window_title = wd_assist->get_text( `003` ).
lv_group_header = wd_assist->get_text( `004` ).
lv_table_header = wd_assist->get_text( `005` ).
ovs_callback_object->set_configuration(
label_texts = lt_label_texts
column_texts = lt_column_texts
group_header = lv_group_header
window_title = lv_window_title
table_header = lv_table_header
col_count = 2
row_count = 20 ).
when if_wd_ovs=>co_phase_1. "set search structure and defaults
In this phase you can set the structure and default values
of the search structure. If this phase is omitted, the search
fields will not be displayed, but the selection table is
displayed directly.
Read values of the original context (not necessary, but you
may set these as the defaults). A reference to the context
element is available in the callback object.
ovs_callback_object->context_element->get_static_attributes(
importing static_attributes = ls_search_input ).
pass the values to the OVS component
ovs_callback_object->set_input_structure(
input = ls_search_input ).
when if_wd_ovs=>co_phase_2.
If phase 1 is implemented, use the field input for the
selection of the table.
If phase 1 is omitted, use values from your own context.
if ovs_callback_object->query_parameters is not bound.
endif.
assign ovs_callback_object->query_parameters->*
to <ls_query_params>.
if not <ls_query_params> is assigned.
TODO exception handling
endif.
call method ovs_callback_object->context_element->get_attribute
exporting
name = 'WERKS'
importing
value = lv_werks.
data: lv_subcat_text type rstxtmd.
select werks
name1
into table lt_select_list
from T001W.
ovs_callback_object->set_output_table( output = lt_select_list ).
when if_wd_ovs=>co_phase_3.
apply result
if ovs_callback_object->selection is not bound.
endif.
assign ovs_callback_object->selection->* to <ls_selection>.
if <ls_selection> is assigned.
ovs_callback_object->context_element->set_attribute(
name = `WERKS`
value = <ls_selection>-werks ).
endif.
endcase.
endmethod. -
Need a perfect example program for ALV GRID LIST
first hi to all,i am new to this community.i am still in learning process of SAP.one of my friend suggeted this community and i think this is the perfect place to learn and excel my skill in SAP.so my requirement is a perfect example program for ALV GRID LIST DISPLAY.while i am trying another program,the sysntax is ok but i am not getting any output and it is not showing any error also.hope i will get an answer asap.thank you.
Check [OO ALV Guide Simple|http://wiki.sdn.sap.com/wiki/display/ABAP/OBJECTORIENTEDALV+Guide] and [Easy Reference to ALV|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]
-
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 -
Time out error in production server for alv grid report
hi. i have developed alv grid report using nested select statments. when i testing in development server it is giving the output but in production server if i give 4 months then it is showing time out error.please help me out..its urgent.
Thanks in advance.Hi Manu,
Don't use Nested selected statements.
Use the Following Performance Tuning Options that i have given below so that your problem can be solved.
1) Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
2) Avoid for all entries in JOINS
3) Try to avoid joins and use FOR ALL ENTRIES.
4) Try to restrict the joins to 1 level only ie only for tables
5) Avoid using Select *.
6) Avoid having multiple Selects from the same table in the same object.
7) Try to minimize the number of variables to save memory.
8) The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
9) Avoid creation of index as far as possible
10) Avoid operators like <>, > , < & like % in where clause conditions
11) Avoid select/select single statements in loops.
12) Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
13) Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
14) Avoid using ORDER BY in selects
15) Avoid Nested Selects
16) Avoid Nested Loops of Internal Tables
17) Try to use FIELD SYMBOLS.
18) Try to avoid into Corresponding Fields of
19) Avoid using Select Distinct, Use DELETE ADJACENT
<b>
Reward Points for sure if you find it useful. </b>
Regards
Babu -
Two Internal Tables for ALV Grid
Hi Gurus,
I have a little problem here. I have a report to display cost of production. The rows is about 50 displaying amount in dollars (currency fields). I have this in ALV Grid. But my problem is that the last 4 lines of the report are not currency fields like the others, they are quantity fields.
How can i go about to display this last 4 lines in this ALV Grid. They are from different internal tables off course because of the data type.
In short. I just want to display these 2 internal tables in an ALV Grid.
Thanks in Advance.Hi,
u can use ALV Block list to display 2 ALV.
Reffer to the below code.
DATA: v_layout TYPE slis_layout_alv.
DATA: ls_print TYPE slis_print_alv.
PERFORM build_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = v_layout
it_fieldcat = it_fcat_nlei
i_tabname = 'IT_NLEI_ALV'
it_events = it_event_nlei
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = it_nlei_alv
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = v_layout
it_fieldcat = it_fcat_vbrp
i_tabname = 'IT_VBRP_ALV'
it_events = it_event_vbrp
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = it_vbrp_alv
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
ls_print-no_print_selinfos = 'X'. " Display no selection infos
ls_print-no_print_listinfos = 'X'. " Display no listinfos
ls_print-reserve_lines = 2. " Lines reserved for end of page
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
is_print = ls_print
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
program_error = 1
OTHERS = 2 -
Hello Experts,
I am using cl_salv_table=>factory to display ALV grid.
Now I also want to attach f4 help in one of the field of ALV grid.
I am unable to locate any event or method.
Please help.Hello,
@Marcin: The aim to display values in search help is not to select values for editable field in alv grid but to display some additional information based on value in that field.
If search help is not possible, then dropdown can also work for me or pls provide any other solution to this.
I had tried implementing dropdown, for that I am using class "cl_salv_column_list" method "set_dropdown_entry".
From this I am able to see dropdown icon for my field but not able to populate values in dropdown.
Pls help in populating values in dropdown.
My logic is:-
Based on the values in the field in alv grid I have to calculate value dynamically to be displayed in search help or drop down list. -
How to control edit checks on alv grid fields
I have set up an alv grid that allows for user input.
The fields are defined from the data dictionary.
Edit checks are happening on all fields, but I would like to turn that off for some fields.
How is that controlled?
Regards!u need to define ur own field catalog for this purpose, for the fields for which u want to set check box, add property like this
X_FIELDCAT-FIELDNAME = 'LIFNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-SELTEXT_L = 'VENDOR'.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = 10.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'BUKRS'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-CHECKBOX = 'X'.
X_FIELDCAT-SELTEXT_L = 'COMPANY'.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = 4.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
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.
u can even check program BCALV_EDIT_05, award points if found helpful -
Getting runtime Error 'UC_OBJECTS_NOT_CHARLIKE' for ALV grid
Hi,
When I call method SET_TABLE_FOR_FIRST_DISPLAY of ALV I get runtime error 'UC_OBJECTS_NOT_CHARLIKE'.
Actually i have set in the fieldcatalog the field 'CHK' of internal table as checkbox.
wa_fcat-fieldname = 'CHK' .
wa_fcat-coltext = 'Clear' .
wa_fcat-seltext = 'Clear' .
wa_fcat-checkbox = 'X' .
wa_fcat-edit = 'X' .
APPEND wa_fcat to p_lt_fieldcatalog .
Field CHK is of type c.
when i dont set the field as checkbox, I stop getting the error.
Please find a solution.
regards,
auroRelevant parts of code are:
Data Declaration:
types: begin of tt_revenue_det,
chk type c,
budat like zefit0006-zefibudat,
racct_txt like skat-txt50,
amount like zefit0006-zefihsl,
pbar_txt like tgsbt-gtext,
sgtxt like zefit0006-zefisgtxt,
costcentertxt like cskt-ktext,
bar_txt like skat-txt50,
doctype like zefit0006-zefiblart,
ch_flag type c,
end of tt_revenue_det,
data: gt_revenue_det type table of tt_revenue_det.
FIELD CATALOG
*& Form set_fieldcatalog_rev_det
text
-->P_LT_FIELDCATALOG text
form set_fieldcatalog_rev_det using p_lt_fieldcatalog type lvc_t_fcat.
data:wa_fcat type lvc_s_fcat.
wa_fcat-fieldname = 'P_GT_REVENUE_DET-CHK' .
wa_fcat-coltext = 'Clear' .
wa_fcat-seltext = 'Clear' .
wa_fcat-checkbox = 'X' .
wa_fcat-edit = 'X' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'BUDAT' .
wa_fcat-coltext = 'Posting Date' .
wa_fcat-seltext = 'Posting Date' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'RACCT_TXT' .
wa_fcat-coltext = 'Account Item Text' .
wa_fcat-seltext = 'Account Item Text' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'AMOUNT' .
wa_fcat-coltext = 'Amount' .
wa_fcat-seltext = 'Amount' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'PBAR_TXT' .
wa_fcat-coltext = 'Partner Business Area' .
wa_fcat-seltext = 'Partner Business Area' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'SGTXT' .
wa_fcat-coltext = 'Item Text' .
wa_fcat-seltext = 'Item Text' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'COSTCENTERTXT' .
wa_fcat-coltext = 'Cost Center' .
wa_fcat-seltext = 'Cost Center' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'BAR_TXT' .
wa_fcat-coltext = 'Business Area' .
wa_fcat-seltext = 'Business Area' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'DOCTYPE' .
wa_fcat-coltext = 'Type' .
wa_fcat-seltext = 'Type' .
APPEND wa_fcat to p_lt_fieldcatalog .
wa_fcat-fieldname = 'CH_FLAG' .
wa_fcat-coltext = 'Split' .
wa_fcat-seltext = 'Split' .
APPEND wa_fcat to p_lt_fieldcatalog .
endform. " set_fieldcatalog_rev_det
CREATE ALV
*& Form create_alv_revenue_det
text
-->P_GT_REVENUE_DET text
form create_alv_revenue_det using p_gt_revenue_det.
ALV related data declaration
DATA: lf_layout TYPE lvc_s_layo, "alv layout
lt_fieldcatalog type table of lvc_s_fcat, "field catalog internal table
wa_fieldcatalog type lvc_s_fcat. "work area for field catalog
create alv only if container is initial
IF G_CUSTOM_CONTAINER_REV_DET IS INITIAL.
lf_layout-no_toolbar = 'X'. " no toolbar
lf_layout-sel_mode = 'B'.
populate field catalog
perform set_fieldcatalog_rev_det using lt_fieldcatalog.
create instance of container class
CREATE OBJECT G_CUSTOM_CONTAINER_REV_DET
EXPORTING CONTAINER_NAME = G_CONTAINER_REV2.
create instance of alv grid class
CREATE OBJECT GR_ALVGRID_REV_DET
EXPORTING I_PARENT = G_CUSTOM_CONTAINER_REV_DET.
call method to display table in alv grid by passing layout and fieldcatalog
CALL METHOD GR_ALVGRID_REV_DET->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
is_layout = lf_layout
CHANGING
IT_OUTTAB = p_gt_revenue_det
IT_FIELDCATALOG = lt_fieldcatalog.
ENDIF.
endform. " create_alv_revenue_det -
"Control + F5" standard filter functionality for ALV Grids
Hi all,
After an ALV Grid is displayed on screen there is a standard functionality to filter a selected column.
You can select a column (click on the head) of the ALV, then "Control + F5" and a pop-up appears to insert a value or a range by which the filtration is going to be done.
But a I have problem with a concrete field. It doesn`t seem different on comparison with other fields (CHAR30), but I don`t know why it doesn`t work correctly as others.
Have you had any situation like this ??
Thanks & sorry for my bad english,
RubèHi Frank,
When you are entering 89012 and pressing enter the additional zeros are adding up because of the data type of VBELN We have standard conversion routine attached with this .So when ever u wrtie any text that routine will works.
Can you please check what data type are you using in the internal table that you are binding to the node?
Thanks and Regards,
NSingh
Edited by: Nsingh on Feb 17, 2012 4:52 AM -
Hi,
I am trying to display data from two different tables, say 3 fields from one table and 3 fields from other table. in alv grid format using classes and using method CALL METHOD go_grid->set_table_for_first_display
how can we build the field catalog for the internal table which consists of 6 fields from two different tables
thanks in advanceHello,
Please check,it is similar case.
FORM set_grid.
IF g_r_grid IS INITIAL.
CREATE OBJECT g_r_cont
EXPORTING container_name = 'CUST1'.
CREATE OBJECT g_r_grid
EXPORTING i_parent = g_r_cont.
g_r_variant = sy-repid.
Build Field Catalog
PERFORM build_field_catalog.
Exclude process options from ALV
PERFORM alv_excl.
setting ALV Grid layout
PERFORM alv_layo.
CALL METHOD g_r_grid->set_table_for_first_display
EXPORTING
is_layout = g_r_layo
is_variant = g_r_variant
it_toolbar_excluding = g_r_excl
i_save = 'X'
CHANGING
it_outtab = g_t_alv[]
it_fieldcatalog = g_t_fieldcat.
ENDIF.
ENDFORM. " set_grid
*Form Routine ID : build_field_catalog
*Form Routine Name : TO Build Field Catalog
*Outline : Subroutine for building the field catalog
*Argument : None
*Return Value : None
FORM build_field_catalog.
DATA : l_f_n TYPE i.
REFRESH g_t_fieldcat.
l_f_n = 0.
Add properties values to ALV Catalog
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MATNR' 'CHAR' l_f_n
text-001 'X' space ' ' 18 ' ' .
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'TXZ01' 'CHAR' l_f_n
text-002 'X' space 'X' 40 ' ' .
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MFRPN' 'CHAR' l_f_n
text-003 ' ' space ' ' 40 ' ' .
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'EBELN' 'CHAR' l_f_n
text-004 space space ' ' 10 ' ' .
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'EBELP' 'NUMC' l_f_n
text-005 space space ' ' 5 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'EINDT' 'DATS' l_f_n
text-006 space space ' ' 10 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MENGE' 'QUAN' l_f_n
text-007 space space ' ' 13 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MEINS' 'UNIT' l_f_n
text-008 space space ' ' 3 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MENGE1' 'QUAN' l_f_n
text-009 space space ' ' 13 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'MEINS1' 'UNIT' l_f_n
text-010 space space ' ' 3 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'LIFNR' 'CHAR' l_f_n
text-011 space space ' ' 10 'ALPHA'.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'NAME1' 'CHAR' l_f_n
text-012 space space 'X' 35 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'BSART' 'CHAR' l_f_n
text-013 space space ' ' 4 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'BEDAT' 'DATS' l_f_n
text-014 space space ' ' 10 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'AEDAT' 'DATS' l_f_n
text-015 space space ' ' 10 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'INSMK' 'CHAR' l_f_n
text-016 space space ' ' 1 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'WERKS' 'CHAR' l_f_n
text-017 space space ' ' 4 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'LGORT' 'CHAR' l_f_n
text-018 space space ' ' 4 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'EKGRP' 'CHAR' l_f_n
text-019 space space ' ' 3 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'PSTYP' 'CHAR' l_f_n
text-020 space space ' ' 1 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'LOEKZ' 'CHAR' l_f_n
text-021 space space ' ' 1 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'DISPO' 'CHAR' l_f_n
text-022 space space ' ' 3 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'PO_TEXT' 'CHAR' l_f_n
text-023 space space 'X' 10 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'BSGRU' 'CHAR' l_f_n
text-024 space space ' ' 3 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'PRDHA1' 'CHAR' l_f_n
text-025 space space ' ' 18 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'VTEXT1' 'CHAR' l_f_n
text-026 space space 'X' 40 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'PRDHA2' 'CHAR' l_f_n
text-027 space space ' ' 18 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'VTEXT2' 'CHAR' l_f_n
text-028 space space 'X' 40 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'PRDHA3' 'CHAR' l_f_n
text-029 space space ' ' 18 ' '.
l_f_n = l_f_n + 1.
PERFORM add_catalog USING 'VTEXT3' 'CHAR' l_f_n
text-030 space space 'X' 40 ' '.
ENDFORM. " build_field_catalog
*Form Routine ID : add_catalog
*Form Routine Name : To Add the Catalog for the ALV
*Outline : Subroutine to add properties values to ALV Catalog
*Argument : p_fname "Field Name
p_inttype "Intenal Type
p_col_pos "Column Position
p_coltext "Column Text
p_key "Key Field
p_hotspot "Hotspot Enabled
p_outlen "Internal Length
p_convexit "conversion exit name
*Return Value : g_t_fieldcat "Field Catalog Table
FORM add_catalog USING p_fname
p_inttype
p_col_pos
p_col_text
p_key
p_hotspot
p_lowercase
p_outlen
p_convexit.
CLEAR g_r_fieldcat.
g_r_fieldcat-fieldname = p_fname.
g_r_fieldcat-inttype = p_inttype.
g_r_fieldcat-col_pos = p_col_pos.
g_r_fieldcat-coltext = p_col_text.
g_r_fieldcat-hotspot = p_hotspot.
g_r_fieldcat-lowercase = p_lowercase.
g_r_fieldcat-outputlen = p_outlen.
g_r_fieldcat-key = p_key.
g_r_fieldcat-convexit = p_convexit.
APPEND g_r_fieldcat TO g_t_fieldcat.
ENDFORM. " add_catalog
*Form Routine ID : alv_excl
*Form Routine Name : ALV Exclude List
*Outline : Subroutine to exclude process options from ALV
*Argument : None
*Return Value : None
FORM alv_excl.
APPEND cl_gui_alv_grid=>mc_mb_sum TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_mb_subtot TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_graph TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_info TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_print_back TO g_r_excl.
ENDFORM. " alv_excl
*Form Routine ID : alv_layo
*Form Routine Name : alv_layo
*Outline : Subroutine to set alv layout
*Argument : None
*Return Value : None
FORM alv_layo.
g_r_layo-grid_title = text-100.
g_r_layo-cwidth_opt = g_c_mark.
g_r_layo-zebra = g_c_mark.
g_r_layo-no_rowmark = space.
g_r_layo-sel_mode = g_c_selmode.
ENDFORM.
Regards -
Hello.
How to assign a help search to a field of an alv grid control?
I would like to use another help search different form the field reference.
Thanks!!!
AlbertoCheck the sample code:
handle_on_f4 FOR EVENT onf4 OF cl_gui_alv_grid
IMPORTING sender e_fieldname e_fieldvalue
es_row_no er_event_data
et_bad_cells e_display.
METHOD handle_on_f4.
IF e_fieldname = text-027. "Date
PERFORM f4_date USING sender e_fieldname e_fieldvalue es_row_no
er_event_data et_bad_cells e_display.
ENDIF.
ENDMETHOD. "handle_On_f4
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*& Form F4_contact_id
F4 for Contact ID
FORM f4_date USING sender TYPE REF TO cl_gui_alv_grid
e_fieldname TYPE lvc_fname
e_fieldvalue TYPE lvc_value
es_row_no TYPE lvc_s_roid
er_event_data TYPE REF TO cl_alv_event_data
et_bad_cells TYPE lvc_t_modi
e_display TYPE c.
DATA: lv_anlage TYPE anlage.
FIELD-SYMBOLS: <itab> TYPE lvc_t_modi.
DATA: ls_modi TYPE lvc_s_modi.
DATA : wa_field_tab TYPE dfies,
lws_date TYPE scal-date.
DATA: lws_row_id TYPE lvc_s_roid,
lws_tabix TYPE sy-tabix.
DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CLEAR: ls_modi, lv_anlage, li_ret_tab, wa_final, wa_field_tab,
lws_date, lws_row_id, lws_tabix.
REFRESH: li_ret_tab.
IF NOT er_event_data->m_event_handled = c_x.
ws_f4_handle = c_x.
MOVE es_row_no-row_id TO lws_tabix.
READ TABLE i_final INTO wa_final INDEX lws_tabix.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = text-012 "I_FINAL
fieldname = text-027 "DATE
searchhelp = text-038 "BU_DATE_CHAR
TABLES
return_tab = li_ret_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ASSIGN er_event_data->m_data->* TO <itab>.
CONCATENATE li_ret_tab-fieldval+6(4)
li_ret_tab-fieldval+3(2)
li_ret_tab-fieldval+0(2) INTO lws_date.
IF lws_date NE ''.
IF lws_date > sy-datum.
IF wa_final-zzmod_eff_code EQ c_03 OR
wa_final-zzmod_eff_code EQ c_04 OR
wa_final-zzmod_eff_code EQ c_05.
wa_final-date = lws_date.
MODIFY i_final FROM wa_final INDEX lws_tabix.
PERFORM no_edit_for_date TABLES i_final.
PERFORM alv_refresh.
ENDIF.
ELSE.
wa_final-date = ''.
MODIFY i_final FROM wa_final INDEX lws_tabix.
PERFORM no_edit_for_date TABLES i_final.
PERFORM alv_refresh.
MESSAGE s001(zesspa) WITH text-037.
EXIT.
ENDIF.
ENDIF.
er_event_data->m_event_handled = c_x.
ENDIF.
ENDFORM. " f4_date
Check the standard program <b>BCALV_EDIT_08</b>
Regards,
Prakash.
Maybe you are looking for
-
How do I get all my apps on the iphone 4
I synced by iphone 3 then I connected by iphone 4 but not all my apps and games (or folders) have moved to my iphone 4 any ideas?
-
Dear, We have a procedure which compress and email a file (account stmt) to 100s of customers daily. Please give idea on protecting that zip file with password before emailing. It is something similar to credit cared statement where only the recipien
-
Please help in Stored procedure? Psoting third time Urgent!!!
Hi, We are running websphere3.5.3 on AS/400 machine with DB2Connect as local database. I am using com.ibm.db2.jdbc.app.DB2Driver We are trying to execute a servlet with stroedprocedure in it. In the bottom, I included complete error. Can some one hel
-
Do you have any fonts with the Latin Extended Additional character set?
I would like to know what fonts in the Adobe catalog support the Latin Extended Additional character set and/or display all of the following diacritics & characters: Macrons: ā ī ū Dot below: ṭ ḍ ṇ ḷ ṃ Dot above: ṅ Tilde: ñ Thanks, MZ
-
Urgent : CO product costing into the SD pricing
client requiremnet is that product costing of material should be reflected in pricing procedure. Thanks in advance.