2006 Jul 17 4:12 AM
Hi all,
i need create service order for existing service notifications (like transaction IW34). I have already used bapi BAPI_ALM_ORDER_MAINTAIN to create service order, but i dont know link or connecting the generated order with the notification.
Please let me know Is there any process to do this ??
Best Regards,
Daniel Pinto
This is realy good one
[Solved] BAPI to create service order through notification
And remember it is important that in lt_methods line with save were at the end.
This is my code
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods>.
<ls_methods>-refnumber = '000001'.
<ls_methods>-objecttype = zcl_tm1_constants=>cs_order_methods-objecttype-oper.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-method-create.
<ls_methods>-objectkey = lv_aufnr.
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods>.
<ls_methods>-refnumber = '000001'.
<ls_methods>-objecttype = zcl_tm1_constants=>cs_order_methods-objecttype-head.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-objecttype-notif.
CONCATENATE lv_aufnr iv_notif_no INTO <ls_methods>-objectkey .
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods> .
<ls_methods>-refnumber = '000001'.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-method-save.
<ls_methods>-objectkey = lv_aufnr.
"header
APPEND INITIAL LINE TO lt_maint_header ASSIGNING FIELD-SYMBOL(<ls_maint_header>).
<ls_maint_header>-order_type = iv_order_type.
<ls_maint_header>-start_date = lv_beg_date.
<ls_maint_header>-finish_date = lv_fin_date.
<ls_maint_header>-basicstart = iv_beg_time.
<ls_maint_header>-basic_fin = iv_fin_time.
<ls_maint_header>-mn_wk_ctr = iv_main_work_center.
<ls_maint_header>-plant = iv_main_work.
<ls_maint_header>-planplant = iv_planning_plant.
<ls_maint_header>-notif_no = iv_notif_no.
<ls_maint_header>-notif_type = iv_notif_type.
"operations
APPEND INITIAL LINE TO lt_operation ASSIGNING FIELD-SYMBOL(<ls_operations>).
<ls_operations>-control_key = iv_control_key.
<ls_operations>-number_of_capacities = iv_no_of_cap.
<ls_operations>-un_work = iv_unit_of_work.
<ls_operations>-duration_normal_unit = iv_normal_duration.
<ls_operations>-work_activity = iv_work_involved.
<ls_operations>-description = iv_operation_txt.
<ls_operations>-activity = '0010'.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods " BAPI structure: Processing methods
it_header = lt_maint_header
* it_component = lt_component
it_operation = lt_operation
return = lt_return
et_numbers = et_numbers. " Return Parameter(s)
2006 Jul 17 4:34 AM
Hi Daniel,
Go through the Function Module present in the link,
http://help.sap.com/saphelp_47x200/helpdata/en/c6/893f0f449311d1893e0000e8323c4f/frameset.htm
Regards,
Azaz Ali.
2006 Jul 17 4:46 AM
2006 Jul 17 2:24 PM
Hi Azaz,
Thanks for you reply, but i dont look bapi to order confirmation. I am looking bapi or FM to create Notification order. Please tell me if the bapi BAPI_ALM_CONF_CREATE just do it. Please, give me an example.
Best regards,
Daniel Pinto
2006 Jul 17 3:24 PM
Hi Daniel,
Have you looked FM IWOL_CREATE_NOTIF_FROM_ORDER?
CALL FUNCTION 'IWOL_CREATE_NOTIF_FROM_ORDER'
EXPORTING
I_AUFNR = CAUFVD-AUFNR
I_MAINTPL = 'X'
IMPORTING
E_QMNUM = CAUFVD-QMNUM
EXCEPTIONS
OTHERS = 0.Regards,
Ferry Lianto
2006 Jul 17 3:47 PM
Hi Ferry,
Thanks for you reply.
This FM need a order to create a notification, but I have the opposite case: I have a notification, then i need create service order for it. (like t-code IW34).
Best regards,
Daniel Pinto
2006 Jul 17 7:01 PM
Hi Daniel,
Please try FM CO_IH_ORDER_GENER_2.
CALL FUNCTION 'CO_IH_ORDER_GENER_2'
EXPORTING
AUART = RIWO00-AUART
GEWRK = VIQMEL-ARBPL
GEWRK_OBJTY = VIQMEL-CROBJTY
VIQMEL_I = VIQMEL
IMPORTING
AUFNR = VIQMEL-AUFNR.Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2007 Jun 05 2:54 PM
Hi,
I have a notification, then i need create order for it.
here i am using the below FM. i getting error INVALID_NOTIFICATION. if we are passing notification numer (QMNUM ) in the structure VIQMEL.
CALL FUNCTION 'CO_IH_ORDER_GENER_2'
EXPORTING
AUART = RIWO00-AUART
GEWRK = VIQMEL-ARBPL
GEWRK_OBJTY = VIQMEL-CROBJTY
VIQMEL_I = VIQMEL
IMPORTING
AUFNR = VIQMEL-AUFNR.
Please let me know Is there any process to do this ??
2010 Nov 05 7:27 AM
Hi All,
I got the same problem here. But the FM CO_IH_ORDER_GENER_2 is used to create an order including the notification. I have the case where i have create a notification and then I want to convert it to an order. Any suggestion for the FM or BAPI? Or is it using BDC programming is the only option?
Thanks,
Gilang
2015 Dec 29 10:22 AM
This is realy good one
[Solved]&nbsp;BAPI to create service order through notification
And remember it is important that in lt_methods line with save were at the end.
This is my code
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods>.
<ls_methods>-refnumber = '000001'.
<ls_methods>-objecttype = zcl_tm1_constants=>cs_order_methods-objecttype-oper.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-method-create.
<ls_methods>-objectkey = lv_aufnr.
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods>.
<ls_methods>-refnumber = '000001'.
<ls_methods>-objecttype = zcl_tm1_constants=>cs_order_methods-objecttype-head.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-objecttype-notif.
CONCATENATE lv_aufnr iv_notif_no INTO <ls_methods>-objectkey .
APPEND INITIAL LINE TO lt_methods ASSIGNING <ls_methods> .
<ls_methods>-refnumber = '000001'.
<ls_methods>-method = zcl_tm1_constants=>cs_order_methods-method-save.
<ls_methods>-objectkey = lv_aufnr.
"header
APPEND INITIAL LINE TO lt_maint_header ASSIGNING FIELD-SYMBOL(<ls_maint_header>).
<ls_maint_header>-order_type = iv_order_type.
<ls_maint_header>-start_date = lv_beg_date.
<ls_maint_header>-finish_date = lv_fin_date.
<ls_maint_header>-basicstart = iv_beg_time.
<ls_maint_header>-basic_fin = iv_fin_time.
<ls_maint_header>-mn_wk_ctr = iv_main_work_center.
<ls_maint_header>-plant = iv_main_work.
<ls_maint_header>-planplant = iv_planning_plant.
<ls_maint_header>-notif_no = iv_notif_no.
<ls_maint_header>-notif_type = iv_notif_type.
"operations
APPEND INITIAL LINE TO lt_operation ASSIGNING FIELD-SYMBOL(<ls_operations>).
<ls_operations>-control_key = iv_control_key.
<ls_operations>-number_of_capacities = iv_no_of_cap.
<ls_operations>-un_work = iv_unit_of_work.
<ls_operations>-duration_normal_unit = iv_normal_duration.
<ls_operations>-work_activity = iv_work_involved.
<ls_operations>-description = iv_operation_txt.
<ls_operations>-activity = '0010'.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods " BAPI structure: Processing methods
it_header = lt_maint_header
* it_component = lt_component
it_operation = lt_operation
return = lt_return
et_numbers = et_numbers. " Return Parameter(s)
2021 Oct 26 5:45 PM
Hello, sorry for bring back this old post, but i hope this helps somebody with the same issue...
BAPI_ALM_ORDER_MAINTAIN will do the job.
The creation of a PM order linked to a notification is really simple, if you know the commands to populate
IT_METHODS.
To do this, you must use the "new object code" %00000000001 followed by the notification number but populating all the 12 characters:

In my case the notification number is 10000786.
Don't forget the SAVE method.
Next you need to populate the header, and at least one operation, remember to include the %00000000001 in the
ORDER_ID field. (IT_HEADER)
Also put the notification number in the
NOTIF_NO field, but this time without the left zeroes. (10000786 in my case)
Next i used the following sequence to doit all in SE37:

"X" to Commit and "X" to DEQUEQUE_ALL.
That will do the job.
Result:

Hope it helps to someone.
Sorry for my bad english
Cheers!
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |