Application Development and Automation 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: 
Read only

Read data from Nested Structures

Former Member
0 Likes
997

Greetings all, I'm trying to read data from nested structures to another internal table.

nested :ty_receipt -> ty_receipt_itm

output table: ty_header.

Could you please advice me how to read the data incase (1) if I have single PO with multiple lines in sub structure (2) in case if I have multiple POs in main structure and have multiple item lines in sub structure. Thanks in advance.

TYPES: BEGIN OF ty_receipt_itm,

Qty TYPE char13,

sign TYPE char1,

uom TYPE char4,

cum_qty TYPE char13,

cum_sign TYPE char1,

cum_uom TYPE char4,

oper_amt TYPE char13,

  • oper_numofdec type char4,

oper_sign TYPE char1,

oper_uom TYPE char4,

  • oper_uomnumdec type char4,

rec_ln_no TYPE char1,

po_ln_no TYPE char1,

packing TYPE char10,

END OF ty_receipt_itm.

DATA: BEGIN OF ty_receipt,

action_code(1) TYPE c,

year(4) TYPE c,

mon(2) TYPE c,

day(2) TYPE c,

hour(2) TYPE c,

min(2) TYPE c,

sec(2) TYPE c,

recip_id(7) TYPE c,

po_num(10) TYPE c,

po_version TYPE zap1_version,

receipt_type TYPE c,

receipt_item_strc TYPE standard table of ty_receipt_itm,

receiver_wwid TYPE zwwid,

receiver_name(35) TYPE c, "receiver lastname,rec first name

receiver_email(30) TYPE c, "receiver e-mail

END OF ty_receipt.

TYPES: BEGIN OF ty_header,

psid type zap1_psid,

doc_type(1) type c, "I/D

org_entity(4) type c, "(business unit )

action_code(1) type c,

year(4) type c,

mon(2) type c,

day(2) type c,

hour(2) type c,

min(2) type c,

sec(2) type c,

recip_id(7) type c,

po_num(10) type c,

po_version type zap1_version,

receipt_type type c,

Qty type char13,

sign type char1,

uom type char4,

cum_qty type char13,

cum_sign type char1,

cum_uom type char4,

rec_ln_no type char1,

po_ln_no type char1,

packing type char10,

receiver_wwid type zwwid,

receiver_name(35) type c, "receiver lastname,rec first name

receiver_email(30) type c, "( receiver e-mail)

END OF ty_header.

1 REPLY 1
Read only

peter_ruiz2
Active Contributor
0 Likes
367

hi,

take a look at this nested loops.

loop at it_header.

loop at it_receipt where po_num eq it_header-po_num.

loop at it_receipt-receipt_item_strc.

endloop.

endloop.

endloop.

hope this helps.

regards,

peter