2011 Aug 11 7:12 AM
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.
2011 Aug 11 8:36 AM
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
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |