Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data from the Deep structure.

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.