on 2014 Dec 04 7:29 AM
Hello,
I have a requirement where in we need to create an Operation thru a Program Code in a Workflow.
I am using BAPI_ALM_ORDER_MAINTAIN to achieve the requirement, however in the return parameters I am getting errors which says 'Requested function KOER is not available here'
By going thru various post, I checked in to Table T185F, and the entry was there for the FCODE. dont know what the issue is.
can someone help please.
for Reference purpose this is my code.
lv_ops_num = '0030'
ls_header-orderid = object-key-number.
APPEND ls_header TO lt_header.
CLEAR ls_header.
ls_header_up-orderid = abap_true.
APPEND ls_header_up TO lt_header_up.
CLEAR ls_header_up.
ls_operation-activity = lv_ops_num.
ls_operation-control_key = 'PM01'.
ls_operation-work_cntr = 'LINE-AR'.
ls_operation-plant = '1000'.
ls_operation-standard_text_key = 'ED00030'.
* ls_operation-description = 'CU Operation 2'.
APPEND ls_operation TO lt_operation.
CLEAR ls_operation.
ls_operation_up-activity = abap_true.
ls_operation_up-control_key = abap_true.
ls_operation_up-work_cntr = abap_true.
ls_operation_up-plant = abap_true.
ls_operation_up-standard_text_key = abap_true.
* ls_operation_up-description = abap_true.
APPEND ls_operation_up TO lt_operation_up.
CLEAR ls_operation_up.
ls_methods-refnumber = '000001'.
ls_methods-objecttype = 'HEADER'.
ls_methods-method = 'CHANGE'.
ls_methods-objectkey = object-key-number.
APPEND ls_methods TO lt_methods.
CLEAR ls_methods.
ls_methods-refnumber = '000001'.
ls_methods-objecttype = 'OPERATION'.
ls_methods-method = 'CREATE'.
* ls_methods-objectkey = object-key-number.
CONCATENATE object-key-number lv_ops_num INTO ls_methods-objectkey.
APPEND ls_methods TO lt_methods.
CLEAR ls_methods.
ls_methods-refnumber = '000001'.
ls_methods-objecttype = ''.
ls_methods-method = 'SAVE'.
ls_methods-objectkey = object-key-number.
APPEND ls_methods TO lt_methods.
CLEAR ls_methods.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_header = lt_header
it_header_up = lt_header_up
return = return
it_methods = lt_methods
it_operation = lt_operation
it_operation_up = lt_operation_up
EXCEPTIONS
OTHERS = 01.
CASE sy-subrc.
WHEN 0. " OK
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
CALL FUNCTION 'DEQUEUE_ALL'
EXPORTING
_synchron = 'X'.
COMMIT WORK AND WAIT.
WHEN OTHERS. " to be implemented
ENDCASE.
Regards,
Jib
Request clarification before answering.
Hello Jib,
You will be able to get good help in ABAP space. Suggest you to shift this thread there.
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
39 | |
7 | |
5 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.