Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reading the HRP1001 and the Salescode tables

Former Member
0 Kudos
274

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?

1 REPLY 1
Read only

Former Member
0 Kudos
218

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