日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

LOOP WITH CONTROL 用法

發布時間:2023/12/9 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 LOOP WITH CONTROL 用法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

LOOP - WITH CONTROL

Syntax ?語法

LOOP [AT itab INTO wa [CURSOR top_line] [FROM n1] [TO n2]]
???? WITH CONTROL contrl.
??...
ENDLOOP.

Variants: 變式

1. LOOP WITH CONTROL contrl.

2. LOOP AT itab CURSOR cur INTO wa
?????? [CURSOR top_line] [FROM n1] [TO n2]
?????? WITH CONTROL contrl.

Effect 作用

Definition of a loop in the dynpro flow logic, which is linked to a table control contrl. The loop sequentially processes the presented rows of table control contrl by executing one loop pass per table control row. For contrl, you must directly specify the name of a table control of the dynpro. If the table control does not exist, the loop is ignored. The statement block between LOOP and ENDLOOP can contain the keywords FIELD, MODULE, CHAIN and ENDCHAIN of the flow logic. You cannot nest loops. You can execute loops either with or without reference to an internal table.

在屏幕邏輯流中定義一個和表控件control 聯系在一起的LOOP循環,這個LOOP循環通過每執行一次循環通過表控件的一行來處理表控件control的當前行。對于表控件control ,你必須直接指定這個屏幕表控件的名字。如果表控件不存在,Loop循環被忽略。在LOOPENDLOOP之間的語句可以包含邏輯流的FIELD, MODULE, CHAINENDCHAIN關鍵字。在這里不能進行循環嵌套。你可以在參照或者不參照內表的情況下執行循環。

If table controls are defined in a dynpro, you must define one loop for each table control both in the PBO processing block and in the PAI processing block.

如果表控件被定義在一個屏幕中,你必須在PBO處理塊和PAI處理塊為每一個表控件定義一個LOOP循環。

System Fields 系統字段

Within the loop pass, the system field sy-stepl contains the number of the current table control row, started at the top visible row. The system field sy-loopc contains the total number of table control rows displayed on the screen.

LOOP循環中,系統字段sy-stepl 保存著當前表控件的行數,從最頂部的可見行開始。系統字段sy-loopc保存著表控件顯示在屏幕上的總行數。

Note

To link the loop to a table control, use the addition WITH CONTROL. The statement LOOP without this addition processes stand-alone step loops and is obsolete.

為了把LOOP和表控件聯接起來,使用with control 附加項。不包含這個附加項的LOOP語句獨立處理每步循環并且已經很被廢棄了。

Variant 1 變式1

LOOP WITH CONTROL contrl.
??...

ENDLOOP.

Effect 作用

If the addition AT itab is not specified, during a loop pass the contents of the screen fields of the current row of table control contrl are transported from (at event PBO) or to (at event PAI) the data objects with the same names of the ABAP program. During PBO processing, the transport is done at the end of, during PAI processing at the beginning of the loop pass. The addition WITH CONTROL must be specified both at PBO and PAI.

?

