SAP ABAP ASSIGNED 用法

 IS ASSIGNED:对于检测的field symbol(类似于指针,可以指代任何变量),该关键字判断该field symbol是否分配有内存区域。

一个field symbol定义之后,如果不为其分配内存区域,则IS ASSIGNED返回abap_false。
例如:
FIELD-SYMBOLS: TYPE any.
IF IS ASSIGNED.
LOOP AT gt_xml_nodes_item_tabix INTO gs_xml_nodes_item_tabix.

  LOOP AT gt_xml_nodes_items INTO gs_xml_node_item FROM gs_xml_nodes_item_tabix-tabix_b
                                                   TO  gs_xml_nodes_item_tabix-tabix_e.
    ASSIGN COMPONENT gs_xml_node_item-ele_name_case OF STRUCTURE  TO .
    IF sy-subrc EQ 0 AND  IS ASSIGNED.
       = gs_xml_node_item-ele_value.

      UNASSIGN .
    ENDIF.
  ENDLOOP.

  APPEND  TO t_items.

ENDLOOP.

ENDIF.

你可能感兴趣的:(SAP知识点,sap)