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

Reading key field from non-key fields (HR ABAP)

29 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.

Thanks in advance