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: 

ALV output with one field Editable and search f4

Former Member
0 Kudos

Hi Experts,

I have a requirement where alv output is displayed and in that one editable field is there, now my requirement is editable field is to enter a mail id for which the user will enter a valid mail id, but at the time of entering some string he should find the related mail ids which are stored in custom table and he can select that.

is this requirement can be possible ?  if not then what is the possibel way to get it.

regards,

Raghava

3 REPLIES 3

venkateswaran_k
Active Contributor
0 Kudos

Yes, it is possible

1. In the field catalog you specify following items for the colum

       <fieldcatalog_variable>-edit = 'X'.  

       <fieldcatalog_variable>-ref_tabname = 'your custom table name'

       ref_fieldname = 'your field name in that custom table'

Secondly, the field name should have help attached. 

Example, if you hve ztable as  zmails  

id

email

name

then you ref_tabname as 'Zmails'   and ref_fieldname as email

In the table defention, the column email should be attached to a elementary help.  

Regards

Venkat

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi Raghava,

Try the below code.

1.in Fieldcatalog set the field as editable like for eg.

WA_FIELDCAT-COL_POS    = L_LIN.     WA_FIELDCAT-FIELDNAME  = 'DATAB'.     WA_FIELDCAT-DATATYPE   = 'DATS'.     WA_FIELDCAT-REPTEXT    = 'Valid From'(T06).     WA_FIELDCAT-F4AVAILABL = 'X'.     WA_FIELDCAT-EDIT       = 'X'.      APPEND WA_FIELDCAT TO I_FIELDCAT. 

2. Define F4 on the fields you want:

DATA: * Line of  F4 table   L_S_F4 TYPE LVC_S_F4, * Table for F4 relevant fields   L_T_F4 TYPE LVC_T_F4.  * F4 on datab   L_S_F4-FIELDNAME  = 'DATAB'.   L_S_F4-REGISTER   = 'X'.   L_S_F4-GETBEFORE  = SPACE.   L_S_F4-CHNGEAFTER = SPACE.   APPEND L_S_F4 TO L_T_F4.   CLEAR L_S_F4. 

..................................................

similarly you can add other fields on which you want to provide F4

..................................................

.   CALL METHOD P_G_ALV_GRID->REGISTER_F4_FOR_FIELDS     EXPORTING       IT_F4 = L_T_F4[]. 

3.Implement the metohds for Event handler:

METHOD HANDLE_ONF4.

for more information:

http://www.sap-partner.hu/ABAP_HELP_INFO/An%20Easy%20Reference%20for%20ALV%20Grid%20Control.pdf

http://my-sap-tutorials.blogspot.in/2012/08/drop-down-f4-help-hot-spot-editable.html

Regards,

Gurunath

Former Member
0 Kudos

Hi Raghava,

Try this ALV with editable F4

Regards,

Mordhwaj