‎2006 Jan 16 8:28 AM
The question is simple. 😃 Wy does the second part works but not the first one. Isn't it possible to do like that. Anyone that can help with how i can do?
************************************************************************
**
<b>Event : start-of-selection employees not connected to position</b>
************************************************************************
rp-provide-from-last p0001 space pn-begda pn-endda.
check pnp-sw-found eq 1.
if p0001-plans EQ '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' or
p0001-persg EQ 'T' )
AND ( p0001-bukrs EQ 'FR46' or
p0001-bukrs EQ 'GB21' or
p0001-bukrs EQ 'PL05' or
p0001-bukrs EQ 'BE06' or
p0001-bukrs EQ 'US22' ).
.
<i>****** What should i write here.
All the condistion are right
But i dont know how/what to select.</i>
if sy-subrc ne 0.
ipos-pernr = pernr-pernr.
ipos-sname = p0001-sname.
ipos-orgeh = p0001-orgeh.
ipos-bukrs = p0001-bukrs.
ipos-plans = p0001-plans.
append ipos.
clear: ipos.
endif.
endif.
************************************************************************
**
Event : <b>start-of-selection connected to position but no task</b>************************************************************************
rp-provide-from-last p0001 space pn-begda pn-endda.
check pnp-sw-found eq 1.
IF p0001-plans NE '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' OR
p0001-persg EQ 'T' )
AND ( p0001-bukrs EQ 'FR46' OR
p0001-bukrs EQ 'GB21' OR
p0001-bukrs EQ 'PL05' OR
p0001-bukrs EQ 'BE06' OR
p0001-bukrs EQ 'US22' ).
.
<i> w_objid = p0001-plans.
select sobid into w_sobid
up to 1 rows
from hrp1001
where otype = 'S'
and plvar = '01'
and objid = w_objid
and rsign = 'B'
and relat = '007'
and endda ge pn-begda
and begda le pn-endda.
endselect.</i>
if sy-subrc ne 0.
itask-pernr = pernr-pernr.
itask-sname = p0001-sname.
itask-orgeh = p0001-orgeh.
itask-bukrs = p0001-bukrs.
itask-plans = p0001-plans.
append itask.
clear: itask, w_objid, w_sobid.
endif.
endif.
end-of-selection.
/ Claes
‎2006 Jan 16 8:46 AM
What should i write here.
All the condistion are right
But i dont know how/what to select.
<b>Should be Replaced by</b>
Function call RH_GET_POSITION_TAB. Then you'll get the list if positions!
Is that what you ask ????
Stphn
‎2006 Jan 16 8:46 AM
What should i write here.
All the condistion are right
But i dont know how/what to select.
<b>Should be Replaced by</b>
Function call RH_GET_POSITION_TAB. Then you'll get the list if positions!
Is that what you ask ????
Stphn
‎2006 Jan 16 9:31 AM
Yes, to get the position is exactly what i want but i also want to learn what i'm doing wrong. 😃 So I can do it right the next time.
Do you understand what I'm looking for? What do I need to add for my code to work? Nice question isn't it 😃
‎2006 Jan 16 9:38 AM
Then use this standard function module
that gets the position...
If none, person has no position
‎2006 Jan 16 9:42 AM
‎2006 Jan 16 4:38 PM
Hollo again,
I will use the function module, i promise. 😃
But i just want to understand why the second part of my code is working "start-of-selection connected to position but no task" and not the first one.
I haven't yet got the hang of how to use PNP Logical database.
Best Regards
Claes
‎2006 Jan 16 4:53 PM
Hi Claes,
Remove the 'if sy-subr ne 0' and its 'endif' in your first part.
Regards,
Suresh Datti
‎2006 Jan 16 5:07 PM