2007 Dec 25 5:53 AM
Hi all,
I am working in screen programming which consists of a table control and i need to attach a f4 help through pov for a field based on some other field in the row . please suggest me how to get the screen values . I am using F4IF_INT_TABLE_VALUE_REQUEST and retrieving the values .
Thanks & Regards
magesh anandan
2007 Dec 25 9:38 AM
hi,
try like this...
After all Modules of PAI,
write,
PROCESS ON VALUE-REQUEST.
FIELD itab_det-vend_cust_code MODULE comp_help.
MODULE comp_help INPUT.
CHECK NOT zform_track_mast-comp_code IS INITIAL .
CLEAR: dyfields, dyfields.
REFRESH: dyfields, dyfields.
dyfields-fieldname = 'ZFORM_TRACK_MAST-COMP_CODE'.
APPEND dyfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dyfields.
READ TABLE dyfields INDEX 1.
SELECT kna1kunnr kna1name1
INTO TABLE i_kna1
FROM kna1 INNER JOIN vbrk
ON kna1kunnr = vbrkkunag
WHERE vbrk~bukrs = dyfields-fieldvalue.
SORT i_kna1 BY kunnr.
DELETE ADJACENT DUPLICATES FROM i_kna1.
CLEAR value_tab.
CLEAR field_tab.
CLEAR return_tab.
REFRESH value_tab.
REFRESH field_tab.
REFRESH return_tab.
field_tab-fieldname = 'KUNNR'.
field_tab-tabname = 'KNA1'.
APPEND field_tab.
field_tab-fieldname = 'NAME1'.
field_tab-tabname = 'KNA1'.
APPEND field_tab.
CLEAR field_tab.
LOOP AT field_tab.
EXIT.
ENDLOOP.
LOOP AT i_kna1 .
value_tab-kunnr = i_kna1-kunnr.
APPEND value_tab.
CLEAR value_tab.
value_tab-name1 = i_kna1-name1.
APPEND value_tab.
ENDLOOP.
LOOP AT value_tab.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = field_tab-fieldname
TABLES
value_tab = value_tab
field_tab = field_tab
return_tab = return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
itab_det-vend_cust_code = return_tab-fieldval.
ENDIF.
ENDMODULE. " comp_help INPUT
here itab_det-vend_cust_code my table control field and i am fetching its value according to some other field on screen....
And this is data declaration...
TYPES : BEGIN OF ty_kna1,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF ty_kna1.
DATA : dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE ,
i_kna1 TYPE TABLE OF ty_kna1 WITH HEADER LINE.
DATA : BEGIN OF wa_value_tab,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF wa_value_tab.
DATA : value_tab LIKE wa_value_tab OCCURS 0 WITH HEADER LINE.
DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.
DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
reward if useful...