zoukankan      html  css  js  c++  java
  • ABAP 唯一GUI ID 的使用

    当在创建日志表,想生成一个永远不会重复的序列号做唯一键值,来保证每次日志记录都不会被覆盖。

    有两种方式,一种带日期的方式,一种是纯GUI ID,参考如下:

    1.

      data: lv_timestamp type timestampl,
            lv_time_c(30) type c,
            lv_date type sy-datum,
            lv_time type sy-uzeit.

        get time stamp field lv_timestamp.
        write lv_timestamp to lv_time_c time zone sy-zonlo.
        convert time stamp lv_timestamp time zone sy-zonlo into date lv_date time lv_time.
        ex_seqid = |{ lv_date }{ lv_time }.{ lv_time_c+20(7) }|.
       

    2.

      data: lv_guid22 type sysuuid_c22,
            lv_guid26 type sysuuid_c26,
            lv_guid32 type sysuuid_c32,
            lo_uuid type ref to cl_system_uuid.

        try.
            create object lo_uuid.
            call method lo_uuid->if_system_uuid~create_uuid_c22
              receiving
                uuid = lv_guid22.
            ex_guid22 = lv_guid22.
          catch cx_uuid_error .
        endtry.

    闫默涵
  • 相关阅读:
    [译]理解 iOS 异常类型 <🌟>
    LeetCode 24. 两两交换链表中的节点
    解决The operation couldn’t be completed. Unable to log in with account
    <Typora> 常用操作快捷键
    LeetCode 23. 合并K个升序链表
    CSS盒子模型
    CCS属性
    CSS
    form表单
    html
  • 原文地址:https://www.cnblogs.com/yanmohan/p/14544235.html
Copyright © 2011-2022 走看看