Application Development 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: 

Field symbol to the table parameter of the Function module

Former Member
0 Kudos

TYPES : BEGIN OF ty_project,

project TYPE aufnr,

END OF ty_project.

DATA : gt_project TYPE TABLE OF ty_project INITIAL

SIZE 0.

Select statement to fill the GT_PROJECT table.

How can I assign the Field symbol to table parameter(value_tab) of the function module.

I need to create 5 search help. i.e i wanted to use field symbol with the table parameter of the function module.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = v_fieldname

dynpprog = v_dyname

dynpnr = v_dynnr

window_title = v_title

value_org = 'S'

TABLES

value_tab = <fs>

return_tab = gt_return

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.

Please let me know how can I pass the field symbol to the table parameter of the FM.

thanks

ASD

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This should be all you need...




report zrich_0004.


types: begin of thelp,
       werks type t001w-werks,
       name1 type t001w-name1,
      end of thelp.

data: help_werks type table of thelp.

field-symbols:  <fs> type table.

parameters: p_werks(4) type c.

at selection-screen on value-request for p_werks.

  assign help_werks to <fs>.


  select * into corresponding fields of table help_werks
           from t001w.


  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'WERKS'
            dynprofield = 'P_WERKS'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = <fs>.


  check sy-subrc = 0.

Regards,

Rich Heilman

0 Kudos

I did some modification in the code suggested by you and I got what i want.

Thanks Rich