‎2007 Dec 27 7:36 AM
hi
I am using a fm 'F4IF_INT_TABLE_VALUE_REQUEST'
how can i populate multiple fields through this
‎2007 Dec 27 8:00 AM
Hi Sandipan,
Check this sample code
the F4 help provided to the field P_MATNR in the program, returns the values of the material and its corresponding material group to the screen fields P_MATNR and P_MATKL..
to achieve this we are making use of the TABLES parameter DYNPFLD_MAPPING
REPORT ZYH284_TEST1.
parameters:
p_matnr type mara-matnr,
p_matKl type mara-matkl.
data:
begin of itab occurs 0,
matnr type mara-matnr,
matkl type mara-matkl,
end of itab,
t_ret_tab LIKE STANDARD TABLE OF DDSHRETVAL,
t_dyn_map LIKE STANDARD TABLE OF DSELC,
fs_ret_tab TYPE DDSHRETVAL,
fs_dyn_map TYPE DSELC,
w_repid type sy-repid,
w_dynnr TYPE sy-dynnr.
at selection-screen on value-request for p_matnr.
select matnr
matkl
from mara
into table itab
up to 10 rows.
fs_dyn_map-fldname = 'F0002'.
fs_dyn_map-dyfldname = 'P_MATKL'.
APPEND fs_dyn_map TO t_dyn_map.
w_repid = sy-repid.
w_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
DYNPPROG = w_repid
DYNPNR = w_dynnr
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
value_tab = itab
RETURN_TAB = t_ret_tab
DYNPFLD_MAPPING = t_dyn_map
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3 .
‎2007 Dec 27 7:42 AM
Hi,
Data:
BEGIN OF fs_values,
pid type ZCL_TIME_DATA1-PROJECTID,
OID TYPE ZCL_OBJECT-OBJECTID,
ODEC TYPE ZCL_OBJECT-OBJECT_DESC,
END OF fs_values.
data: t_values type table of fs_values.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'OID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'FS_TIME-OBJECTID'-----> for the screen field
value_org = c_s
TABLES
value_tab = t_values.
PLzz reward points if it helps.
‎2007 Dec 27 7:44 AM
Hi
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
REFRESH ITAB.
SELECT matnr FROM mara INTO TABLE ITAB.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR '
dynprofield = 'P_MATNR '
dynpprog = sy-REPID
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = ITAB
return_tab = return.
Reward points if helpful
Regards
hitesh
‎2007 Dec 27 8:00 AM
Hi Sandipan,
Check this sample code
the F4 help provided to the field P_MATNR in the program, returns the values of the material and its corresponding material group to the screen fields P_MATNR and P_MATKL..
to achieve this we are making use of the TABLES parameter DYNPFLD_MAPPING
REPORT ZYH284_TEST1.
parameters:
p_matnr type mara-matnr,
p_matKl type mara-matkl.
data:
begin of itab occurs 0,
matnr type mara-matnr,
matkl type mara-matkl,
end of itab,
t_ret_tab LIKE STANDARD TABLE OF DDSHRETVAL,
t_dyn_map LIKE STANDARD TABLE OF DSELC,
fs_ret_tab TYPE DDSHRETVAL,
fs_dyn_map TYPE DSELC,
w_repid type sy-repid,
w_dynnr TYPE sy-dynnr.
at selection-screen on value-request for p_matnr.
select matnr
matkl
from mara
into table itab
up to 10 rows.
fs_dyn_map-fldname = 'F0002'.
fs_dyn_map-dyfldname = 'P_MATKL'.
APPEND fs_dyn_map TO t_dyn_map.
w_repid = sy-repid.
w_dynnr = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
DYNPPROG = w_repid
DYNPNR = w_dynnr
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
value_tab = itab
RETURN_TAB = t_ret_tab
DYNPFLD_MAPPING = t_dyn_map
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3 .
‎2007 Dec 27 12:16 PM
Hi this may be of some help for u.
See the following ex:
TYPES: BEGIN OF TY_MBLNR,
MBLNR LIKE MKPF-MBLNR,
END OF TY_MBLNR.
DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-low.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
DYNPFLD_MAPPING =
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.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-low.
ENDIF.
Go through the test program.
REPORT Ztest_HELP .
TABLES : MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_MATNR(10) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR
FROM MARA
INTO TABLE ITAB
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATERIAL NUMBER'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
with regards,
Hema Sundara.
‎2007 Dec 27 2:32 PM
Hi Das,
To populate multiple fields through F4 help refer to the below program .In this program for the selection screen field arktx i have used search help concept.So based upon the value of vbeln it will display values in F4 help.In F4 help we will get the combination of VBELN POSNR MATNR and ARKTX.i am sure it will help u..
REPORT ZPRACTICE_43_032.
tables:vbap.
data : begin of itab occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
posnr like vbap-posnr,
arktx like vbap-arktx,
end of itab.
selection-screen:begin of block a with frame title text-001.
select-options:s_vbeln for vbap-vbeln.
parameters:p_arktx like vbap-arktx.
selection-screen:end of block a.
initialization.
s_vbeln-low = '0000004900'.
s_vbeln-high = '0000004970'.
append s_vbeln.
clear s_vbeln.
at selection-screen on value-request for p_arktx.
select vbeln matnr posnr arktx
from vbap
into table itab
where vbeln in s_vbeln.
if not itab[] is initial.
sort itab.
endif.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ARKTX'
DYNPPROG = 'ZPRACTICE_43_022'
DYNPNR = '1000'
DYNPROFIELD = 'P_ARKTX'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = itab .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward points if it s useful.
With Regards,
Thasneem