rel_exp - IS BOUND

Syntax

... ref IS [NOT] BOUND ...

Effect

This predicate expression checks whether a reference variable contains a valid reference. A reference variable must be specified for ref. This is a functional operand position.

  • A data reference is valid if it can be dereferenced.
  • An object reference is valid if it points to an object.

When using addition NOT, the expression is true if the reference variable does not contain a valid reference.

Note

A non-initial reference variable that contains a heap reference is generally always valid (since it keeps an object alive). Only heap references that point to rows from internal tables can become invalid when rows are deleted. A data reference variable that contains a stack reference, on the other hand, can become invalid even if the reference data object is removed from the stack.

Example

The logical expression in the IF statement is false. The data reference dref contains a reference to a deleted table row.

DATA: dref TYPE REF TO data,
      itab TYPE TABLE OF ...

FIELD-SYMBOLS <fs> TYPE ANY.

dref = REF #( itab[ ... ] ).

...

CLEAR itab.

...

IF dref IS BOUND.
  ASSIGN dref->* TO <fs>.

ENDIF..


例子:

 IF GR_ALV_CC IS NOT BOUND.
    CREATE OBJECT GR_ALV_CC
      EXPORTING
        CONTAINER_NAME 'ALV_CC'.
    CREATE OBJECT LO_SELE_ALV.
    LO_SELE_ALV->GENERATE_ALV).
  ELSE.
    LO_SELE_ALV->REFRESH_ALV).
  ENDIF.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值