Skip to Content
Author's profile photo Former Member

Mass Data Upload For Custom Business Object for Sub Node.

As Mr.  Host Schaude already posted a blog regarding XML File input. Now i am describing here  how to upload xml file  if  my Custom BO contains sub node ,with reference of Host’s blog.

Have a look , how to create a service integration via XML File Input.

Here I want to describe what steps need to be done if the data of a Custom Business Object shall be uploaded.

For this task we choose the service integration via XML File Input.

At the end we will be able to upload the data even periodically.

Step 1: Create the Custom Business Object


Here is a very simple Custom BO with some fields at the Root node and a sub node with a 1 to n multiplicity.

If you want not only a simple upload (= Create) but also an update (= Modify) you should provide an Alternative Key for the Root node.


  

There is even a navigation association based on a relationship code (which is a custom code list data type).

Have this Custom BO active before the next step.

Step 2 : Create an XML File Input Service

First choose from the context menu of the Custom BO the entry “Create Service Integration”.

  

Second in the upcoming window select the radio button “XML File Input” and press “Next”.

  

Now the fields for the basic information (e.g. receiving BO) are already filled. You may adjust only the integration name.


  

In the next window you can select the elements of the Custom BO which shall become part of the XML file so they can be uploaded.

  

As we want to do mass upload we set the flag “Mass Processing”.

Now we need to define how the Custom BO instance can be identified in case of update. For sub nodes this is done via a combination of fields.


  


Finally save the Service Integration and activate it.


A WebDAV folder is created which you need later to place the XML files in.

If you re-open the Service Integration you will be able to download the XSD schema definition from the “General” tab.


  

Step 3: Create the XML File

Use the XSD from above to create your XML files.

  • One way (for Business Objects with only a Root node) is via Excel
    • Menu Developer -> Click on Source -> Add the XSD via “XML Maps…”
    • All entries with the red star are mandatory
    • From the “MessageHeader” you need only the “CreationDateTime”
    • In my example only the “MyFamily” root node is supported 
  • Another solution is to open the XSD in MS Visual Studio.
    • From 2008 SP 1 on you can generate sample code in the XML Schema Explorer
    • Make sure that you right click on the element typed the request


                            

  

    • In the generated code you delete from the MessageHeader tag all entries except the CreationDateTime tag
    • In the List tag you will find all nodes and fields from your Custom BO.
      • You may add or remove some tags for additional or superflous node instances
      • You need to replace the sample data by your real data

                          

    

    • The third way I know is a commercial tool named Oxygen XML Editor

Now i want to describe XML file input if Your Custom business object has sub node.



  Save this XML file. Open the Excel and go to the developer tab. Click on source -> click on xml map -> click on add browse and select your xml file.

  Here i have taken  an Example , In This i have one root node  > UPLOAD and one sub node   >  PRODUCT

Once your file will added, your all elements will show in right side- just click on your root node ,drag and drop in the sheet.





Now  your all elements will be on the sheet . your root node and your item node is now available in the sheet .

Just do one thing select your root element –means header part , copy the header partonly and select a single shell of excel and (paste special  as transpose).

Once you paste it , delete the existing header element from sheet.

Now your excel sheet will look like this ->

Now We have to bind the header element from XML Source.

Now it is ready ……………………

Go to Developer Tab Export it in XML -Save it and Go to (Application And User Management) WOC Sub view -File Input and upload your xml file.


Thanks,

Manoj Kannaujiya.

Assigned tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Stefan Hagen
      Stefan Hagen

      Great post. Thank you very much!

      Author's profile photo May Thitsa Oo
      May Thitsa Oo

      Hi,

      Thanks for your post.

      But I think this data xml includes one Root node data.

      How can I create multiple Root and sub nodes in excel file to export xml.

      Regards, May.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Dear May,

      You have to create it separately for every root node.

      Thanks,

      Manoj Kannaujiya

      Author's profile photo May Thitsa Oo
      May Thitsa Oo

      Dear Manoj Kannaujiya,

      Sorry, I don't mean multiple root node in the BO, I mean the root data in excel.

      For example, I want to create Nr_no 129,130,131,.. with their item node data at the same time in one excel, how can I do that? For now, I can export xml for only one root node data with items at one time.

      Best regards, May.

      Author's profile photo Former Member
      Former Member

      Hi Manoj,

                    Is there is any way where I can upload a xls or csv or txt file instead of xml file ?

      Thanks

      Suba

      Author's profile photo Horst Schaude
      Horst Schaude

      Hello Suba,

      For some SAP BOs we have predefined Excel templates, but this does not work for own BOs. 🙁

      Sorry,

          Horst

      Author's profile photo rahul kumar
      rahul kumar

      Hi Suba,

      CSV File can be uploaded, we have done some solution.

       

      BR
      Rahul

      Author's profile photo Kareem Gaber
      Kareem Gaber

      Hello,

      I have custom BO with two level sub-nodes (Root -> Parent -> Child), what is the right way to upload my objects via XML file.

      Thanks.