Bapi for Notification (Tcode IW51 or IW52)

Berikut ini adalah BAPI yang bisa digunakan untuk service notification.

Create Notification

  call function 'BAPI_SERVNOT_CREATE'
    exporting
*     external_number = external_number
      notif_type         = notif_type
      notifheader        = notifheader
*     task_determination = task_determination
*     sender = sender
*     orderid = orderid
    importing
      notifheader_export = lt_notifheader_export
    tables
      notitem            = notitem
      notifcaus          = notifcaus
      notifactv          = notifactv
      notiftask          = notiftask
      notifpartnr        = notifpartnr
      longtexts          = longtexts
      key_relationships  = key_relationships
      return             = return.


Change Notification

    call function 'BAPI_SERVNOT_MODIFY_DATA'
      exporting
        number             = number
        notifheader        = notifheader
        notifheader_x      = notifheader_x
      importing
        notifheader_export = lt_notifheader_export
      tables
        notifitem          = notifitem
        notifitem_x        = notifitem_x
        notifcaus          = notifcaus
        notifcaus_x        = notifcaus_x
        notifactv          = notifactv
        notifactv_x        = notifactv_x
        notiftask          = notiftask
        notiftask_x        = notiftask_x
        notifpartnr        = notifpartnr
        notifpartnr_x      = notifpartnr_x
        return             = return.

Add Item Notification

  call function 'BAPI_SERVNOT_ADD_DATA'
    exporting
      number            = number
*      i_bapi            = ' '
    importing
      notifheader       = notifheader
      notifhdtext       = notifhdtext
    tables
      notfulltxt        = notfulltxt
      notitem           = notitem
      notifcaus         = notifcaus
      notifactv         = notifactv
      notiftask         = notiftask
      notifpartnr       = notifpartnr
      key_relationships = key_relationships
      return            = return.

Delete Item Notification

    call function 'BAPI_SERVNOT_DEL_DATA'
      exporting
        number      = notif_no
      tables
        notitem     = t_notitem
        notifcaus   = t_notifcaus
        notifactv   = t_notifactv
        notiftask   = t_notiftask
        notifpartnr = t_notifpartnr
        return      = t_return.

Get All Item of Notification

  call function 'BAPI_SERVNOT_GET_DETAIL'
    exporting
      number      = notif_no
    tables
      notlongtext = lt_notlongtext
      notitem     = lt_notitem
      notifcaus   = lt_notifcaus
      notifactv   = lt_notifactv
      notiftask   = lt_notiftask
      notifpartnr = lt_notifpartnr
      return      = t_return.

Set Notification in “Put in Progress” Status

  call function 'BAPI_SERVNOT_PUTINPROGRESS'
    exporting
      number       = ld_number
      langu        = sy-langu
*      languiso     =
    importing
      systemstatus = systemstatus
      userstatus   = wa_userstatus
    tables
      return       = return.

Set Notification in “Complete” Status

  call function 'BAPI_SERVNOT_CLOSE'
    exporting
      number       = ld_number
      syststat     = wa_syststat
    importing
      systemstatus = systemstatus
      userstatus   = wa_userstatus
    tables
      return       = return.

Release Task

  call function 'BAPI_SERVNOT_RELEASE_TASK'
    exporting
      number       = ld_number
      langu        = sy-langu
      task_key     = ld_taskkey
    importing
      systemstatus = systemstatus
      userstatus   = wa_userstatus
    tables
      return       = return.

Setelah menjalankan bapi tersebut, jangan lupa menyimpannya dengan BAPI_SERVNOT_SAVE dan commit transaksi dengan BAPI_TRANSACTION_COMMIT

    call function 'BAPI_SERVNOT_SAVE'
      exporting
        number      = lt_notifheader_export-notif_no
      importing
        notifheader = notifheader_result
      tables
        return      = return.

    call function 'BAPI_TRANSACTION_COMMIT'
      exporting
        wait = 'X'.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s