05-04-2011 2:08 PM
Hi Guys,
I want to place a search help on the field PRPS-USR03. For that I'd went to SE51 and opened the screen 1460 program "SAPLCJWB" and placed the search help in layout of that screen. When I am running it the search help is working, but when I am seeing this screen from transaction CJ02/CJ20N the search help is not working.
Please help me to get out from this problem.
Thanks in advance.
Virendra Kedia
Whinging removed
Edited by: Rob Burbank on May 4, 2011 9:43 AM
05-04-2011 3:38 PM
Don't change the standard when not necessary. Better look at BAdI [WBS_USER_FIELDS_F4|http://help.sap.com/saphelp_crm50/helpdata/en/d6/98bb4222bdc511e10000000a1550b0/content.htm].
Regards,
Raymond
05-04-2011 3:38 PM
Don't change the standard when not necessary. Better look at BAdI [WBS_USER_FIELDS_F4|http://help.sap.com/saphelp_crm50/helpdata/en/d6/98bb4222bdc511e10000000a1550b0/content.htm].
Regards,
Raymond
05-05-2011 7:44 AM
Hi Raymond,
Thanks for your reply.
Actually I am new to ABAP, can you please provide the AT_F4 method code here.
I'll be thankful to you.
Regards,
Virendra Kedia
05-05-2011 8:25 AM
In SE19, try something like
METHOD if_ex_wbs_user_fields_f4~at_f4.
TYPES returntab TYPE TABLE OF ddshretval INITIAL SIZE 0.
DATA : tabname TYPE dfies-tabname,
fieldname TYPE dfies-fieldname,
searchhelp TYPE shlpname,
return_tab TYPE returntab,
valuestab TYPE ddshretval.
CASE i_user_field.
WHEN 'PRPS-USR00'.
tabname = 'ZTABLE00'.
fieldname = 'ZFIELD00'.
searchhelp = 'ZHELP00'.
WHEN 'PRPS-USR01'.
tabname = 'ZTABLE01'.
fieldname = 'ZFIELD0'.
searchhelp = 'ZHELP01'.
* etc.
ENDCASE.
IF NOT tabname IS INITIAL.
CALL FUNCTION 'F4_FIELD_ON_VALUE_REQUEST'
EXPORTING
tabname = tabname
fieldname = fieldname
searchhelp = searchhelp
TABLES
return_tab = return_tab
EXCEPTIONS
OTHERS = 0.
LOOP AT return_tab INTO valuestab.
e_value = valuestab-fieldval.
ENDLOOP.
ELSE.
MESSAGE s398(00) WITH 'No search help is available for this field'.
ENDIF.
ENDMETHOD. "IF_EX_WBS_USER_FIELDS_F4~AT_F4
Regards,
Raymond
05-05-2011 8:57 AM
Thanks Raymond for your code.
Now the search help is coming on the user field and it is also saying tha 3 entries found, but it is not displaying those 3 values.
Can you tell me what is the problem??
Regards
Virendra Kedia
05-05-2011 9:21 AM
Is the name of the field the same as the parameter name of the search help, if no fill also parameter SHLPPARAM of F4_FIELD_ON_VALUE_REQUEST with the parameter name of the search help. Also you can test F4_FIELD_ON_VALUE_REQUEST via SE37.
Regards,
Raymond
05-05-2011 9:45 AM
Yes, the name of the field is same as the parameter name of the search help.
I don't know what is the problem.
05-05-2011 9:56 AM
Do you get the list displayed when testing F4_FIELD_ON_VALUE_REQUEST via SE37 or the search help via SE11 ?
05-05-2011 10:12 AM
Hurray!!
Now Its working fine. I think there was the problem with my search help so I made another search help. Now its working.
Thanks Raymond for your kind help.
You are a LIFE SAVIOUR
Thanks once again.
Regards,
Virendra Kedia
06-21-2021 10:31 AM
raymond.giuseppi
Your solution works perfectly for a regular field in CJ20N. I have a similar but different request. I have to add a search help to a field (customer) which is chosen after clicking on the 'mass change' icon in CJ20N. I tried to implement the method AT_F4 in badi WBS_USER_FIELDS_F4 but the program did not reach it. Do you have a solution to this?
Thanks in advance,
Hagit
06-22-2021 9:01 AM
The table control used for mass maintenance doesnt call the BAdI (sad) It only call standard FM (F4IF_FIELD_VALUE_REQUEST) so I would suggest a ddic solution (attach a search help to structure or data element)
(or look for an enhancement point in the dynpro containing the table control of selected fields)
Nevetheless you could consider it a bug (defect) and raise an incident to SAP
06-22-2021 10:24 AM
raymond.giuseppi
Thank you for your answer.
I add search help to CNMASS_WBS_ELEMENT and it works