2011年9月30日 星期五

[Func] TH_POPUP

跳出通知訊息窗

By Client + User ID :
  DATA: client  LIKE sy-mandt,
        user    LIKE sy-uname,
        message LIKE sm04dic-popupmsg

  CALL FUNCTION 'TH_POPUP'
    EXPORTING
      client               = client
      user                 = user
      message              = message

[BAPI] BAPI_CONTRACT_CREATEFROMDATA

使用 BAPI 建立 Contract

定義
* BAPI Define
  DATA: gw_so_header          LIKE bapisdhd1,
        gw_so_headerx         LIKE bapisdhd1x,
        gw_so_logic_switch    LIKE bapisdls,
        gv_so_doc_in          TYPE bapivbeln-vbeln,
        gv_so_doc_num         TYPE bapivbeln-vbeln,
        gt_so_return2         TYPE bapiret2,
        gt_so_partners        TYPE bapiparnr  OCCURS 0 WITH HEADER LINE,
        gt_so_items_in        TYPE bapisditm  OCCURS 0 WITH HEADER LINE,
        gt_so_items_inx       TYPE bapisditmx OCCURS 0 WITH HEADER LINE,
        gt_so_return1         TYPE bapiret2   OCCURS 0 WITH HEADER LINE,
        gt_so_conditions_in   TYPE bapicond   OCCURS 0 WITH HEADER LINE,
        gt_so_conditions_inx  TYPE bapicondx  OCCURS 0 WITH HEADER LINE.

夥伴功能

2011年9月14日 星期三

[ABAP] Connection Keeper for network idle

當閒置時間過長連線中斷

有時是因為系統參數 rdisp/gui_auto_logout 的關係,有時是因為網路設備的關係,當閒置時間超過設定時,就會中斷連線。

如果可以的話,修改系統參數、網路設備設定,是最直接有效的。

如果不行的話,可以參考底下的程式。執行時輸入訊息傳輸的間隔秒數,要少於設定斷線的閒置秒數。


2011年8月24日 星期三

[Manual] CA - Drilldown Reporting


CA - Drilldown Reporting


With drilldown reporting, SAP provides you with an interactive information system to let you evaluate the data collected in your application. This information system is capable of analyzing all the data according to any of the characteristics that describe the data. You can also use any key figures you wish to categorize your data. You can display a number of objects for a given key figure, or a number of key figures for a given object. In addition, the system lets you carry out any number of variance analyses (such as plan/actual comparisons, fiscal year comparisons, comparisons of different objects, and so on).
You can produce both simple, data-directed lists (basic reports) and complex, formatted lists in drilldown reporting (form reports).
Drilldown report provides you with comfortable functions for navigating through your data. For example, you can jump to the next level of detail or the next report object on the same level, hide individual levels and switch between the detail and drilldown lists. It also provides a number of additional functions which let you process lists interactively (sorting, conditions, ranking lists, and so on). SAP Graphics, SAPmail and the Excel List Viewer are also integrated into drilldown reporting.
The drilldown functions are divided into three groups which differ in the number of functions available. That way each user can choose the functional level most suited for his requirements.
In addition to the online functions for displaying reports, drilldown reporting also provides functions which let you print reports. A number of formatting functions are available to let you determine the look of your printed reports (page breaks, headers and footers, underscores, and so on).
The menus and the functions available directly on the drilldown report make it easy to use the information system.

Source: CA - Drilldown Reporting

2011年8月8日 星期一

[Link] Finding Tools and Services to Make XBRL Work


Finding Tools and Services to Make XBRL Work


In This Chapter

Exploring XBRL processors Evaluating XBRL software Finding products that support XBRL Searching for assistance
M BRL is brought to life within software (see Chapters 1 and 3). In this chapter, we dig deeper into the area of software and services to help you get the most out of what XBRL offers. We cover both locally installed software, which is how most of what we did in the past was accomplished, and software you use as a service (SaaS), which is a newer model that software creators are using to deliver functionality to their customers. We tell you how to find this software, and we provide information to help you select the software that’s right for you.
Having the right tool for the right job can make a complex task simple. Likewise, having the wrong software tool or using a good tool for the wrong purpose can make something that is quite simple much more complex.
To avoid having to type the long links,  This takes you to a landing page where you can click the link you need.

2011年8月2日 星期二

[Link] SAP Batch Determination made easy

Source: http://www.renet-web.net/2008/09/05/sap-batch-determination-made-easy/

