Popular Posts
Convert relative url to absolute Uri baseUri = new Uri("http://www.domain.com/path/sample"); Uri absoluteUri = new Uri(baseUri, "../../other/path"); Uri... Convert pfx file to certificate file and private key file Use openssl Convert swing component to image package y11.m03; import java.awt.Graphics2D; import java.awt.GridLayout; import java.awt.geom.AffineTransform; import java.awt.image.Buffer...
Stats
Enable UNC (c$, d$) on windows 7
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"LocalAccountTokenFilterPolicy"=dword:00000001
Receive doPostBack params
Javascript:
__doPostBack("btnQuery", '123456');
Code behind:
string target = Request.Params["__EVENTTARGET"];  // btnQuery
string args = Request.Params["__EVENTARGUMENT"];  // 123456
Query all columns of all tables
SELECT
    a.TABLE_NAME                as 表格名稱,
    b.COLUMN_NAME               as 欄位名稱,
    b.DATA_TYPE                 as 資料型別,
    b.CHARACTER_MAXIMUM_LENGTH  as 最大長度,
    b.COLUMN_DEFAULT            as 預設值,
    b.IS_NULLABLE               as 允許空值,
    (
        SELECT
            value
        FROM
            fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', a.TABLE_NAME, 'column', default)
        WHERE
            name='MS_Description' 
            and objtype='COLUMN' 
            and objname Collate Chinese_Taiwan_Stroke_CI_AS = b.COLUMN_NAME
    ) as 欄位備註
FROM
    INFORMATION_SCHEMA.TABLES  a
    LEFT JOIN INFORMATION_SCHEMA.COLUMNS b ON ( a.TABLE_NAME=b.TABLE_NAME )
WHERE
    TABLE_TYPE in ('BASE TABLE','VIEW')
ORDER BY
    a.TABLE_NAME, ordinal_position
CTE, recursive search
WITH DepartmentSearch(DeptID, DeptParent, DeptName, OuID)
AS
(
    -- 找出簽核者所屬部門
    SELECT d.DeptID, d.DeptParent, d.DeptName, d.OuID
    FROM tbDepartment d
    LEFT JOIN tbEmpDept ed ON ed.DeptID = d.DeptID
    INNER JOIN tbFlowApprove fa ON fa.Approver = ed.EmpID
    WHERE fa.FlowInsID = @FlowInsID AND fa.FlowAct = @FlowAct AND fa.ActAppendix IS NULL
    UNION ALL
    -- 遞迴向上找出主管部門
    SELECT d.DeptID, d.DeptParent, d.DeptName, d.OuID
    FROM tbDepartment d
    INNER JOIN DepartmentSearch ON DepartmentSearch.DeptParent = d.DeptID
)
SELECT * FROM DepartmentSearch
other ref: 一般資料表運算式(Common Table Expressions, CTE)
Convert relative url to absolute
Uri baseUri = new Uri("http://www.domain.com/path/sample");
Uri absoluteUri = new Uri(baseUri, "../../other/path");
Uri uri;
Uri.TryCreate("http://www.domain.com/base/uri", "../relative/uri", out uri);
filetracker error ftk1011
FileTracker error: ftk1011 : an error occurs on converting project from visual studio 2008(or under?) to visual studio 2010, and with some folder or directory named by Chinese characters. There are some kinds of solutions provided (from google):
  1. Add a system enviroment variant TRACKFILEACCESS and set value as false
  2. Edit project file (.csproj), find all <PropertyGroup/> sections and add content <TrackFileAccess>false</TrackFileAccess> into it.
  3. Change .net Framework to 4(above)
Text Symbols
*&---------------------------------------------------------------------*
*& Report  ZA000020                                                    *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

report  ZA000020                                .

write / TEXT-A01.                    " 文字元件, 類似Resource, 需先建立定義
write / 'Default text value'(A02).   " 同上, 可不先建立定義, 若未建立文字內容, 以引號內的內容為預設值

*
建立文字內容的方式有
  1. 在source code中, 雙擊文字元件變數, 會跳出對話窗
    按yes即可建立
  2. 在ABAP Editor(SE38)中, 選擇Text elements建立
text elements 編輯畫面
Introductory Statements for Programs
Program Type Introductory Statement
Executable Program REPORT
Module Pool PROGRAM
Function Group FUNCTION-POOL
Class Pool CLASS-POOL
Interface Pool INTERFACE-POOL
Subroutine Pool PROGRAM
Type Group TYPE-POOL
Include Program -
Internal Table: header line
types: begin of POW,
         NUM type I,
         NUM2 type I,
       end of POW.
data: ITAB type POW occurs 0,
      ROW type POW.

do 5 times.
  ROW-NUM = SY-INDEX.
  ROW-NUM2 = SY-INDEX ** 2.
  append ROW to ITAB.
enddo.

* ======================================================================
* "ITAB" is a table without a header line and therefore has no component
* ======================================================================
*do 5 times.
*  ITAB-NUM = SY-INDEX + 5.
*  ITAB-NUM2 = ITAB-NUM ** 2.
*  append ITAB.
*enddo.

loop at ITAB into ROW.
  write: / 'num:', ROW-NUM left-justified, ', num2:', ROW-NUM2.
endloop.
types: begin of POW,
         NUM type I,
         NUM2 type I,
       end of POW.
data: ITAB type POW occurs 0 with header line,
      ROW type POW.

do 5 times.
  ROW-NUM = SY-INDEX.
  ROW-NUM2 = SY-INDEX ** 2.
  append ROW to ITAB.
enddo.

do 5 times.
  ITAB-NUM = SY-INDEX + 5.
  ITAB-NUM2 = ITAB-NUM ** 2.
  append ITAB.
enddo.

loop at ITAB into ROW.
  write: / 'num:', ROW-NUM left-justified, ', num2:', ROW-NUM2.
endloop.
Internal Table: declare
types ARR type I occurs 10.                   " 定義長度為10的數值table/array

types: begin of CONTACT,                      " 定義CONTACT為work area, 並以CONTACT定義內表
         FIRST_NAME(15),
         LAST_NAME(15),
         EMAIL(30),
         TEL type N length 12,
       end of CONTACT,
       CTAB type CONTACT occurs 0.


data S1 type I occurs 10 with header line.    " 宣告包含header line(work area)的表變數
data S2 type I occurs 10.                     " 宣告無header line的表變數
data S3 type standard table of I.             " 取代舊occurs語法的宣告方式

data: begin of EMPLOYEE occurs 10,            " 宣告EMPLOYEE的表變數, 並定義其欄位
        FIRST_NAME(15),
        LAST_NAME(15),
        TEL type N length 12,
      end of EMPLOYEE.