Skip to Content

Select material data on staging area via ABAP

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 16, 2015 at 01:43 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2015 at 10:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.