Popular Posts
Translating 1.3 <html> <head>     <title>Translating 1.1</title>     <meta http-equiv="content-type" content="text... vi hot key guide 第一部份:一般模式可用的按鈕說明,游標移動、複製貼上、搜尋取代等 移動游標的方法 h 或 向左方向鍵(←) 游標向左移動一個字元 j 或 向下方向鍵(↓) 游標向下移動一個字元 k 或 向上方向鍵(↑) 游標向上移動一個字元 l 或 向右方向鍵(→) 游標... SwiXml SwiX ml , is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that ...
Stats
declare
定義資料類型(EMPLOYEE):
TYPES dtype [TYPE type|LIKE dobj] ...
types: begin of EMPLOYEE,          " type definition
         WID(10) type C,
         FIRST_NAME(15) type C,
         LAST_NAME(15) type C,
         AGE type I,
       end of EMPLOYEE.
data EMP1 type EMPLOYEE.           " declare variant
types EMP like EMP1.               " type definition using exist variant
data EMP2 like EMP1.               " declare variant using exist variant
宣告變數(EMPLOYEE):
DATA var [{TYPE type}|{LIKE dobj}] ...
data: begin of EMPLOYEE,           " declare variant with structs
        WID(10) type C,
        FIRST_NAME(15) type C,
        LAST_NAME(15) type C,
        AGE type I,
      end of EMPLOYEE.
data EMP3 like EMPLOYEE.           " declare variant using exist variant
宣告常數:
constants: CNAME(10) value 'Bruce',
           BIRTHDAY type D value '19650201'.

constants: begin of MYADDRESS,
             NAME     type C length 20 value 'Fred Flintstone',
             STREET   type C length 20 value 'Cave Avenue',
             NUMBER   type P           value  11,
             POSTCODE type N length 5  value  98765,
             CITY     type C length 20 value  'Bedrock',
           end of MYADDRESS.
宣告表格:
tables: SPFL.                " load from ABAP/4 Dictionary
select * from SPFL.          " iterator data
  write: SPFL-MANDT,
         SPFL-CARRID,
         SPFL-CONNECTION.
endselect.
ADD ... THEN ... UNTIL ...
data: begin of SERIES,
         N1 type I value 10,
         N2 type I value 20,
         N3 type I value 30,
         N4 type I value 40,
         N5 type I value 50,
         N6 type I value 60,
      end of SERIES.
data SUM type I.
add SERIES-N1 then SERIES-N2 until SERIES-N5 giving SUM.
write SUM.
add SERIES-N2 then SERIES-N3 until SERIES-N6 to SUM.
write / SUM.
output:
       150
       350
Horizontal, vertical line and space
* Horizontal line
write sy-uline.
write '------'.
uline.

* Vertical line
write sy-vline.
write '|'.

* space
skip 3.
skip to line 10.
WRITE: format option
通用格式化選項
選項 用途選項
LEFT-JUSTIFIED 輸出對左對齊
CENTERED 輸出置中對齊
RIGHT-JUSTIFIED 輸出對右對齊
UNDER <g> 輸出至<g>下方
NO-GAP 忽略輸出後方的間格空格
USING EDIT MASK <m> 指定輸出格式
USING NO EDIT MASK 取消abap dictionary中定義的輸出格式
NO-ZERO 取消前導的'0'以空格替代

數值格式化選項
選項 用途選項
NO-SIGN 取消前置符號
DECIMALS <d> 定義小數位數
EXPONENT <e> 定義資料類型F中的冪數
ROUND <r> 四拾五入至指定位數
CURRENCY <c> 以TCURX表中定義的貨幣格式化
UNIT <u> 按表格T006中為類型P欄位所指定的單位<u>固定小數位數

日期格式化選項
選項 用途選項
DD/MM/YY 以系統設定的分隔符號格式化
MM/DD/YY 以系統設定的分隔符號格式化
DD/MM/YYYY 以系統設定的分隔符號格式化
MM/DD/YYYY 以系統設定的分隔符號格式化
DDMMYY 無分隔符號格式化
MMDDYY 無分隔符號格式化
YYMMDD 無分隔符號格式化
Data type
資料類型 預設大小 大小 初始值 輸出長度 輸出定位 說明
C 1 1-65535 SPACE 字串長度 LEFT-JUSTIFIED 字元,字串
D 8 8 '00000000' 8 LEFT-JUSTIFIED 日期
F 8 8 0 24 RIGHT-JUSTIFIED 浮點數
I 4 4 0 11 RIGHT-JUSTIFIED 整數
N 1 1-65535 '000...0' 字串長度 LEFT-JUSTIFIED 數值字串
P 8 1-16 0 2*字串長度+1 RIGHT-JUSTIFIED 壓縮號
T 6 6 '000000' 6 LEFT-JUSTIFIED 時間
X 1 1-65536 X'00' 2*字串長度 LEFT-JUSTIFIED 16進制
abap naming rule
命名規則
  • 報表程式(以列表格式輸出資料分析):Yaxxxxxx或Zaxxxxxx。用應用程式區的分類字母替換a。
    任何有效字元替換x。注意SAP報表程式遵守相似的命名約定:Raxxxxxx。
  • 任何其他ABAP/4程式(培訓程式或事務程式):SAPMYxxx或SAPMZxxx。用有效字元替換x。
    注意標準SAPABAP/4程式遵守相似的命名約定:SAPMaxxx,其中a代表某應用程式區。
