Application Development 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: 

How to check in ABAP if one referenced table is initial?

0 Kudos
305

Hello,

I have the next code:

IF lt_sals_range-mt_range_table IS INITIAL.
ENDIF.

As I want to check if lt_sals_range-mt_range_table[] IS INITIAL. But it gives me a sintax error because component mt_range_table is next type:

mt_range_table TYPE REF TO data

and I can't change it.

How I could check if this internal table that it gives have any entry?

Regards.

1 ACCEPTED SOLUTION

matt
Active Contributor
211

Look how lt_sals_range-mt_range_table is used in other parts of the program. Or possible some examples. (You've not given any context here).

But essentially, you need a field-symbol of some kind and a dereference.

ASSIGN lt_sals_range-mt_range_Table->* TO field-symbol(<range_Table>).
IF sy-subrc IS NOT INITIAL or range_table IS INITIAL.
  " Do initial processing.
ENDIF.
2 REPLIES 2

matt
Active Contributor
212

Look how lt_sals_range-mt_range_table is used in other parts of the program. Or possible some examples. (You've not given any context here).

But essentially, you need a field-symbol of some kind and a dereference.

ASSIGN lt_sals_range-mt_range_Table->* TO field-symbol(<range_Table>).
IF sy-subrc IS NOT INITIAL or range_table IS INITIAL.
  " Do initial processing.
ENDIF.

0 Kudos
211

It worked by this way!

Thanks.