10-11-2007 2:32 PM
hi all,
i developed a table maint generator.
in this i have 3 fields out of three there is a field called subtype. for this i ahve to create f4 help for this. foir this field i have to display two descptions calles' sub type1 and subtype2. these are not coming from any database tables. any body can tell me how to wrote. and send me the sample code for it.
thanks,
maheedhar
10-11-2007 2:37 PM
Go to SE51..Give the program name..in your case..SAPL + function group name.
Give the screen number...that you gave when you created the table maintenance..
THen press change..
Create an event process on value-request for F4..
PROCESS ON VALUE-REQUEST.
FIELD ZTABLE-F4 MODULE F4_FOR_F4.
**In the module use the function module F4IF_INT_TABLE_VALUE_REQUEST.
Check this example for how to use this function module
TABLES: T005T.
DATA: BEGIN OF t_t005 OCCURS 0,
land1 TYPE t005-land1,
END OF t_t005.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.
PARAMETERS: p_land1 TYPE t005-land1.
SELECTION-SCREEN COMMENT 13(35) v_text1.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
v_text = 'Country'.
v_text1 = ' '.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.
REFRESH: t_t005.
SELECT land1
INTO TABLE t_t005
FROM t005.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'T005'
PVALKEY = ' '
retfield = 'LAND1'
dynpprog = sy-repid
DYNPNR = sy-dynnr
dynprofield = 'P_LAND1'
callback_program = sy-repid
value_org = 'S'
TABLES
value_tab = t_t005
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.
10-11-2007 2:37 PM
You will have to create a data element and domain for your table fields to get the F4 values in table maintenence...
Define your possible values in the domain.
Once you do this, you will have the f4 values populated accoring to the domain you have defined. .
10-17-2007 7:28 AM