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: 

Component Allocation in Routing using EWB

Former Member
0 Kudos

Dear Masters

I have some difficulties in using EWB for Component Allocation in Routing

For 1 week, I have test and explore and finally i can delete previous Component Allocation then Create a new one

(In this requirement basically the BoM save cost center number in SORTF Field, so the program intended to automatically link to the Operation with this Cost Center)

When I allocate those BoM to Operation via CA02 it was perfect,the FM CP_CC_S_PROVIDE_COM_BY_OPR succesfuly Export the E_COM_CLASS_DATA

However when I have successfuly allocate BoM via FM CP_CC_S_CREATE_COM, the next time when i want to retrieve the component allocation via CP_CC_S_PROVIDE_COM_BY_OPR was empty

When I compare the manual allocation via CA02 and automatic allocation via this ABAP Program (Attached) In Table PLMZ, the main difference is the allocation via CA02 filled the PLMZ-ZAEHL, and this Program didn't.

I have tried filling the I_COM_CLASS_DATA-ZAEHL before CP_CC_S_CREATE_COM but it didn't work.

Do you have any solution?

Much Thanks for the help

(Sorry for the messed up Coding)

13 REPLIES 13

ŁukaszPęgiel
Contributor
0 Kudos

Wendi,

I see you used my coding as a base but although at my installation ZAEHL is also filled always with 1, it does not give any problems in retrieving components allocation with CP_CC_S_PROVIDE_COM_BY_OPR. Additionally if the data is in PLMZ table then I don't see reason why you cannot fetch it. Does CA02 and CEWB shows allocation correctly after you use your program? If yes then you must debug your program in order to see whether you passing correctly all parameters.

Cheers

Łukasz

0 Kudos

Dear Lukasz,

I think if I didn't pass parameter correctly, the Components wouldn't be fetched when I first get those Components to be deleted right?
Yes, it does shows allocation correctly in CA02

And honestly I don't know how to use CEWB

So, the Internal Counter supposed to be 1 all the time then

What did you do at your item_check and recursive_item_check?

My requirement is not multi level BOM so I think these FMs are personal requirement so I didn't read it at all

Thanks,

Wendi

0 Kudos

If it show items correctly on CA02 then it means it work correctly. When you re-run your program does it read components allocation then?

In item_check and recursive_item_check I do some calculation for multilevel assignment, but if you don't use it then probably you can omit this part.

0 Kudos

That's the main problem, it doesn't read components allocation although in the table PLMZ the allocation exist

When I checked table PLMZ, the only difference for the allocation via CA02 and CP_CC_S_CREATE_COM was the Internal Counter

Then you say that Internal Counter is correct already

So, I really don't know why the Component is not fetched.

By the way have you try to compile my code?
did it work well in your system?

Message was edited by: Wendi Gunawan

0 Kudos

No I haven't try to compile your code. Sorry. Have you debugged ?

0 Kudos

I Have debugged many times but i still confused at this CP_CC_S_PROVIDE_COM_BY_OPR function.

In the end I Surrender and use BDC instead.

I'll try to find the solution if I have time to

0 Kudos

Dear all,

I have the same/similar problem with this program,  I can create the component allocations and all looks well in CA02, however in PLMZ ZAEHL is always filled with 1.

If I run the program again, it locks up during the call to CP_CC_S_PROVIDE_COM_BY_OPR.  The same seems to happen in CEWB.

If I delete the allocations in CA02 and try again, the program loads once more, but again fills ZAEHL with 1.

I debugged the create process and tracked it down to line 70 in CM_CL_COM_KEY_PROVIDE where it makes ZAEHL always 1.

    G_COM_KEY-ZAEHL_PLMZ = 1


I do not know the implication of this issue further down the line and the client wants me to load component allocation now.


Note in CA02 when you create an allocation ZAEHL is filled with a internal counter so each one is different.  This seems to be what is causing CP_CC_S_PROVIDE_COM_BY_OPR to freeze when retrieving the operation details


Can you advise?

Many Thanks

Phil

0 Kudos

Try to use FM CP_CC_S_REFRESH_DATA at the beginning, maybe it's only problem of buffer.

0 Kudos

Hi Lukasz,  Many thanks for your reply.

To test this I implemented it after   CP_CC_S_LOAD_COMPLEX_BY_TSK otherwise it complains of no work area. I then repeated   CP_CC_S_LOAD_COMPLEX_BY_TSK after as it clears.  (probably a better way but this was quick)

This made no improvement, it still locks up during CP_CC_S_PROVIDE_COM_BY_OPR.  It just shows "Loading Component Assignments" on screen until it times out eventually.

I can only imagine it is related to the 1 in ZAEHL but could be something else.  Do you have any comments on that?

Any other suggestions?

Regards

Phil

0 Kudos

Just catch the sy-subrc and do nothhing if he complains, no need to load data twice.

I had never problem with ZAEHL although I've noticed that from beginning that it does set 1 always there. I know it's not easy there but I'd debug  CP_CC_S_PROVIDE_COM_BY_OPR till I'll get the point in which this is locking.  Maybe this document will help you to make it faster

0 Kudos

Hi Lukasz,

So I made a modification to the program that updates ZAEHL after the commit to the correct value.  Unfortunately this did not resolve the issue as it still freezes if there is already an allocation in that routing.

looks like I have a long debug ahead to find this or just use CA02 to delete everything before loading.

Many thanks for your help.

If you have any further ideas, I'd be happy to received.

Best Wishes

Phil

0 Kudos

I would not update ZAEHL directly as my experience show that this cause no problem in the system. I use that code all the time on production system and I don't have the problem at all with deleting existing allocation. Must be something connected to your system or data. Maybe there are some OSS note for that?

0 Kudos

Yes agreed, that was just a test to see if it resolves the issue.  it doesnt.

I now think there is something wrong in the system as CEWB seems to be locking up too.  One of my colleagues is looking at that,

Many thanks for your help

Phil