FIELD-SYMBOLS <fs> TYPE string.
DATA(some_string) = `hello`.
ASSIGN some_string TO <fs>.
IF <fs> IS ASSIGNED.
DATA(fs_assigned) = `is assigned`.
ELSE.
fs_assigned = `is not assigned`.
ENDIF.
DATA(fs_assigned_w_cond) = COND #( WHEN <fs> IS ASSIGNED THEN `is assigned` ELSE `is not assigned` ).
UNASSIGN <fs>.
ASSERT <fs> IS NOT ASSIGNED.
FIELD-SYMBOLS <another_fs> TYPE i.
DATA num TYPE i VALUE 1.
ASSERT <another_fs> IS NOT ASSIGNED.
ASSIGN num TO <another_fs>.
ASSERT <another_fs> IS ASSIGNED.
"The following statement only initializes the value and does
"not remove the assignment.
CLEAR <another_fs>.
ASSERT <another_fs> IS ASSIGNED.
ASSERT <another_fs> = 0.
ASSERT num = 0.
Serkan AKKAVAK
Computer Engineer BSc
Head of SAP & Software Department
Contact : serkurumsal@yandex.com
0 Comments