F4 help to ALV output Field
Hi All,
I am displaying an ALV output using class. In the output list, i have added one push button 'ADD'. If user clicks on this button, new line should be available to enter the data. This is working fine.
Now i want to give an F4 help for a column for which values is to be generated in the program. I have an internal table with values which is to be displayed when user clicks on that column.
This is very urgent.
Pls. suggest me.
best regards,
Hi,
Linking F4 Help to Fields
For the last section, we will deal with linking F4 help to fields. It is easy. As usual, define, implement and register the event onf4 at proper places in your code. For F4 help, you must register the fields whose F4 request will trigger the onf4 event. For this you must prepare a table of type LVC_T_F4 and register this table using the method register_f4_for_fields. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;
Pass the fieldname to FIELDNAME
Set REGISTER to make the field registered,
Set GETBEFORE to provide field content transport before F4 in editable mode
Set CHNGEAFTER to make the data changed after F4 in editable mode.
Preparing table for the fields to be registered to trigger F4 event
DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .
lt_f4-fieldname = 'PRICE'.
lt_f4-register = 'X' .
lt_f4-getbefore = 'X' .
APPEND lt_f4 .
CALL METHOD gr_alvgrid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4[] .
A sample onf4 method implementation
METHOD handle_on_f1 .
PERFORM f4_help USING e_fieldname es_row_no .
er_event_data->m_event_handled = 'X' .
Again, we set the attribute er_event_data->m_event_handled to prevent further processing of standard F4 help.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
ENDMETHOD .
Similar Messages
-
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. -
HI EXPERTS,
IN ALV OUTPUT FIELD LENTH IS MAX 128?
IN MY REQUIRMENT THE FIELD HAS 500 CHARTERS
Moderator Message: So where is the question? And why type in CAPITAL letters? Do some research before you post a question here. Also, please read the Rules of Engagement of this forum
Edited by: kishan P on Apr 1, 2011 10:10 AMHi,
Linking F4 Help to Fields
For the last section, we will deal with linking F4 help to fields. It is easy. As usual, define, implement and register the event onf4 at proper places in your code. For F4 help, you must register the fields whose F4 request will trigger the onf4 event. For this you must prepare a table of type LVC_T_F4 and register this table using the method register_f4_for_fields. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;
Pass the fieldname to FIELDNAME
Set REGISTER to make the field registered,
Set GETBEFORE to provide field content transport before F4 in editable mode
Set CHNGEAFTER to make the data changed after F4 in editable mode.
Preparing table for the fields to be registered to trigger F4 event
DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .
lt_f4-fieldname = 'PRICE'.
lt_f4-register = 'X' .
lt_f4-getbefore = 'X' .
APPEND lt_f4 .
CALL METHOD gr_alvgrid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4[] .
A sample onf4 method implementation
METHOD handle_on_f1 .
PERFORM f4_help USING e_fieldname es_row_no .
er_event_data->m_event_handled = 'X' .
Again, we set the attribute er_event_data->m_event_handled to prevent further processing of standard F4 help.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
ENDMETHOD . -
How to include F4 help to a alv output field?
Hi All,
I have a sel screen with 2 inputs say x1 and x2. Based on my inputs we have a alv(using OOPS) output where a field say tabname is editable and the values in it are hardcoded.
I have to get a F4 help in this editable field tabname with those hardcoded values from the program say T1 and T2.
If we pres F4 of tabname value, we must get only T1 and T2 from the program.
Please let me know how to do this.
Thanks in advance.Hi Aiswary,
Check the Following program
BCALV_EDIT_08 -
> Integrate Non-Standard F4 Help
BCALV_F4 -
> Possible entries
BCALV_GRID_EDIT_DELTA -
> Example Report for F4 Help of the ALV Grid
BCALV_GRID_F4_HELP_APPLICATION
BCALV_GRID_F4_HELPM01
BCALV_TEST_GRID_EDIT -
> F4 Help
BCALV_TEST_GRID_F4_HELP -
> Example Report for F4 Help of the ALV Grid
Cheers
Ram
Edited by: Ramchander Krishnamraju on Oct 23, 2009 2:20 PM -
Hi ..
In a output list of alv few fields should have F4 help functionality. I am using REUSE_ALV_GRID_DISPLAY.
Please let me know how to get the functionality in grid display...
More helpful if any one can send me sample program for it ...
Please don't send BCALV* Programs ...
Rewards for sure !!!
Regards,
Varmahi
go to this
http://www.****************/Tutorials/ALV/Edit/F4.htm
regards
Snehi
Edited by: snehi chouhan on Jul 10, 2008 12:17 PM -
Add new selection fields and ALV output fields in VA05
Hi,
I want to add two new selection fields in VA05 'Further selection criteria' screen, also want to add some more fields in VA05 ALV output.
Please help me how i can do it using user exit ?
Thanks ,
Archanahi,
You have to copy the standard program SAPMV75A to ZSAPMV75A, change them accordingly. -
To Display Calender in F4 help in ALV Output Display.
Hello Experts.
I have one requirement. I have an ALV output. In this one date field is editable. Here User wants F4 Help. I have provided the F4 help, F4 help is coming but for F4 help i want the Factory Calendar type display. Currently the F4 help is coming like a normal F4 help.
Thanks.
Swati.hi Swati,
I hope you have checked standard program 'bcalv_edit_08'.
in this program, if the type of field we are taking in that perticuler column is 'DATS' then it should display the calender.
Regards,
Ani -
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. -
hi experts,
I have the Batch field as an editable field in ALV list display. I want to Give an F4 for this Field. I have given the reference field and reference table as 'MCHA'. I am getting the F4 values also. But i want like an search help dialog box instead of a whole list of values as i get in VL02n when we f4 for batch in a modal kind of a box.Is there any way i could do it. I am Using Reuse_alv_list_display.Is there any way i could do it.
With thanks in advance,
Syed Ibrahim
Edited by: SYED_ibbu on Jun 21, 2011 11:26 AMHi.,
I think using search help exit at domain leven you can get that.,
also check vijay's reply in this thread: [Custom F4 in ALV|Assigning F4 help in REUSE_ALV_GRID_DISPLAY;
hope this helps u.,
Thanks & Regards,
Kiran -
Search Help in ALV Editable Field
Hi,
My requirentment is to get F4 functionality for one Editable field,
These F4 values should come from processing of internal table.
i have searched in SDN but didnt get satisfactory answer for it.
. I dont want to use ALV control table concept and with OOPs ALV,
Please let me know.how we can achieve this functionality,
your suggestions are always welcome.
Regards
VivekHi,
Use the Function module: F4IF_INT_TABLE_VALUE_REQUEST
The below code shows how function module F4IF_INT_TABLE_VALUE_REQUEST is used to display a basic ABAP internal table as an SAP search help.
parameters: p_ebeln type ekko-ebeln.
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,
it_return type STANDARD TABLE OF DDSHRETVAL,
wa_return like line of it_return.
*at selection-screen
at selection-screen on value-request for p_ebeln.
select *
up to 10 rows
from ekko
into CORRESPONDING FIELDS OF TABLE it_ekko.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'EKKO'
RETFIELD = 'EBELN'
PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'EBELN'
STEPL = 0
WINDOW_TITLE = 'Ekko Records'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = 'X' "allows you select multiple entries from the popup
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET = ld_ret
TABLES
VALUE_TAB = it_ekko
FIELD_TAB = lt_field
RETURN_TAB = it_return
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
READ TABLE it_return into wa_return index 1.
p_ebeln = wa_return-fieldval.
Hope it helps you.
Regards,
Anju -
How to show exact value in ALV output field (including space at the start)
Hi,
This is my Scenerio:
In the output the field value (char type) shows "6-10-3", the actual field value has a space before the 6 " 6-10-3".
How to incorporate this, any suggestions?
Thanks in advance,
Dileep.Hi Dileep,
While filling the internal table of that field, conactinate with the space and fill.
like
concatenate space
wa-fileld " your fild
into wa-filed.
appned wa to itab
clear wa.
hope it works.
Regards! -
How to pass custom search help(F4 help) for a field in ALV output?
Hi,
I want to activate the F4 help in ALV output for a field for which we do not have search help assigned at table ,data element and domain level.
In field catalog i have enabled it by below line.
ls_fcat-F4AVAILABL = 'X'.
but because there are no standard input help available it is giving message as "No input help is available".
so how to pass our custom search help (g_search) for any field in ALV output.
I am using object oriented ALV grid display.
Thanks!!!
Rajesh Gupta.hi,
check this out:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/acdefb13-0701-0010-f1a2-8eeefa7d3780
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d?quicklink=index&overridelayout=true -
Editable field with F4 help in alv tree output using cl_gui_alv_tree
HI
i need Editable field with F4 help in alv tree output using cl_gui_alv_tree
Regards
NareshHi Naresh,
Pass the field catalog with the additional parameter (ls_fcat-edit = 'X'.).
for F4 help if the data element have the search help it automatically will come. other wise include the additional parameter in the field catalog (ls_fcat-F4AVAILABL = 'X')
Reward if found helpful.
Regards,
Boobalan Suburaj -
Search help problem in ALV output for field TD24A-DISMM
Hi Abap-Experts,
I have one issue regarding simple ALV report.
I need to display search-help for field DISMM. I have used below code in ALV fieldcatalog.
ts_fieldcat - tabname = 'TD24A'.
ts_fieldcat - tabname = 'DISMM'.
I have attached search-help for fields such as MATNR and WERKS too.
The search-helps are getting displayed for MATNR as well as WERKS.
But, the search-help is not gettting displayed for field DISMM(RP-TYPE) .
The output displayed is done using Simple ALV.
Could anyone please help me and correct my code or logic i have used.Hi,
I have changed code a bit...and used T438A table.
CLEAR ts_fieldcat.
ts_fieldcat-col_pos = '5'.
ts_fieldcat-fieldname = 'DISMM'.
ts_fieldcat-seltext_l = text-014.
ts_fieldcat-outputlen = 2.
ts_fieldcat-reptext_ddic = ''.
ts_fieldcat-ref_tabname = 'T438A'.
ts_fieldcat-ref_fieldname = 'DISMM'.
ts_fieldcat-ddic_outputlen = '2'.
ts_fieldcat-input = 'X'.
APPEND ts_fieldcat TO gt_fieldcat.
still it is not showing me the F4 help in simplae ALV output..
kindly help me -
Newly added field not getting displayed in ALV output
Hi All,
I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
DATA: BEGIN OF it_salary OCCURS 0,
pernr LIKE pa0000-pernr,
ename LIKE pa0001-ename,
rtext like lv_rtext, -
added field
waers LIKE pa0008-waers
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_SALARY'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_salary
EXCEPTIONS
program_error = 1
OTHERS = 2.
The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
Please provide suggestion for this issue.
Regards,
Sridevi SHi,
Fieldcat is buffered - so use
I_BYPASSING_BUFFER = 'X'
Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
A simple use would be:
data: gt_output type standard table of (adjust!).
*simple ALV output
data go_alv type ref to cl_salv_table.
data go_functions type ref to cl_salv_functions_list.
data go_columns type ref to cl_salv_columns_table.
data go_column type ref to cl_salv_column_table.
*Exceprion handlig
data: go_exception type ref to cx_root,
gv_errortext type string.
** fill table gt_output ...
** ALV output
if not gt_output is initial.
try.
call method cl_salv_table=>factory
importing
r_salv_table = go_alv
changing
t_table = gt_output.
catch cx_salv_msg into go_exception.
gv_errortext = go_exception->get_text( ).
message gv_errortext type 'A'.
endtry.
* enable all standard ALV functions
go_functions = go_alv->get_functions( ).
go_functions->set_all( ).
* hide MANDT
go_columns = go_alv->get_columns( ).
go_column ?= go_columns->get_column( columnname = 'MANDT' ).
go_column->set_technical( ).
go_alv->display( ).
Kind regards,
Holger
Maybe you are looking for
-
Getting other people's messages on iMessage after losing my #? Help!
I used to have phone service through T-Mobile but I ran out of money to pay for bills, and T-Mobile canceled my account eventually. Someone else in the area got an account with them and now they have my number. However, all my friends who had me in t
-
Better estimation of phase difference between two signals with variable frequency!
Hello LabView Gurus, Being a power engineer and having just a little knowledge of signal processing and labview, I have been pulling my hair out for the last couple of days to get a better estimation of phase difference between two signals. We have
-
Global temporary Table-Table becomes empty
Hi, I have used global temp table on commit preserve rows. During initialization of the screen i'm creating temp tables and all the manipulation done on screen has been stored on temp table , at the end of all the insert and delete operation i'm retr
-
Laserjet 5000n installed on windows 7 shows offline
I installed the driver for the 5000n laserjet and it worked fine. Overnight my computer shut down and I had to restart it today. Now my laserjet is not recognized by my computer and it says it is off line. Frustrating! How do I get it to print ag
-
Does labview 8.6 work with DDE?
I think it was due to be phased out and replaced by opc. Can you still dde within Labview? Stu Solved! Go to Solution.