04-14-2010 1:04 PM
Hi,
I have a custom table with 5 fields - say A, B, C, D and E. While populating data to the table through SM30, I need to create a F4 help for the field C. A custom function module needs to be used.
I have created a module for the same in the event PROCESS ON VALUE-REQUEST of the function group of the table.
But the F4 for field C depends on the values put in fields A and B.
I am not able to get the values of fields A and B from within the module PROCESS ON VALUE-REQUEST.
Please help me to create the F4 help.
04-14-2010 1:21 PM
hii,
This is the piece of code i have used in one of my SM30 to get f4. mopdify according to ur need and use.
revert back for further help.
w_dynpread-fieldname = 'ZSITEDCDATA-SITE'.
APPEND w_dynpread TO i_dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = 'SAPLZSITEDCDATA'
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = i_dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE i_dynpread INTO w_dynpread INDEX 1.
IF sy-subrc IS INITIAL.
SELECT land1 FROM t001w
INTO TABLE i_site
WHERE werks EQ w_dynpread-fieldvalue.
IF i_site[] IS NOT INITIAL.
DATA: lv_line TYPE i.
CLEAR lv_line.
DESCRIBE TABLE i_site LINES lv_line.
IF lv_line GT 1.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZSITEDCDATA-SITE_COUNTRY'
dynpprog = 'SAPLZSITEDCDATA'
dynpnr = sy-dynnr
window_title = 'Site Country'
value_org = 'S'
TABLES
value_tab = i_site[]
return_tab = i_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.
ELSE.
READ TABLE i_return INTO w_return INDEX 1.
IF sy-subrc IS INITIAL.
zsitedcdata-site_country = w_return-fieldval.
ENDIF.
ENDIF.
Thanks ,
Gaurav
04-14-2010 1:35 PM
Hi Gaurav,
This did not work... May be because I need to create the F4 help for the field during populating data in the table through SM30..
I could not get the values in the fields A and B..
04-14-2010 1:38 PM
I was wondering if a custom search help can help. Unfortunately i don't have SAP access at this point of time so can try it out.
04-14-2010 1:42 PM
Hi Suhas,
Actually I cannot make any custom search help.... need to do it through coding in the function group of the custom table.
Hence the problem...
04-14-2010 1:55 PM
Hi,
Generally making changes to the code of table maintenance is not appreciated because it might be lost once the TMG is regenerated or deleted.
You can go for a custom serach help and attach it to the data element of the table.
But if you want to attach a search help through code modification,
then check ,
07-15-2010 6:25 AM
Hi Tiyasha,
Were u able to solve this?Can you kincly brief me on the steps that you carried out?
Regards,
Nandini