‎2007 Nov 28 2:54 PM
Hi Experts....
Can you guys look at this and tell me whats wrong with this code:
DATA : LS_9105 TYPE HRP9105.
DATA: ls_act_beh_flag TYPE string.
DATA: LS_WPLOG_VDATA TYPE string.
DATA: LS_cand_id TYPE string.
DATA: ls_hrobject TYPE hrobject.
SELECT * FROM HRP9105 INTO LS_9105
WHERE LS_cand_id = ls_hrobject-objid
AND subty = INVB
AND endda > SY-DATUM.
IF SY-SUBRC = 0
SEND false to ls_act_beh_flag
ELSE
SEND true to <ls_act_beh_flag
ENDIF.
The error I am getting is : LS_cand_id unknown.
Can you guys help me on this...
Thanks
fhf
‎2007 Nov 28 2:57 PM
hi,
check fields of table HRP9105 (in SE11), LS_cand_id does not exist (which you use in WHERE)...
ec
‎2007 Nov 28 2:57 PM
I cannot see this table in my system sap, but, i am sure that the field LS_cand_id is dificult to be in a standard table of sap. Perhaps it not exists, or have another name similar.
‎2007 Nov 28 2:59 PM
HRP9105 must not have a component with the name LS_cand_id .
Open HRP9105 it into SE11 and try to check the components.
Regards,
Naimesh Patel
‎2007 Nov 28 2:59 PM
Hi
The error should be here:
SELECT * FROM HRP9105 INTO LS_9105
WHERE LS_cand_id = ls_hrobject-objid <---It seems the table
HRP9105
hasn't the fieldLS_CAN_ID
LS_CAN_ID
is a variable of your program, check which field has to be used by SE11U could have other problem with the statament SEND, I suppose you want to use MOVE:
SELECT * FROM HRP9105 INTO LS_9105
WHERE LS_cand_id = ls_hrobject-objid
AND subty = INVB
AND endda > SY-DATUM.
IF SY-SUBRC = 0
* SEND false to ls_act_beh_flag
MOVE 'false' to ls_act_beh_flag
ELSE
* SEND true to ls_act_beh_flag
MOVE 'true' to ls_act_beh_flag
ENDIF.At the last you should considere if the program run the abap code inclused in a SELECT statament the SY-SUBRC is always true, so your code should be:
SELECT * FROM HRP9105 INTO LS_9105
WHERE LS_cand_id = ls_hrobject-objid
AND subty = INVB
AND endda > SY-DATUM.
ENDSELECT.
IF SY-SUBRC = 0
MOVE 'false' to ls_act_beh_flag
ELSE
MOVE 'true' to ls_act_beh_flag
ENDIF.Max
‎2007 Nov 28 5:43 PM
Thanks for this code. However, I am now I am getting an error saying: subty is not a valid comparison operator>. Can you help??
‎2007 Nov 28 3:41 PM
I am sorry guys to not tell you the whole scenario, I am using this code in a method in the bsp application. I am declaring LS_cand_id as local, DATA: LS_cand_id TYPE string. HRP9105 is a custom infotype and this does not has the fiels LS_cand_id. In other words, I am using ls_hrobject to read the data and move it into ls_cand_id. The code for ls_hrobject is not included in this conversation where ls_hrobject is reading the candidate ID. Anyway, I thought, if I declare LS_cand_id as local than it should recognize it. I am still lost....
‎2007 Nov 28 6:05 PM
HI,
I think LS_cand_id field does not exist in the table HRP9105, check table HRP9105 in SE11.
Please Reward,
Mahi.
‎2007 Nov 28 6:54 PM
You are correct, it doesn't exist as I mentioned it in my previous post. I declared the field as local and am moving the data into it. Its not an issue anymore. I fixed it.
Thanks
fhf