Data Declaration in SAP-ABAP as follows.
1.Character ( C ) .
Ex1 : without length specification .
Source Code :
DATA: FLOAT TYPE F.
1.Character ( C ) .
Ex1 : without length specification .
Source Code :
PARAMETER : NAME TYPE C.
WRITE : name.
WRITE : name.
Input:
Output :
Default Value space.
---------------------------------------------------------------------------------------------------------------------------------------------------------
Ex 2 : with length specification
Source Code :
PARAMETER : NAME(10) TYPE C.
WRITE : name.
WRITE : name.
Output :
-------------------------------------------------------------------------------------------------------------------------------------------------------
2 : Integer ( I )
Length specification is not require.
Ex :
PARAMETER : Num TYPE i.
WRITE : NUM.
WRITE : NUM.
Input :
Output :
-------------------------------------------------------------------------------------------------------------------------------------------------------
3 . Numerical ( N )
- Length specification require.
- Default length 1.
- Default value is 0.
Ex 1 : Without Length Specification.
PARAMETER : Num TYPE N.
WRITE : NUM.
WRITE : NUM.
Input :
Output :
---------------------------------------------------------------------------------------------------------------------------------------------------
Ex 2 : With Length Specification.
PARAMETER : Num(10) TYPE N.
WRITE : NUM.
WRITE : NUM.
Input :
Output :
--------------------------------------------------------------------------------------------------------------------------------------------------
4 . Date : ( D ) :
Ex :
PARAMETER : DATE TYPE D.
WRITE : DATE.
WRITE : DATE.
To Know External Date format settings as follows:
Click defaults tab.
Internal Date format ( i.e in SAP Editor )always YYYYMMDD.
Input :
Output :
------------------------------------------------------------------------------------------------------
5 .TIME ( T ) :
- Syntax : time type t.
- Format :HH : MM :SS.
Ex :
PARAMETER : time TYPE T.
WRITE : time.
WRITE : time.
Input :
Output :
----------------------------------------------------------------------------------------------------------------
6. Float ( F ):
Ex 1:
WRITE : FLOAT.
Default :
Output :
-----------------------------------------------------------------------------------------------------------------------------------
Ex 2 :
DATA: FLOAT TYPE F VALUE '2.56'.
WRITE : FLOAT.
WRITE : FLOAT.
Output
--------------------------------------------------------------------------------------------
7.Packed decimals ( P)
Ex 1 : Without decimal point
PARAMETER: pack TYPE p .
WRITE : pack.
Input :
Output :
Output :
-------------------------------------------
Ex 2 : with decimal point .
7.Packed decimals ( P)
Ex 1 : Without decimal point
PARAMETER: pack TYPE p .
WRITE : pack.
Input :
Default output :
Input :
Output :
-------------------------------------------
Ex 2 : with decimal point .
PARAMETER: pack TYPE p DECIMALS 2.
WRITE : pack.
WRITE : pack.
Input :
Ex 3 : Default
Input :
Output :
------------------------------------------------------------------------------------------
Input :
Output :
------------------------------------------------------------------------------------------
8. XSTRING ( X ) :
- (0–9 , A, B, C, D, E, F ) = 16 ---> Hexadecimal Values.
Ex : 1.
PARAMETER: hex TYPE x.
WRITE : hex.
WRITE : hex.
Input :
No comments:
Post a Comment