Skip to Content
0
Sep 13, 2007 at 05:06 PM

Reading table without key(HR ABAP --> OM)

68 Views

Hi All,

if you see the statement below , i am giving the non-key fields sobid and sclas in the where condition and retrieving one of the key fields which is objid. I am getting the correct output but is this statement correct. i mean can we get the key field from non-key field

SELECT objid

INTO gw_obj_id

UP TO 1 ROWS

FROM hrp1001

WHERE plvar EQ '01' AND

otype EQ 'O ' AND

istat EQ '1' AND

rsign EQ 'A' AND

relat EQ '011' AND

sclas EQ 'K ' AND

sobid EQ w_id AND

endda GE curr_dt AND

begda LE curr_dt.

ENDSELECT.

In the baove example i am getting the Org unit id from cost center id. There is ponly one way relation A011 O-K. But there is no K-O.

Thanks in advance