10-20-2008 7:30 AM
Hi experts,
when i want to add notification in IW 21 tcode for that i am using this
BAPI_ALM_NOTIF_DATA_ADD but it's not woking . any one send me sample code for that .
thank you for advance.
with best regards
vas
10-20-2008 7:32 AM
Hi
What is the error your getting when using that BAPI?
Regards,
Vishwa.
10-20-2008 11:22 AM
Hi,
you can use these FM's ALM_PM_NOTIFICATION_CREATE , ALM_PM_NOTIFICATION_SAVE and BAPI_TRANSACTION_COMMIT to create entries in IW21
See this sample code.
&----
*& Report Z94406_BAPI_ASSIGNMENT
*&
&----
*&
*&
&----
DATA : ITAB TYPE BAPI2080_NOTHDRI,
NOTNO LIKE BAPI2080_NOTHDRE-NOTIF_NO,
NOTIF LIKE BAPI2080-NOTIF_TYPE,
p_filename TYPE STRING,
notifheader_export TYPE BAPI2080_NOTHDRE,
notifheader TYPE BAPI2080_NOTHDRE,
RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE,
RETURN1 TYPE TABLE OF BAPIRET2 WITH HEADER LINE,
RETURN2 TYPE BAPIRET2,
MSG TYPE BAPIRET2-MESSAGE,
TYP TYPE BAPIRET2-TYPE.
DATA: BEGIN OF DATA_TAB OCCURS 0,
notype TYPE QMEL-QMART,
txt TYPE QMEL-QMTXT,
floc TYPE IFLOT-TPLNR,
END OF DATA_TAB.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETERS : p_file TYPE RLGRAP-filename.
SELECTION-SCREEN END OF BLOCK b1.
P_FILENAME = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = P_FILENAME
filetype = 'ASC'
has_field_separator = '#'
TABLES
data_tab = DATA_TAB
.
LOOP AT DATA_TAB.
NOTIF = DATA_TAB-NOTYPE.
ITAB-FUNCT_LOC = DATA_TAB-FLOC.
ITAB-SHORT_TEXT = DATA_TAB-TXT.
CALL FUNCTION 'ALM_PM_NOTIFICATION_CREATE'*
EXPORTING
notif_type = NOTIF
notifheader = ITAB
SENDER = SENDER
ORDERID = ORDERID
IMPORTING
notifheader_export = NOTIFHEADER_EXPORT
TABLES
NOTITEM = NOTITEM
NOTIFCAUS = NOTIFCAUS
NOTIFACTV = NOTIFACTV
NOTIFTASK = NOTIFTASK
NOTIFPARTNR = NOTIFPARTNR
LONGTEXTS = LONGTEXTS
KEY_RELATIONSHIPS = KEY_RELATIONSHIPS
return = RETURN
.
IF RETURN IS NOT INITIAL.
MSG = RETURN-MESSAGE.
TYP = RETURN-TYPE.
MESSAGE MSG TYPE 'I'.
ELSE.
CALL FUNCTION 'ALM_PM_NOTIFICATION_SAVE'
EXPORTING
number = NOTIFHEADER_EXPORT-NOTIF_NO
IMPORTING
notifheader = NOTIFHEADER
TABLES
return = RETURN1.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = RETURN2.
ENDIF.
ENDLOOP .
IF RETURN IS INITIAL.
message 'The Notification is created' type 'I'.
endif.
****************************
Hope it helps.
Regards,
Syed
10-20-2008 12:59 PM
Hi
Thank you for reply
ok . In that i want to upload (add ) analysis data only. rest of i am using through recording. for adding some respect record through orcal database. for that how will i write code.
thanks and regards
vas
10-21-2008 11:36 AM