Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Declare data in the custom program based on data type (TY_MARA in this case) declared in the global class (Z_TEST).
In this case data type(TY_MARA) is declared as public. So we have created an object of global class and then use the object to refer the data type in our data declaration.


report  z_test_demo1.

data oref type ref to z_test.

create object oref.

data: i_mara type standard table of oref->ty_mara initial size 0

with header line.

select * from mara into table i_mara

up to 10 rows.

check sy-subrc  = 0.

loop at i_mara.

 write:/ i_mara-matnr.




This solution only works if data type is declared in the global class as public.

  • No labels

1 Comment

  1. The content has helped me, thank you very much.