2007 Mar 21 7:16 PM
Hello,
I am attempting to setup an ABAP OO framework for extending master data with the CMOD exit, EXIT_SAPLRSAP_002. My goal is to create generic base class, upcast to the actual extraction structure, apply the customizing data fields, and then return the full table to the exit. The problem is that I_T_DATA, the internal table for return values is untyped and therefore generic. I tried using a class parameter as type ref to DATA, but the upcast if failing is failing. Can any one suggest:
What parameter type should I use for the class method parameter?
How do you upcast to the formal extract structure type?
How do you assign the result back to the generic type?
Thanks very much for the help!
Hello,
I am attempting to setup an ABAP OO framework for extending master data with the CMOD exit, EXIT_SAPLRSAP_002. My goal is to create generic base class, upcast to the actual extraction structure, apply the customizing data fields, and then return the full table to the exit. The problem is that I_T_DATA, the internal table for return values is untyped and therefore generic. I tried using a class parameter as type ref to DATA, but the upcast if failing is failing. Can any one suggest:
What parameter type should I use for the class method parameter?
How do you upcast to the formal extract structure type?
How do you assign the result back to the generic type?
Thanks very much for the help!
2007 Mar 22 12:38 PM
I ended up figuring out the answer after a bit more work. In case it helps others, the keys points are:
I_T_DATA exposed in EXIT_SAPLRSAP_00x is a dynamic internal table
The reference to the table can be passed to a method parameter as a generic type, TABLE
Though, to store the value in the class as a formally typed value, such as required by an attribute, the type must be cast to the type, DATA.
For example:
Public section
Method CONSTRUCTUR
IMPORTS
PT_DATA TYPE TABLE.
Assign data pointer to attribute
GET REFERENCE OF PT_DATA INTO A_T_DATA.
Endmethod.
protected section.
data A_T_DATA type ref to DATA .
Hope that helps.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |