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

selection from logical database.

Former Member
0 Likes
861

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
838
            • 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

7 REPLIES 7
Read only

Former Member
0 Likes
839
            • 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

Read only

0 Likes
838

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 😃

Read only

0 Likes
838

Then use this standard function module

that gets the position...

If none, person has no position

Read only

0 Likes
838

Debugger mode? 😃

Read only

0 Likes
838

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

Read only

0 Likes
838

Hi Claes,

Remove the 'if sy-subr ne 0' and its 'endif' in your first part.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
838

Thank you SOOOOOOOO much!!

/ Claes