Skip to Content
0
Feb 16, 2016 at 11:57 AM

how to get service entry sheet , PO against a service for a WBS

608 Views

hello all,

in CJ20N for a given WBS,

to get services PLAN details(like service qty and service plan cost),

i used following code,

SELECT pspnr
post1
posid
werks
prctr
fkstl
psphi
belkz
loevm
vernr
verna
FROM prps
INTO TABLE it_prps
WHERE posid = p_posid.

if it_prps is not INITIAL.
SELECT projn
vornr
ltxa1
packno
matkl
STEUS
banfn
bnfpo
loekz
from afvc
INTO CORRESPONDING FIELDS OF TABLE it_afvc
FOR ALL ENTRIES IN it_prps
WHERE projn = it_prps-pspnr
and loekz ne 'X'.

endif.
DELETE lit_afvc WHERE packno IS INITIAL.

DELETE ADJACENT DUPLICATES FROM lit_afvc COMPARING packno.

if lit_afvc[] is NOT INITIAL.

SELECT packno " Package number
fpackno " Parent package number
FROM eslh
INTO TABLE it_eslh
FOR ALL ENTRIES IN lit_afvc
WHERE fpackno EQ lit_afvc-packno.


endif.


if it_eslh[] is NOT INITIAL.

SELECT packno " Package number
introw " Line Number
srvpos " Activity Number
menge " Quantity with Sign
meins " Base Unit of Measure
brtwr " Gross Price
netwr
ktext1 " Short Text
tbtwr " Gross Price
FROM esll
INTO CORRESPONDING FIELDS OF TABLE it_esll
FOR ALL ENTRIES IN it_eslh
WHERE packno EQ it_eslh-packno
AND srvpos NE ''.

endif.


sort it_esll by srvpos.

from the above code i could get the service plan qty and plan cost,

but my question is how do i get services actual qty and actual cost (i.e PO and Service entry sheet ) are created against it...

from AFVC i can get purchase requisition number, if i pass PR no to table EBAN i can get PO number,

after this how do i proceed.

or is there any FM or BAPI to get these details...

thanks in advance....

Attachments

cj.jpg (128.7 kB)