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: 

BAPI_ALM_ORDER_MAINTAIN to create Operation

Former Member
0 Kudos

Hi,

I am using BAPI_ALM_ORDER_MAINTAIN to create Operation for an existing order.

As of now am hard coding the available Activity number while creating a new operation.

How can I get the available Activity numbers dynamically or is there any function module or table which contains tha available Activity number for an Order so that i can pass it to my above FM?

IT_OPERATION-ACTIVITY = '0470'. -


> here i have to pass the available Activity

IT_OPERATION-CONTROL_KEY = 'PM01'.

IT_OPERATION-PLANT = '0100'.

IT_OPERATION-DESCRIPTION = 'Description'.

IT_OPERATION-LANGU = 'E'.

APPEND IT_OPERATION.

Thanks & Regards,

Adithya M.

Edited by: Mahadas Adithya on Mar 19, 2009 3:48 PM

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos

check AFVC - VORNR

Ok check the database view: VIAUFK_AFVC hit it with AUFNR , AUFPL , APLZL , TPLNR/ STRNO

Edited by: J@Y on Mar 19, 2009 10:57 AM

6 REPLIES 6

former_member156446
Active Contributor
0 Kudos

check AFVC - VORNR

Ok check the database view: VIAUFK_AFVC hit it with AUFNR , AUFPL , APLZL , TPLNR/ STRNO

Edited by: J@Y on Mar 19, 2009 10:57 AM

raymond_giuseppi
Active Contributor
0 Kudos

Did you call BAPI_ALM_ORDER_GET_DETAIL before trying to change the order, so you would

- Get the data you required (in Et_Operations)

- Don't have to map most of the data into BAPI parameters

Regards

0 Kudos

Hi Raymond,

The FM BAPI_ALM_ORDER_GET_DETAIL gives only the existing operations for an order. It does't give the Operations which are deleted. So we can't get the accurate next available Operation by seeing the operation details from this BAPI.

Ex:- In my case my Order has 0010, 0020 operations & operation 0030 is deleted. So by using the above bapi i am getting the two existing operations(0010 & 0020). So from that data if i consider next sequential available operation as 0030.... i may go wrong as it has been already used but deleted.

Can you please suggest how to handle this case?

Thanks & Regards,

Adithya M

0 Kudos

you can select the max operation from VIAUF_AFVC

and add 10 to that.

also deleted operations are visible in this table when you select on order number

kind regards

arthur de smidt

Edited by: A. de Smidt on Mar 19, 2009 4:55 PM

0 Kudos

Trying to call BAPI_ALM_OPERATION_GET_DETAIL before storing the new operation number and analyzing the return table may help (different error code for non-existent and deleted operation ?)

Regards

0 Kudos

since you have not marked the question answered I'm curious what more information you need to define the next free operation number ?

perhaps you can also look at IBAPI_ORDER_OPERATION_CREATE

kind regards

arthur