SAP Batch Determination made easy

Posted on September 5, 2008 | Category: SAP
Recently a colleague encountered the following problem:
His customer tracks perishable products that are bought / inventory managed / sold using the SAP functionality Batch Management (LO-BM). The products have a shelf life and therefore a “Use by/Expiration” date. His problem was that he was able to correctly update the characteristic “Expiration date” of the batch, but was not able to select batches during the delivery stage, based on the “Expiration date” – i.e batches that were still fit for use.
So here is a tutorial on how to select batches during the delivery (but it could be applied to any batch search requirement) for which the shelf life has not expired. It has to be noted that SAP covers all kinds of scenario.
- It might be company practice to ship out the door products with a minimum shelf life of X days
- It might be that a specific customer requires a product with a different, longer minimum remaining shelf life
- It might also be that products that are shipped to a specific country require a yet again different minimum shelf life
It might be that you require all three or a logical combination of all three. SAP will easily cover all those requirements and more.
This tutorial only covers the batch determination process in SD, but once you get the jist of it you should be able to apply this to any other module where that function is covered. I also assume that you have set up your system in such way that you are able to have products batch managed.

2011年7月26日 星期二

SAPor

What is SAPor?

SAPor is a extension for Chrome, It's command prefix for SAP style. if you used Chrome then you can install it.

It's my first extension just for fun.
How to using?

  1. News list for SAP.info
    - When you click the icon of SAPor, the news list well popup like image-1.
    Image 1: news list

2011年6月14日 星期二

GuiXT Mobile puts inventory control in the customer's hands—literally.

Tune in to this live webinar and hear how Olin Brass empowered users to enter inventory transactions WHERE and WHEN needed to support real time inventory management with an SAP BOH (Balance On Hand) System that also improved accuracy. You'll then hear how Olin Brass used GuiXT to simplify those SAP transaction screens for use in mobile devices. GuiXT Mobile Solution Suite gives SAP customers fast connectivity to the SAP database without configuration to SAP, additional servers, or browser-based clients. GuiXT Mobile speeds up business operations, increases data integrity, and updates information from SAP transactions in real time.

GuiXT in Transaction Variants and Screen Variants

Use the GuiXT function to edit a GuiXT script from transaction variant maintenance. The script is then stored together with its corresponding screen variant in the database. The GuiXT process downloads the script to the frontend if no current version is already on the frontend. GuiXT scripts are transported along with their corresponding screen variants.

GuiXT

GuiXT is a client–server] system that provides user interface customization to SAP solutions. While designed specifically for use with SAP software, and completely integrated with SAP, GuiXT solutions operate independently of SAP solutions. That enables firms to tailor “do-everything” SAP transaction screens to the narrower requirements of specific jobs within their organizations while leaving essential SAP coding untouched. The “hands-off” design simplifies development and testing significantly. GuiXT Solutions users report greatly improved productivity and accuracy while, at the same time, reducing training and support costs.

GuiXT Profile

Click on Edit->Profile in the GuiXT window in order to display and change the profile parameters.
The link address is: 

[Like] GuiXT - Moving fields between tabs

Screens with tabs are common in complex transactions dealing with lots of different fields. The tabs represent one way of grouping similar fields together. The user does not always appreciate this logical ordering, being more interested in simply finding a way to reach the relevant fields without clicking through all tabs.

[Link] SWITCHING, ENHANCING, AND ADAPTING STANDARD PROGRAMS

The state-of-the art technology to enhance and adapt SAP standard objects is the new Enhancement Framework (available as of ABAP 7.0). You should use if you are sure that you have done everything in terms of customizing and still not completely accomplished what you need.

[Link] SAP ABAP Performance Tuning Tips & Tricks Introduction

In this world of SAP programming, ABAP is the universal language. In most of the projects, the focus is on getting a team of ABAP programmers as soon as possible, handing over the technical specifications to them and asking them to churn out the ABAP programs within the “given deadlines”.

[Code] READ_TEXT

SO Header
DATA  BEGIN OF ITLINE OCCURS 0.
      INCLUDE STRUCTURE TLINE.
DATA  END OF ITLINE.
DATA  G_VGBEL LIKE THEAD-TDNAME.

G_VGBEL = VBAK-VBELN.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID       = '0001'
    LANGUAGE = 'M'
    NAME     = G_VGBEL
    OBJECT   = 'VBBK'
  TABLES
    LINES    = ITLINE
  EXCEPTIONS
    ID       = 1
    OTHERS   = 2.
