Application Development and Automation 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: 
Read only

Create Service Notification. Help, please!!!

Former Member
0 Likes
1,012

Hello there,

I am having problem when trying to call the BAPI : BAPI_SERV_NOT_SAVE.

First called function 'BAPI_SERVNOT_CREATE' which returned notification number.

after that I know to call BAPI:

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 = notifheader_export

TABLES

  • NOTITEM = NOTITEM

  • NOTIFCAUS = NOTIFCAUS

  • NOTIFACTV = NOTIFACTV

  • NOTIFTASK = NOTIFTASK

notifpartnr = notifpartnr

  • LONGTEXTS = LONGTEXTS

  • KEY_RELATIONSHIPS = KEY_RELATIONSHIPS

return = return.

IF sy-subrc = 0.

IF notifheader_export-notif_no NOT IS INITIAL.

MOVE notifheader_export-notif_no TO number.

CALL FUNCTION 'BAPI_SERVNOT_SAVE'

EXPORTING

number = number

IMPORTING

notifheader = notifheader

TABLES

return = return.

ENDIF.

...

But the returned notifheader doesn't contain any number.

Also after called BAPI_TRANACTION_COMMIT, the notification isn't saved at all.

Would anyone please help.

Thanks.

Alexander

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
742

Hey,

After the call to function 'BAPI_SERVNOT_CREATE' read the contents of the table RETURN. If it does not have a entry with key = E then call the subsequent BAPI's.

Use the code below after the call to function 'BAPI_SERVNOT_CREATE'.

READ TABLE return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

*Write the error

ELSE.

CALL FUNCTION 'BAPI_SERVNOT_SAVE'

READ TABLE return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

*Write the error

ELSE.

CALL 'BAPI_TRANSACTION_COMMIT'

ENDIF.

ENDIF.

-Kiran

*Please mark useful answers

Hello there,

I am having problem when trying to call the BAPI : BAPI_SERV_NOT_SAVE.

First called function 'BAPI_SERVNOT_CREATE' which returned notification number.

after that I know to call BAPI:

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 = notifheader_export

TABLES

  • NOTITEM = NOTITEM

  • NOTIFCAUS = NOTIFCAUS

  • NOTIFACTV = NOTIFACTV

  • NOTIFTASK = NOTIFTASK

notifpartnr = notifpartnr

  • LONGTEXTS = LONGTEXTS

  • KEY_RELATIONSHIPS = KEY_RELATIONSHIPS

return = return.

IF sy-subrc = 0.

IF notifheader_export-notif_no NOT IS INITIAL.

MOVE notifheader_export-notif_no TO number.

CALL FUNCTION 'BAPI_SERVNOT_SAVE'

EXPORTING

number = number

IMPORTING

notifheader = notifheader

TABLES

return = return.

ENDIF.

...

But the returned notifheader doesn't contain any number.

Also after called BAPI_TRANACTION_COMMIT, the notification isn't saved at all.

Would anyone please help.

Thanks.

Alexander

5 REPLIES 5
Read only

Former Member
0 Likes
742

Do you have external number range for service notification.check out with your Functional consultant.

If that is the case specify the value with the external number parameter.

Read only

Former Member
0 Likes
743

Hey,

After the call to function 'BAPI_SERVNOT_CREATE' read the contents of the table RETURN. If it does not have a entry with key = E then call the subsequent BAPI's.

Use the code below after the call to function 'BAPI_SERVNOT_CREATE'.

READ TABLE return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

*Write the error

ELSE.

CALL FUNCTION 'BAPI_SERVNOT_SAVE'

READ TABLE return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

*Write the error

ELSE.

CALL 'BAPI_TRANSACTION_COMMIT'

ENDIF.

ENDIF.

-Kiran

*Please mark useful answers

Read only

0 Likes
742

Hi Kiran,

after the call BAPI_SERVNOT_CREATE the return table is empty, so first function doens't contain any errors.

I tries in SE37 BAPI_SERVNOT_SAVE with notification number returned from BAPI_SERVNOT_CREATE. Returntable is empty, but result gives table with message 000 in it. and notifheader doesn't contain any number...

I getting frustrated..

Read only

0 Likes
742

Hey,

You need to check the export paramter NOTIFHEADER_EXPORT and not the import parameter NOTIFHEADER.

Kiran

Read only

0 Likes
742

Thanks!!!

It works, how stupid of me!!