Skip to Content

How to Create a Notification using BDC For IW21 Tcode

Hai,

I am new to Abap.

I need to create a notification, all the fields i am inputting from a screen and using a BDC function module i needto save it and generate a notifcation in the database table using Tcode IW21. But its getting dump. Plz provide me the Sample code for the same .

Thanks in Advance

Renjith

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2016 at 01:06 PM

    Dear Renjith,

    Please use the BAPI Notification not BDC like the below :

    CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'

    EXPORTING

    * EXTERNAL_NUMBER =

    notif_type = lv_notif_type

    notifheader = lw_notifheader

    * TASK_DETERMINATION = ' '

    * SENDER =

    * ORDERID =

    IMPORTING

    notifheader_export = lw_notifheader_export

    TABLES

    * NOTITEM =

    * NOTIFCAUS =

    * NOTIFACTV =

    * NOTIFTASK =

    * NOTIFPARTNR =

    longtexts = lt_lines

    * KEY_RELATIONSHIPS =

    return = lt_return

    .

    IF LINES( lt_return ) > 0.

    READ TABLE lt_return INTO lw_return INDEX 1.

    IF sy-subrc = 0.

    ge_message_error = lw_return-message.

    ENDIF.

    ROLLBACK WORK.

    EXIT.

    ELSE.

    REFRESH lt_return.

    CALL FUNCTION 'ALM_PM_NOTIFICATION_SAVE'

    EXPORTING

    number = lw_notifheader_export-notif_no

    IMPORTING

    notifheader = lw_nothdre

    TABLES

    return = lt_return.

    IF LINES( lt_return ) > 0.

    READ TABLE lt_return INTO lw_return INDEX 1.

    IF sy-subrc = 0.

    ge_message_error = lw_return-message.

    ENDIF.

    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'

    IMPORTING

    return = lw_return.

    EXIT.

    ELSE.

    CLEAR lw_return.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'

    IMPORTING

    return = lw_return.

    ENDIF.

    ENDIF.

    May be you can search another link for your reference.

    Regards,

    Yance

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 22, 2016 at 08:35 PM

    You'd better be taught and understand why it dumps and how to solve it, instead of just asking a "working" code

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.