ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

ABAP Source Code: Character types

Print This Post Email This Post Written by admin on Nov 3rd, 2007 | Filed under: ABAP Programs

REPORT ZSOURCE0403.

* Type c is the default type when no type is specified.
* Initial value is space, if it is not specified explicitly.

DATA: NAME(25) TYPE C,
CITY(25),
FLAG,
SINGLE_CHARACTER VALUE ‘A’.

* If the field and the initial value have different lengths, the
* initial value is either truncated or padded with blanks on the right:

DATA LANGUAGE(2) VALUE ‘ABAP/4′.
WRITE / LANGUAGE.


* Maximum length 64KB

DATA MAX_CHARACTER_FIELD(65535).

* Variables of type n (numeric texts) contain strings of digits

DATA CUSTOMER_ID(8) TYPE N VALUE ’87654321′.

* The default length for a field of type n is 1,
* and the default initial value is a string of zeros

DATA ZIP_CODE(5) TYPE N.
WRITE / ZIP_CODE.

* Type n fields pad the left side with zeroes
CUSTOMER_ID = ’1234′.
WRITE / CUSTOMER_ID.

———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info

Share

If you like this post, you may as well like these too:

  1. ABAP Source Code: Types, data, constants REPORT ZSOURCE0402.* Type flag defines an abstract typeTYPES FLAG TYPE C. * Field address_flag will allocate space in main memory at runtimeDATA ADDRESS_FLAG TYPE FLAG VALUE ‘X’.* Constants are defined...
  2. ABAP Source Code: Three approaches to define data objects REPORT ZSOURCE0401.* 1. Elementary typesDATA: CUSTOMER_NAME_1(25) TYPE C, VENDOR_NAME_1(25) TYPE C. * 2. Reference to an existing fieldDATA: CUSTOMER_NAME_2(25) TYPE C, VENDOR_NAME_2 LIKE CUSTOMER_NAME_2. * 3. Reference to a non-elementary...
  3. ABAP Source Code: Syntax of ABAP/4 Programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 * Declaration...
  4. Source Code: Few simple examples 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30...
  5. Source Code: Designing a report REPORT ZSOURCE0104. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
  6. ABAP Programs: Converting character fields REPORT ZSOURCE0703. * Truncating fields or padding with blanksDATA: SHORT_NAME(8), LONG_NAME(16).MOVE ‘Washington’ TO: SHORT_NAME, LONG_NAME.WRITE: / SHORT_NAME, LONG_NAME. * Take care of intermediate stepsLONG_NAME = SHORT_NAME = ‘Washington’.WRITE: / SHORT_NAME,...
  7. Source Code: Working with database tables and internal tables REPORT ZSOURCE0103. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
  8. Different types of ABAP Programs There are nine types of ABAP Programs in SAP: 1 Executable Programs (ABAP Reports) I INCLUDE Program M Module Pool/Dialogue programs S Sub-Routine Pool J Interface Pool K Class Pool...
  9. SAP ABAP Program Types Each ABAP program has a type, which is defined in the program attributes. What is the purpose of all the different program types? The program type determines which processing blocks...
  10. ABAP Programs: Form parameters with generic types REPORT ZSOURCE1009.* Variable for later useDATA: SHORT_STRING(3) VALUE ‘AB’, SHORT_NUMBER(3) TYPE N VALUE ’0′, ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100.* Calling forms with different actual parameters* Correct call (actual paramter is...
  11. ABAP Programs: Complex Non-Elementary Types and Data Objects REPORT ZSOURCE0408. * Nested recordsTYPES: BEGIN OF ADDRESS, CITY(25), STREET(30), END OF ADDRESS, BEGIN OF PERSON, NAME(25), ADDRESS TYPE ADDRESS, END OF PERSON.DATA RECEIVER TYPE PERSON.RECEIVER-NAME = ‘Smith’.RECEIVER-ADDRESS-CITY = ‘Big...
  12. Transaction Code to Access Other Transaction Code with Values Many times in SAP, you may come across situations where in the users wants to have a separate transaction codes for some of the tables which can be easily maintained...
  13. Source List The purpose of the source determination process is to automatically assign a source of supply to a purchase requisition. If the requester has set the Source Determination indicator in the...
  14. How to Create Source List? Use Transaction ME01. Enter the Material Number and the Plant Data. Enter source list records, validity period, period of time material is procurable, Vendor Number, responsible Purchasing  Organization (or number...
  15. What is the Source List? The Source List identifies preferred sources of supply for certain materials. If the Source List has been properly maintained, it will identify both the source of a material and the...



Leave a Reply