Logon language¶
Helpers for converting between the two-character ISO language code and the one-character SAP language code that the RFC logon frame carries.
Both names match the equivalents exposed by pyrfc
(language_iso_to_sap / language_sap_to_iso), which in turn wrap
RfcLanguageIsoToSap / RfcLanguageSapToIso in the SAP NetWeaver RFC SDK.
See Connection Options
for how this interacts with connect(lang=…).
language_iso_to_sap ¶
Convert a two-character ISO language code to its one-character SAP code.
Mirrors RfcLanguageIsoToSap in the SAP RFC SDK, with one deliberate
difference: an unknown code raises instead of returning a garbage character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
iso_code
|
str
|
Two-character ISO code, e.g. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The one-character SAP language code, e.g. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/saprfclib/language.py
language_sap_to_iso ¶
Convert a one-character SAP language code to its two-character ISO code.
Mirrors RfcLanguageSapToIso in the SAP RFC SDK.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sap_code
|
str
|
One-character SAP code, e.g. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The two-character ISO code, e.g. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |