• 【ABAP内表】关于At first/ At last/ At new /At end of


    在ABAP开发中,各种方式的操纵内表是最最基本。我们经常会用到:将内表置于一个loop循环里去一条一条的读、写内表record。本文只是一个小总结或小操作,叙述在loop时对内表的几个控制。测试代码.

     loop at td_table1 into th_table1.

     at first.

      write:/ ‘AT First’.

     write:/ sy-tabix.

     write:/ th_table1-MATNR,

     th_table1-SPRAS.

     endat.

     at new matnr.

     write:/ ‘at new matnr’.

     write:/ sy-tabix.

     write:/ th_table1-MATNR,

     th_table1-SPRAS.

     endat.

     at end of matnr.

     write:/ ‘at end of matnr’.

     write:/ sy-tabix.

     write:/ th_table1-MATNR,

     th_table1-SPRAS.

     endat.

     at last.

     write:/ ‘at last’.

     write:/ sy-tabix.

     write:/ th_table1-MATNR,

     th_table1-SPRAS.

     endat.

     endloop.

    write:/ ‘OK’. 

    使用测试数据:

    测试结果

    测试小结

    At first :仅内表的第一行.

    AT last:仅内表的最后一行.

    AT new <field>:以该field为标记,加上前面的字段,如果是新的记录,则进行;

    AT end of <field>:以该field为标记,加上前面的字段,如果它的下一行是新的记录,则进行.


    http://scnblogs.techweb.com.cn/tcsapbw/archives/386.html

  • 相关阅读:
    利用 Makefile 写的小程序
    linux内核学习之进程管理------task_struct结构体
    智能指针
    explicit 关键字
    ant脚本编写
    FROM_UNIXTIME 格式化MYSQL时间戳函数
    Dubbo架构设计详解-转
    Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)转
    SiteMesh详解
    sitemesh使用步骤
  • 原文地址:https://www.cnblogs.com/cnlmjer/p/4099835.html
Copyright © 2020-2023  润新知