Wednesday, 25 May 2016

Data Declarations

Data Declaration in SAP-ABAP as follows.




1.Character ( C )  .

Ex1  : without length specification .

Source Code : 


PARAMETER NAME TYPE C.

WRITE name.

Input:





Output :

Default Value space.



---------------------------------------------------------------------------------------------------------------------------------------------------------
Ex 2 : with length specification


Source Code :

PARAMETER NAME(10TYPE C.

WRITE name.



Output :





-------------------------------------------------------------------------------------------------------------------------------------------------------

2 : Integer ( I )

  Length specification is not require.


Ex :

PARAMETER Num TYPE i.

WRITE NUM.


Input :




Output :





-------------------------------------------------------------------------------------------------------------------------------------------------------

3 . Numerical ( N )
  1. Length specification require.
  2. Default length 1. 
  3. Default value is 0.

Ex 1 : Without Length Specification.

PARAMETER Num TYPE N.

WRITE NUM.


Input :



Output :



---------------------------------------------------------------------------------------------------------------------------------------------------

Ex 2 : With Length Specification.


PARAMETER Num(10TYPE N.

WRITE NUM.


Input :




Output :



--------------------------------------------------------------------------------------------------------------------------------------------------


4 . Date :  ( D ) :

Ex :

PARAMETER DATE TYPE  D.

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 ) :

  1. Syntax : time type t.
  2. Format :HH : MM :SS.
Ex :

PARAMETER time TYPE  T.

WRITE time.



Input : 





Output :



----------------------------------------------------------------------------------------------------------------

6. Float    ( F ):

Ex 1:

DATAFLOAT TYPE  F.

WRITE FLOAT.


Default : 


Output :






-----------------------------------------------------------------------------------------------------------------------------------

Ex 2 : 

DATAFLOAT TYPE  VALUE '2.56'.

WRITE FLOAT.


Output





--------------------------------------------------------------------------------------------
7.Packed decimals ( P)


Ex  1 :  Without decimal point


PARAMETERpack TYPE  .

WRITE pack.

Input :



Default output :

Output :




Input :



Output :




-------------------------------------------
Ex 2 :  with decimal point .



PARAMETERpack TYPE  DECIMALS 2.

WRITE pack.


Input :





Output :




Ex 3 : Default


Input :


Output :




------------------------------------------------------------------------------------------


8. XSTRING ( X ) :  

  1. (0–9 ,  A, B, C, D, E, F )  = 16 ---> Hexadecimal Values.

Ex : 1.

PARAMETERhex TYPE  x.

WRITE hex.


Input




Output :





Input :


Output :





Input :



Output :




-----------------------------------------------------------------------------------------------------

9.String ( String )


Ex :


PARAMETERst TYPE  string.

WRITE st.


Input :



Default output is Space.


Output :




No comments:

Post a Comment