03-18-2009 4:30 PM
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
03-19-2009 2:54 PM
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
03-19-2009 2:54 PM
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
03-19-2009 2:56 PM
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
03-19-2009 3:19 PM
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
03-19-2009 3:54 PM
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
03-20-2009 7:08 AM
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
03-20-2009 11:26 AM
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