. NET connection to SAP system topic: C # Call RFC Chinese garbled solution (12)

Source: Internet
Author: User

According to the chairman's instruction, the IT department of TW corporation last week restricted billing if the internal order number in the miscellaneous purchase orders does not have a development execution ticket. So tw it performed user Export Development in ME51N on the System screen. If the system detects that there is no development execution order in the internal order, IT prompts that IT does not continue. Because the text instructions on the card control over TW are traditional, OA will return this error message after calling the RFC application to open a requisition, And it is garbled, such:

I thought it was an exception when I saw this garbled code, because the system throws an exception class: RfcCommunicationException. I found the cause everywhere and made it full of the header package. Later I had to go to the official environment and try to open a purchase order with OA data. As a result, the system prompts that the development execution order does not exist, so I knew the reason. Therefore, I felt very hard to solve this garbled code.

We can specify the encoding in the configuration information before RFC is called, as shown in the red letter below:

public class MyBackendConfig : IDestinationConfiguration

{

public RfcConfigParameters GetParameters(String destinationName)

{

if ("PRD_000".Equals(destinationName))

{

RfcConfigParameters parms = new RfcConfigParameters();

parms.Add(RfcConfigParameters.AppServerHost, "192.168.1.3");

parms.Add(RfcConfigParameters.SystemNumber, "00");

parms.Add(RfcConfigParameters.User, "MENGXIN");

parms.Add(RfcConfigParameters.Password, "×××");

parms.Add(RfcConfigParameters.Client, "888");

parms.Add(RfcConfigParameters.Language, "ZH");

parms.Add(RfcConfigParameters.PoolSize, "5");

parms.Add(RfcConfigParameters.MaxPoolSize, "10");

parms.Add(RfcConfigParameters.IdleTimeout, "60");

parms.Add(RfcConfigParameters.Codepage, "8300");

return parms;

}

else return null;

}

public bool ChangeEventsSupported()

{

return false;

}

public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;

}

 

This code is set to 8300 (traditional), so the system correctly prompts the information:

The Code meanings of this Codepage are as follows:

So far, the garbled problem has been completely solved ~

PS:. NET connection to the SAP system is now over. Thank you for your comments...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.