Friday, 24 May 2013

39.PROVIDING F4 HELP



Most of the times, providing F4 help for particular field at WEB UI level requires creating a search help in SE11 transaction. 

Let us create one search help in SE11 first. 

Go to the SE11 transaction and create one search help. Enter the values as shown in the below. Here we want provide a F4 help to the partner function field at search view. 





Selection method is a table name from which values will come.  Activate the search help.

Go to the UI component and go to the field for which F4 help has to be provided. Here we want to provide it for PARTNER FUNCTION field at search view.
Go and generate the v-GETTER method. 






Once method is generated,copy and paste the following code. 






To make the developers work easy, SAP has provided one standard class CL_BSP_WD_VALUEHELP_F4DESCR. We just need to create one stance of this class by providing some information. 

1.       Help id : This is search help id that we created in se11.
2.       Input mapping : to provide the mapping between the context node attribute and the attribute in the search help.

Here we are providing the f4 help to the PARTNER FUCNTION field. so at line 9, we have given the ‘STRUCT.PARTNER_FCT’ to the input mapping’s CONTEXT_ATTR.  In the next line, we mapped it to the ‘PARTNER_FCT’ in the SE11 search help.

3.       Outputmapping:  once user selects any value on the F4 help, we need to transfer the selected value back to the field. This information will be given in the output mapping.  In lines 14 & 15, we have done this by telling framework to transfer the value from the ‘PARTNER_FCT’ to the context node attribute ‘STRUCT.PARTNER_FCT’


Activate the method and test the application.







Here we can see two fields at top, partner function, text to search entries. These fields are appeared here because we have given the values 1 and 2 in the SPos column in se11 while we created the search help. If we had left this column blank, then these fields won’t appear.

Select any value. Value will be automatically transferred to the partner function field.

We can every restrict the search by sending values as below .
'\''Z*\'''

Comment the ‘STRUCTU.PARTNER_FCT’ and uncomment above value in the line no 9. Activate the method and test the application. Your f4 will be shown as below.  All entries that start with Z will be searched.





7 comments:

  1. Thanks.The example explained is clear and brief.

    ReplyDelete
  2. thanks dude very helpful tutorial you got...

    ReplyDelete
  3. if we are not creating search help in se11. then how we can create the search help

    ReplyDelete
  4. great.
    The F4 function is showing. I get some entries found.
    But the result is blank. I was expecting some partner functions and it's description to be shown below the XXX entries found. but mine is just blank. is there anything missing? (Coding wise and Search help are identical to yours)

    ReplyDelete
  5. I want to remove some values in the result..How can i do that

    ReplyDelete