Skip to Content
0
Dec 28, 2011 at 04:21 PM

Generating XML from internal table

22 Views

All,

I have a requirement where we need to generate XML file from an internal table. I have been successful to generate that but now they want the xml in a different format. I am having difficulty to do so.

I am also able to generate similar format but am not able to close ZMAM_RUN_TYPE at the top. I am able to do it at the end.

Requirement

- <sap:ZMAM_BCC_PUBDATE_GETLIST xmlns:sap="urn:sap-com:document:sap:rfc:functions.response">
  <NO_UPSELL_MARK /> 
  <ZMAM_RUN_TYPE>jobs</ZMAM_RUN_TYPE> 
- <ZMAM_BCC_LIST>
- <item>
  <AVM_NR>0010249901</AVM_NR> 
  <POS_NR>030</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>PAJUP</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>2010012045</GPAG> 
  <INSERENT>2010012045</INSERENT> 
  <REGULIERER>2010012045</REGULIERER> 
  <GPNR_RECH>2010012045</GPNR_RECH> 
  <S_TERMIN>2011-11-06</S_TERMIN> 
  <E_TERMIN>2011-12-05</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220557</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
+ <item>
  <AVM_NR>0010249944</AVM_NR> 
  <POS_NR>020</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>PAJUP</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>2010012056</GPAG> 
  <INSERENT>2010012056</INSERENT> 
  <REGULIERER>2010012056</REGULIERER> 
  <GPNR_RECH>2010012056</GPNR_RECH> 
  <S_TERMIN>2011-12-04</S_TERMIN> 
  <E_TERMIN>2012-01-02</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220594</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
+ <item>
  <AVM_NR>0010250017</AVM_NR> 
  <POS_NR>020</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>PAJUP</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>1010143394</GPAG> 
  <INSERENT>1010143394</INSERENT> 
  <REGULIERER>1010143394</REGULIERER> 
  <GPNR_RECH>1010143394</GPNR_RECH> 
  <S_TERMIN>2011-11-27</S_TERMIN> 
  <E_TERMIN>2011-12-26</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220711</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
+ <item>
  <AVM_NR>0010250053</AVM_NR> 
  <POS_NR>020</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>PAJUP</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>2010012064</GPAG> 
  <INSERENT>2010012064</INSERENT> 
  <REGULIERER>2010012064</REGULIERER> 
  <GPNR_RECH>2010012064</GPNR_RECH> 
  <S_TERMIN>2011-11-27</S_TERMIN> 
  <E_TERMIN>2011-12-26</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220733</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
+ <item>
  <AVM_NR>0010250511</AVM_NR> 
  <POS_NR>020</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>PAJUP</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>2010011719</GPAG> 
  <INSERENT>2010011719</INSERENT> 
  <REGULIERER>2010011719</REGULIERER> 
  <GPNR_RECH>2010011719</GPNR_RECH> 
  <S_TERMIN>2011-12-04</S_TERMIN> 
  <E_TERMIN>2012-01-02</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220922</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
+ <item>
  <AVM_NR>0010250512</AVM_NR> 
  <POS_NR>010</POS_NR> 
  <EIN_NR>000001</EIN_NR> 
  <INHK_KFM>00004899</INHK_KFM> 
  <BELEGEINH>PAJFRZ</BELEGEINH> 
  <PSTYV>ZSTD</PSTYV> 
  <GPAG>2010011719</GPAG> 
  <INSERENT>2010011719</INSERENT> 
  <REGULIERER>2010011719</REGULIERER> 
  <GPNR_RECH>2010011719</GPNR_RECH> 
  <S_TERMIN>2011-12-04</S_TERMIN> 
  <E_TERMIN>2012-01-02</E_TERMIN> 
  <MOTIV>000001</MOTIV> 
  <MOTIVID>100000220923</MOTIVID> 
  <AZART_GEST>0003</AZART_GEST> 
  <CHIFFRE_NR /> 
  <ZZPICCNT>00</ZZPICCNT> 
  <AENDATE>0000-00-00</AENDATE> 
  <AENTIME>00:00:00</AENTIME> 
  </item>
  </ZMAM_BCC_LIST>
  </sap:ZMAM_BCC_PUBDATE_GETLIST>