Mentor SAP
2017-07-24 Submitted by:- Admin

We can create nested Interface by declaring one Interface in another Interface. We know to declare Interface in the class. The same syntax is followed here. In the class we only have to declare the Final Interface in public section.

The following program contains Interface it1 and it2. It2 declares it1 inside. In the it1 we have two methods mit1 and mit2. Similarly in the it2 we have two methods mit1 and mit2. Now in mit1 of it1 we Select from EKKO and mit2 of it1 we Select from EKPO for all entries in internal table it_ekko. Next we have mit1 in it2 and mit2 in it2. In mit1 we are preparing the final output table whereas in mit2 we are preparing the Output. After all these in start of selection we create an object obj referenced to class cls. Next we call method mit1 and mit2 of it1 and mit1 and mit2 of it2 by object obj.