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

runtime error for assign

Former Member
0 Likes
776

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.

3 REPLIES 3
Read only

Former Member
0 Likes
612

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.

Read only

0 Likes
612

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.

Read only

0 Likes
612

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.