Skip to Content

How to get the key fields of a CDS view?

Aug 23, 2017 at 06:59 AM


avatar image

I am displaying some CDS views dynamically using SALV IDA. The sort order is currently random so I would like to order the displayed entries by primary key.

I do not see an option to order by primary key directly in the IDA interfaces, so I assume I have to use DEFAULT_LAYOUT( )->SET_SORT_ORDER( ).

For that to sort using the primary key I need to the key columns over to the method explicitly, so I am currently trying to figure out how to get the KEY fields of a CDS view.

I so far found the classes CL_DD_DDL_HANDLER_FACTORY, CL_DD_DDL_VIEW_DEF and CL_DD_DDL_OBJ which look primising. However the whole API seems to be hidden from public using protected or private methods and explicit friendship. CL_DD_DDL_VIEW_DEF->GET_SELECTLIST( ) has the key information I need but it's private. I don't want to "work around it" by trying to find a non final friendship class and inherit from it.

Is there a public API available for this information?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers