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

dynamic function module call

Former Member
0 Likes
4,680

Hi all,

can anybody suggest me how to handle import, export and tables parameters in a dynamic function module call if they are associated with TABLE types.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
4,473

You might be interested in reading this [http://help.sap.com/abapdocu_702/en/abapcall_function_dynamic.htm].

There are several ways of doing it.

I 'll pass You one that 'll do the work, but I 'm not sayin it's best practice.

And this logic is applyable only when mapping goes 1 on 1.


TYPES:
  BEGIN OF abap_type_struc,
   date    TYPE d                     ,
   decimal TYPE p LENGTH 16 DECIMALS 3,
  END   OF abap_type_struc,
  BEGIN OF char_type_struc,
   date    TYPE char10,
   decimal TYPE char20,
  END   OF char_type_struc.

FIELD-SYMBOLS:
  <a_field> TYPE ANY,
  <c_field> TYPE ANY.

DATA:
  a_struc   TYPE abap_type_struc,
  c_struc   TYPE char_type_struc,
  component TYPE i              .

a_struc-date    = sy-datum   .
a_struc-decimal = '20000.987'.

WHILE sy-subrc = 0.
  ADD 1 TO component.

  ASSIGN COMPONENT component OF STRUCTURE a_struc TO <a_field>.
  IF sy-subrc = 0.
    ASSIGN COMPONENT component OF STRUCTURE c_struc TO <c_field>.
    IF sy-subrc = 0.
      WRITE <a_field> TO <c_field>.
    ENDIF.
  ENDIF.
ENDWHILE.

WRITE: / c_struc.

Hope it'll wake up creativity in your development.

Igor.

39 REPLIES 39