Application Development 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: 

Actual cost and Planed cost based on wbs project.

Former Member
0 Kudos

Hello Friends,

       

          could you please provide me logic for actual cost and planned cost based on project and I have tried rpsco,coep tables but no use.

       

Thanks in adv,

Moderator Message: Please search in SCN before posting, this question has been asked and answered many times already

Message was edited by: Kesavadas Thekkillath

3 REPLIES 3

former_member185116
Active Participant
0 Kudos

i sainath,

i don't know about ,based on project ,

but i can help u for actual cost and planned cost based on WBS...

0 Kudos

Hello Vinay,

     thanks for your quick reply, please provide me logic for planned cost and actual cost based on WBS.

Thanks.

0 Kudos

select * from RPSCO by passing objnr from prps ...

*to get actual cost *********************************************


loop at it_rpsco2 into wa_rpsco2 WHERE wrttp eq '04'.               "here wlp01 to wlp12 is from month april to march     (to get actual)
                

                lv_act = lv_act + wa_rpsco2-WLP01 + wa_rpsco2-WLP02 + wa_rpsco2-WLP03 + wa_rpsco2-WLP04 + wa_rpsco2-WLP05 +


                                 wa_rpsco2-WLP06 + wa_rpsco2-WLP07 +wa_rpsco2-WLP08 + wa_rpsco2-WLP09 + wa_rpsco2-WLP10 +


                                     wa_rpsco2-WLP11 + wa_rpsco2-WLP12 + wa_rpsco2-WLP13 + wa_rpsco2-WLP14 +


                                      wa_rpsco2-WLP15 + wa_rpsco2-WLP16 .


endloop.

*to get plan *******************************


if it_prps[] is NOT INITIAL.


    select * FROM rpsco
             INTO TABLE it_rpsco
             FOR ALL ENTRIES IN it_prps
             WHERE objnr eq it_prps-objnr.


    select * FROM afvc
             into TABLE it_afvc
             FOR ALL ENTRIES IN it_prps
             WHERE projn eq it_prps-pspnr.

  endif.



if it_afvc[] is NOT INITIAL.

    select * FROM rpsco
             into TABLE it_rpsco_plan1
             FOR ALL ENTRIES IN it_afvc
             WHERE objnr eq it_afvc-objnr
             and wrttp eq '01'.                 "wrrtp = '01' for plan

  endif.




sort it_afvc by objnr.

sort it_rpsco_plan1 by objnr.

sort it_prps by pspnr.   "very imp




loop at it_prps into wa_prps.


  at new pspnr.

   loop at it_afvc into wa_afvc WHERE projn eq wa_prps-pspnr.


       loop at it_rpsco_plan1 into wa_rpsco_plan1 WHERE objnr eq wa_afvc-objnr.


            APPEND wa_rpsco_plan1 to it_rpsco_plan2.

        endloop.


    endloop.



  endat.


    loop at it_rpsco_plan2 into wa_rpsco_plan2.

      lv_plan = lv_plan + wa_rpsco_plan2-WLP01 + wa_rpsco_plan2-WLP02 + wa_rpsco_plan2-WLP03 + wa_rpsco_plan2-WLP04 + wa_rpsco_plan2-WLP05 + wa_rpsco_plan2-WLP06 + wa_rpsco_plan2-WLP07 +
                          wa_rpsco_plan2-WLP08 + wa_rpsco_plan2-WLP09 + wa_rpsco_plan2-WLP10 + wa_rpsco_plan2-WLP11 + wa_rpsco_plan2-WLP12 + wa_rpsco_plan2-WLP13 + wa_rpsco_plan2-WLP14 +
                          wa_rpsco_plan2-WLP15 + wa_rpsco_plan2-WLP16 .


     endloop.


   wa_prps-plan = lv_plan.

  MODIFY it_prps FROM wa_prps TRANSPORTING plan.


  REFRESH  : it_rpsco_plan2.

  clear : lv_plan,wa_afvc, wa_rpsco_plan1.


endloop.


*************************************************************************************************************************************

i have checked it, its working fine for me , any doubts get back to me...

regards

vinay reddy