06-03-2011 9:46 AM
Hi,
I have a problem in my interactive ALV.
In my field catalogue I have a field wher ei provide REF_TABLE and REF_FIELD.
Now in the ALV, this column gets a automatic F4 which shows all entries coming for the field.
In normal conditions I want to display the standard F4 coming from the ref_table and ref_field for a ALV column.
But in some conditions, I have to restrict this standard F4 and launch my own F4 showing only restricted values.
Now in certain conditions, i launch a search help which shows restrictd values for this column. But after I make a selection from this F4 pop-up, the standard F4 pop-up also comes up, which I don't want now.
Do you know how can I avoid this second pop-up?
Thanks & Regards,
Kamini
06-03-2011 11:58 AM
You can customize this field by handling event onf4 . In the handler you can attach your custom search help or provide internal table input help and suppress standard input help pop up
METHOD handle_on_f4.
DATA: repid LIKE sy-repid,
dynnr LIKE sy-dynnr,
field TYPE help_info-dynprofld.
MESSAGE 'User defined value input' TYPE 'I'.
repid = sy-repid.
dynnr = sy-dynnr.
field = e_fieldname.
"this part work excatly as standard search help for this field
"but is processed by a user althought looks like standard processing
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SFLIGHT'
fieldname = 'SEATSMAX_F'
dynpprog = repid
dynpnr = dynnr
dynprofield = field. "return to same screen field which triggered the event
"prevent furhter standard processing
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
I assumed you know how to properly register this event.
Regards
Marcin
06-03-2011 10:26 AM
Hi.,
When you want to display your own F4 for certain conditions., if the condition satisfies modify the fieldcatalag by setting reference field to empty . OR take two forms., in first form build field catalog with reference field for standard F4 and in second form ,. build field catalog with no reference field and with custom F4 .
now if the condition satisfies.,
clear lt_fieldcat.
perform form2.
else.
perform form1.
endif.
hope this helps u.,
Thanks & Regards,
Kiran
06-03-2011 12:17 PM
Hi Kiran,
I was also thinking of the same logic before.
But this has problems when I control the conditions from data changed event.
Regards,
Kamini
06-03-2011 11:58 AM
You can customize this field by handling event onf4 . In the handler you can attach your custom search help or provide internal table input help and suppress standard input help pop up
METHOD handle_on_f4.
DATA: repid LIKE sy-repid,
dynnr LIKE sy-dynnr,
field TYPE help_info-dynprofld.
MESSAGE 'User defined value input' TYPE 'I'.
repid = sy-repid.
dynnr = sy-dynnr.
field = e_fieldname.
"this part work excatly as standard search help for this field
"but is processed by a user althought looks like standard processing
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SFLIGHT'
fieldname = 'SEATSMAX_F'
dynpprog = repid
dynpnr = dynnr
dynprofield = field. "return to same screen field which triggered the event
"prevent furhter standard processing
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
I assumed you know how to properly register this event.
Regards
Marcin
06-03-2011 12:15 PM