Search on ALV Grid
Hello ABAPERS!!!
I'm a abap jr and I need your help let me explain.....
On ALV Grid I added a button on the status menu, this button is for make an "advanced search data" if the data were found I need focus the cursor on the row (only one row). Also if is possible highlight the corrsponding row.
I know a little bit about ALV, please be pacient and explain me in detail.
Thks a looooooooot!!!
Hello,
I think you have to add the zHelp to the structure you r using...I mean you had to give an structure name when calling the ALV FM
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = i_repid
i_internal_tabname = i_internal_tabname ->THIS IS THE STRUCTUE I MEAN!!
i_inclname = i_repid
CHANGING
ct_fieldcat = int_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
on that structure append on se11 the search help you need....
Did you do it??
Bye
Gabriel
Similar Messages
-
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. -
Searching for ALV grid layout variants
How can I find weather there are any saved layout variants? I tried some functions like LVC_VARIANT_F4, but I do not need any pop-ups and so on. I need only to are there any saved variants or no.
Thanks in advance
Regards
Peter Yordanovjust declare like this and pass to IT_RA_REPORT.
ranges: lr_report for ltdx-report.
lr_report-sign = 'I'.
lr_report-option = 'EQ'.
lr_report-low = gc_repid.
append lr_report.
and pass lr_report to FM LT_VARIANTS_READ_FROM_LTDX
call function 'LT_VARIANTS_READ_FROM_LTDX'
tables
et_variants = lt_variants
it_ra_report = lr_report
it_ra_handle = lr_handle
it_ra_log_group = lr_log_group
it_ra_username = lr_username
it_ra_variant = lr_variant
it_ra_type = lr_type
exceptions
not_found = 1
others = 2. -
Search help (PREM) for personal no. is not coming in ALV grid table control
hi experts,
Search help (PREM) for personal no. is not coming in ALV grid table control.
i have assigned the srch help (prem) to my 'ZFIEXP_PROJALLOC' table for the emp_id.
but in output it is now showing the help.
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'ZFIEXP_PROJALLOC'.
ls_fcat-ref_field = 'EMP_ID'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
Then i tried to solve it using the PA0002 . ie.,
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'PA0002'.
ls_fcat-ref_field = 'PERNR'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
with this it is showing the help in employee code, but, when i click on an empl number, it is not added to my table control and allowing me to add the number by typing them.
plz help me.
thanks.Hi
In the layout give layout-sel_mode = 'A'. and
pass 'A' to i_save exporting parameter to method set_table_for_first_display.
The same thing if you are working with function module
reuse_alv_grid_display.
Reward points for useful answer.
Venkat -
Search help for date in ALV grid
I have ALV grid with field type date and search help for this:
ws_field-ref_table = 'ADCP'.
ws_field-ref_field = 'DATE_FROM'.
ws_field-inttype = 'D'
After I have clicked on this key F4 then I see a calendar and I have choosen some date, but in input grid field there aren't
choosen value. Why? Another search helps works perfect except this. Where is the problem?
Edited by: Kosmo on Jul 7, 2009 8:48 AMHi,
Find the code below
TYPE-POOLS: slis.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
DATA: it_data TYPE vbap_t.
SELECT *
FROM VBAP
INTO TABLE it_data
UP TO 20 ROWS.
wa_fcat-fieldname = 'VBELN'.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-ref_fieldname = 'VBELN'.
wa_fcat-ref_tabname = 'VBAK'.
APPEND wa_fcat TO it_fcat.
clear wa_fcat .
wa_fcat-fieldname = 'POSNR'.
wa_fcat-tabname = 'IT_DATA'.
wa_fcat-seltext_l = 'Date'.
wa_fcat-ref_fieldname = 'ERDAT'.
wa_fcat-ref_tabname = 'VBAK'.
APPEND wa_fcat TO it_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab = it_data
EXCEPTIONS
program_error = 1.
I have derived the above code from WIKi link
https://wiki.sdn.sap.com/wiki/display/Snippets/f4helpforalvgrid+display
Regards,
Murthy. -
Search Helps in ALV grids.
Hi,
I am working on ALV grids in custom control.
My requirement is to provide search helps in the ALV grid for few fields out of which the search help for one field should be populated dynamically.
Please help me.hi
good
You can have almost everything you like in a search help. Nice search help examples are:
MPLAL (exit = F4_MATCHCODE_USER_EXIT) -> calls a selection report (transaction IP03)
HRBAS00OBJID (exit = RHF4_EXIT_OBJID) and include search helps
thanks
mrutyun^ -
How to make a field of ALV Grid to use a Search Help?
Hi;
I have a ALV grid with a field catalog. Say the field is 'USR000'.
F4availabl = 'X' . for the field in the field catalog.
I have prepared search help named ZEV_PROTYPE that uses tha table ZEV_PROTYPES.(two fields in the table :ProType and Text).
Is it possible to make the field in ALV grid to use this search help if F4 is pressed on the field. ?
Which structure of the ALV must be used for that ? Is it Field Catalog ?
Would you please help me ?
erk.Hi,
If you have a Z data element and the search help is attached to it, you can just give the reference table and field in the field catalog for the editable ALV field, and the search help should appear.
Regards,
Sagar -
F4 help in ALV grid using existing search help
Hi All,
It would be appreciable , if some help on problem. Thanks in advance.
How to provide user defined F4 help in ALV grid using existing search help?
ALV grid has developed using OOPS concept.
Thanks,
Sudhakar.Hi,
if you already developed using OO concept, it should be possible to:
create a handler for event ONF4
The interface will tell you actual field name and value where F4 is pressed. This will enable you to call your own routine (see FM F4-IF....).
Please check how the standard handles F4 - if you have standard and customer-F4 mixed you shouldtake care that the standard handling is triggered.
Regards,
Clemens -
What is shortest way to attach particular Search Help in ALV grid using OOPS ?
Thanks Gurpreet,
Through search helps attached to data element it is possible but is there any other way to attach searchhelp differet from from the search help attached to the data element ? The new search-elp is not customized search help as given in the above threads ?
Eg. - If I want to attach MAT2 to a field named MATNR in the table instead of the MAT1 which is standard.
Thanks in advance -
ALV grid - using f4 search help - want separate value from hit list
I have the following scenario that I am trying to resolve.
I have created my own search help with a search help exit for a bespoke maintenance table which lists categories against HR positions which are to receive workflow for these categories. I am designing a front-end for this table using an ALV grid whereby the person holding that position (i.e. name) is shown instead of position number. The search help allows you to select by First name and last name and brings up a hit list which includes employee number, first name last name, formatted name field, position number, position description and org unit it belongs in.
The issue occurs where the list brings back more than one hit.
e.g.:
1 Fred Bloggs Fred Bloggs 50000001 pos1 org 1
2 Frederic Bloggs Fred Bloggs 50000002 pos2 org 3
If you select an entry, the formatted name field goes in the ALV grid field. I call the search help via F4IF_FIELDVALUE_REQUEST using the onf4 event .
What I want to do is retrieve the position number of the entry selected and put this into another table without having to add this to my ALV grid and make available for input. I want to use name only for the input in my ALV grid (i.e. if I select the second example, the return table in F4IF_FIELDVALUE_REQUEST shows the name Fred Bloggs but does not show the position number which I need to add to another table to update my maintenance table).
Can anyone suggest any way around this?
Many thanks
LarissaYou are right, you can add this fields as an import parameter to the list.
In Custom search help you must have marked fields as Export or Import parameters.
If field is marked as Export parameters, it will be displayed in the selection pop up.
If Import paramter check box is selected then this will be imported to the screen.
Check this SAP documentation for both these options -
Flag for IMPORT parameter of the search help
Flag if the parameter is an import parameter.
Context information from the processed input template (screen) can be
copied to the help process with an import parameter. Where an import
parameter gets its values from is defined when the search help is
attached to the corresponding field of the input template.
Flag for EXPORT parameter of the search help
Flag if the parameter is an export parameter.
Values can be returned from the hit list to the input template (screen)
with an export parameter. The fields of the input template in which the
contents of the export parameter are returned are defined by the search
help attachment.
Message was edited by: Ashish Gundawar -
To populate another alv grid's field with value selected from search help
Hi,
I have two fields in alv grid, first column holds code and the second one holds code's description. Also I have a search help includes these two fields. The search help is attached to the first column. The requirement is, when I select a code from the search help, second column should be populated with selected code's description.
Any help will be appreciated. Thanks..Hi,
have a look into Report: BCALV_EDIT_03.
Regards, Dieter -
Popup instead of list when using WD4A ALV Grid Drop Down By Key
I am develop a WD4A application and I am using an ALV grid. I have set the cell editor for one column wiht the following code:
CREATE OBJECT lr_ddbk
EXPORTING
SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
Data: lv_key_visable TYPE abap_bool,
lv_key_visible_fieldname TYPE string.
lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
* lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
* lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
* lr_ddbk->SET_KEY_VISIBLE( abap_false ).
lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
This code works fine. I then fill the drop down with the following code:
*...Build the currency drop down list
DATA lv_default_currency TYPE wdr_context_attr_value.
DATA lv_currency_count TYPE STRING.
DATA ls_tcurt TYPE tcurt.
CLEAR ls_contextvalue_set.
CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
CLEAR lv_default_currency.
loop at it_ac_attr into ls_ac_attr.
if ls_ac_attr-attr_id eq 'CUR'.
select single * from tcurt into ls_tcurt
Where spras = 'EN' AND
waers = ls_ac_attr-value.
If sy-subrc = 0.
ls_contextvalue_set-value = ls_ac_attr-value.
ls_contextvalue_set-value = ls_ac_attr-value.
ls_contextvalue_set-text = ls_tcurt-ktext.
IF ls_ac_attr-DFT_FLAG = 'X'.
lv_default_currency = ls_contextvalue_set.
ENDIF.
append ls_contextvalue_set to lt_contextvalue_set.
endif.
Endif.
endloop.
lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
lo_nd_zebuy_describe_item_info->set_attribute_value_set(
exporting
name = 'ZCURRENCY'
value_set = lt_contextvalue_set ).
*...End build currency drop down list
This code works fine. The issue I am having is that the drop down is behaving like a search help field rather than a drop down list. Meaning a popup comes when I drop down the list. The popup has the values I have set. I don't want a popup I want a drop down list. Additionallly the field is editable (meaning I can type a value into the field as well as select a value). I want the user to only be able to select values from the list. Any help with this issue would be appreciated.I fugured out what I was doing wrong. I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.
-
I'm hoping that someone can help.
I have a program that displays an ALV grid. I want the user to be able to select one or more lines from this grid and then to pop up a box to allow them to input a new date and then update this date via BAPI.
Could any one please point me in the right direction of how to get the info of the lines selected by the user into another internal table so that I can merge this with my new date info to run the BAPI.
ThanksWhich version of ALV technology do you use (REUSE_ALV, OO ALV, SALV ? ) <br />
<br />
e.g. for CL_GUI_ALV_GRID<br />
- Use the <a class="jive-link-external" href="http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/frameset.htm" target="_newWindow">SEL_MODE</a> field of the layout to enable multiple row selection (also add a check box in internal table)<br />
- you have method <a class="jive-link-external" href="http://help.sap.com/saphelp_erp2004/helpdata/EN/0a/b55312d30911d2b467006094192fe3/frameset.htm" target="_newWindow">GET_SELECTED_ROWS</a> and CHECK_CHANGED_DATA <br />
<br />
<i>Also, don't hesitate to use the search tool.there are sample in wiki like [Capture single and multiple row selction in ALV |http://wiki.sdn.sap.com/wiki/display/Snippets/Capturesingleandmultiplerowselctionin+ALV]</i><br />
<br />
Regards,<br />
Raymond -
Download from ALV grid to PDF format
hai Friends!
plz tell me how can i download from ALV grid to PDF format..
send me some sample codescheck this thread
ALV Grid to PDF
and do use the search functionality from next time and post the question only wheb u dont find the answer
кu03B1ятu03B9к -
Dump when summing up CURR field in ALV GRID display
Hi All,
I am getting dump when I try to sum the CURR field in my ALV Grid Display. The field is of CURR 23. I am using classes and methods to display alv grid.
I tried passing <fs_fieldcat>-do_sum = 'X'. When I did this, it is dumping without even displaying the alv grid.
Here is the part it is throwing dump:
ls_lvc_data-value = space.
clear ls_lvc_data-style.
loop at it_fcat_local assigning <ls_fcat>
where tech ne 'X' and no_out ne 'X'.
if l_invisible eq 'X'.
clear l_invisible.
if <ls_fcat>-do_sum is initial.
continue.
else.
clear ls_lvc_data-col_pos.
endif.
endif.
add 1 to ls_lvc_data-col_pos.
assign component <ls_fcat>-fieldname
of structure <ls_data> to <l_field_value>.
_if sy-subrc ne 0.
message x000(0k).
endif._
Regards,
GuruThomas,
Here is the dump:
Runtime Errors MESSAGE_TYPE_X
Date and Time 10/22/2010 23:30:53
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Long text of error message:
Technical information about the message:
Message class....... "0K"
Number.............. 000
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLSLVC" or "LSLVCF36"
"FILL_DATA_TABLE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
Source Code Extract
Line
SourceCde
2708
is_subtottxt_info = ls_subtot_info
2709
ip_subtot_line = lr_data
2710
changing
2711
c_subtottxt = l_subtottxt.
2712
ls_lvc_data-value = l_subtottxt.
2713
2714
append ls_lvc_data to ct_lvc_data.
2715
endif.
2716
2717
2718
Column per Fieldcat Entry
2719
2720
ls_lvc_data-value = space.
2721
clear ls_lvc_data-style.
2722
loop at it_fcat_local assigning <ls_fcat>
2723
where tech ne 'X' and no_out ne 'X'.
2724
if l_invisible eq 'X'.
2725
clear l_invisible.
2726
if <ls_fcat>-do_sum is initial.
2727
continue.
2728
else.
2729
clear ls_lvc_data-col_pos.
2730
endif.
2731
endif.
2732
2733
add 1 to ls_lvc_data-col_pos.
2734
2735
assign component <ls_fcat>-fieldname
2736
of structure <ls_data> to <l_field_value>.
2737
if sy-subrc ne 0.
>>>>>
message x000(0k).
2739
endif.
2740
2741
*... work on average
2742
if <ls_fcat>-do_sum eq 'C'.
2743
Initialize average result and entries
2744
<l_field_value> = 0.
2745
clear l_entries.
2746
2747
retrive unit from fieldcatalog
2748
assign space to <l_unit>.
2749
if not <ls_fcat>-cfieldname is initial.
2750
assign component <ls_fcat>-cfieldname
2751
of structure <ls_data> to <l_unit>.
2752
endif.
2753
if not <ls_fcat>-qfieldname is initial.
2754
assign component <ls_fcat>-qfieldname
2755
of structure <ls_data> to <l_unit>.
2756
endif.
2757
Maybe you are looking for
-
Tip: How to change order of plugins/effects/inserts in a channel strip?
I share one tip for working with plugins in a channel trip. To rearrange your plugins, hold down the Command key and drag, move and drop your plugins easily. You even can create multiple empty slots if needed by moving plugin to the last position ove
-
After installation trouble with lightroom **please help me**
When i installed lightroom (3.6 and 4) i keep getting this error message that says " unexpected error opening catalog" i can't use or open lightroom< it doesn't give me specific details as to why it's not working. I've tried to update my computer wit
-
Hi, I have a problem in given mapping case. Source : 10 abc india 10 trgg lanka 10 mkn chaina 20 klnl uyte 20 uyty us Taget: 10 abc india trgg lanka mkn chaina 20 klnl uyte uyty us pls
-
To add attachment in supplier survey scenario
Hi all, I am now working with adding attachment to standard supplier survey process. Briefly speaking, the role purchaser send mail to supplier's mailbox. The supplier send a response mail with attachments to the SRM server. In SO50, I configure a ZC
-
TROUBLESHOOTING A STACK OVERFLOW ERROR
제품 : ORACLE SERVER 작성날짜 : 1997-02-04 ========================================== TROUBLESHOOTING A STACK OVERFLOW ERROR ========================================== OVERVIEW A stack is a temporary storage space for programs. All programs have a stack. M