cancel
Showing results for 
Search instead for 
Did you mean: 

Issue converting XML file to CSV File

Former Member
0 Kudos

Hello

    I am working on converting XML file to CSV file. I do not have a KEY FIELD NAME that is common at both Header and Detail level. I do not see any messages in SXMB_MONI.

Adapter Log:

Information
Channel CC_MODELN_REBATE_REQUEST_SENDER: Converted complete file content to XML format.
2012-10-15 08:24:03WarningChannel CC_MODELN_REBATE_REQUEST_SENDER: Empty document found - proceed without sending message.

Please let me know if anybody had this issue before.

Incoming XL File:

- <Entries>

- <PAYMENTPACKAGE PAYMENTNEEDEDBYDATE="" PAYMENTPACKAGEID="0000124-001" PAYMENTPACKAGENAME="Test_cy_101112" PAYMENTPACKAGEPK="17103" PAYMENTPACKAGETYPE="INST" PKGCURRENCY="USD" PKGORGID="0002" PKGPAYMENTMETHOD="Check" PKGTOTALESTPMTAMT="0" PKGTOTALPAYMENTAMOUNT="7730" PKGTOTALPMTAMTNETESTPMT="7730" PKGTOTALREVPMTAMOUNT="0" PKGTOTPMTAMTNETREV="7730">

<PAYEE PKGPAYEEAPID="" PKGPAYEEFGERPORDERTYPE="" PKGPAYEEFGUOM="" PKGPAYEEID="53AM_GPO1" PKGPAYEENAME="53AM_GPO1" PKGPAYEETOTESTPMT="0" PKGPAYEETOTFGQTYDUE="" PKGPAYEETOTPMTAMT="3000" PKGPAYEETOTPMTAMTNETESTPMT="3000" PKGPAYEETOTPMTAMTNETREV="3000" PKGPAYEETOTREVAMT="0" PKGPAYERAPID="" PKGPAYERID="53AM_GPO1" />

<PAYEE PKGPAYEEAPID="" PKGPAYEEFGERPORDERTYPE="" PKGPAYEEFGUOM="" PKGPAYEEID="T1034568" PKGPAYEENAME="Test GPO2" PKGPAYEETOTESTPMT="0" PKGPAYEETOTFGQTYDUE="" PKGPAYEETOTPMTAMT="4730" PKGPAYEETOTPMTAMTNETESTPMT="4730" PKGPAYEETOTPMTAMTNETREV="4730" PKGPAYEETOTREVAMT="0" PKGPAYERAPID="" PKGPAYERID="T1034568" />

- <PAYMENT CUSTOMPAYMENTTYPE="CH" ERPNOTES="" ORIGPAYMENTID="" PAYMENTENDDATE="2012-06-30 23:59:59" PAYMENTID="000006-0001-06" PAYMENTLEVEL="AGGREGATE" PAYMENTSTARTDATE="2012-04-01 00:00:00" PMTCURRENCY="USD" PMTFGERPORDERTYPE="NONE" PMTFGUOM="EA" PMTORGID="0002" PMTPAYEEAPID="" PMTPAYEEID="53AM_GPO1" PMTPAYEENAME="53AM_GPO1" PMTPAYERAPID="" PMTPAYERID="53AM_GPO1" PMTPAYMENTMETHOD="CustDefind" PMTTOTALFGQUANTITYDUE="0" PMTTOTALREVAMOUNT="0" PMTTOTPMTAMOUNT="3000" PMTTOTPMTAMTNETREV="3000" PROGRAMNAME="IR" PROGRAMTYPE="Incentive Rebate">

<BYPAYEE PPFGERPORDERTYPE="NONE" PPFGUOM="EA" PPPAYEEAPID="" PPPAYEEID="53AM_GPO1" PPPAYEENAME="53AM_GPO1" PPPAYERAPID="" PPPAYERID="53AM_GPO1" PPPAYMENTMETHOD="CustDefind" PPTOTESTPMTAMT="0" PPTOTFGQTYDUE="0" PPTOTPMTAMT="3000" PPTOTPMTAMTNETESTPMT="3000" PPTOTPMTAMTNETREV="3000" PPTOTREVPMTAMT="0" />

</PAYMENT>

