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: 

FM/BAPI to update requirements assignment on a PM order

Former Member
0 Kudos

Hello,

I am working on a project which involves building interfaces between a client's SAP ECC system and a third party scheduling system. The orders are created in SAP, interfaced to the third party, where they assign resources and schedule appointments. Hence we need to build is inbound to SAP, to update the "requirements assignment" tab of PM order operations - transaction IW32.

I have looked at BAPI_ALM_ORDER_MAINTAIN, but this doesn't provide this specific functionality.

Does anyone know if there is any other type of function module which enables this to be created/updated?

The data appears to be stored in table KBED - capacity requirements.

Many thanks in advance,

Peter

12 REPLIES 12

kesavadas_thekkillath
Active Contributor
0 Kudos

Please have a look into the functions available in function group CYBT.

0 Kudos

Many thanks Keshav for pointing me in the right direction.

I have debugged the transaction and the update is done at the end of form SPLITS_UPDATE in include LCY18F02, in FM CO_IT_UPD_SKBD_OF_KBED. However I can't call this FM on its own as it is dependent upon a lot of processing before it e.g. FM CY_BT_KBED_ASSIGN. I have played around with several other CY_BT* FMs and none of them on their own provide all-in-one functionality like a BAPI. It might be easier to write a program which uses call transaction ...

Peter

0 Kudos

Hello Peter,

did you got the full steps how to update resource assignment?

0 Kudos

Hello Peter,

I also have played with almost all the function modules in the group CY_BT*. But none does the job on its own.
I am also very interested in your approach: what did you do to be able to maintain the requirements assignment on for a PM Order?

Regards,

Kamal.

0 Kudos

Hi Peter,

In the same situation here.  Simply need to add split capacity to PM order operations (assign more than one employee to an operation).  What did you end up doing to get this done?

Thanks,

Martin

0 Kudos

hi Peter

I am struggling with the same issue as my predecessor.

We are building Fiori app where user would be able to add person and work to operation.

Any clue which CY_BT* functions to use?

thanks

Bartosz

Former Member
0 Kudos

Hi Peter,

I am also having a similar requirement. So would like to know how have been able to achieve it. If you can share the same, it would be extremely helpful.

Thanks

Balaji

0 Kudos

Hi Balaji,

After lots of search and trials, I have gave up on the function group CY_BT*.

I eventually used direct update on the database tables of the Requirements Assignment.

Using SQL Trace and Runtime Analysis of the transaction IW31/32, I have been able to imitate the standard SAP process for creation, update and deletion and the effect of every scenario on the database tables:

KBED     Capacity Requirements Records

KBEZ      Add. data for table KBED (for indiv. capacities/splits)

KBKO     Header Record for Capacity Requirements

Combine that with locking mechanism, you will get your results.

Just build a Z-'BAPI'. The best cost-benefit balance, as far as I am concerned.

Good luck,

Kamal.

0 Kudos

Hi Kamal,

Thanks for your response. Do you have the code to populate the different fields in these 3 tables? Is it possible for you to send me the sample code please? my email id is balaji.graman@gmail.com

Thanks

Balaji

0 Kudos

Hello Balaji,

It has been a while now!

I am sorry I have missed your (late) post of feb 2015. But even if I had seen it, I wouldn't have been able to reply with the code. The project is delivered and thus no longer have access to the system on which I implemented the solution.

Let me know if you still needed it, I will try to search my docs/usb's...

Regards,

Kamal.

0 Kudos

Hi Kamal,

Thanks for your response. If you can find and send me the same to my email id, that would of great help.

Thanks in advance.

Regards

Balaji

Former Member
0 Kudos

Use  BAPI_REQUIREMENTS_GETDETAIL to get all the details.

     MATERIAL -20 char material

     PLANT - plant

     REQUIREMENTSTYPE - type of requirement

     VERSION  - version number

     REQMTSPLANNUMBER - '  '

     REQUIREMENTS_OUT

     RETURN

Next call the BAPI  BAPI_REQUIREMENTS_CHANGE.

Al the parameters same as above , also pass these additional parameters

      DO_COMMIT                      = 'X'

       UPDATE_MODE                = 'X'

       DELETE_OLD                    = 'X'

REQUIREMENTS_SCHEDULE_IN - to this table pass only those records which need not be deleted.

REQ_QTY , REQ_DATE , DATE_TYPE is required ( Which can be got from requirements_out).

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

      WAIT          =  'X'.