‎2008 Mar 20 4:07 AM
Hi,
This is regarding F4 help.
I am passing internal table to FM F4IF_INT_TABLE_VALUE_REQUEST to display F4 help. Internal table has 4 columns.
In parameter retfield i am passing name of column to be selected from F4 popup.
In returning table return_tab, i only get value for field i have mentioned in retfield.
My requiernment is , i want full row with all 4 colunms in return table.
It is very urgent. How to do this?
Full points will be rewarded.
Regards
‎2008 Mar 20 4:15 AM
Check this below example it will help u.
PARAMETERS:
p_senkey TYPE zsession_key.
AT SELECTION-SCREEN .
**F4 help for
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_senkey.
PERFORM f0012_sh_on_s_session CHANGING p_senkey.
FORM f0012_sh_on_s_session CHANGING p_senkey TYPE any.
REFRESH : i_seskey, i_ddshretval.
CLEAR:wa_seskey.
SELECT template_id " #CCE No deletion Flag
version
session_key
lock_date
success
unlock_date
FROM zfact_maint_jlog INTO wa_seskey.
APPEND wa_seskey TO i_seskey.
ENDSELECT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'SESSION_KEY'
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_SENKEY'
STEPL = 0
window_title = 'SESSION KEY'
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = i_seskey
FIELD_TAB =
return_tab = i_ddshretval.
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF sy-subrc <> 0. "#EC *
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CLEAR wa_ddshretval.
READ TABLE i_ddshretval INTO wa_ddshretval INDEX 1.
IF sy-subrc EQ 0.
p_senkey = wa_ddshretval-fieldval.
ENDIF.
ENDIF.
ENDFORM. " f0013_sh_on_s_session
‎2008 Mar 20 4:16 AM
This will work.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'POSNR'
dynpprog = wf_dyn
dynpnr = wf_dynnum
dynprofield = 'S_POSNR'
value_org = 'S'
TABLES
value_tab = int_helptab.
int_helptab is the internal table containing all the data.
Reward if useful.Thanks.
‎2008 Mar 20 4:34 AM
int_helptab will have only POSNR value. I want values of full row selected.
‎2008 Mar 20 4:19 AM
Hi,
Better you created collective search help............
reward if useful...............
‎2008 Mar 20 5:00 AM
Hi Ashish,
Try to keep pass the primary key field of internal table to that function module. After execute of that function module, the return_tab contains the value selected by the user.
Then read that internal table by checking that field value is equal to return_tab value.So that you can get the entire row.
Hope it will useful.
Regards,
Raghu
‎2008 Mar 20 5:28 AM
You can get the value of the field in the field 'FIELDVAl' of return tab. then you can just read the original table with this field.
ie, Read table <ITAB> into <WA> with key POSNR = returntab-fieldval.
then this <WA> conatins the corresponding row.
‎2008 Mar 20 6:28 AM
Hi Ashish,
Just read the original table which is passed to the Function module with the value you get for the field.
Check sample code what have done.
if i_zhrpat_contrtyp1[] is initial.
* Select all Contract type1 texts
select *
from zhrpat_contrtyp1
into corresponding fields of table li_zhrpat_contrtyp1.
* Select only contract type1 values available based on the PERSK PERSG of the employee.
select zhrpae_contrtyp1
from zhrpat_it0016
into corresponding fields of table i_zhrpat_it0016_g
where persk = p0001-persk
and persg = p0001-persg
and begda le sy-datum
and endda ge sy-datum.
if i_zhrpat_it0016_g[] is not initial.
delete adjacent duplicates from i_zhrpat_it0016_g.
loop at i_zhrpat_it0016_g into w_zhrpat_it0016_g.
read table li_zhrpat_contrtyp1 into w_zhrpat_contrtyp1 with key zhrpae_contrtyp = w_zhrpat_it0016_g-zhrpae_contrtyp1.
if sy-subrc = 0.
append w_zhrpat_contrtyp1 to i_zhrpat_contrtyp1.
clear w_zhrpat_contrtyp1.
endif.
endloop.
endif.
endif.
g_progname = 'MP001600'.
g_scr_num = '2000'.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'ZHRPAE_CONTRTYP'
dynpprog = g_progname
dynpnr = g_scr_num
dynprofield = 'P0016-ZZ_CONTR_TYP'
value_org = 'S'
tables
value_tab = i_zhrpat_contrtyp1
return_tab = i_ret_values
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_ret_values into w_ret_values index 1.
p0016-zz_contr_typ = w_ret_values-fieldval.
read table i_zhrpat_contrtyp1 into w_zhrpat_contrtyp1 with key zhrpae_contrtyp = p0016-zz_contr_typ.
if sy-subrc = 0.
g_contrtype1_txt = w_zhrpat_contrtyp1-zhrpae_ctyp_desc.
endif.Regards,
Venkat.O