‎2020 Oct 03 6:35 PM
Hello,
I have the following selection into internal table.
SELECT SINGLE sobid
FROM hrp1001
INTO @wa_hrp1001-var_sobid
WHERE otype = 'O'
AND plvar = '01' AND relat = '011'
AND endda GE '99991231'
AND subty = 'A011'
AND sclas = 'K' AND objid = @wa_hrp1001-var_objid.
This produces the output: 0000555559999.
I would like to remove the leading 0 and 9999. I have removed leading 0 by SHIFT wa_hrp1001-var_sobid LEFT DELETING LEADING '0'. I can remove the 9999, in a test, by giving a value with:
DATA: str TYPE string VALUE '555559999.
str = substring( val = str off = 0 len = strlen( str ) - 4 ). write: str.
My question is, how do I loop or incorporate this into that column of data.
‎2020 Oct 04 3:26 AM
‎2020 Oct 04 8:55 AM
I don't understand the question. SOBID is 45 characters. Maybe your question is:
If yes, that would be: (read ABAP doc SQL String Functions for more information)
SELECT SINGLE ltrim( left( sobid, 10 ) , '0' ) AS sobid ...NB: don't you have native ABAP functions to operate directly on SOBID value? (like WRITE or a function module) It seems that there are many questions around HRP1001-SOBID, did your read the answers?
‎2020 Oct 08 3:19 PM
Thank you Sandra and S Abinath. Information provided was very helpful.
Brian