释疑の字段符号 FIELD-SYMBOLS
FIELD-SYMBOLS:?<fs1>?TYPE?ANY,
???????????????<fs2>?TYPE?ANY.
ASSIGN?text+3(3)?TO?<fs1>.”456分配給<fs1>解釋紅字部分2
DO?8?TIMES.
??ASSIGN?<fs1>(sy-index)?TO?<fs2>.
????WRITE?/?<fs2>.
??ENDIF.
ENDDO.
運行結果:
4
45
456
4567
45678
解釋:
In the first ASSIGN statement, the area limits of the data objecttext are assigned to<fs1>. In the secondASSIGN statement,<fs2> takes on these limits. Starting from the second loop run, the system will attempt to assign a larger storage area to<fs2>. However, in Unicode programs, the logical expression afterIF is no longer true, while in non-Unicode programs the larger storage area is assigned.----1
Notes
- If the area limits are the same as the data area of the ABAP program, you must ensure that this data area also contains the administration information fordeep data objects because otherwise errors could occur if these are exceeded unintentionally.
- Up to Release 6.10, the specification of range_spec was not possible. The area limits were independent of the name of the data object and were determined by thedata area of the ABAP program. If the data area of the ABAP program has been exceeded, it can trigger an exception that cannot be handled.
Effect in Unicode Programs
If there is no specification made for range_spec, the area limits inUnicode programs are defined as follows:
- If you have specified an elementary data object fordobj inmem_area, the storage area of this data object determines the area limits.
- If you have specified a field symbol for dobj in mem_area, and this field symbol has an elementary data object assigned to it, the field symbol<fs> of the current statement takes on the area limits assigned to this field symbol.-----2
- 如果您已經指定了一個mem_areadobj領域符號,和這一領域的象征對象分配給它的一個基本數據,當前語句的字段符號<fs>分配給該地區這一領域的象征限制。
- If you have a structure or a field symbol specified for dobj inmem_area, and one of these points to a structure, the system checks whether the structure has a character-type initial section (up to the firstalignment gap). This then determines the area limits.?
- 如果你有一個結構或為dobjmem_area,這些結構之一指定的字段符號,系統將檢查結構是否有一個字符類型的初始部分(第一對齊差距)。這就決定了區域限制。就是第二個分配語句的寫照。
If these area limits are exceeded, no storage area is assigned for the static variant ofmem_area after theASSIGN statement. Also, the logical expression<fs> IS ASSIGNED is incorrect, whilesy-subrc is set to 4 in the dynamic variant
如果超過了這些地區的限制,沒有存儲區域分配mem_area靜態變種后ASSIGN語句。此外,被分配的邏輯表達式<fs>,是不正確的的,而SY - SUBRC設置在動態的變4。 程序中 sy-index = 5以后就是這種情況,不做輸出。
Effect in Non-Unicode Programs
If no specification is made for range_spec, the area limits innon-Unicode programs are defined as follows:
- If the name of a data object is not specified directly in the specification of the storage areamem_area, , the area limits are determined by thedata area of the ABAP program.
如果一個數據對象的名稱是不直接指定規格的存儲區域mem_area,區域限制是由ABAP程序的數據區。
- If the name of a data object is specified dynamically for the specification of the storage areamem_area, the area limits are determined by the dynamically specified data object.?
- 如果數據對象的名稱被指定為動態存儲區域mem_area的規范,區域限制是由動態指定的數據對象。
If these area limits are exceeded, an exception that cannot be handled will be triggered.
如果超過了這些地區的限制,無法處理的異常將被觸發。
附錄:
Unicode(統一碼、萬國碼、單一碼)是一種在計算機上使用的字符編碼。它為每種語言中的每個字符設定了統一并且唯一的二進制編碼,以滿足跨語言、跨平臺進行文本轉換、處理的要求。1990年開始研發,1994年正式公布。隨著計算機工作能力的增強,Unicode也在面世以來的十多年里得到普及。
Unicode定義了大到足以代表人類所有可讀字符的字符集。
總結
以上是生活随笔為你收集整理的释疑の字段符号 FIELD-SYMBOLS的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pe文件
- 下一篇: ABAP入门程序,你会了嘛?