Comments (4)
I don't have issues on my system in French, what's the actual result?
Have you tried changing the language to sy-langu
in format_message
from abap-logger.
can_log_batch_msgs, 'Did not log BDC return messages correctly'
can_log_chained_exceptions: 'Did not log chained exception correctly'
The Details are,
"Erwartet [Specify the object to be tested], tatsächlich [Geben Sie das zu testende Objekt an]"
which translates to,
"Expected [Specify the object to be tested], actual [Geben Sie das zu testende Objekt an]"
I'm actually logged in German. But when the unit tests are executing in Eclipse / SAP GUI, sy-langu = 'E'.
When zcl_logger->lcl_test->get_messages ->call function 'BAL_LOG_MSG_READ' is called, the SAP system returns the messages in German.
Even when I alter the call to 'BAL_LOG_MSG_READ' with the language parameter, the messages are still returned in German.
call function 'BAL_LOG_MSG_READ'
exporting
i_s_msg_handle = msg_handle
i_langu = 'E'
importing
e_s_msg = msg_detail
e_txt_msg = msg_text. "messages are still in German!
When I dived into the function module 'BAL_LOG_MSG_READ' and debugged it, I found the text was set in the Function Module 'BAL_DSP_TEXT_MSG_READ' with the following code.
* when language is current language, use MESSAGE INTO
IF i_langu = sy-langu.
MESSAGE ID i_msgid
TYPE 'S'
NUMBER i_msgno
WITH i_msgv1
i_msgv2
i_msgv3
i_msgv4
INTO e_message_text.
EXIT.
ENDIF.
i_langu = 'E' and sy-langu = 'E' - but for some reason the text is being returned in German! This is very strange.
I assume this is somehow because my Eclipse / SAP GUI login language is German - but the Unit Tests are being executed in English and somehow this is messing the MESSAGE statement up.
format_message is returning the text in English (as it should).
This affects both SAP GUI and Eclipse.
Changing the FORMAT_MESSAGE language from 'E' to sy-langu didn't change anything. It always returned the messages in English...
I did manage to fix the problem by exchanging CALL FUNCTION 'FORMAT_MESSAGE' by using MESSAGE directly.
This way I get the same 'curious' language behaviour and the test (that the texts are the same) passes.
method format_message.
" call function 'FORMAT_MESSAGE'
" exporting
" id = id
" lang = 'E'
" no = no
" v1 = v1
" v2 = v2
" v3 = v3
" v4 = v4
" importing
" msg = msg
" exceptions
" not_found = 1
" others = 2.
"* TODO: raise abap unit
MESSAGE ID id TYPE 'S' NUMBER no WITH v1 v2 v3 v4 INTO msg.
endmethod.
Obviously my fix is dependant on the the implementation of BAL_LOG_MSG_READ
/ BAL_DSP_TEXT_MSG_READ
and the behaviour of MESSAGE during Unit Tests.
Cheers
Martin
from abap-logger.
Yes this will fix the issue.
@AlexandreHT i think you don't have this issue because there is no translated message in French?
from abap-logger.
That fix doesn't work for me...
from abap-logger.
Related Issues (20)
- bal_tt_msg type not exist HOT 1
- callback routine useless HOT 5
- adding syst messages no working for methods i,a,e,w,s of zcl_logger HOT 2
- Importance is not propagated when logging a table HOT 4
- Unit tests use non-existing SLG0 subobject HOT 5
- Limited Test Double Framework compatibility? HOT 2
- BAL-Log-Handle remains after destruction of ABAP-Logger HOT 1
- Misleading Name of Method popup() when providing custom Profile
- Build Hierarchy with Logger HOT 1
- Navigation to the application Log is not working for background jobs HOT 2
- Stale project? HOT 4
- Add support for BAPI_ALM_RETURN message structure HOT 1
- ABAP Logger v2 HOT 16
- Add injector class to match factory methods
- Add entry to log with context don't work if obj_to_log is an instance of a exception class
- Avoid abbreviations: add methods error, warning, info and success HOT 3
- Read messages from log with context HOT 4
- Option to use grid for DISPLAY_AS_POPUP HOT 1
- System message is logged if initial object is passed to as object to log HOT 3
- Open log doesn't save messages with second db connection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abap-logger.