2008 May 27 9:13 AM
Greetings Abapers
I am trying to read the HRP1001 table for all relationships where the BP's match those in the Salescode table. Fundamentally its simple enough but the BP number in the HRP1001 table is stored in sobid and it is of the form 0000000134. The number in the salescode table which i want to compare it to when i do my select statement is simply 134. How can i chop off the first seven digits of sobid?
I tried the following:
select * from hrp1001 into table lt_hrp1001
where plvar = '01'
and relat = 'Z40'
and sobid+7(3) = lt_/ccdev01/a2scode-partner. *comparing BP numbers
This does not work as i get the error message filed sobid+7(3) is unknown. Any suggestions?
2008 May 27 9:17 AM
Declare a variable like hrp1001-sobid ..
and pass lt_/ccdev01/a2scode-partner to the variable ..
now pass this for sobid in where condition.
data : v_sobid like hrp1001-sobid.
v_sobid = lt_/ccdev01/a2scode-partner.
select * from hrp1001 into table lt_hrp1001
where plvar = '01'
and relat = 'Z40'
and sobid = v_sobid. *comparing BP numbers