Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Any bapi for t.code IW21

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Hi

What is the error your getting when using that BAPI?

Regards,

Vishwa.

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

thank you for all problem is sloved.

regards

vas