‎2008 Mar 05 6:29 AM
Experts!
Question:
I need to create custom popup display which will appear via F4. given data are:
field1 field2
0 c/r
1 c/0r
2 mail
3 ret
how would I do this? my parameter is lfa1-dtaws.
help me please.
poist will be rewarded.
many thanks
‎2008 Mar 05 6:37 AM
Hi,
If a field in an executable program is defined with reference to an ABAP Dictionary field for which possible entries help is defined, the values from the ABAP Dictionary help are automatically displayed when the user calls the F4 help for that field. To create possible values help for input fields that have no Dictionary reference, or to override the help normally linked to the field, you can create an event block for the event
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
The event is triggered when the user calls the F4 help for the field <field>. If no corresponding event block has been defined, the possible values help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes
precedence over the default possible values help mechanism. It is then up to the programmer to ensure that an appropriate list of values is displayed, and that the user can choose a value from it.
You cannot declare the event block AT SELECTION-SCREEN ON VALUE-REQUEST for input fields on the selection screen that are declared within a logical database. You cannot override the possible values help mechanism of a logical database within the program. You can define separate help within the logical database program using the VALUE-REQUEST option in the PARAMETERS and SELECT-OPTIONS statements.
Ex.
REPORT SELECTION_SCREEN_F4_DEMO.
PARAMETERS: P_CARR_1 TYPE SPFLI-CARRID,
P_CARR_2 TYPE SPFLI-CARRID.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CARR_2.
CALL SCREEN 100 STARTING AT 10 5
ENDING AT 50 10.
MODULE VALUE_LIST OUTPUT.
SUPPRESS DIALOG.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS SPACE.
NEW-PAGE NO-TITLE.
WRITE 'Star Alliance' COLOR COL_HEADING.
ULINE.
P_CARR_2 = 'AC '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'Air Canada'.
HIDE P_CARR_2.
P_CARR_2 = 'LH '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'Lufthansa'.
HIDE P_CARR_2.
P_CARR_2 = 'SAS'.
WRITE: / P_CARR_2 COLOR COL_KEY, 'SAS'.
HIDE P_CARR_2.
P_CARR_2 = 'THA'.
4 WRITE: / P_CARR_2 COLOR COL_KEY, 'Thai International'.
HIDE P_CARR_2.
P_CARR_2 = 'UA '.
WRITE: / P_CARR_2 COLOR COL_KEY, 'United Airlines'.
HIDE P_CARR_2.
CLEAR P_CARR_2.
ENDMODULE.
AT LINE-SELECTION.
CHECK NOT P_CARR_2 IS INITIAL.
LEAVE TO SCREEN 0.
Regards,
Bhaskar
‎2008 Mar 05 6:39 AM
do you want f4 help in the pop up or after selecting from f4 help the pop up is displayed
regards
Ramya
‎2008 Mar 05 6:48 AM
hi,
This you can done
If you want to f4 help for FIELD12
write event on that field and also in
the function module that to in the RETFIELD = 'FIELD12'.
at event - At selection-screeen on f4 for field12.
data : begin of itab occurs 0,
field1 type numc,
field2 type char5,
end of itab.
at selection-screen on value-request for werks.
itab-field1 = 0
itab-field2 = c/r
append itab.'
itab-field1 = 1
itab-field2 = c/r
append itab.
itab-field1 = 2
itab-field2 = mail
append itab.
itab-field1 = 3
itab-field2 = ret
append itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'FIELD12'
DYNPPROG = sy-cprog
DYNPNR = sy-dynnr
DYNPROFIELD = 'FIELD12'
TABLES
VALUE_TAB = itab.
Hope this will resolve your problem
‎2008 Mar 05 6:48 AM
Hi,
DATA : BEGIN OF I_LFA1 OCCURS 0,
dtwas LIKE lfa1-dtwas,
field2 LIKe xxxxx-field2
END OF i_lfa1.
SELECT-OPTIONS : S_dtaws FOR LFA1-dtaws.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_dtaws-low.
SELECT dtwas xxxxx INTO TABLE i_lfa1
FROM lfa1.
SORT i_lfa1 BY dtwas.
DELETE ADJACENT DUPLICATES FROM i_lfa1 COMPARING dtwas.
IF sy-subrc EQ 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'DTWAS'
dynpprog = ws_repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = i_lfa1
return_tab = v_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
s_dtwas-low = v_return-fieldval.
‎2008 Mar 05 6:57 AM
Hi
Please see this program and follow as it.
TABLES :spfli.
PARAMETERS:
conn(4) TYPE c,carrier LIKE spfli-carrid.
TYPES: BEGIN OF values,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
END OF values.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
INITIALIZATION.
progname = sy-repid.
dynnum = sy-dynnr.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrier.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'CONN'.
APPEND field_value TO dynpro_values.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE values_tab
WHERE connid = field_value-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CARRIER'
value_org = 'S'
TABLES
value_tab = values_tab.Rewards point if it is helpful.
‎2008 Mar 05 7:01 AM
Either create a search help and attach to the field.
Or use FM 'F4IF_INT_TABLE_VALUE_REQUEST'