SO Item
DATA  BEGIN OF ITLINE OCCURS 0.
      INCLUDE STRUCTURE TLINE.
DATA  END OF ITLINE.

DATA  G_VGBEL LIKE THEAD-TDNAME.

CONCATENATE VBAP-VBELN VBAP-POSNR G_VGBEL.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID       = '0001'
    LANGUAGE = 'M'
    NAME     = G_VGBEL
    OBJECT   = 'VBBP'
  TABLES
    LINES    = ITLINE
  EXCEPTIONS
    ID       = 1
    OTHERS   = 2.

[Func] Converting Material Quantities To Different Unit Of Measure

單位轉換
Example code:
IF GT_ITAB-VRKME EQ GT_ITAB-KMEIN OR
   GT_ITAB-KMEIN EQ SPACE.
  LV_LFIMG = GT_ITAB-LFIMG.
ELSE.
  CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
    EXPORTING
      INPUT    = GT_ITAB-LFIMG
      KZMEINH  = 'X'
      MATNR    = GT_ITAB-MATNR
      MEINH    = GT_ITAB-VRKME
      MEINS    = GT_ITAB-KMEIN
      TYPE_UMR = '3'
    IMPORTING
      OUTPUT   = LV_LFIMG.
ENDIF.

[Link] USING SAP JAVA CONNECTOR TO GENERATE ABAP DOCUMENTATION


The tool presented in this article is simple yet useful. We needed documentation for the maintenance and support of an application, which has a Web and Java user interface, and ABAP backend. In the middle is the SAP® Java Connector also known as JCO. We used JCO to extract information from the SAP backend system.
The link address is:

[Code] Bills of material in the BAPI for create SO


使用 BAPI 建立含 BOM 的銷售訂單,重點在於先使用 BAPI_SALESORDER_SIMULATE 算出所有的 item no, 另外就是呼叫 BAPI_SALESORDER_CREATEFROMDAT2 時要使用 Exporting 參數 int_number_assignment = 'X'

Programming dynamic selections

You require two things before you can implement a dynamic selection in a logical database. One is a special statement in the database program's selection include (DBxxxSEL). This special statement ensures that the user can enter the corresponding selection criterion. You enter the selection criterion for a dynamic selection in a different way from simply parameters or selection tables, and the program also evaluates it in a different way. Therefore, the selection statement must be tailored to the paritcular table so that the table can evalutate this selection criterion. This section will introduce you to the statements you require in more detail.

[Code] Lock Mechanism


Lock:
CALL FUNCTION 'ENQUEUE_E_TRDIR'
  EXPORTING
    name           = 'PROGRAM_RUNNING'
    _scope         = '1'
  EXCEPTIONS
    foreign_lock   = 1
    system_failure = 2
    OTHERS         = 3.
IF sy-subrc <> 0.
  CALL FUNCTION 'DEQUEUE_ALL'.
  MESSAGE e000(zsd01) WITH 'Err: Program running!'.
ENDIF.
Unlock:
CALL FUNCTION 'DEQUEUE_ALL'.

Reference Manual:

[BAPI] to create sales orders

BAPIs to create sales orders for Returns and Debit Memo Request
https://forums.sdn.sap.com/message.jspa?messageID=4222007


Hi,
I have to create a sales order for document type Returns as well as a debit memo request.The BAPI 'BAPI_SALESORDER_CREATEFROMDAT2' is giving the following error message for Debit Memo Request document creation as well as for Returns.
761 Unpermitted combination of business object BUS2032 and sales doc. category L

Working with files


[Link] Useful ABAP Function Modules

This page is intended to maintain documentation of useful function modules. This is needed because indexing and search of information will be easier here (When compared to searching in SE37). When this page starts growing, this can be structured in an area wise list.

[Manual] SAPScrpit

BC SAPscript: Printing with Forms

2011年6月10日 星期五

[Code] YourIMG

Download Your IMG to Excel

IMG 的設定主要是存放在 Table, Maintenance View, Cluster View 裡,YourIMG 只針對主要的這三種格式下載。在 4.7 版中還有部份的 IMG 是使用獨立撰寫的程式去作設定的,這一類的資料就無法一併下載了。

2011年5月28日 星期六

[ABAP] Use OLE to Manipulate EXCEL

透過 SAP GUI 的功能直接操作 EXCEL

