Skip to Content

Editing XML in XI


Occasionally you may need to edit a complicated XML document.  I realized I needed to do this for the input XML data for my How to Support Industry Standards in XI (Part I of III) – Interfaces of weblogs entitled “How to Support Industry Standards in XI”.  We use a fantastic tool from Altova called XMLSpy for working with XML.  Unfortunately, our license agreement only allows 1 concurrent user on the network.  =( 

I needed to edit an Open Applications Group (OAG) ProcessPurchaseOrder XML file.  I didn’t want to do this with Notepad (sorry Microsoft) and I had to wait for my developer colleague ,  Yukai Shi (aka Captain Steven), to get out of XMLSpy so I could use it (gee… thanks Altova for policing use of your product so i was forced to use XI more). So instead of waiting, I wrote this weblog to show you how we can do this in XI. 


Prerequisites


    1. XI 3.0 SP14 Note: Pre-SP14 your gui will look slightly different.
    2. Existing XI Message Mapping
    3. Sample XML file

In general, I would not recommend using XI as an IDE for XML. For quick and dirty fixes Notepad or any text editor is fine for really simple XML files. But XI can also come in handy for viewing and maintaining values in your complicated XML files in a graphical format (i.e. table or tree).


Let’s Begin…


  • Navigate to your XI Message Mapping in the Integration Repository.

    Note:

see my How to Support Industry Standards in XI (Part I of III) – Interfaces for instructions on how to create a Message Mapping. 

!https://weblogs.sdn.sap.com/weblogs/images/297/MM_Objs.jpg|height=210|alt=image|width=355|src=https://weblogs.sdn.sap.com/weblogs/images/297/MM_Objs.jpg|border=0!

Put the mapping into image Edit mode.

Click the image (SRC) button.

Notice you can edit the XML file as you would in any other text editor.  Clicking the image (#) button brings you back to the “Tabular Tree View” of the interface. 


I’m not sure if BizTalk or WebMethods has any similar graphical XML editing tools. image


</ol>


What follows are the recommended steps for creating the appropriate input file for the testing section of my How to Support Industry Standards in XI (Part II of III) – Mapping.


  1. Please complete the 5 steps listed above.

Click the image (XML) button.

!https://weblogs.sdn.sap.com/weblogs/images/297/XML_LoadTestInstance.jpg|height=99|alt=image|width=205|src=https://weblogs.sdn.sap.com/weblogs/images/297/XML_LoadTestInstance.jpg|border=0!

Navigate to 

image


    1. Notice that the “Value” column is no longer blank.


image

With the newly loaded example instance of the OAG ProcessPurchaseOrder, you can now generate an IDOC Information on IFR… “shell” in the Integration Repository. 


Click the image “Start Transformation” button.


!https://weblogs.sdn.sap.com/weblogs/images/297/Success.jpg|height=80|alt=image|width=235|src=https://weblogs.sdn.sap.com/weblogs/images/297/Success.jpg|border=0!

    1. the Partner in the ALE/EDI Partner Profile.
    2. the Customer in the SD Customer Master.

    1. Navigate to: /ns0:ProcessPurchaseOrder/ns0:ApplicationArea/ns0:Sender/ns0:ReferenceId

      Enter Value: JG_TEST123 Any alphanumeric value will work here. Pick what ever you like.

    2. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Header/ns0:PromisedDeliveryDate

      Enter Value: 2006-03-28 Any date will work, I just like this date as it’s my birthday…

    3. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Header/ns0:DocumentDateTime

      Enter Value: 2006-03-28T00:00:00Z Same as above.

    4. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Line/ns0:LineNumber

      Enter Value: 0010

    5. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Line/ns0:OrderItem/ns0:ItemStatus/ns0:Code

      Enter Value: 001

    6. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Line/ns0:OrderQuantity

      Enter Value: 2

    7. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Line/ns0:OrderQuantity/@uom

      Enter Value: EA

      Note: This should be the unit of measure associated with the material in the Material Master (MM).

    8. Navigate to: /ns0:ProcessPurchaseOrder/ns0:DataArea/ns0:PurchaseOrder/ns0:Line/ns0:OrderItem/ns0:ItemIds/ns0:ItemId/ns0:Id
      Enter Value: BMW

      Note: This value is extremely important as it must be a valid MM item.


Save your data


    1. The sample XML input file has been created and filled with the necessary elements for the SAP R/3 SD Sales Order. From here you have a choice:

Click image to save the XML instance to your local file directory.

Click image to view the XML text file and cut and paste to your sending application.

Click image to save the XML instance you created as input for testing of the Message Mapping object in the XI Integration Repository.

    1. I recommend that you save the XML instance to your local file directory, as it will be used by a simple application that sends to your XI system.


Summary


I hope you found this info useful.  It turns out someone is still in our 1-concurrent license of Altova’s XMLSpy , I guess I have to write more SDN Blogs or figure out other ways to get more out of XI….

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply