Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

F4 help on REUSE_ALV_GRID_DISPLAY

former_member2492
Active Participant
0 Kudos

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

1 ACCEPTED SOLUTION

former_member2492
Active Participant
0 Kudos

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!

25 REPLIES 25

Sandra_Rossi
Active Contributor

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)

former_member2492
Active Participant
0 Kudos

Hi sandra.rossi , yes I did but it still does not show anything in the alv

former_member2492
Active Participant
0 Kudos

Hi sandra.rossi , yes I did but it still does not show anything in the alv

venkateswaran_k
Active Contributor
0 Kudos

Hi

You need to add EDIT = X

ls_fieldcat-EDIT       ='X'.

0 Kudos

I just did ,the field becomes editable but still no pop up

0 Kudos

Okay,

Try using the table name 'AUFK'. This has built in F4 enabled.

ls_fieldcat-ref_table ='AUFK'.

0 Kudos

bu the way I am using REUSE_ALV_GRID_DISPLAY

0 Kudos

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

0 Kudos

i have tried with aufk before , it does not work ,maybe REUSE_ALV_GRID_DISPLAY is the problem?

Sandra_Rossi
Active Contributor
0 Kudos

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 ' '.

former_member2492
Active Participant
0 Kudos

Sandra Rossi I just tried still nothing 😞

Sandra_Rossi
Active Contributor

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).

0 Kudos

Hi Sandra the custom table of ordp is caufd-aufnr....

0 Kudos

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)

venkateswaran_k
Active Contributor

raymond_giuseppi
Active Contributor

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)

0 Kudos

still nothing,I will be switching to oo 😞

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

  • Field name - AUFNR
  • Table Name - 1
  • F4 help exists - X
  • CHECKTABLE - AUFK
  • Reference field name - AUFNR
  • Reference table name - AFIH

Or even this simple code (it will work with ALV which is based on the same DDIC logic):

PARAMETERS p_aufnr TYPE afih-aufnr.

0 Kudos

what are these?

  • Table Name - 1
  • F4 help exists - X

I do not see them in the structure of lvc_s_fcat

0 Kudos

'F4 help exists' field name is F4AVAILABL for example (column header/short text of the data element is displayed by the tool)

0 Kudos

can it be,that I have a custom structure and not standard table

0 Kudos

If you have created a specific structure within SE11, you can choose the search help on all fields yourself.

0 Kudos
Jonathan Blavatsky I don't understand what you mean "I have a custom structure and not standard table", because you told us you used REF_TABLE = 'CAUFV' and Raymond answer was to use REF_TABLE = 'AFIK'. Can you explain what you mean?

former_member2492
Active Participant
0 Kudos

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!