2020 Mar 06 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
2020 Mar 11 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!
2020 Mar 06 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)
2020 Mar 09 8:19 AM
Hi sandra.rossi , yes I did but it still does not show anything in the alv
2020 Mar 09 8:19 AM
Hi sandra.rossi , yes I did but it still does not show anything in the alv
2020 Mar 09 8:35 AM
2020 Mar 09 9:01 AM
2020 Mar 09 9:24 AM
Okay,
Try using the table name 'AUFK'. This has built in F4 enabled.
ls_fieldcat-ref_table ='AUFK'.
2020 Mar 09 9:30 AM
2020 Mar 09 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
2020 Mar 09 9:42 AM
i have tried with aufk before , it does not work ,maybe REUSE_ALV_GRID_DISPLAY is the problem?
2020 Mar 09 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 ' '.
2020 Mar 09 9:06 AM
2020 Mar 09 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).
2020 Mar 09 1:15 PM
2020 Mar 09 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)
2020 Mar 09 1:20 PM
Hi
Please refer to this link
https://answers.sap.com/questions/4669081/assigning-f4-help-in-reusealvgriddisplay.html
2020 Mar 09 1:37 PM
2020 Mar 09 2:22 PM
2020 Mar 09 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
2020 Mar 09 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.
2020 Mar 10 3:35 PM
what are these?
I do not see them in the structure of lvc_s_fcat
2020 Mar 10 3:42 PM
2020 Mar 10 4:00 PM
can it be,that I have a custom structure and not standard table
2020 Mar 10 4:09 PM
2020 Mar 11 3:27 AM
2020 Mar 11 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!