Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP without UNICODE - is it possible

Iu2019m working with the NWRFCSDK (c/c++).

My problem is that I can connect to the SAP server only when I have u201CSAPwithUNICODEu201D preprocessor definition - without this the connection is always null.

I donu2019t think sap would make sdk without the option to work with non-unicode.

What do you say?

Here is a code example:

int mainU(int argc, SAP_UC** argv){

RFC_RC rc = RFC_OK;

RFC_CONNECTION_PARAMETER loginParams[6];

RFC_ERROR_INFO errorInfo;

RFC_CONNECTION_HANDLE connection;

RFC_FUNCTION_DESC_HANDLE bapiCompanyDesc;

RFC_FUNCTION_HANDLE bapiCompany;

RFC_STRUCTURE_HANDLE returnStructure;

SAP_UC message[221];

RFC_BYTE buffer[1105];

unsigned utf8Len = 1105, resultLen;

FILE* outFile;

loginParams[0].name = cU("ashost"); loginParams[0].value = cU("hostname");

loginParams[1].name = cU("sysnr"); loginParams[1].value = cU("05");

loginParams[2].name = cU("client"); loginParams[2].value = cU("800");

loginParams[3].name = cU("user"); loginParams[3].value = cU("user");

loginParams[4].name = cU("lang"); loginParams[4].value = cU("JA");

loginParams[5].name = cU("passwd"); loginParams[5].value = cU("1234");

connection = RfcOpenConnection(loginParams, 6, &errorInfo);

// as I specified this always returned as null when u201CSAPwithUNICODEu201D is not defined

if (connection == NULL) errorHandling(rc, cU("Error during logon"), &errorInfo, NULL);

}

Tx.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question