‎2010 Jan 12 1:18 PM
hello all,
i ahve following snippet of code
DATA: BEGIN OF lt_temp,
buffer(30000),
END OF lt_temp.
FIELD-SYMBOLS: <l_wa> TYPE ANY,
<l_comp> TYPE ANY.
ASSIGN lt_temp TO <l_wa> CASTING TYPE (p_table).
if i give p_table value such as AUSP (which contains FLTP fields), i am getting a runtime error at ASSIGN statement as below.
(((((((In the current program "SAPLY_TEST", an error occurred when setting the
field symbol "<WA>" with ASSIGN or ASSIGNING (maybe in the combination with
the CASTING addition).
When converting the base entry of the field symbol "<WA>" (number in base
table: 33986), it was found that the target type requests a memory
alignment of 8.
However, the source data object has an invalid memory alignment, that is
an alignment not divisible by 8.))))))))
for other tables its working fine.
How can i rectify the error?
any help is greatly appreciated.
Thank you in advance.
‎2010 Jan 12 4:08 PM
Why don't you keep it simple as this?
DATA: TEST_DATA TYPE REF TO DATA,
P_TABLE TYPE STRING.
FIELD-SYMBOLS: <FS> TYPE ANY.
P_TABLE = 'SPFLI'.
CREATE DATA TEST_DATA TYPE (P_TABLE).
ASSIGN TEST_DATA->* TO <FS>.
Greetings,
Blag.
‎2010 Jan 13 4:55 AM
thank you Blag,
i cant keep that simple, because, this is a RFC FM, which gives records from table(p_table). in this case, i cant have FM interface a generic type.
‎2010 Jan 13 2:22 PM
You don't need to interface a generic type...I would do it like this...
TAB_NAME TYPE STRING.
That would you would pass the name of the required table and use it to generate the field-symbol.
Greetings,
Blag.