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

Checking whether a structure is assigned or not

Former Member
0 Likes
617

Hello All,

I am trying to check in a custom pricing requrement routine whether the internal table tkomv is assigned or not, because further statements on the same is causing a dump as it is not assigned. I tried to assign it to a field symbol like

ASSIGN 'tkomv[]' TO <fs_tkomv>

and then check sy-subrc, but in all cases sy-subrc is 0, even though the internal table tkomv is not assigned.

Can anyone give me a solution for this to check whether it is assigned or not??

Thanks in advance

Anirban

3 REPLIES 3
Read only

Former Member
0 Likes
513

Hi!

Check out this example:


FIELD-SYMBOLS <FS> TYPE ANY. 
IF <FS> IS NOT ASSIGNED. 
  WRITE 'That is O' NO-GAP. 
ENDIF. 
ASSIGN SY-SUBRC TO <FS>. 
IF <FS> IS ASSIGNED. 
  WRITE 'K.'. 
ENDIF. 

Regards
Tamás

Read only

Former Member
0 Likes
513

Hi,

You have used the single quotes for the internal table while writing the Assign statment,

ASSIGN tkomv[] TO <fs_tkomv>.

Regards

Sudheer

Read only

0 Likes
513

If I try without the quotes it will dump as tkomv is not assigned. Using quotes also is not useful as you mentioned.