How To use Data Referenece ...
*-----------------------------------------------------------------------
*
* Company XXX Company Limited
*
* ProgrameName: ZZW_DATA_REFERENCE
*
* Author: Lilo.Zhu
*
* Date: 10/08/2007
*
* Description: Practice ABAP Data Reference.
*
*-----------------------------------------------------------------------
REPORT ZZW_DATA_REFERENCE .
Types:
Begin Of Struc_1,
A Type i,
B type ref to sflight,
C type P,
End Of Struc_1.
Data: S1 Type Struc_1.
Types:
Begin Of Struc_2,
X(10) Type C,
Y Type ref to struc_1,
Z type i,
End Of Struc_2.
Data: S2 Type Struc_2,
R2 Type ref to Struc_2.
s1-A = 11.
If S1-A > 10.
Create data s1-b.
S1-B->Carrid ='LH'.
S1-B->Paymentsum = 1000.
EndIf.
create data s2-y.
create data s2-y->b.
S2-X = '100'.
s2-Y->A = 200.
s2-Y->*-A = 200. "same as s2-Y->A
s2-Y->B->Fldate = Sy-Datum.
Write: / s2-Y->A,
s2-Y->*-A,
s2-Y->B->Fldate.