Go on link..

link us with ...

Friday, December 31, 2010

ADDING TWO STRUCTURES

*DATA:
* BEGIN OF S1,
* NUM TYPE I VALUE 12,
* AMT TYPE P DECIMALS 2 VALUE '13.45',
* END OF S1.
*
*DATA:
* BEGIN OF S2,
* NUM TYPE I VALUE 10,
* AMT TYPE P DECIMALS 2 VALUE '34.56',
* NAME(20) TYPE C VALUE 'ESWAR',
* END OF S2.
*
* ADD-CORRESPONDING S1 TO S2.
*
* WRITE : / S2-NUM, S2-AMT, S2-NAME.
*
* ADDING SEQUENTIALFIELDS ...*********************

*DATA:
* BEGIN OF S3,
* A TYPE I VALUE 1,
* B TYPE I VALUE 2,
* C TYPE I VALUE 3,
* D TYPE I VALUE 4,
* E TYPE I VALUE 5,
* END OF S3,
*
* GTOT TYPE P VALUE 5 ,
* TTOT TYPE P VALUE 5.
* ADD S3-A THEN S3-B UNTIL S3-E GIVING GTOT.
* ADD S3-A THEN S3-B UNTIL S3-E TO TTOT.
*
* WRITE: / 'TOTAL GIVING = ', GTOT.
*
* WRITE: / 'TOTAL TO = ', TTOT .
*
*FIELD-SYMBOLS .... *******************************

*PARAMETERS: NAME(20) TYPE C,
* NUM(5) TYPE N.
*
* FIELD-SYMBOLS .
*
* ASSIGN NUM TO .
* WRITE .
* ASSIGN NAME TO .
* WRITE .
*


* FIELDS-SYMBOLS FOR STRUCTURES ...****************************

*DATA:
*
* BEGIN OF TNAME,
* FIRSTNAME(20) TYPE C VALUE 'KIRAN',
* MIDDLENAME(20) TYPE C VALUE 'KUMAR',
* LASTNAME(20) TYPE C VALUE 'RAMI',
* END OF TNAME.
*
**DATA MYNAME TYPE TNAME.
**
**MYNAME-FIRSTNAME = 'RAMI'.
**MYNAME-MIDDLENAME = 'VENKAT'.
**MYNAME-LASTNAME = 'ESWAR'.
**
**WRITE : / MYNAME-FIRSTNAME, MYNAME-MIDDLENAME, MYNAME-LASTNAME.
*
*
*FIELD-SYMBOLS .
*
*ASSIGN COMPONENT SY-INDEX OF STRUCTURE TNAME TO .
*
*WRITE: / .

DATA: BEGIN OF LINE,
COL1 TYPE I VALUE '11',
COL2 TYPE I VALUE '22',
COL3 TYPE I VALUE '33',
END OF LINE.

DATA COMP(5) VALUE 'COL3'.

FIELD-SYMBOLS: , , .

ASSIGN LINE TO .
ASSIGN COMP TO .

DO 3 TIMES.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE TO .
WRITE .
ENDDO.

ASSIGN COMPONENT OF STRUCTURE TO .
WRITE / .

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)