SAP Agent receiving language error messages

Document ID : KB000102681
Last Modified Date : 16/07/2018
Show Technical Document Details
Issue:
SAP agents are failing with the following error message:
U2004172 Error while calling function module 'BAPI_XMI_LOGON'. 
Initialization of repository destination QR1_E011UC4CPIC failed: Parameter logon language ('lang') code 'EN|ENGLISH' is invalid 
com.sap.conn.jco.JCoException: Initialization of repository destination QR1_E011UC4CPIC failed: Parameter logon language ('lang') code 'EN|ENGLISH' is invalid 

U2004172 Error while calling function module 'BAPI_XBP_JOB_OPEN'. 
Initialization of repository destination QR1_E011UC4CPIC failed: Parameter logon language ('lang') code 'EN|ENGLISH' is invalid 

U2004081 Fehler bei Funktion 'BAPI_CONVERSION_EXT2INT1': 'Sprache EN', Type: 'ENGLISH ist dem System unbekannt.', ID:'E', Nummer: 'TL|080' 
Environment:
Java API version 12
Cause:
When importing SAP JOB objects, the Java API is not validating the input language.
If an SAP JOB object is exported, the language is saved in the format - two character language code, pipe symbol and language name.
eg. EN|ENGLISH or DE|GERMAN

When importing the exported object, the Java API just takes the entire string and places it in the language field on SAP JOB Objects.
Resolution:
Workaround:
1. Run the following SQL statement to find out, which SAP JOB objects have the incorrect language stored:
SELECT OH_client,JBA_OH_Idnr, OH_Name, JBA_Rest, OH_ModDate 
FROM JBA, OH 
where JBA_OH_Idnr=OH_Idnr 
and JBA_Rest like '%|%'; 

2. For each of the objects from the SQL statement's result, do the following: 
1. Open the object  in the AWI and go to the SAP tab. 
2. Make a note of the original language on the job. 
3. Change the language to something another value. 
4. Save the changes. 
5. Repeat the steps above(1 through 4) to return the job back to the original language value. 

3. Stop and restart the effected SAP agent.
___________________________________________________________________________________________
A permanent solution to the issue will be supplied.
The exact versions and dates of the solution will be announced shortly.