06-19-2007 7:36 AM
Hi
How to get from the deep structure. Means i have one table in that having onother structure. i need to read data from that inner structure.
Regards
Reddy
06-19-2007 7:43 AM
Hi,
you can access in the way u use for the normal structure, u should only consider a deep structure is a table without headerline.
TABLES: BKPF, BSEG.
TYPES: TY_ITEM TYPE TABLE OF BSEG.
DATA: BEGIN OF W_DOCUMENT,
HEADER TYPE BKPF,
ITEM TYPE BSEG,
END OF W_DOCUMENT.
DATA: T_DOCUMENTS LIKE STANDARD TABLE OF W_DOCUMENT.
Insert the data:
SELECT * FROM BKPF WHERE ....
W_DOCUMENT-HEADER = BKPF.
SELECT * FROM BSEG INTO TABLE W_DOCUMENT-ITEM
WHERE BUKRS = BKPF-BUKRS
AND BELNR = BKPF-BELNR
AND GJAHR = BKPF-GJAHR.
APPEND W_DOCUMENT TO T_DOCUMENTS.
ENDSELECT.
Read the data:
LOOP AT T_DOCUMENTS INTO W_DOCMENT.
Header data
WRITE: / W_DOCUMENT-HEADER-BUKRS,
W_DOCUMENT-HEADER-BELNR,
W_DOCUMENT-HEADER-GJAHR.
Item data
LOOP AT W_DOCUMENT-ITEM INTO BSEG.
WRITE: / BSEG-BUZEI,
BSEG-WRBTR CURRENCY W_DOCUMENT-HEADER-WAERS.
ENDLOOP.
ENDLOOP.
Regards,
Padmam.
06-19-2007 7:43 AM
Hi,
You can use as normal as a field, lets say you have a DEEP structure(DEEP) in a Internal table(ITAB) .
ITAB_DEEP-FIELD1 --> Calling the FIELD1 field
Regards
Sudheer
06-19-2007 7:44 AM
Hi,
You can use as normal as a field, lets say you have a DEEP structure(DEEP) in a Internal table(ITAB) .
ITAB-DEEP-FIELD1 --> Calling the FIELD1 field
Regards
Sudheer
06-19-2007 7:45 AM
Hi Paturu,
Actually Structures dont having the Data's. So you cant retrieve the data from Structures.
But try to find out the package in which the structure exists.
Get the package name and then search the tables under this package in SE80.
From the list of the tables find the field which you are searching for.
Thanks.