cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Tables and XMLSerialize

Former Member
0 Kudos

I am using the .NET connector with C# and doing a proof of concept calling the bapi Bapi_Customer_Getdetail, which is working great. My problem is, I want to serialize the contents of the BAPIKNA101 table to an XML document. I have produced the XML file, but there is only one problem with how it is doing this. For attributes of the BAPIKNA101 table that have an underscore in the name, the serialization puts the characters '5f' in. For example, here is the 'POSTL_CODE' node: <POSTL_5fCODE>2500 BG</POSTL_--5fCODE>. Here is a short piece of code doing the serialization:

sap_proxy.Bapi_Customer_Getdetail(CustomerNo,

null, null, null, "1", out tab_kna1, out tab_return);

XmlSerializer objSr = new XmlSerializer(typeof(BAPIKNA101));

TextWriter writer = new StreamWriter(@"c:\sr.xml");

objSr.Serialize(writer, tab_kna1);

Any help would be great. I will see how the responses here are, I may need to take this to a C# forum.

Thanks.

Don

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

Please install the patch from OSS note 506603 and regenerate (right-click .sapwsdl file and say "Run custom tool". This will fix the problem with the XML attributes.

Answers (0)