03-10-2008 10:37 AM
i need to provide f4 help for a field .
when user presses f4 i need to provide help
which contains values which i want to hard core.
please help me regarding.i want to hardcore values to be displayed
03-10-2008 10:40 AM
Hi,
Please refer to the code below:
PARAMETERS:p_matnr(18) TYPE c.
DATA:BEGIN OF itab OCCURS 0,
matnr TYPE matnr,
END OF itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
itab-matnr = 'ABC123456788'.
APPEND itab.
itab-matnr = 'BCS123456788'.
APPEND itab.
itab-matnr = 'DFC123456788'.
APPEND itab.
itab-matnr = 'ASW123456788'.
APPEND itab.
"you can use select statement as well
"incase you are using any table field.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_MATNR'
value_org = 'S'
TABLES
value_tab = itab.
Thanks,
Sriram Ponna.
03-10-2008 10:40 AM
Hi,
Please refer to the code below:
PARAMETERS:p_matnr(18) TYPE c.
DATA:BEGIN OF itab OCCURS 0,
matnr TYPE matnr,
END OF itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
itab-matnr = 'ABC123456788'.
APPEND itab.
itab-matnr = 'BCS123456788'.
APPEND itab.
itab-matnr = 'DFC123456788'.
APPEND itab.
itab-matnr = 'ASW123456788'.
APPEND itab.
"you can use select statement as well
"incase you are using any table field.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_MATNR'
value_org = 'S'
TABLES
value_tab = itab.
Thanks,
Sriram Ponna.
03-10-2008 10:43 AM
Hi,
Move the required data to an internal table i_tab and pass that internal table to this function module.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_Num'
value_org = 'S'
TABLES
value_tab = i_tab.
Hope this will help
Regards
shibin
03-10-2008 10:44 AM
first declare an internal table itab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>.
now add or hardcore the values of the field into this internal table or else even data can be selected from database table into this internal table.
Use the function module.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = <field>
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = <selection screen field>
value_org = 'S'
TABLES
value_tab = itab.
03-10-2008 10:46 AM
create a domain and assign fixed values in se11.
den in program create ur field with reference to this domain.
03-10-2008 10:49 AM
Hi,
see this example.
TABLES: usr02.
parameters: p_bname LIKE usr02-bname,
p_class LIKE usr02-class.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bname.
PERFORM f_valuerequest_vbeln.
*&---------------------------------------------------------------------*
*& Form f_valuerequest_vbeln
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM f_valuerequest_vbeln.
DATA: BEGIN OF t_data OCCURS 1,
data(20),
END OF t_data.
DATA: lwa_dfies TYPE dfies.
data h_field_wa LIKe dfies.
data h_field_tab like dfies occurs 0 with header line.
data h_dselc like dselc occurs 0 with header line.
SELECT * FROM usr02.
t_data = usr02-bname. APPEND t_data.
t_data = usr02-class. APPEND t_data.
ENDSELECT.
PERFORM f_fieldinfo_get USING 'USR02'
'BNAME'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
PERFORM f_fieldinfo_get USING 'USR02'
'CLASS'
CHANGING h_field_wa.
APPEND h_field_wa TO h_field_tab.
h_dselc-fldname = 'BNAME'.
h_dselc-dyfldname = 'P_BNAME'.
APPEND h_dselc.
h_dselc-fldname = 'CLASS'.
h_dselc-dyfldname = 'P_CLASS'.
APPEND h_dselc.
DATA: ld_repid LIKE sy-repid.
ld_repid = sy-repid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_BNAME'
dynpprog = ld_repid
dynpnr = '1000'
dynprofield = 'P_BNAME'
* multiple_choice = ''
* value_org = 'S'
TABLES
value_tab = t_data
field_tab = h_field_tab
* return_tab = return_tab
DYNPFLD_MAPPING = h_dselc
EXCEPTIONS
OTHERS = 0.
ENDFORM. " f_valuerequest_vbeln
*&---------------------------------------------------------------------*
*& Form f_fieldinfo_get
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0079 text
* -->P_0080 text
* <--P_H_FIELD_WA text
*----------------------------------------------------------------------*
FORM f_fieldinfo_get USING fu_tabname
fu_fieldname
CHANGING fwa_field_tab.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = fu_tabname
FIELDNAME = fu_fieldname
LFIELDNAME = fu_fieldname
IMPORTING
DFIES_WA = fwa_field_tab
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 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.
ENDFORM. " f_fieldinfo_get
rgds,
bharat.
03-10-2008 10:49 AM
Hi sai, if u r using customization table u can maintain hardcoded valus in domain for a particular filed, i.e value range option in domain of that field.
if it is standard table, create one intenal table with that field, and append hardcoded value innternal table use, then use FM CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'urfield'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'screenfield'
value_org = 'S'
TABLES
value_tab = itab.
call above FM in event AT SELECTION-SCREEN ON VALUE-REQUEST FOR urfield.
Reward pts if it helps........