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: 

Not able to update field in notification thru BAPI's. ??

Former Member
0 Kudos

Hi,

I am trying to update the fields URGRP and URCOD present for F3 and Q3 notification in tcode QM03.

i am using the bapi's in this order but, still not able to update the notification.

BAPI_SERVNOT_MODIFY_DATA

BAPI_SERVNOT_SAVE

BAPI_TRANSACTION_COMMIT

Kindly help.

13 REPLIES 13

Former Member
0 Kudos

Anyone... ???

0 Kudos

Hi,

Are u passing the wait parameter in BAPI_TRANSACTION_COMMIT?

If not then try setting the value of wait parameter to 'X'.It might solve the problem.

Thanks,

Sandeep.

0 Kudos

Nooo..it still is not updating...

0 Kudos

The BAPI...BAPI_SERVNOT_MODIFY_DATA

is also returning that ...

Notification type F3 not defined

???

this probably is the reason why it is not updating..but no idea..

0 Kudos

anyone.....

0 Kudos

Anyone...

0 Kudos

Hi

Your functional consultant can help u, ask him for correct dummy data .

OR

Refer some documents which allredy created in ur system.

coz these errors are based on config settings and possible INPUT values and there combination, which ur functional can clear more.

Regards

Sachin

0 Kudos

I have tried everything possible...

This is code which i have tried...


data: wl_notifheader like BAPI2080_NOTHDRI occurs 0 with header line,
      wl_NOTIFHEADER_X like BAPI2080_NOTHDRI_X occurs 0 with header line,
      wl_notifheader_export like BAPI2080_NOTHDRE.

data: wl_notifitem like BAPI2080_NOTITEMI occurs 0 with header line,
      wl_notifitem_x like BAPI2080_NOTITEMI_X occurs 0 with header line,
      wl_notifcaus like BAPI2080_NOTCAUSI occurs 0 with header line,
      wl_notifcaus_x like BAPI2080_NOTCAUSI_X occurs 0 with header line.

DATA: tl_return       LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
      tl_notifheader like ALM_ME_NOTIF_HEADER,
      tl_notifcause like ALM_ME_NOTIF_CAUSE occurs 0 with header line.

      break-point.

      wl_notifheader-refobjectkey = '000400000020'.
      append wl_notifheader.

      wl_notifheader_x-refobjectkey = 'X'.
      append wl_notifheader_x.

      wl_notifitem-ITEM_KEY = '0001'.
      wl_notifitem_x-item_key = 'X'.
      append wl_notifitem.
      append wl_notifitem_x.

      wl_notifcaus-REFOBJECTKEY = 'QM0004000000200001'.
      wl_notifcaus-CAUSE_CODEGRP = 'ZQ5'.
      wl_notifcaus-CAUSE_CODE = '0020'.
      append wl_notifcaus.

      wl_notifcaus_x-CAUSE_CODEGRP = 'X'.
      wl_notifcaus_x-CAUSE_CODE = 'X'.
      append wl_notifcaus_x.

      break-point.

CALL FUNCTION 'BAPI_SERVNOT_MODIFY_DATA'
  EXPORTING
    number                   = '000400000020'
   NOTIFHEADER              = wl_notifheader
   NOTIFHEADER_X            = wl_notifheader_x
 IMPORTING
   NOTIFHEADER_EXPORT       = wl_notifheader_export
 TABLES
   NOTIFITEM                = wl_notifitem
   NOTIFITEM_X              = wl_notifitem_x
   NOTIFCAUS                = wl_notifcaus
   NOTIFCAUS_X              = wl_notifcaus_x
   RETURN                   = tl_return
          .

CALL FUNCTION 'BAPI_SERVNOT_SAVE'
  EXPORTING
    number            = '000400000020'
 IMPORTING
   NOTIFHEADER       = wl_notifheader_export
 TABLES
   RETURN            = tl_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = 'X'
 IMPORTING
   RETURN        = tl_return.

0 Kudos

In this the table TL_RETURN, says, notification type F3 is not defined.

0 Kudos

Hi

Check the notification type that is used...in notifications in general from the tcode..

Regards,

Vishwa.

0 Kudos

I have tried this bapi also...


DATA: tl_return       LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
      tl_notifheader like ALM_ME_NOTIF_HEADER,
      tl_notifcause like ALM_ME_NOTIF_CAUSE occurs 0 with header line,
      tl_notifitem like ALM_ME_NOTIF_ITEM occurs 0 with header line.

tl_notifitem-NOTIF_NO = '000400000020'.
tl_notifitem-ITEM_KEY = '0001'.
append tl_notifitem.

tl_notifcause-CAUSE_CODEGRP = 'ZQ5'.
tl_notifcause-CAUSE_CODE = '0020'.
append tl_notifcause.
CALL FUNCTION 'ALM_ME_NOTIFICATION_GETDETAIL'
  EXPORTING
    notif_no                       = '000400000020'
 IMPORTING
   NOTIFICATION_HEADER            = tl_notifheader
 TABLES
   NOTIFICATION_ITEM              = tl_notifitem
   NOTIFICATION_CAUSE             = tl_notifcause
   RETURN                         = tl_return
          .

CALL FUNCTION 'ALM_ME_NOTIFICATION_CHANGE'
  EXPORTING
    notif_no                         = '000400000020
   NOTIFICATION_HEADER              = tl_notifheader
 TABLES
   NOTIFICATION_ITEM                = tl_notifitem
   NOTIFICATION_CAUSE               = tl_notifcause
   RETURN                           = tl_Return
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


CALL FUNCTION 'BAPI_SERVNOT_SAVE'
  EXPORTING
    number            = '000400000020'
 TABLES
   RETURN            = tl_return
          .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

 IMPORTING
   RETURN        = tl_return
          .

in this i get TL_RETURN from 'ALM_ME_NOTIFICATION_GETDETAIL' as... "No entry with key F3 in table TQ80".

0 Kudos

Notification type F3 exists.... and i tried with other notifications also.. i am still getting the same thing..... "Notification type XX is not defined ".... :

0 Kudos

Anyone....