首先定義 Object :
TYPE-POOLS: ole2.
* OLE objects Declarations DATA: w_excel TYPE ole2_object, w_workbooks TYPE ole2_object, w_workbook TYPE ole2_object, w_worksheets TYPE ole2_object, w_worksheet TYPE ole2_object, w_columns TYPE ole2_object, w_column_ent TYPE ole2_object, w_cell TYPE ole2_object, w_int TYPE ole2_object, w_range TYPE ole2_object, w_font TYPE ole2_object, w_window TYPE ole2_object.
接著開啟 Excel :

2011年5月26日 星期四

IMG related tables & functions

與 IMG 相關的表格及功能模組

表格
SCUS_HIER                           Replacements table for hierarchies

TNODEIMG                            Node table for the new IMG
TNODEIMGR                           References for the new IMG

CUS_ACTOBJ                          Customizing Activity - Object List
CUS_IMGACH                          IMG Activities
功能模組
S_CUS_IMG_GET_REFERENCE_IMG_ID
S_CUS_IMG_SELECT_NODES

STREE_BROWSER_DYNP_HC
STREE_HIERARCHY_READ

STREE_STRUCTURE_READ_N_TOP_LEV
STREE_STRUCTURE_READ_TOP_NODE
STREE_STRUCTURE_READ_N_LEVEL

2011年5月25日 星期三

When you use ABAP to split a BIG5 string , how to make sure that you have no cut a word of BIG5 in half ?

當你用 ABAP 在分割或刪減包含有 BIG5 的字串時,如何確認你沒有把一個 BIG5 的字切成一半?

首先我們要知道 BIG5 的編號規則,BIG5 是 2 bytes code ,分為 High Byte 和 Low Byte:
*      ===========   ===========
*       High Byte     Low Byte
*      ===========   ===========
*       0xA1-0xF9     0x40-0x7E
*                        or
*                     0xA1-0xFE
*      ===========   ===========
依照其編碼規則我們可以發現 high byte 和 low byte 有重疊的部份就是 0xA1-0xF9 的區間,底下的程式假設將一個長字串縮減成 30 個字元,然後判斷最後一個字元是否有將 BIG5 的文字切成一半:

2011年5月24日 星期二

[Link] Remove of non-printable characters from string

移除無法列印的文字

這只能用在可以使用 regular expression 的 REPLACE 指令上 
replace all occurrences of regex '[^[:print:]]+(?!$)' in STRING with ' '.
replace all occurrences of regex '[^[:print:]]+$' in STRING with ''.

2011年5月19日 星期四

[Link] Enhancement Framework

NetWeaver 2004s 之後的 Enhancement Framework,值得參考的入門文件:

INTRODUCING THE ENHANCEMENT FRAMEWORK: 
THE COOL NEW WAY TO ENHANCE YOUR ABAP SYSTEMS 
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bb54c452-0801-0010-0e84-a653307fc6fc 

2011年5月18日 星期三

[Link] Change Material Document DATA Using BADI: MB_DOCUMENT_BADI

BADI: MB_DOCUMENT_BADI 

MB_DOCUMENT_BADI 並沒有 Exporting / Changing 任何物料文件的資料結構,但是可以用 Field-Symbols 來修改到其中的資料:
FIELD-SYMBOLS: <ERFMG>   TYPE any,
                            <ERFMG1> TYPE any.
ASSIGN '(SAPMM07M)MSEG-ERFMG' TO <ERFMG>.
ASSIGN (<erfmg>) TO <erfmg1>.

<ERFMG1> = '0.001'.


Source URL: http://forums.sdn.sap.com/thread.jspa?threadID=1688671

Reference:
1. http://scn.sap.com/thread/367073 ((SAPMV45A)XVBAP : Table XVBAP)

2011年5月11日 星期三

Getting Sales order -Schedule line field , Delivered Quantity ( VSMNG )


I need to use the Delivered Quantity present in a sales order at schedule line level.
Sheeba Bhaskaran
Posts:
252
Registered:
2/27/07
Forum Points:
302
Re:
Getting Sales order -Schedule line field , Delivered Quantity ( VSMNG ) ??
Posted:
Jan 13, 2009 10:38 AM
Content:
Hi.
You can use the function module RV_SCHEDULE_CHECK_DELIVERIES to get the delivered quanity corresponding to schedule line item in sales order.
Please refer below code:
ie3mdpslx-delnr:
 is sales order numer
ie3mdpslx-delps:
 is line item.