for xml usage
SELECT
p.[product_name],
p.[product_imgstyle],
p.[product_color],
p.[product_size],
p.[product_weight],
p.[product_desc],
(
 SELECT l.[purchase_url], s.[store_name], s.[display_order]
 FROM [Product_StoreLink] l, [Store] s
 WHERE l.[store_id] = s.[store_id] AND l.[product_id] = p.[product_id]
 FOR XML RAW
) store
FROM Product p
Tab control using url hash variant
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>anchor test with tab design</title>
    <style type="text/css">
        ul.tab
        {
            margin: 1px 0px;
            padding: 0px;
        }
        ul.tab li
        {
            display: inline;
        }
        ul.tab li a
        {
            padding: 3px;
            margin-right: 2px;
            background-color: #eee;
            border: 1px outset gray;
            font-size: small;
            color: Blue;
        }
        ul.tab li a:hover
        {
            background-color: gold;
        }
        ul.tab li a.active_tab
        {
            background-color: Orange;
        }
        
        div.tab_container
        {
            border: 1px solid gray;
            padding: 10px;
        }
        
        a
        {
            text-decoration: none;
        }
        a:hover
        {
            text-decoration: underline;
        }
    </style>
    <script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function tab_change() {
            // 頁籤序號
            var index = location.hash.substring(1);
            if (!index) index = '0';
            index = parseInt(index);

            // 變更頁籤css
            $('ul.tab li a').removeClass('active_tab').eq(index).addClass('active_tab');

            // postback, 以觸發update panel更新
            //$('<%=hdnTabIndex.ClientID%>').val(index);
            __doPostBack('hdnTabIndex', index);
        }
        $(function () {
            // 頁籤變更觸發
            $(window).bind('hashchange', tab_change);
            // 載入頁面時更新
            tab_change();
        });
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="smPage" runat="server">
    </asp:ScriptManager>
    <ul class="tab">
        <li><a href="#0" class="active_tab">第一頁</a></li>
        <li><a href="#1">第二頁</a></li>
        <li><a href="#2">第三頁</a></li>
        <li><a href="#3">第四頁</a></li>
        <li><a href="#4">第五頁</a></li>
    </ul>
    <div class="tab_container">
        <asp:UpdatePanel ID="upTabContainer" runat="server" UpdateMode="Conditional" RenderMode="Block">
            <ContentTemplate>
                <asp:HiddenField ID="hdnTabIndex" runat="server" />
                <asp:Panel ID="plTabContainer0" runat="server" Visible="false">
                    第一頁內容
                </asp:Panel>
                <asp:Panel ID="plTabContainer1" runat="server" Visible="false">
                    第二頁內容
                </asp:Panel>
                <asp:Panel ID="plTabContainer2" runat="server" Visible="false">
                    第三頁內容
                </asp:Panel>
                <asp:Panel ID="plTabContainer3" runat="server" Visible="false">
                    第四頁內容
                </asp:Panel>
                <asp:Panel ID="plTabContainer4" runat="server" Visible="false">
                    第五頁內容
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Tab_Load();
        }

        protected void Tab_Load()
        {
            // postback參數
            string _index = Request.Form["__EVENTARGUMENT"];
            if (string.IsNullOrEmpty(_index)) _index = "0";

            plTabContainer0.Visible = false;
            plTabContainer1.Visible = false;
            plTabContainer2.Visible = false;
            plTabContainer3.Visible = false;
            plTabContainer4.Visible = false;
            upTabContainer.FindControl("plTabContainer" + _index).Visible = true;
        }
    }
}
Speed up VisualStudio using RAMDisk
STEP:
  1. Install RAMDisk and create a ramdisk r:
  2. Create a batch file and setting temp variant:
    @echo off
    set tmp=r:\
    set temp=r:\
    call "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
  3. edit web.config
    <compilation debug="true" tempDirectory="r:\">