cancel
Showing results for 
Search instead for 
Did you mean: 

copy planned cost to estimated cost in work order

former_member199302
Participant
0 Kudos

hi experiment ,


i have requirement to copy planned cost to estimated cost in the save  work order  please help me to get user exit and function module to get this

i have add this requirment and deleted because it a same in another post but i have to mention here http://scn.sap.com/thread/2079395?start=0&tstart=0

to know is the reply in this post is true or not please advise

best regards Sadin

Accepted Solutions (1)

Accepted Solutions (1)

peter_atkin
Active Contributor
0 Kudos

Sadin,

I know it can be done in user-exit IWO10009 because we have done it on a previous project

What you need to do is:

  1. In IWO10009 you need to force a "Determine Costs" function. Get your ABAPers to debug the way the standard program does this via the IW31/2 button (looks like a calculator on the order header).
  2. Then you need to retrieve the cost data from memory - it'll be the one of the PMCO tables in probably in program SAPLICO1.
  3. Put the data into the Estimated Cost field (CAUFVD-USER4). Note this can be done before or after release.

PeteA

marc_marco
Contributor
0 Kudos

Sadin Hello,

In user exit IW0009 you first need to  trigger  “determine cost”  as pointed out by Pete this can be done by FM : CK_F_ORDER_COSTING

and then try to call as  the FM suggested by Jogeswara : PM_WORKORDER_COSTS_LIST which will be by then updated with the plan cost updated value.

Regards,

Ziv

former_member647955
Participant
0 Kudos

Hello Pete,

I am Hadi, we have similar issue like the one in this thread and I am checking on the solution you provided.

I have question on step number 3: Put the data into the Estimated Cost Field (CAUFVD-USER4). I see that user exit  IWO10009 has only importing parameter CAUFVD_IMP but no Exporting parameter. So I thought that we can't pass out the value of Estimate Cost Field to the outside of user exit.

When I try to populate CAUFVD_IMP-USER4 with the value, it doesn't set the Estimated Cost Field

Also when I try to populate CAUFVD-USER4 (global variable which is accessible from IWO10009), it still doesn't set the Estimate Cost Field.

Could you please advise on how to technically do the step number 3 above?

Thanks a lot and appreciate your feedback.

Regards

Hadi

former_member647955
Participant
0 Kudos

Hi All,


I found the way to force update work order header change using following code:


CALL FUNCTION 'CO_IH_SET_HEADER'    

     EXPORTING       CAUFVD_IMP = CAUFVD_IMP.

PERFORM HEADER_UPDATE(SAPLCOIH).


It's explained in following thread https://scn.sap.com/thread/3697460


Regards

Hadi

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Wadi,

It's nice to give some feedback about knowledge. But.....

It will be useful ONLY if you give the working code to do the same. The code you suggested is a part of which I suggested in a different context in the thread referred by you. The use of the same fm in this context has some issues. So it will be helpful if you share the working code which you might have already tested. Also you need to specify where you've used this suggested fm (in some user-exit like IWO10009).

I am sure you'd agree when I say, ''When we are posting in a closed thread, the post should be a complete solution. If it is not so, it will become a question again to members.''.

Regards

KJogeswaraRao

Answers (3)

Answers (3)

former_member199302
Participant
0 Kudos

dear experiment ,

thanks for all reply it's very useful and helpful i appreciate all your efforts

best regards Sadin

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Sadin,

You have referred a thread, where the emphasis is on the Tcode i.e., IW31 means the requirement was during Create Order. This makes the things complicated. This requirement indicates that the user will Release the Order at the time of creation itself. Because only then the Planned Costs will be calculated. Means  the code in the user-exit (IWO10009) needs to retrieve the costs at the time of Order Release event and before Save event. Means Order number is not yet available. Without Order number retrieving the planned costs at run time is a difficult task. For this ABAPer uses Field symbols and Assign etc.

Now a reply in the referred thread was helpful enough to tell about the fm she has used to retrieve the Planned Costs. i.e, PM_WORKORDER_COSTS_LIST. But I'm unable to get the results using this fm. (Possible that I'm doing some mistake, which will not be the case when expert ABAPers works on this).

Replies like 'We have used and Contact your ABAPer'. are of no use. At least what is the fm used OR what is the table used to retrieve the Planned costs etc should be mentioned. Also the main point should be touched upon while replying to this thread, i.e., whether we are talking about IW32 or IW31.

Also it is assumed that your requirement is IW31, because your referred thread says so.  If it is the case of IW32 things would be simpler. Means you have created the Order and Saved. And run IW32 and Released the Order, when the Estimated Costs field will be updated. In this case you can make use of user-exit IWO10002 also (IWO10009 also is an option).


As I mentioned the problem is to retrieve the Planned costs, because only above fm is a way of doing it. Even it is not that easy to retrieve from PMCO table (in case of IW32).

Once the planned costs issue is solved then updating the Estimated cost field is not an issue at all. I would have given you the full code, had I succeeded in making one in last few hours.

Perhaps the above narration will be good guidelines for your ABAPer. Show it to him.

Best of luck

KJogeswaraRao

Former Member
0 Kudos

Hi Sadin,

Yes, you can refer the post.very useful.

Also  Activate LOG_EAM_OLC business function to copy Estimated cost from Planned cost.

Once the order is released the Estimated Cost field is no longer editable.

We have copied the Planned Cost at order release into the Estimated Cost field via user-exit IWO10009 or IWO10002.

Take help from ABAP team and develop logic.

Regards

Vivek

former_member199302
Participant
0 Kudos

dear Vivek ,


thanks alot for reply and help answer i have check with my abap for this


best regards Sadin