Skip to main content

ABAP

ERP: Translate an entire message class

Submitted by Stefan Barsuhn on

When you go to SE91 and want to translate messages, the system will generally only display the message you selected for translation.

If you want to handle the translation more efficient, go to SE63, select transport object, enter R3TR MSAG and the name of your message class, specify source and target language and click edit.

In the next screen, all your messages are displayed. Click "Sequentially Process Objects" and you can edit one message after another, pressing F7 and F8 to navigate back and forth.

Tags

SAP: Change request body in BSP response

Submitted by Stefan Barsuhn on

I recently needed to modify the body of an HTTP response in a BSP page. Previously, the request was simply returning a status 403. This was done using request->set_status. So I assumed that I simply had to do request->set_cdata to set the HTML body corresponding to the status. But this was incorrect. 

The correct approach was to use me->write (me referring to the BSP page in the DO_REQUEST method). I know too little about BSP to explain why the request and the BSP page are two different objects.

Tags

SAP: Convert string to multiline table

Submitted by Stefan Barsuhn on

In case you have to deal with text in ERP, the text function modules do not usually allow you to pass a string value. Rather, you have to pass a table that contains your string, split up into multiple lines. The data element of those texts is usually TDLINE and you have to provide some additional information in the table, like object type and format.

Doing this split was actually not very straight-forward because you need to take into account that your (flat) source string may contain line breaks.

Tags

SAP: Transport Report Translations

Submitted by Stefan Barsuhn on

I guess it was the first time that I've translated an SAP report after releasing the code changes to the Q system. But much to my surprise, I wasn't prompted for a transport request when I maintained the translations.

There's a very good article that explains how to transport the translations using transaction SLXT, however what I was really after was how to add those texts to the transport request manually.

Tags

SAP: Get the callstack in ABAP

Submitted by Stefan Barsuhn on

To get the callstack in ABAP, simply call the following line:

DATA(lt_callstack) = cl_abap_get_call_stack=>format_call_stack_with_struct( cl_abap_get_call_stack=>get_call_stack( ) ).

Then you can access the callstack the same way you see it in the debugger, e.g. the name of the program will be in lt_callstack-progname.

Tags

SAP CRM: BPATH - debugging relation traversal

Submitted by Stefan Barsuhn on

Quick note: if you're trying to find out what's going on with your BPATH statement and you want to debug the traversal thereof, the central entrypoint is method CL_WCF_BPATH_PARSER=>STATUSMACHINE. This splits the string and acts on the segments.

Method CL_WCF_BPATH_PARSER=>PROCESS_ACTION is then called to delegate processing of the different segment types to different methods.

Tags