我正在嘗試在 SAP ABAP 中創建一個演算法,以從某些欄位中消除 IBAN 一詞。例如,在照片下面我們有對KNBK-Bankschlüssel=7415000,對KNBK-Bankkontonummer= <IBAN 000000000008。我試圖從該欄位中消除 IBAN,以便表中僅顯示 000000000008。

是否有任何字串操作可以讓我檢查欄位是否具有關鍵字 IBAN 并消除它?
謝謝大家!
uj5u.com熱心網友回復:
您可以使用 REPLACE 陳述句來做到這一點:
IF word CS 'IBAN'. "to check if the string contains IBAN (as substring)
REPLACE 'IBAN' WITH '' INTO word. "This will remove the substring IBAB, but it will be replaced with a space
CONDENSE word NO-GAPS. "This will remove the space (and other spaces as well, if there is any in the string)
ENDIF.
查看螢屏截圖,該欄位包含“< IBAN>”(而不僅僅是“IBAN”),因此您必須相應地修改代碼。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/321769.html
