• 一、用Oracle的函数

    select to_char(sysdate,'WW') from dual; --取当期日期按年数第几周,以1月1日到1月7日为第一周

    select to_char(sysdate,'IW') from dual; --取当期日期按年数第几周,按自然周计数

    select to_char(sysdate,'IW') from dual; --取当期日期按月数第几周,以月初的第1天的第7天为第一周

    二、用Excel函数

    首先使用菜单工具-加载宏,选择“分析工具库”

    公式为: WEEKNUM(date,2),第二个参数为1表示周日为周开始,为2表示周一为周开始,结果和上面的第二个函数结果相同

  • SAP的Online Help里面已经有了比较清楚的讲述,below are 2 key issues:

    About the TOP program:This contains the FUNCTION-POOL statement (equivalent for a function group of the REPORT or PROGRAMstatement) and global data declarations for the entire function group.
    What happens when you use "CALL FUNCTION" statement? When you run an ABAP program, the system starts a new internal session. The internal session has a memory area that contains the ABAP program and its associated data. When you call a function module, an instance of its function group plus its data, is loaded into the memory area of the internal session. An ABAP program can load several instances by calling function modules from different function groups.

    相关链接:

    Function Groups

    From Function Groups to Objects

  • 以前在VBA中Dictionary对象使用小结中有一种字典对象的遍历方法,实际上是将字典的key和value转换为数组,写起来比较麻烦。

    类似于一些动态语言里面的hash遍历,VBA中字典对象比较方便的遍历代码是:

    Dim key

    For Each key In dict

    msgbox dict(key)

    Next