如果沒有指定AT itab條件,在一個LOOP循環期間表控件control的當前行的屏幕字段內容傳送從(事件PBO)或者到(事件PAIABAP程序中具有相同名字的數據對象中。在PBO處理期間,傳送在結束時完成,在PAI處理期間在LOOP循環開始時完成。WITH CONTROL條件必須在PBOPAI模塊都被指定。

?

Notes 注釋

  • For screen fields of the table control that are defined with a reference to the ABAP Dictionary, the data objects with the same names of the ABAP program must be declared exactly like normal screen fields with TABLES, otherwise there will be no data transport.

對于參照ABAP字典定義的表控件上的屏幕字段,與ABAP程序中有相同名字的數據對象必須像普通的屏幕字段一樣用TABLES準確地進行聲明,否則將不會傳遞數據。

  • In the loop, you can call dialog modules to process the relevant data objects of the ABAP program. For example, you can read data from an internal table at PBO and write it back to this internal table at PAI, after processing it on the screen.

LOOP循環中,你可以調用會話模塊來處理和ABAP程序相關的數據對象。例如,你可以在PBO模塊從一個內表中讀取數據并且在屏幕處理結束后在PAI模塊把他寫回內表中。

Variant 2 變式2

LOOP AT itab CURSOR cur INTO wa
???? [CURSOR top_line] [FROM n1] [TO n2]

???? WITH CONTROL contrl.
??...
ENDLOOP.

Effect 作用

If you specify addition AT itab, during loop processing of the table control the internal table itab of the corresponding ABAP program is processed sequentially in parallel. For each row of the table control, one row of the internal table is processed. The internal table itab must be an index table. You can specify the additions INTO, CURSOR, FROM, TO and WITH CONTROL only at PBO, but not at PAI. At PAI, the internal table is used for reference to the table control.

如果你指定AT itab 項,在表控件的循環處理期間,ABAP程序中相一致的內表itab也同時被處理了。對于表控件的每一行,處理內表中的一行。內表itab必須是索引表。你只能在PBO模塊指定INTO, CURSOR, FROM, TO WITH CONTROL些項,而不能在PAI模塊指定。在PAI模塊,內表用于表控件的參考。

Use addition INTO to specify a work area wa, to which at PBO at the end of each loop pass the current row of the internal table is assigned. If you do not specify the addition wa, an internal table with header row must be used, which will then be used implicitly instead of wa. The content of wa or of the header row is transported after the assinment to the fields with the same names in the current row of the table control. The work area wa must be a global data object of the ABAP program matching the row type of the internal table. At the event PAI, only the work area wa or the header row of the internal table is filled with the content of the table control rows at the beginning of each loop pass. The content of the internal table is not automatically changed.

使用INTO項來指定一個工作區WAwa在每個LOOP循環結束通過內表的當前行時被指定。如果你不指定wa項,必須使用帶表頭的內表,表頭用來在后臺代替waWa的內容或者是表頭行的內容在這個作業結束后被傳輸到表控件的當前行具有相同名字的字段中。Wa工作區必須是ABAP程序的一個和內表的行類型相匹配的全局數據對象。在PAI事件中,只有工作區wa或者是內表的表頭被表控件的行在每次循環開始時被填充。內表的數據不會自動改變。

The syntax of additions CURSOR, FROM and TO is identical to the processing of step loops. When looping on table controls, you are allowed to use additions, but they are not really necessary, because the table controls are designed to be controlled by the structure of type CXTAB_CONTROL created via CONTROLS in the ABAP program. Here, top_line of component TOP_LINE corresponds to this structure while the number of rows to be displayed can be controlled using component LINES instead of n1 and n2. If n1 is still specified for table controls, the content of component CURRENT_LINE is calculated as follows, differing from the method shown at CONTROLS: sy-stepl+ (TOP_LINE - 1) + (n1 - 1).

語法中的CURSOR, FROM TO項與循環處理相同。當在表控件上執行loop循環時,你可以使用附加項,但它們也并不是必須的,因為表控件被設計用于被結構類型CXTAB_CONTROL ABAP程序中通過生成CONTROLS控制。這里,字段TOP_LINE top_line相當于這個結構當行數被顯示出來時能夠用字段LINES控制從而取代了n1n2。如果n1仍然被指定了,字段CURRENT_LINE的值通過如下方法計算得到,和在CONTROLS中出現的方法不相同。

Notes 注釋

  • For screen fields of the table control defined with a reference to flat structures in the ABAP Dictionary, the data objects with the same names of the ABAP program must be declared identically to normal screen fields using TABLES, otherwise there will be no data transport.

對于表控件上參照ABAP字典的扁平結構定義的屏幕字段,和ABAP程序具有相同名字的數據對象必須和普通屏幕字段一樣用TABLES進行聲明,否則將不會有數據傳遞。

  • Between LOOP and ENDLOOP, at PBO no dialog module must be called to read the data from the internal table. At PAI, however, this is necessary provided you want to evaluate the transported data. For example, you can modify the internal table according to the user entries.

LOOPENDLOOP之間,在PBO不必調用會話模塊來從內表中讀取數據。然而,在PAI,如果想取到傳遞來的數據你必須提供會話模塊。例如,你可以通過用戶記錄修改內表。

Example

If on the screen of a dynpro a table control FLIGHT_TAB is defined, the relevant flow logic may look like this. The loop is executed with reference to the internal table spfli_tab. At PBO, the loop calls a dialog module prepare_tab to fill the internal table. In the loop, at PBO no dialog module is called, because the table control in this case is filled automotically. At PAI, in the loop a dialog module modify_tab is called to store the changes the user entered in the table control in the internal table. You can find the relevant programming section of the ABAP program in the example for CONTROLS.

如果在主屏幕上定義一個表控件FLIGHT_TAB,相關的流邏輯可能是這樣的。LOOP循環參照內表spfli_tab執行。在PBOLOOP循環調用一個會話模塊prepare_tab來填充內表,在LOOP循環中,在PBO塊沒有調用會話模塊,因為在這個例子中的表控件被自動填充了。在PAILOOP循環調用了modify_tab會話模塊用來保存用戶在表控件上的輸入修改到內表中。你可以找到ABAP程序示例CONTROLS中相關的程序塊。

PROCESS BEFORE OUTPUT.
??MODULE prepare_tab.
??LOOP AT spfli_tab INTO spfli WITH CONTROL flight_tab.
??ENDLOOP.
PROCESS AFTER INPUT.
??LOOP AT spfli_tab.
????MODULE modify_tab.
??ENDLOOP.

由于水平有限,并且也是剛接觸這些不久,所以翻譯顯得很生硬,請諒解。翻譯也是旨在提高自己的英語水平,希望自己能有所提高,這樣堅持下去吧……

希望大家批評指正,謝謝。

轉載于:https://www.cnblogs.com/clsoho/archive/2010/01/22/1654379.html

總結

以上是生活随笔為你收集整理的LOOP WITH CONTROL 用法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。