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

Help needed in work area Declaration

Former Member
0 Likes
473

Hi All,

I am trying to declare an Internal table like the import parameter defined in the method signature. The parameter lt_results is defined of the type Any Table.

I need to loop around this table. for this i need to declare a work area of type lt_results. But not able to proceed by declaring a work area wa_results of type lt_results.

Any work around for this issue.

Thanks,

udaya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
449

Hi,

try this


FIELD-SYMBOLS <wa> TYPE ANY.
...

LOOP AT lt_result ASSIGNING <wa>. "CASTING...
...

P.S. Be carefull if lt_result belongs to a search help - always use function modules F4UT* to modify this table. Otherwise line allocations might be wrong....

Kind regards,

HP

3 REPLIES 3
Read only

Former Member
0 Likes
449

Try

data: wa_results like line of lt_results.

Hope that helps,

Michael

Read only

Former Member
0 Likes
450

Hi,

try this


FIELD-SYMBOLS <wa> TYPE ANY.
...

LOOP AT lt_result ASSIGNING <wa>. "CASTING...
...

P.S. Be carefull if lt_result belongs to a search help - always use function modules F4UT* to modify this table. Otherwise line allocations might be wrong....

Kind regards,

HP

Read only

Former Member
0 Likes
449

Try this piece of code.

DATA: vo_ref     TYPE REF TO data. 

  FIELD-SYMBOLS: <fs>     TYPE ANY.

  CREATE DATA vo_ref LIKE LINE OF itab.
  ASSIGN vo_ref->* TO <fs>.

<fs> will be the work area of internal table itab.

Hope it helps.

Thanks

Romit