Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ABAP] Einfügen von Zeichenketten mit Leerzeichen

Empfohlene Antworten

Veröffentlicht

Hallo,

Ich wollte im ABAP 3 strings mit jeweils Leerzeichen zu einem String zusammenführen.

Leider werden die Leerzeichen ignoriert.

Die Anweisungen sind wie folgt:

data: ls_titel type string,

ls_name type string,

ls_vorname type string,

ls_namevorname type string.

concatenate ls_titel ' ' ls_name ', ' ls_vorname into ls_namevorname.

Als Ergebniss kommt es heraus z.B.: Dr.Müller,Martin

Es sollte aber so rauskommen: Dr. Müller, Martin

Wie kann ich realisieren?

Vielen Dank und viele Grüße

Hi,

Verwende den Zusatz "RESPECTING BLANKS", bzw. "SEPARATED BY space". Dann klappts mit den Leerzeichen.

Genauer gesagt: "RESPECTING BLANKS" funktioniert nur mit Variablen vom Typ C, nicht für Strings. "SEPARATED BY space" funktioniert für Variablen vom Typ C und für Strings.

Gruß,

Tom.

Bearbeitet von MAJOR_TOM

Joa aber wenn du z.B. vor dem ',' kein Blank willst dann arbeite statt mit separated by space mit der klasse CL_ABAP_CHAR_UTILITIES (oder so ähnlich, mal mit * suchen) in der Klasse gibt es eine konstante die ein leerzeichen enthält... die konstante kannst du dann einfach in das concatenate aufnehmen und dann hast du nur da blanks wo du die konstante angibst

würde es denn nicht so funktionieren?

concatenate ls_titel ' ' ls_name ', ' ls_vorname into ls_namevorname
da fügt er ja schon das komma ein...also warum nicht auch leerzeichen? sonst müsste auch das gehen:
concatenate ls_name  ','  into ls_name.

concatenate ls_titel ls_name ls_vorname into ls_namevorname SEPARATED BY space

Jo, und schau dir dann nochmal den Befehl CONDENSE an... damit nicht zu viele leerzeichen vorkommen...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.