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,660

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,453

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

This wrapper RFC is triggered by third party system, which understands only char type data i.e the output tables associated type must be a char type (the abap defined packed, raw data types are not understandable)

I guess you're looking for a dynamic way to access components. Well, this has been answered a ton of times in the forum. Here is the principle, and if you need more information, refer to the corresponding ABAP documentation. By the way, I assume/hope that your internal tables do not contain nested structures, internal tables... (it would be a little bit more complex to handle, for example using recursive processing)


FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
"<=== Here assign <itab>
FIELD-SYMBOLS <wa> TYPE ANY.
FIELD-SYMBOLS <field> TYPE ANY.
DATA type TYPE c LENGTH 1.
DATA char TYPE c LENGTH 100.
DATA string TYPE string.
LOOP AT <itab> ASSIGNING <wa>.
  DO.
    ASSIGN COMPONENT sy-index OF <wa> TO <field>.
    IF sy-subrc NE 0. EXIT. ENDIF.
    DESCRIBE FIELD <field> TYPE type.
    CASE type.
      WHEN 'P'.
        WRITE <field> TO char. "<=== Here, add the formatting options you want
      WHEN 'C' OR 'g'.
        char = <field>.
      WHEN OTHERS.
"<=== handle cases for all elementary data types
    ENDCASE.
  CONCATENATE string ';' char INTO string.
  ENDDO.
ENDLOOP.

Sandra

39 REPLIES 39