internal table tl_da_vbep has got field VSMNG which is the delievred quantity for each line item
SELECT * FROM vbfa
    INTO CORRESPONDING FIELDS OF TABLE tl_xvbfa
   WHERE vbelv = ie3mdpslx-delnr
     AND posnv = ie3mdpslx-delps
     AND vbtyp_v = 'C'.

SELECT * FROM vbup
    INTO CORRESPONDING FIELDS OF TABLE tl_xvbup
   WHERE vbeln = ie3mdpslx-delnr
     AND posnr = ie3mdpslx-delps.

SELECT * FROM vbep
    INTO CORRESPONDING FIELDS OF TABLE tl_da_vbep
   WHERE vbeln = ie3mdpslx-delnr
     AND posnr = ie3mdpslx-delps.

SELECT * FROM vbap
    INTO CORRESPONDING FIELDS OF TABLE tl_xvbap
   WHERE vbeln = ie3mdpslx-delnr
     AND posnr = ie3mdpslx-delps.

CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
  EXPORTING
    fbeleg = ie3mdpslx-delnr
    fposnr = ie3mdpslx-delps
  TABLES
    fvbfa = tl_xvbfa
    fvbup = tl_xvbup
    fxvbep = tl_da_vbep
    fvbap = tl_xvbap
  EXCEPTIONS
    fehler_bei_lesen_fvbup = 1
    fehler_bei_lesen_fxvbep = 2
    OTHERS = 3.

SE16N active editing functional


First you need input table name, and press Enter.
Next, type "&SAP_EDIT" in transaction code box, and press Enter.
Then you well get an message: SAP editing function is activated.
(In NEW version ECC 6.0, the "&SAP_EDIT" can't activate editing function,
u can use UASE16N to do so.) 

Archive Tips


Archived Sale Document Read

T-Codes

SARA
Archive Administration
SARE
Archive Explorer
SARI
Archive Information System
SARJ
Archive Retrieval Configurator
DB15
Data Archiving: Database Tables

Functions

AS_API_READ
Reading of Data from the Archive Information System
ARCHIVE_OPEN_FOR_READ
Open an Existing Archive File for Reading
ARCHIVE_READ_OBJECT
Read a Data Object from an Archive File
ARCHIVE_GET_NEXT_RECORD
Sequential Read of the Records from a Data Object
ARCHIVE_CLOSE_FILE
Open Archive Files Will Be Closed
ARCHIVE_GET_TABLE
Read Records by Structure from the Current Data
KASH_ARCHIVE_DATA_FILE_SHOW
Display tools for archive

Tables

ADMI_FILES
Archive Files of Archive Sessions
ARCH_IDX
Index table for data object selection

[Func] Func Group - TXXL


EXCEL - list viewer interface

Function Module:
  • XXL_SIMPLE_API: 單個情況 Excel 清單查看器的省略接口
  • XXL_FULL_API: Excel 清單瀏覽器的完整界面

XXL_SIMPLE_API

Example code:
  1. XXLSTEST
  2. DATA_Export
*&---------------------------------------------------------------------*
*&      Form  data_export
*&---------------------------------------------------------------------*
*       資料匯出至 Excel
*----------------------------------------------------------------------*
FORM DATA_EXPORT .

DATA: XMPL_HEADER LIKE  GXXLT_P-TEXT
                  VALUE '交貨明細表'.

DATA BEGIN OF XMPLT_O OCCURS 1.
        INCLUDE STRUCTURE GXXLT_O.
DATA END OF XMPLT_O.

DATA BEGIN OF XMPLT_P OCCURS 1.
        INCLUDE STRUCTURE GXXLT_P.
DATA END OF XMPLT_P.

DATA BEGIN OF XMPLT_V OCCURS 1.
        INCLUDE STRUCTURE GXXLT_V.
DATA END OF XMPLT_V.

DATA: BEGIN OF XMPLT_D OCCURS 60,
        VBELN    LIKE LIPS-VBELN,
        POSNR    LIKE LIPS-POSNR,
        KUNNR    LIKE LIKP-KUNNR,
        NAME1    LIKE KNA1-NAME1,
        NAME1_SH LIKE KNA1-NAME1,
        MATNR    LIKE LIPS-MATNR,
        VGBEL    LIKE LIPS-VGBEL,
        KDMAT    LIKE LIPS-KDMAT,
        LFIMG    LIKE LIPS-LFIMG,
        VRKME    LIKE LIPS-VRKME,
        LFDAT    LIKE LIKP-LFDAT,
      END OF XMPLT_D.

* 標題列
CLEAR XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '交貨'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '項目'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '收貨人'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '客戶名稱'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '出貨對象名稱'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '物料'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '採購文件'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '客戶物料號碼'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '交貨數量'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = 'SU'.
APPEND XMPLT_V.
XMPLT_V-COL_NO     = XMPLT_V-COL_NO + 1.
XMPLT_V-COL_NAME   = '發貨日期'.
APPEND XMPLT_V.

* 資料轉移
LOOP AT GT_ITAB.
  MOVE-CORRESPONDING GT_ITAB TO XMPLT_D.
  APPEND XMPLT_D.
ENDLOOP.
SORT XMPLT_D BY VBELN POSNR.
*
CALL FUNCTION 'XXL_SIMPLE_API'
   EXPORTING
        N_KEY_COLS         = 4
        FILENAME           = 'XMPL0002'
        HEADER             = XMPL_HEADER
   TABLES
        DATA               = XMPLT_D
        ONLINE_TEXT        = XMPLT_O
        PRINT_TEXT         = XMPLT_P
        COL_TEXT           = XMPLT_V.

ENDFORM.                    " data_export

XXL_FULL_API

Example code: XXLFTEST
CALL FUNCTION 'XXL_FULL_API'
   EXPORTING
        N_VRT_KEYS         = 3     " Of the 9 columns in the list
        N_ATT_COLS         = 6     " \ object, 3 are key columns
        N_HRZ_KEYS         = 3     " Header above the non-key-columns
                                   " \ forms a three-level-hierarchy
        DATA_STARTING_AT   = 5     " Only 50 rows out of 60 are
        DATA_ENDING_AT     = 54    " \ really exported
        FILENAME           = 'XMPL0001'
        HEADER_1           = XMPL_HEADER1
        HEADER_2           = XMPL_HEADER2
        SEMA_TYPE          = 'X'    " C-Columns are converted if SEMA
                                    " \ definitions require this
        NO_DIALOG          = SPACE  " XXL itself prompts for FILENAME
   TABLES
        VKEY               = XMPLT_V
        HKEY               = XMPLT_H
        DATA               = XMPLT_D
        SEMA               = XMPLT_S
        ONLINE_TEXT        = XMPLT_O
        PRINT_TEXT         = XMPLT_P
   EXCEPTIONS
        FILE_OPEN_ERROR    = 71
        FILE_WRITE_ERROR   = 72
        INV_WINSYS         = 73
        INV_XXL            = 74
        CANCELLED_BY_USER  = 75
        OTHERS             = 99.

[Func] PUT SIGN IN FRONT


Function: CLOI_PUT_SIGN_IN_FRONT ,將負號放到數字前面
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
  CHANGING
    VALUE         = var_char
注意 :如果原先負號的後面還有其他的字元(例如 %),經過處理後會遺漏掉。

[Code] Put Data into Range Object with Macro


Put data into ranges table.
首先是先定義好資料:
TABLES: tvfk.
RANGES: gr_fkart FOR vbrk-fkart.
最重要的 萬用巨集
* -------------
* Define Macro
* -------------
DEFINE put_ranges.
  &1-sign   = &2.
  &1-option = &3.
  &1-low    = &4.
  &1-high   = &5.
  APPEND &1.
END-OF-DEFINITION.
或者是這個「假猴」的 :p
DEFINE put_ranges.
  FIELD-SYMBOLS <PT> LIKE &1.
  ASSIGN &1 TO <PT>.
  <PT>-sign   = &2.
  <PT>-option = &3.
  <PT>-low    = &4.
  <PT>-high   = &5.
  APPEND <PT> TO &1.
END-OF-DEFINITION.
然後是運用的方式:
SELECT fkarts INTO tvfk-fkarts
    FROM tvfk
   WHERE kappl = 'V3'.
  put_ranges gr_fkart 'E' 'EQ' tvfk-fkarts ''.
ENDSELECT.

Distinct vs Single


Select Distinct vs Select Single

SINGLE

The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.

DISTINCT

Duplicate entries in the result set are automatically deleted.

[Link] LET US ABAP


SAP AND ABAP TIPS AND FACTS
The link address is: http://abaplovers.blogspot.com/

[Link] sapcommander


Filecommander (Norton-Commander-Clone) for SAP-Systems (ABAP)