Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

example for SMUM_XML_PARSE or other option to import xml to itab ?

former_member186143
Active Contributor
0 Kudos

I'm looking for a function to import an xml I have found a lot of threads regarding this but it's very hard to test certain function I found

like SMUM_XML_PARSE , I really can't figure out what input I have to give to this function and I can't find a proper example

further on TEXT_CONVERT_XML_TO_SAP can't be tested from se37 but searching for a good and understable example also leads to jumping through a lot of topics with no clear example

I want to generate salesorders from an xml with the bapi BAPI_SALESORDER_CREATEFROMDAT2

so I have the xml schem for this bapi and only filled the appropiate fields for testdata.


<?xml version="1.0"?>

      <ORDER_HEADER_IN>
        <DOC_TYPE>TA</DOC_TYPE>
        <SALES_ORG>6300</SALES_ORG>
        <DISTR_CHAN>00</DISTR_CHAN>
        <DIVISION>00</DIVISION>
        <REQ_DATE_H>18-09-2008</REQ_DATE_H>
        <PURCH_NO_C>12345</PURCH_NO_C>
      </ORDER_HEADER_IN>
 
      <ORDER_CONDITIONS_IN>
        <item>
          <ITM_NUMBER>0010</ITM_NUMBER>
          <COND_TYPE>PR00</COND_TYPE>
          <COND_VALUE>250</COND_VALUE>
        </item>
      </ORDER_CONDITIONS_IN>
      <ORDER_ITEMS_IN>
        <item>
          <ITM_NUMBER>000010</ITM_NUMBER>
          <MATERIAL>87100-A9</MATERIAL>
          <TARGET_QTY>1</TARGET_QTY>
          <ORDERID>6405210</ORDERID>
        </item>
      </ORDER_ITEMS_IN>


      <ORDER_PARTNERS>
        <item>
          <PARTN_ROLE>AG</PARTN_ROLE>
          <PARTN_NUMB>1400</PARTN_NUMB>
        </item>
      </ORDER_PARTNERS>
  
      <ORDER_TEXT>
        <item>
          <DOC_NUMBER></DOC_NUMBER>
          <ITM_NUMBER>000010</ITM_NUMBER>
          <TEXT_ID>0001</TEXT_ID>
          <LANGU>N</LANGU>
          <LANGU_ISO></LANGU_ISO>
          <FORMAT_COL>*</FORMAT_COL>
          <TEXT_LINE>TEKST EN ZO</TEXT_LINE>
          <FUNCTION>009</FUNCTION>
        </item>
      </ORDER_TEXT>

Is there an easy way to read this xmldata into itabs ??

kind regards

arthur de smidt

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Hi,

Please check this

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

Hi,

Please check this

0 Kudos

strange I already updated my topic with the other blog of the same author which is the correct way I want to go

but still I'm looking for examples on the functions mentioned above or other simple ways to read xml

I also found call transformation but also no clear example

and also you're example from table to xml is nice but now I want to have it the other way around

kind regards

arthur de smidt

Edited by: A. de Smidt on Sep 18, 2008 4:27 PM

former_member186143
Active Contributor
0 Kudos

no answer at all but I have to close it otherwise no possibilty to post another question