PyRFC icon indicating copy to clipboard operation
PyRFC copied to clipboard

Language Codes

Open Joselguti opened this issue 3 years ago • 1 comments

Hello,

I am opening a connection and retrieving data from a BAPI with PyRFC, but the data returned is in english, even when I'm specifying that language = 'ES' (for spanish).

I know the BAPI should be working correctly, because with another program I call the same BAPI (with it's parameters) and the data is returned in Spanish.

These is how passing the parameters to the function:

conn_lang = 'ES'
conn_trace = '3'
conn = Connection(lang=conn_lang, trace=conn_trace, user=conn_user, passwd=conn_password,
                  ashost=conn_ashost, sysnr=conn_sysnr, client=conn_client)

Joselguti avatar Apr 19 '22 21:04 Joselguti

The conn_lang = 'S' should solve the issue.

Language code fields have internal and external representations and in RFC communication the internal representation is expected, as described here and here.

To check if particular BAPI parameter field is subject to internal/external conversion, you can install the nodejs CLI abap-api-tools. Using abap call command you can see all function module parameters, fields and their metadata, as described here: abap-api-tools/README.md#abap-function-module-call-template.

Other language codes you can find here: SAP/fundamental-tools/abap-api-tools/src/ts/constants.ts#L73

bsrdjan avatar Apr 21 '22 08:04 bsrdjan