SAP web gui Type Into activity line breaks not processed

Hi Experts

I am currently trying to configure a process where data is retrieved from an Excel sheet and then entered into SAP web gui.

The Excel sheet input can handle line breaks which is also shown when using the Message Box activity. However when the data is inserted into a comments field in the SAP web gui the line breaks are not handled as line breaks - looks more than tabs.

Is there a way to handle this? The myText.Replace(chr(13), Environment.NewLine) in the TypeInto activity does not work.

Hi @jacchr

Could you give this a try?
myText.Replace(chr(10),Environment.NewLine)

Hi @loginerror

Apparently that does not work either (I tried both chr(10), chr(13) and the two in combination). I’m not sure that it can be done on the fly but somehow needs to be broken down in bits.

Could you provide a sample Excel file with the cell with the line break?
I tested it a bit and it works for me when typing into the notepad.

You can just press Alt + Enter in the Excel sheet to create a line break. It also works for me in Notepad and when showing the string in a Message Box - but as described in the initial post it is when it is entered into a field in SAP web gui.

Meanwhile I found that myText.Replace(VbCrLf, “[k(enter)]”) is working if I deselect the SimulateType property of the activity. However from previous tests it shows that it needs to be enabled in order have the input made properly working in the background.

Thank you for more context. Indeed, the SAP field must be somehow sanitizing your input.
However, just so you know why I keep asking the same questions :slight_smile: Are you sure that the line break is not entered properly into your SAP application?

For example, if I prepare my input Excel file with one cell and with a line break (Alt+Enter) line this:
image

And then load it to UiPath and write it using Write Range activity, I get this when I open the new file:
image

But all it takes is to click the cell to get the correct output:
image

Maybe the line break is preserved, but simply won’t display? Could you try entering it into the app with UiPath and then copy pasting it to Notepad++ (or anything else that shows detailed characters) to see what is the character between the lines?

I did some further testing where I disable SimulateType and then also where SimulateType is disabled and SendWindowsMessage is enabled. In both cases the text is being entered with line breaks without any further processing of the text string.

According to the UI Path documentation the SimulateType does not support “sendkeys” but for more stable input in SAP web gui the SimulateType is required (otherwise the text is not inserted properly at all).

Hello,
Do you have a solution for it? I’m facing the same problem evenif I use myText.Replace(VbCrLf, “[k(enter)]”).
Thank for your help

Sorry - I never got it to work as the text with line breaks was not entered with 100% accuracy.

1 Like

Thank you for your reply, i find other approach for my problem

Hi @Bao_Nguyen, @jacchr

I am facing the same issue. What approach did you use?
Tried using description.Replace(VbCrLf, “[k(enter)]”), din work for me

I have an SAP flash page where I need to enter the course description, but it gets entered in a single line even though the excel data has line breaks,

Input:
image

Log message:
image

Output:

@loginerror, any inputs on this?

Hi @kavyashreeh22

I never got it to work as the text was not typed with 100% accuracy when the line breaks should be entered as well.

@jacchr, @Bao_Nguyen, @loginerror
Checking SendWindowMessages in type into activity worked for me like a charm without any further string processing and also with 100% accuracy.

Thanks