08-18-2008 7:44 PM
Hi all,
I am working on a report program. In the selection screen, I have the field 'Brand Node ID'(ZNODEID). The requirement is to have the F4 help for this field. This field is available in a 'Z' table ZNODETAB. There is no Value table maintained for the corresponding data element. So, without disturbing the table data element/domain, I should get the F4 help in the selection screen of the report. In the F4 help, data should be fetched from the table ZNODETAB and the field is ZNODEID. Is there any way to do this.
By searching the function modules, I could find that, we can use the FM F4IF_INT_TABLE_VALUE_REQUEST. But, I am not Sure. Can someone tell me the parameters to be passed to this function module to get the F4 help and the procedure to follow. S_NODEID is the select option used in the program. Please help me in this regard. Thanks in advance.
Thanks & Regards,
Paddu.
08-18-2008 7:50 PM
Check this example code. Here I am using the VBELN select option and gets data from VBAK.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln-low.
PERFORM value_request_vbeln using p_vbeln-low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln-high.
PERFORM value_request_vbeln using p_vbeln-high.
*&---------------------------------------------------------------------*
*& Form value_request_lead_type
*&---------------------------------------------------------------------*
FORM value_request_vbeln using p_vbeln type vbeln.
DATA: BEGIN OF value_tab OCCURS 0,
field1 TYPE vbeln,
END OF value_tab.
data: it_return_tab type standard table of DDSHRETVAL with header line.
* Drop down values
REFRESH value_tab. CLEAR value_tab.
select vbeln into table value_Tab
from vbak
up to 50 rows.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD1'
value_org = 'S'
TABLES
value_tab = value_tab[]
return_tab = it_return_tab.
READ TABLE it_return_tab INDEX 1. " INTO wa_return_tab.
p_vbeln = it_return_tab-fieldval.
w_vbeln = it_return_tab-fieldval.
ENDFORM. " value_request_lead_type
Regards,
Naimesh Patel
08-18-2008 7:50 PM
Check this example code. Here I am using the VBELN select option and gets data from VBAK.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln-low.
PERFORM value_request_vbeln using p_vbeln-low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln-high.
PERFORM value_request_vbeln using p_vbeln-high.
*&---------------------------------------------------------------------*
*& Form value_request_lead_type
*&---------------------------------------------------------------------*
FORM value_request_vbeln using p_vbeln type vbeln.
DATA: BEGIN OF value_tab OCCURS 0,
field1 TYPE vbeln,
END OF value_tab.
data: it_return_tab type standard table of DDSHRETVAL with header line.
* Drop down values
REFRESH value_tab. CLEAR value_tab.
select vbeln into table value_Tab
from vbak
up to 50 rows.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'FIELD1'
value_org = 'S'
TABLES
value_tab = value_tab[]
return_tab = it_return_tab.
READ TABLE it_return_tab INDEX 1. " INTO wa_return_tab.
p_vbeln = it_return_tab-fieldval.
w_vbeln = it_return_tab-fieldval.
ENDFORM. " value_request_lead_type
Regards,
Naimesh Patel
08-18-2008 7:55 PM
08-18-2008 7:59 PM
look at this code and try
select-options : S_NODEID for ZNODETAB-ZNODEID.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-LOW'.
at selection-screen on value-request for s_nodeid-low
perform f4_nodeid using 'S_NODEID-HIGH'.
end-of-selection.
FORM f4_nodeid USING p_field.
declare it_node.
select znodeid from ZNODETAB into table it_node.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZNODEID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = p_field
value = space
value_org = 'S'
display = 'F'
TABLES
value_tab = it_node
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
endform
08-19-2008 5:16 AM
Hi,
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = <table field name>
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = <select-option name>
value_org = 'S'
TABLES
value_tab = <internal table>
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Internal table - the table in which you have values to be displayed in the f4 help.
Sharin.
08-19-2008 9:45 AM
Hi,
try this:
INITIALIZATION.
SELECT * INTO CORRESPONDING FIELDS OF TABLE so_setheader
FROM setheader
WHERE setclass = '0000'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_kost-low.
* F4 uitvoeren
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'setname'
dynprofield = 'so_kost'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = so_setheader.
AT SELECTION-SCREEN ON so_kost.
READ TABLE so_setheader INTO wa_so_setheader WITH KEY setname = so_kost-low.
IF sy-subrc NE 0.
so_kost = space.
MESSAGE e333(s1) WITH 'Does not exist!'.
STOP.
ENDIF.