来源资料待手动核验
ABAP Platform Yy
YY Data Service: A Poor Man's RTTI for the ABAP Environment on SAP Cloud Platform
项目简介
YY Data Service: A Poor Man's RTTI for the ABAP Environment on SAP Cloud Platform
YY Data Service: A Poor Man's RTTI for the ABAP Environment on SAP Cloud Platform
YY Data Service: A Poor Man's RTTI for the ABAP Environment on SAP Cloud Platform
REUSE status
Attention: This is sample code!
This repository contains sample code which should not be used in production. It only shows the capabilities of APACK - the ABAP package and dependency manager.
A Poor Man's RTTI for the ABAP Environment on SAP Cloud Platform
This small library - called the YY Data Service - is an alternative approach towards RTTI on an ABAP system running on the SAP Cloud Platform. Keep in mind that this is just a demo. In production, you better use the officially supported RTTI...
Please make sure to fulfill the following requirements:
Use the abapGit plug-in to install the YY Data Service by executing the following steps:
If you want to get some information about ABAP data in the Cloud, YY makes it really easy for you. The service is ready-to-use, no configuration is necessary. Simply get an instance of the service class by calling ZCLYYABAPDATASERVICE=>CREATEINSTANCE. The one and only parameter IDATA expects the data which you want to investigate.
The resulting object of type ZIFYYDATAELEMENT has two methods, GETDESCRIPTOR and GETVALUE.
This method returns an object of type ZIFYYDATADESCRIPTOR which describes the metadata of the respective element. If the element has a name (e.g. as a structure element), you'll find this name by calling the method GETNAME. If there was no name, it will return the value of ZIFYYDATADESCRIPTOR=>COUNNAMEDOBJECT. The more important information is probably the type of the data element which you can get by calling GETTYPE. This one returns an instance of the interface ZIFYYDATAELEMENTTYPE. It's currently one and only method GETTYPENAME returns a textual representation of the data type. Constants for currently supported ones can be found in the interface ZIFYYDATAELEMENTTYPE as well. Depending on this format you need to decide which format your variable needs to have which you use to get the actual data from GETVALUE...
If you have a simple data type such as a number or text, you get it directly back using this method. For structures and tables it's slightly more difficult. There you get the full information about the structure or the table in a nice format, either ZIFYYDATAELEMENT=>TYSTRUCTURE or ZIFYYDATAELEMENT=>TYTABLE. They feature the structure elements or the table lines with their corresponding data element objects in their original order of sequence.
Currently no support for objects (reference types), only simple data types, structures and tables. And it's not even guaranteed that it works for them as you might expect... It's sample code!
As mentioned before, after cloning a abapGit repository some objects might not be active. Use the mass activation feature in ADT to activate those artifacts.
Copyright (c) 2019-2026 SAP SE or an SAP affiliate company.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use any file of this project except in compliance with the License.
You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.