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].
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.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |