(转载)LOOP WITH CONTROL 用法

2023-10-27

 转载自@凡尘clsoho
源链接:http://www.cnblogs.com/clsoho/archive/2010/01/22/1654379.html

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 FIELDMODULECHAIN 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之间的语句可以包含逻辑流的FIELDMODULECHAINENDCHAIN关键字。在这里不能进行循环嵌套。你可以在参照或者不参照内表的情况下执行循环。

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 INTOCURSORFROMTO 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模块指定INTOCURSORFROMTO  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 CURSORFROM 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 CONTROLSsy-stepl+ (TOP_LINE - 1) + (n1 - 1).

语法中的CURSORFROM  TO项与循环处理相同。当在表控件上执行loop循环时,你可以使用附加项,但它们也并不是必须的,因为表控件被设计用于被结构类型CXTAB_CONTROLABAP程序中通过生成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/sapabap/p/5057502.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

(转载)LOOP WITH CONTROL 用法 的相关文章

  • tamcat服务器的项目配置,服务器配置tomcat部署项目

    部署项目首先你需要把你的java web项目打包成war文件 在需要打包的项目上右键 gt 选择 Export 选中 Web 下面的 WAR file 点击 Next 通过 Browse 选择保存路径 点击 Finish 完成即可 然后在服
  • osgEarth的Rex引擎原理分析(一二二)着色器程序的opengl过程

    目标 一二一 中问题208 1 创建着色器程序glCreateProgram 2 创建着色器glCreateShader 如果有多个着色器 比如多个顶点 多个片段着色器 多个情况下只有一个有main函数 2 4三步需要执行多次 3 上传着色
  • 10.Xaml ListBox控件

    1 运行界面 2 运行源码 a Xaml 源码
  • shell执行curl_Linux Shell脚本编程--curl命令详解

    用途说明 curl命令是一个功能强大的网络工具 它能够通过http ftp等方式下载文件 也能够上传文件 其实curl远不止前面所说的那些功能 大家可以通过man curl阅读手册页获取更多的信息 类似的工具还有wget curl命令使用了
  • ubuntu18.04 安装NVIDIA3080ti 显卡驱动及SSH服务和用户添加

    主要参考的这篇博客https blog csdn net weixin 46203866 article details 119425999 spm 1001 2014 3001 55061 显卡驱动下载 下载nvidia驱动程序 RTX
  • PRD 发布报表(2)

    发布报表 发布到bi Server 1 首先启动bi Server 这个在我其他的博文中已经有记述 可以参考 Pentaho学习笔记 bi Server配置 2 然后在PRD中如下图所示 选择发布 注意填写bi Server的账号和密码 选
  • 长篇图解java反射机制及其应用场景

    一 什么是java反射 在java的面向对象编程过程中 通常我们需要先知道一个Class类 然后 new 类名 方式来获取该类的对象 也就是说我们需要在写代码的时候 编译期或者编译期之前 就知道我们要实例化哪一个类 运行哪一个方法 这种通常
  • 中国的官办经济-陈经

    这本书写的不错 从建国到2006年的中国的经济进行了梳理 说明了到底为何中国的经济具有这么大的竞争力 我深深认可其中对于中国人民勤劳 勇敢的描写 经济嘛 就是干活创造价值 中国人民是世界上最勤劳的民族 如果没有走错了 如闭关锁国 一定会跟上
  • Google语法

    目录 Google语法 搜索语法 intitle inurl intext link site filetype related 通配符 注意 快照 cache 举例 Google语法 总结一下平时经常用到的搜索引擎语法 基本都适用于百度搜
  • 项目上传svn 服务器

    1 选中项目右键到 team gt share Project 2 进入到选择界面 选择svn 进入下一个界面 现在可以看到的界面是要选择共享资源的地址了 如果之前已经共享过就会保存在下面了 没有的话我们就自己创建新的资源位置 就是第一个选
  • Blender基础:UV编辑器、UV坐标、UV映射、UV展开

    目录 1 纹理 2 UV编辑器 3 UV坐标 4 UV映射 5 UV展开 6 纹理绘制 7 自动UV展开 8 手动UV展开 9 UV布局调整 10 练习 弯曲文字 1 纹理 纹理Texture 又叫贴图 一般来说 物体的表面不是纯色的 由贴
  • springboot 定时任务(线程配置,并行【同步】、异步等)

    1 定时任务实现方式 SpringBoot自带的Scheduled 可以将它看成一个轻量级的Quartz 而且使用起来比Quartz简单许多 本文主要介绍 执行方式 单线程 串行 多线程 并行 2 创建定时任务 Component Enab
  • 【云原生之Docker实战】使用Docker部署StackEdit在线Markdown编辑器

    云原生之Docker实战 使用Docker部署StackEdit在线Markdown编辑器 一 StackEdit介绍 1 StackEdit简介 2 StackEdit中文版简介 3 StackEdit中文版功能 二 检查本地Docker
  • 关于linux /etc/sysconfig/network中的NOZEROCONF=yes参数

    关于linux etc sysconfig network中的NOZEROCONF yes参数 今天从CSSD Fails to Join the Cluster After Private Network Recovered if ava
  • 【算法研究】Bresenham画线算法

    作者 gnuhpc 出处 http www cnblogs com gnuhpc 0 算法目的这个算法是要画一条平滑的直线 这个工作的难点是确定两点之间的那些像素点 使其近可能的靠近手工绘制的直线 1 基本算法描述现在我们要在一个光栅格子上
  • Django独有报错

    You called this URL via POST but the URL doesn t end in a slash and you have APPEND SLASH set Django can t redirect to t
  • vcruntime140.dll文件下载安装方法以及一些注意事项

    其实vcruntime140 dll文件是Microsoft Visual C Redistributable Packages for Visual Studio 2015中的一个重要组件 它包含了Windows操作系统和其他应用程序所需
  • 加拿大见!拓数派受邀参加第17届PostgreSQL国际开发者大会(PGCon 2023)

    5月30日 6月2日 作为疫情后的第一场线下会议第17届 PostgreSQL 国际开发者大会 PGCon 2023 将在加拿大渥太华隆重举行 拓数派将作为黄金赞助商 受邀参与本次盛会 与全球数据库爱好者们共聚加拿大 此外 拓数派 PieC
  • 由“2013软考之不完美结果”来剖析自己的学习方式误区

    2013年5 25日的软考 昨天晚上可以查成绩了 当时同学走到我面前让查成绩时 心开始跳了 手开始抖了 那一刻的紧张 那一刻的激动 既担心又想知道结果 别急别急 成绩看到了 不高 上午50 下午45 也就是说按百分制算的话 下午只考了60分
  • VScode 安装 ESP-idf 5.0报错:LookupError: unknown encoding: utf-8,gbk

    原因 说明从 pip 源返回的是 utf 8 gbk 编码类型 但是 pip 不能解析 请求了一下 pip 源后发现确实如此 尝试更新 pip python m pip install upgrade pip 但也会报同样的问题 这是因为镜

随机推荐

  • 服务器不能全屏显示,远程服务器如何全屏显示

    远程服务器如何全屏显示 内容精选 换一换 本节操作介绍在Windows和Linux环境中使用SSH密码方式远程登录Linux云服务器的操作步骤 弹性云服务器状态为 运行中 弹性云服务器已经绑定弹性公网IP 绑定方式请参见绑定弹性公网IP 所
  • firemonkey开发通讯录app

    1 添加AddressBook1 MultiView1 speedbuttonX3 labelX editboxX3 buttonX2 listbox组件 2 对listbox右键additem选择tsearchbox类型 3 设置Mult
  • Jlink SWD和Jtag下载失败总结

    学习STM32或者说使用Jlink的同学都有很多的困扰 我把自己遇到的情况总结一下 并给出解决方法 希望后来人少走点弯路 第一次写博客 勿喷 一 提示No Jlink Device Found 错误 没有发现Jlink 可能原因 1 Jli
  • 函数式编程总结

    函数式编程的概念 函数式编程理念来自于数学中的函数 函数的概念 对于两个变量x和y 如果每给定x的一个值 都有一个y值与之对应 那么我们就说y是x的函数 如下即是一些函数 f x 5x 2 4x 3 g x 2f x 5 10x 2 8x
  • cmath常用库函数

    cmath int abs int i double fabs double x long labs long n double exp double x double log double x double pow double x do
  • KVM 性能调优

    CPU Tuning Cache share tuning 对于物理 CPU 同一个 core 的 threads 共享 L2 Cache 同一个 socket 的 cores 共享 L3 cache 所以虚拟机的 vcpu 应当尽可能在同
  • 深度学习日记

    一 基于连续帧排序的语言分割 BubbleNets Learning to Select the Guidance Frame in Video Object Segmentation by Deep Sorting Frames 论文地址
  • cmd命令行如何快速进入当前目录

    我们在cmd命令行中如果想要进入某一个目录 相信大家一般都是先按D 或者E 进入相应的盘符 然后再输入cd 当前目录 以下有两种快捷方式可以进入当前目录 1 部分绿色windows版本可以支持以下操作 按住shift 鼠标右键 即可看见 在
  • 华为机试HJ8 合并表记录

    HJ8 合并表记录 Python 题目 解题思路 代码 结果 题目 解题思路 1 题目中没有说有多组输入 不考虑循环 2 结果列表先初始化 3 键值对的处理简单 合并按位置加和即可 4 要记录出现过的键 最后输出要决定显示哪些键值对 代码
  • STM32学习之SHT20温湿度传感器

    一 产品综述 SHT20 新一代 Sensirion 湿度和温度传感器在尺寸与智能方面建立了新的标准 它嵌入了适于回流焊的双列扁平无引脚 DFN 封装 底面 3 x3mm 高度 1 1mm 传感器输出经过标定的数字信号 标准 I 2 C 格
  • LAMP平台部署及论坛搭建

    部署LAMP平台实验 一 编译安装APACHE 1 准备工作 2 解压到opt目录 3 将解压好的apr文件放到httpd源码文件代码库中 4 配置Apache 5 make编译安装 6 优化httpd服务执行方式需要先优化路径 7 设置系
  • Error: Unable to execute “/usr/bin/vmware-uninstall-tools.pl.终极解决方案

    如何快速安装VMware Tool 可以参考这篇文章 https allen5g blog csdn net article details 102759282 Error Unable to execute usr bin vmware
  • Fiddler使用方法小结

    Fiddler基本使用 简介 Fiddler是一个http协议调试代理工具 它能够记录并检查所有你的电脑和互联网之间的http通讯 设置断点 查看所有的 进出 Fiddler的数据 指cookie html js css等文件 这些都可以让
  • CSS:三个div放在一排

    div 1 div div 2 div div 3 div 方法一 div display inline block 方法二 div float left 方法三 flex布局 123外面加一个div 这个div的style为 displa
  • HttpServletRequestWrapper替代HttpServletRequest

    本文解析以下两个方面 1 HttpServletRequestWrapper的作用 HttpServletRequest采用装饰者模式包装了HttpServletRequest 客户端发送请求后 容器实例化了一个org apache cat
  • 大数据构建数据生态系列02——与研发的爱恨情仇

    1 写在之前 接上一章的架构图 我们知道我们只是起了个头 后续还有待完善的部分 这一章节暂时不讲 我们在上一章成果的基础上 讲述一下整个数据收集的相关故事 以及期间的一些收获和思考 主要是和研发团队之间的 爱情火花 在数据生态的第一环中 最
  • 【编程之路】面试必刷TOP101:动态规划(78-82,Python实现)

    面试必刷TOP101 动态规划 78 82 Python实现 78 打家劫舍 一 小试牛刀 78 1 动态规划 或许有人认为利用贪心思想 偷取最多人家的钱就可以了 要么偶数家要么奇数家全部的钱 但是有时候会为了偷取更多的钱 或许可能会连续放
  • 怎么让小孩子学计算机,小朋友不会电脑怎么学编程?终于真相了!

    孩子太小根本玩不转电脑 鼠标都握不稳 26个英文字母都认不全 学编程简直天方夜谭 在很多家长看来 孩子借助电脑能进行熟练的源代码编程操作才叫学编程 清华前校长陈吉宁先生曾经说过 中国未来社会需要逻辑思维缜密 能够应对变化 提出独特想法的创造
  • Java解一元二次方程和四则运算

    目录 一 Java解一元二次方程 运行结果 思路解析 二 Java四则运算 运行结果 思路解析 一 Java解一元二次方程 package hello import java util Scanner public class hey pu
  • (转载)LOOP WITH CONTROL 用法

    转载自 凡尘clsoho源链接 http www cnblogs com clsoho archive 2010 01 22 1654379 html LOOP WITH CONTROL Syntax 语法 LOOP AT itab INT