Skip to Content

MII JSON to RFC Table

Hi all,

I have an MII transaction where I receive a JSON string as input. This string contains all field value pairs that are needed by the RFC on R3 that I want to call from MII. The RFC input consists of a table which can contain multiple lines (with data from the JSON string).

What are the possible ways of handling this or what is the best practice for handling this and where can I find some information/guidelines on how to do this.

Many Thanks in advance,

Joery

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 15, 2013 at 02:00 PM

    Hello Joery,

    If you are using SAP MII 14.0 then you can use Json_To_XML_Converter action block available in MII workbench.

    For example if your input JSON string is as below

    {

    "geometries" :

    [{

    "xmin" : -4,

    "ymin" : -60,

    "xmax" : 25,

    "ymax" : -41

    }

    ]

    }

    Then on using Json_To_XML_Converter will provide you an XML output shown as below.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>

    <root>

    <geometries>

    <element>

    <xmin>-4</xmin>

    <ymin>-60</ymin>

    <xmax>25</xmax>

    <ymax>-41</ymax>

    </element>

    </geometries>

    </root>

    Then you can do an XSLT transformation on the above output XML to generate the RFC/BAPI request structure. May be something like below which is just an indicative xml and not the actual RFC structure.

    <RFC_READ_TABLE>

    <TABLE>

    <item>

    <xmin>-4</xmin>

    <ymin>-60</ymin>

    <xmax>25</xmax>

    <ymax>-41</ymax>

    </item>

    </TABLE>

    </RFC_READ_TABLE>

    Hope this helps !

    Regards,

    Prashant Mittal

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 14, 2013 at 05:46 PM

    Create transaction parameters which is of same type as RFC item and table, Repeat on your json string and assign to trx parameters.

    You can refer below link to do that.

    http://scn.sap.com/people/padmavathi.rao2/blog/2009/03/14/mii-odyssey-how-to-pass-table-structure-to-bapi-using-jco-interface-of-erp-system-interface-in-mii-12

    Add comment
    10|10000 characters needed characters exceeded