Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

F4 help

Former Member
0 Likes
798

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

7 REPLIES 7
Read only

Former Member
0 Likes
768

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

Read only

Former Member
0 Likes
768

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.

Read only

0 Likes
768

int_helptab will have only POSNR value. I want values of full row selected.

Read only

Former Member
0 Likes
768

Hi,

Better you created collective search help............

reward if useful...............

Read only

Former Member
0 Likes
768

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

Read only

Former Member
0 Likes
768

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.

Read only

venkat_o
Active Contributor
0 Likes
768

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