on 09-07-2014 10:38 PM
Hello experts, I have created a Workflow with the following steps:
For a Maintenance Order
- Trigger when BUS2007 Event:Created is reached
- User Decision: Approval/Rejected Maintenance Order
Now, I need if I choose Approval, the Maintenance Order is released automatically.
What do you do this?
Thank in advance for your help.
Hello,
Assuming you know how to release a Maintenance Order in SAP, you have to add a Release method to BUS2007 (by creating a subobject and delegating to it). Then create a TS task to call that method. Finally, create a step in your workflow to call that task.
regards
Rick Bakker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I don't know it off the top of my head either - that's not really a workflow question. You would face the same problem if trying to do it in ABAP.
Maybe someone else here knows the FM or you could find the answer in another forum by searching SCN (best to use Google for this).
regards
Rick Bakker
Sorry, I tried and I couldn´t. Show this screen the program. I know, i have to fill but I am trying and I got only errors.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
BEGIN OF KEY,
NUMBER LIKE AUFK-AUFNR,
END OF KEY,
_AUFK LIKE AUFK.
END_DATA OBJECT. " Do not change.. DATA is generated
BEGIN_METHOD REL_MO3 CHANGING CONTAINER.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
EXPORTING
IV_MMSRV_EXTERNAL_MAINTENACE =
TABLES
EXTENSION_IN =
RETURN =
ET_NUMBERS =
IT_REFORDER_ITEM =
IT_REFORDER_ITEM_UP =
IT_REFORDER_SERNO_OLIST_INS =
IT_REFORDER_SERNO_OLIST_DEL =
IT_PRT =
IT_PRT_UP =
IT_REFORDER_OPERATION =
IT_SERVICEOUTLINE =
IT_SERVICEOUTLINE_UP =
IT_SERVICELINES =
IT_SERVICELINES_UP =
IT_SERVICELIMIT =
IT_SERVICELIMIT_UP =
IT_SERVICECONTRACTLIMITS =
IT_SERVICECONTRACTLIMITS_UP =
ET_NOTIFICATION_NUMBERS =
IT_PERMIT =
IT_PERMIT_UP =
IT_PERMIT_ISSUE =
IT_METHODS =
IT_HEADER =
IT_HEADER_UP =
IT_HEADER_SRV =
IT_HEADER_SRV_UP =
IT_USERSTATUS =
IT_PARTNER =
IT_PARTNER_UP =
IT_OPERATION =
IT_OPERATION_UP =
IT_RELATION =
IT_RELATION_UP =
IT_COMPONENT =
IT_COMPONENT_UP =
IT_OBJECTLIST =
IT_OBJECTLIST_UP =
IT_OLIST_RELATION =
IT_TEXT =
IT_TEXT_LINES =
IT_SRULE =
IT_SRULE_UP =
IT_TASKLISTS =
EXCEPTIONS
OTHERS = 01.
CASE SY-SUBRC.
WHEN 0. " OK
WHEN OTHERS. " to be implemented
ENDCASE.
END_METHOD.
Hi,
Did you actually look at the sample code that I suggested?
It's pretty simple! OK, let me post it here for you.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = ls_result-aufnr
IMPORTING
output = lv_aufnr.
* fill methods to prepare for BAPI
ls_methods-refnumber = '000000'.
ls_methods-objecttype = 'HEADER'.
ls_methods-method = 'RELEASE'.
ls_methods-objectkey = ls_result-aufnr.
APPEND ls_methods TO lt_methods.
CLEAR ls_methods.
ls_methods-method = 'SAVE'.
APPEND ls_methods TO lt_methods.
* set status to Released
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
return = lt_return.
cheers
Paul
Hi Cristian ,
You dont need to worry , you can learn ABAP !!!
You are getting this error as you have not implimented the method which you have created .
Follow these steps .
Step 1 . Go to EDIT >> CHANGE RELEASE STATUS > IMPLIMENT
Now Release the same method .
Step 2. Write this code inside the method .
DATA : lt_methods TYPE STANDARD TABLE OF bapi_alm_order_method ,
ls_methods TYPE bapi_alm_order_method,
lt_return TYPE STANDARD TABLE OF bapiret2 ,
lv_aufnr TYPE aufnr .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = object-key-number
IMPORTING
output = lv_aufnr.
* fill methods to prepare for BAPI
ls_methods-refnumber = '000000'.
ls_methods-objecttype = 'HEADER'.
ls_methods-method = 'RELEASE'.
ls_methods-objectkey = lv_aufnr.
APPEND ls_methods TO lt_methods.
CLEAR ls_methods.
ls_methods-method = 'SAVE'.
APPEND ls_methods TO lt_methods.
* set status to Released
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
return = lt_return.
Step 3. Now save and generate the Method and the custom BOR .
It should work .
All the best .
Regards ,
Ashish Gaur .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cristian ,
What I understand is you want to release the maintenance order using workflow approval process .
Steps :
1.In workflow header > start event use object type and link this with event .
2.use user decision activity step .
3.Delegate the BUS2007 and add a method in which write the code to release the maintenance order as suggeted by Paul use 'BAPI_ALM_ORDER_MAINTAIN' . Here use OBJECT-KEY-NUMBER as the maintenance order no .
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Everybody wants to help you (look at the number of replies!), but you're not making it easy.
It's like you are asking for driving directions ('how do I get to the beach?'), but it turns out you don't know how to drive ('how do I start the car?').
Time to crack open a book and learn a bit of basic ABAP. Luckily it's not too difficult.
good luck
Paul
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.