03-06-2020 3:51 PM
Hi guys I want to add AUFNR F4 search help in the alv.
I have added the following :
if ls_dfies-fieldname eq 'AUFNR'.
ls_fieldcat-f4availabl = 'X'.
ls_fieldcat-ref_table = 'CAUFV'.
ls_fieldcat-ref_field = 'AUFNR'.
endif.
it does not show the search help in the column.
I have searched that in Iw33 the search help for aufnr is ORDP
Srch. help exit PM_HLP_PREVENT_RECURSION
how can I enable this?
thank you in advance
03-11-2020 9:33 AM
the solution to my problem:
cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = gt_output ).
gr_columns = gr_table->get_columns( ).
gr_column ?= gr_columns->get_column( columnname = 'AUFNR' ).
gs_ddic-table = 'AFIH'.
gs_ddic-field = 'AUFNR'.
gr_column->set_ddic_reference( gs_ddic ).
gr_column->set_f4( abap_true ). gr_table->display( ).
Thank you all to thiose who provided an answer above,I have rewarded you with upvotes!
03-06-2020 4:13 PM
You said "in Iw33 the search help for aufnr is ORDP", didn't you see what is the table and field for the screen field? (usually the screen field is linked to DDIC table/structure field linked to search help)
03-09-2020 8:19 AM
Hi sandra.rossi , yes I did but it still does not show anything in the alv
03-09-2020 8:19 AM
Hi sandra.rossi , yes I did but it still does not show anything in the alv
03-09-2020 8:35 AM
03-09-2020 9:01 AM
03-09-2020 9:24 AM
Okay,
Try using the table name 'AUFK'. This has built in F4 enabled.
ls_fieldcat-ref_table ='AUFK'.
03-09-2020 9:30 AM
03-09-2020 9:36 AM
Hi It should work
just change the reference table to 'AUFK' instead of 'CAUFV'.
if ls_dfies-fieldname eq'AUFNR'.
ls_fieldcat-f4availabl ='X'.
ls_fieldcat-ref_table ='AUFK'.
ls_fieldcat-ref_field ='AUFNR'.
endif.
Regards,
Venkat
03-09-2020 9:42 AM
i have tried with aufk before , it does not work ,maybe REUSE_ALV_GRID_DISPLAY is the problem?
03-09-2020 8:56 AM
F4AVAILABL = 'X' means that the F4 is handled via the ONF4 event, so it's not what you want, just let it to initial value ' '.
03-09-2020 9:06 AM
03-09-2020 12:13 PM
The question title REUSE_ALV_GRID_DISPLAY is misleading.
I understand that you wonder why the same reference to DDIC field CAUFV-AUFNR in IW33 and in your custom program (whatever it's ALV or just PARAMETERS aufnr TYPE caufv-aufnr) opens a different F4 help: for IW33, it's the collective help ORDE, and in your custom program it's the collective help ORDP (which is part of ORDE).
Some search help exits do some processing based on the current transaction code (SY-TCODE) or program (SY-CPROG) or any other context element, so maybe this is one of them. If you want exactly the same behavior, you have to debug what it does and enhance it.
If ORDP is an acceptable choice, then simply refer to a DDIC table/structure field which refers to ORDP (where-used list, or eventually create a custom DDIC table/structure).
03-09-2020 1:15 PM
03-09-2020 1:26 PM
CAUFD or CAUFV?
CAUFV is a view, not a table. CAUFV-AUFNR points to AUFNR of table AUFK, which points to search help ASH_ORDE (it's what I see in my S/4HANA version).
In my system, ORDP is a search help of AAFIH-AUFNR, AILOA-DAUFN, DIEQUZ-DAUFN, etc. (via the where-used list)
03-09-2020 1:20 PM
Hi
Please refer to this link
https://answers.sap.com/questions/4669081/assigning-f4-help-in-reusealvgriddisplay.html
03-09-2020 1:37 PM
Try to use ref_table = 'AFIH' and not the generic 'AUFK' or 'CAUFV' which don't carry any explicit search help. (check it with SE11 on field 'AUFNR')
(Or switch to OO ALV)
03-09-2020 2:22 PM
03-09-2020 2:31 PM
I build a fast (dirty) test program and it worked for me...
DATA: itab TYPE TABLE OF afih.
SELECT * INTO TABLE itab
FROM afih UP TO 1000 ROWS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_structure_name = 'AFIH'
TABLES
t_outtab = itab.<br>
Check your fieldcatalog with ALV grid consistency check
03-09-2020 2:35 PM
Or even this simple code (it will work with ALV which is based on the same DDIC logic):
PARAMETERS p_aufnr TYPE afih-aufnr.
03-10-2020 3:35 PM
what are these?
I do not see them in the structure of lvc_s_fcat
03-10-2020 3:42 PM
'F4 help exists' field name is F4AVAILABL for example (column header/short text of the data element is displayed by the tool)
03-10-2020 4:00 PM
03-10-2020 4:09 PM
If you have created a specific structure within SE11, you can choose the search help on all fields yourself.
03-11-2020 3:27 AM
03-11-2020 9:33 AM
the solution to my problem:
cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = gt_output ).
gr_columns = gr_table->get_columns( ).
gr_column ?= gr_columns->get_column( columnname = 'AUFNR' ).
gs_ddic-table = 'AFIH'.
gs_ddic-field = 'AUFNR'.
gr_column->set_ddic_reference( gs_ddic ).
gr_column->set_f4( abap_true ). gr_table->display( ).
Thank you all to thiose who provided an answer above,I have rewarded you with upvotes!