Skip to Content

How to dynamically insert in an MDO

Dear Experts,

I have a transaction where I dynamically determine an MDO name and then need to perform an insert into this MDO.

As the MDO name is dynamically determined, I want to write a dynamic insert query using a generic MDO object. Has anyone experience in how to dynamically pass the attribute names and values to the insert query? As I would not know the structure of the MDO upfront, I cannot populate the AttributeName and AttributeValues parameters.

Or is there something I am overlooking?

Any pointers towards the solution would be highly appreciated.

Regards,

Saumya Govil

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2014 at 11:08 AM

    Hi Saumya,

    It is possible to dynamically insert values in an MDO. These are the parameters you might need,

    Here, the MDO could be your any generic MDO (Persistent MDO) . To insert into an MDO, the columns or the attributes should be the custom ones and the MDO should not have a data provider. Moreover, for insert, we do not need a data provider too. "MDO Insert Mode : Inserts persisted data for an MDO with custom attributes only. Persisted data cannot be inserted for an MDO with a data provider and data attributes."- SAP Help Doc

    AttributeName.X and AttributeValue.X determines the columns and columns values. Here Column1 and Column2 are columns/attributes of my MDO.

    Mode would be Insert,

    Server would be MDOConnector.

    I used the MDOQuery Action block in a transaction, the same parameters can also be used via illuminator URL.

    http://localhost:50000/XMII/Illuminator?server=MDOConnector&Mode=Insert&MDO=MyMDOPath&<Rest of the param name and value pairs> .

    Regards

    Tufale Ashai


    MDO11.PNG (4.5 kB)
    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.