- <PAYMENT CUSTOMPAYMENTTYPE="" ERPNOTES="" ORIGPAYMENTID="" PAYMENTENDDATE="2012-03-31 23:59:59" PAYMENTID="000125-0001-05" PAYMENTLEVEL="AGGREGATE" PAYMENTSTARTDATE="2012-01-01 00:00:00" PMTCURRENCY="USD" PMTFGERPORDERTYPE="NONE" PMTFGUOM="EA" PMTORGID="0002" PMTPAYEEAPID="" PMTPAYEEID="T1034568" PMTPAYEENAME="Test GPO2" PMTPAYERAPID="" PMTPAYERID="T1034568" PMTPAYMENTMETHOD="CustDefind" PMTTOTALFGQUANTITYDUE="0" PMTTOTALREVAMOUNT="0" PMTTOTPMTAMOUNT="4730" PMTTOTPMTAMTNETREV="4730" PROGRAMNAME="IR Gross" PROGRAMTYPE="Incentive Rebate">

<BYPAYEE PPFGERPORDERTYPE="NONE" PPFGUOM="EA" PPPAYEEAPID="" PPPAYEEID="T1034568" PPPAYEENAME="Test GPO2" PPPAYERAPID="" PPPAYERID="T1034568" PPPAYMENTMETHOD="CustDefind" PPTOTESTPMTAMT="0" PPTOTFGQTYDUE="0" PPTOTPMTAMT="4730" PPTOTPMTAMTNETESTPMT="4730" PPTOTPMTAMTNETREV="4730" PPTOTREVPMTAMT="0" />

</PAYMENT>

</PAYMENTPACKAGE>

</Entries>

Thanks

Naga

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Naga,

Are you trying to go from XML to CSV as in a File to File scenario?

I see above you have adapters which look like File Senders. This makes sense if you don't see anything in SXMB_MONI because according to the error message the adapter is not reading your source XML correctly.  File Content Conversion is expecting a flat file on input.

If you agree that is the case then you really need an XML File sender which doesn't need FCC, and then for output a File Receiver channel which does use FCC.

Maybe import or create a PI data type which matches your input XML schema and then you should get something in SXMB_MONI. Then you can work on your CSV output.

Sorry if I misunderstood your problem!

Former Member
0 Kudos

Aaron

   You are right  I am trying to convert XML file to CSV in a file to File scenario. If I dont need FCC for XML File sender,how do I convert XML file to CSV, please let me know.

Thanks

Naga

Former Member
0 Kudos

Hi Naga,

Just make sure your data type structure corresponds correctly to your xml input. In your comm channel sender, make sure adapter is set to file and specify the filename as <your filename>.xml. Thanks.

Regards,

Rare

Former Member
0 Kudos

Now I am seeing message in SXMB_MONI. There is an issue with the Inbound message, it is supposed to have the following two lines as the first two lines. Because these lines are missing I do not see anything in the payload under Request Message Mapping.

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

<ns0:MT_REBATE_REQUEST_IN xmlns:ns0="urn:cslbehring:modeln:rebate:request">

Former Member
0 Kudos

Hi Naga,

It sounds like your data type is not matching your input file's XML. Glancing at your sample XML file above it may not be well-formed XML (e.g. no XML declaration as first line).

There are methods to handle that by adjusting your PI data type, handling namespace and top level XML matching through module, XSLT mapping, or probably other approaches too.

Here is an end-to-end example for working with XML and the file adapter.

http://scn.sap.com/people/srinivas.vanamala2/blog/2007/02/05/step-by-step-guide-xml-file-2-xml-file-...

Here is an example of how to use XSLT mapping to get XML data into the right form before your normal mapping.

http://scn.sap.com/message/6897166#6897166

Once your input looks fine in moni, you can find many good examples of CSV output with the File Receiver adapter. Please remember to reward points for helpful answers, and good luck!

-Aaron

Former Member
0 Kudos

Aaron

   FILE to FILE scenario is designed according to the link you mentioned. When I add the two lines

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

<ns0:MT_REBATE_REQUEST_IN xmlns:ns0="urn:cslbehring:modeln:rebate:request">

at the beginning of the message, it works fine. So I think it is not the issue with the data type.

In the second like i understand that XSLT mapping has to be executed to add the namespace line before executing Graphical mapping. Please let me know how to do this.

Thanks

Naga

Former Member
0 Kudos

Hi,

Can you please provide the FCC parameters what you configured.  It will be useful to understand the issue.

Thanks,

Satish Kumar P.

Former Member
0 Kudos

Satish

   I attached the screen shots of the FCC parameters as well as XML file.

Thanks

Naga

Former Member
0 Kudos