4 weeks ago
Hi, has anyone experienced that the field-symbol gets unassigned unexpectedly?
Here's my code
ASSIGN IT_TABLE [ ... ] TO FIELD SYMBOL <FS_TEST>.
IF <FS_TEST> IS ASSIGNED.
ENDIF.
DATA(V_VAR1) = <FS_TEST>-EBELN. <-------------- I'm encountering an error here. Because the <FS_TEST gets unassigned even though there was no UNASSIGN logic inside the IF ENDIF condition.
How do I resolve that?
Hello @walkerist
Field symbols don't get unassigned automagically but themselves. Your code is as follows (make sure to format the code properly in your question):
ASSIGN IT_TABLE [ ... ] TO FIELD SYMBOL <FS_TEST>.
IF <FS_TEST> IS ASSIGNED.
ENDIF.
DATA(V_VAR1) = <FS_TEST>-EBELN.
If the assignment in the 1st line fails, then IF...ENDIF is not executed, but line 4 is. Thus, the line 4 is executed even if the field symbol is not assigned.
Best regards
Dominik Tylczynski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.