2008 Oct 01 10:26 AM
Dear Guru's,
Is there any solutions for this. ????
I want to assign the service order ( iw32 ) while creating a service notification ( iw52 ).
I ahave tried with BAPI_ALM_NOTIF_CREATE ,
By passing ORDERID = service order
Notification type : 'Z1'.
Filled up notification header data , Partner data and longtext data .
I am able to to a notification number.
Then i am using BAPI_SERVNOT_SAVE BY PASSING notification header_exp - notif no.
After this function module ( BAPI_SERVNOT_SAVE ) , notification number. is getting cleared.
,
Have also tried with BAPI_TRANSACTION_COMMIT. .
There is no error message also appering.
It is not getting stored in DB.
Can any body will tell the paraneters to be filled for the BAPI's.
Regards,
Amitav
Dear Guru's,
Is there any solutions for this. ????
I want to assign the service order ( iw32 ) while creating a service notification ( iw52 ).
I ahave tried with BAPI_ALM_NOTIF_CREATE ,
By passing ORDERID = service order
Notification type : 'Z1'.
Filled up notification header data , Partner data and longtext data .
I am able to to a notification number.
Then i am using BAPI_SERVNOT_SAVE BY PASSING notification header_exp - notif no.
After this function module ( BAPI_SERVNOT_SAVE ) , notification number. is getting cleared.
,
Have also tried with BAPI_TRANSACTION_COMMIT. .
There is no error message also appering.
It is not getting stored in DB.
Can any body will tell the paraneters to be filled for the BAPI's.
Regards,
Amitav
2008 Oct 01 11:48 AM
Here's the code I used. Unfortunately - I don't have the code for the Z_BAPI, I think it was close to BAPI_ALM_NOTIF_CREATE. I can't remember what I changed. If you have questions, I can look at it in more detail.
I also created the order. I can add that code if you like.
Michelle
clear: i_userinfo, i_methods, i_return, i_header, i_operations, i_numbers.
refresh: i_userinfo, i_methods, i_return, i_header, i_operations, i_numbers.
data: error(1),
w_tplnr type iloa-tplnr.
error = 'N'.
set up tracking table
st_output-assettag = assettag.
st_output-personname = personname.
st_output-pmtype = pmtype.
st_output-priority = priority.
st_output-shortdescription = shortdescription.
st_output-datum = sy-datum.
st_output-UZEIT = sy-UZEIT.
insert the new data into the tracking table
insert ztrackinput from st_output.
w_number = assettag.
im_assettag = w_number.
im_personname = personname.
im_pmtype = pmtype.
im_description = shortdescription.
im_priority = priority.
Check Asset Tag
select single anln1 into anlh-anln1
from anlh
where anln1 = im_assettag.
if sy-subrc <> 0.
concatenate '1 - Asset' im_assettag 'Not Found' into
E_ERRNUMBER separated by space.
error = 'Y'.
endif.
if error <> 'Y'.
Check maintenance type
select maintype into zpmtype-maintype
from zpmtype
where maintype = im_pmtype.
endselect.
if sy-subrc <> 0.
im_pmtype = 'MECHANICAL'.
endif.
TRANSLATE im_priority TO UPPER CASE.
case im_priority.
when 'HIGH'.
scmgattr_priot-PRIORITY = '2'.
when 'LOW'.
scmgattr_priot-PRIORITY = '4'.
when 'MEDUIM'.
scmgattr_priot-PRIORITY = '3'.
when 'VERY HIGH'.
scmgattr_priot-PRIORITY = '1'.
when others.
scmgattr_priot-PRIORITY = '3'.
endcase.
Check priority
*select PRIORITY description into (scmgattr_priot-PRIORITY, scmgattr_priot-description)
from scmgattr_priot
where description = im_priority and
langu = 'EN'.
endselect.
*if sy-subrc <> 0.
*scmgattr_priot-PRIORITY = '2'.
*endif.
Get the functional location
select tplnr into iloa-tplnr from iloa
where ANLNR = im_assettag.
if not iloa-tplnr is initial .
w_tplnr = iloa-tplnr.
endif.
endselect.
iloa-tplnr = w_tplnr.
if not iloa-tplnr is initial .
notifhead-funct_loc = iloa-tplnr.
notifhead-short_text = im_description.
notiftype = 'M1'.
notifhead-funct_loc = iloa-tplnr.
notifhead-short_text = im_description.
notiftype = 'M1'.
CALL FUNCTION 'Z_BAPI_NOTIF_CREATE'
EXPORTING
NOTIF_TYPE = notiftype
NOTIFHEADER = notifhead
TASK_DETERMINATION = ' '
SENDER =
ORDERID =
IMPORTING
NOTIFHEADER_EXPORT = ex_notifheader
TABLES
NOTITEM =
NOTIFCAUS =
NOTIFACTV =
NOTIFTASK =
NOTIFPARTNR =
LONGTEXTS =
KEY_RELATIONSHIPS =
RETURN =
.
if sy-subrc <> 0.
E_ERRNUMBER = '200 - Notification not created'.
else.
E_NOTIFNO = ex_notifheader-NOTIF_NO.
endif.
2008 Oct 01 7:55 PM
Hi,
Consider creating the notification with the order -see this wiki link:
https://wiki.sdn.sap.com/wiki/display/ERPLO/UsingBAPI_ALM_ORDER_MAINTAINmethod+CREATETONOTIF
-Paul
Please use [Enterprise Asset Management (EAM)|; forum for PM/CS specific topics
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |