Showing posts with label Keywords. Show all posts
Showing posts with label Keywords. Show all posts

Monday, May 16, 2011

Document Type

The document type classifies the accounting documents. It is stored in the document header.

Attributes that control the entry of the document, or which are they noted in the document, are defined for each document type. In particular, the number range assigned to the associated documents is defined on the basis of the document type.
Extraction from SAP.

Normally, field name for document type is BLART.

Thursday, January 7, 2010

CLEAR vs. REFRESH vs. FREE

I almost forgot what does these 3 used for, basically they are used to initialize internal table.
  1. CLEAR => Initialize the content and remain the allocated initial memory space, BUT,
    • because SAP allows using internal table(itab) with header line (enable you refer to structure and internal table with the same name). CLEAR itab will only clear the header line not the table body. => clear the content of the structure.
    • To clear the table content, you need to use CLEAR itab[]. 
    • IF you declared it without header line (for instance, DATA lt_itab TYPE STANDARD TABLE OF ever) CLEAR itab will clear the table content.
  2. REFRESH => similar as CLEAR, but REFRESH always refer to internal table content (table body). Thus, REFRESH itab = CLEAR itab[].
  3. FREE => similar to REFRESH, always refer to internal table content, but it does one more thing, it release the initial memory space allocated for the table body (table header is still exists). When you try to fill in value to internal table again, new memory space will be allocated for the table body.
In Conclusion,
 
C1/Case 1: DATA: itab TYPE STANDARD TABLE OF ever.
C2/Case 2: DATA: itab TYPE ever OCCURS 0 WITH HEADER LINE.

How to Initialize table content
Refer to Work Area / Structure
Refer to Table Content / Table Body
Release
Table Header Memory Space
Release Table Body Memory Space
CLEAR
C1: CLEAR itab
C2: CLEAR itab[]
C1:
C2: CLEAR itab.
C1:
C2: CLEAR itab[]


REFRESH
REFRESH itab




FREE
FREE itab






Summarized from: Initializing Internal Tables.

    Monday, December 28, 2009

    LINES vs DESCRIBE


    1. LINES
    · LINES( itab ) => return number of rows of an itab in TYPE i .
    · DESCRIBE TABLE itab [LINES lin] [OCCURS n] [KIND knd].
    - [LINES lin] => lin TYPE i, contains number of filled lines in itab.
    - [OCCURS n] => n TYPE i, contains initial size of the table.
    - [KIND knd] => knd TYPE c, contains the table type of itab.
    o ‘T’ = Standard Table
    o ‘S’ = Sorted Table
    o ‘H’ = Hashed Table
    · DESCRIBE TABLE itab.
    - SY-TFILL TYPE i, contains number of filled lines in itab.