cancel
Showing results for 
Search instead for 
Did you mean: 

Select material data on staging area via ABAP

matthias_fischer
Explorer

We have external material numbering and we have a customer developped report, which gives the user free material numbers before creating a new one.

With material creation via MDG we have to consider material numbers too which are currently part of a running change request and not existing on MARA yet.

To determine the generated MDG table names via MDG_DATA_MODEL is not the question.

Unfortunately the table names can be different between the systems and can change when extending the data model.

Is there a function module to determine the table name dynamicly and how to integrate it into ABAP code?

Or even better: is there a function module or class methode to select material data which are part of a change request without reading the database directly.

Kind regards, Matthias

Accepted Solutions (0)

Answers (2)

Answers (2)

michael_theis
Active Contributor
0 Kudos

Hi Matthias,

MDG offers several APIs that are able to fulfill your requirement. Kindly check the corresponding guide (http://scn.sap.com/docs/DOC-45127) for details and code examples.

Best regards

Michael

henk_verdaasdonk4
Active Participant
0 Kudos

Hi Matthias,

With class method cl_usmd_adapter_provider-->if_usmd_model_gen_adapter~get_generated_objects you can get the physical table names together with MDG data model entity names. First you need to get an instance of the class using cl_usmd_adapter_provider=>get_model_generation_adapter.

If you want do use api. You can use CL_USMD_CREQUEST_API=>GET_CREQUEST but this has no filtering options. And you only interested in the creates. So maybe better do a select on USMD120C and then use CL_USMD_CREQUEST_API->READ_OBJECT_LIST to get the key of the material

Cheers,

Henk