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

Modify service Notification with Equipment using BAPI_SERVNOT_MODIFY_DATA

hady_ibrahim
Participant
0 Likes
1,519

Dear ABAPERs.

how can i use BAPI_SERVNOT_MODIFY_DATA to link service notification with equipment.

I run the program but runtime error occurs.


DATA : IT_NOTIFHEADER TYPE  TABLE OF BAPI2080_NOTHDRI WITH HEADER LINE ,
       WA_NOTIFHEADER TYPE  BAPI2080_NOTHDRI.
WA_NOTIFHEADER-EQUIPMENT = '000000000010007264'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '808081'.
APPEND WA_NOTIFHEADER TO IT_NOTIFHEADER.
CALL FUNCTION 'BAPI_SERVNOT_MODIFY_DATA'
   EXPORTING
     NUMBER                   = 300002676
    NOTIFHEADER              = IT_NOTIFHEADER.
*   NOTIFHEADER_X            =
* IMPORTING
*   NOTIFHEADER_EXPORT       =
* TABLES
*   NOTIFITEM                =
*   NOTIFITEM_X              =
*   NOTIFCAUS                =
*   NOTIFCAUS_X              =
*   NOTIFACTV                =
*   NOTIFACTV_X              =
*   NOTIFTASK                =
*   NOTIFTASK_X              =
*   NOTIFPARTNR              =
*   NOTIFPARTNR_X            =
*   RETURN                   =
           .

9 REPLIES 9
Read only

Former Member
0 Likes
1,385

Hi Hady,

can you post that runtime error.

Tahnks

Srini

Read only

0 Likes
1,385

after i add BAPI2080_NOTHDRI_X structure the error gone.


DATA : IT_NOTIFHEADER TYPE  TABLE OF BAPI2080_NOTHDRI WITH HEADER LINE ,
       WA_NOTIFHEADER TYPE  BAPI2080_NOTHDRI,
       IT_NOTIFHEADER_X TYPE  TABLE OF BAPI2080_NOTHDRI_X WITH HEADER LINE ,
       WA_NOTIFHEADER_X TYPE  BAPI2080_NOTHDRI_X,
       IT_RETURN TYPE TABLE OF BAPIRET2.

WA_NOTIFHEADER-EQUIPMENT = '000000000010007264'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '808081'.
APPEND WA_NOTIFHEADER TO IT_NOTIFHEADER.

WA_NOTIFHEADER_X-EQUIPMENT = 'X'.
WA_NOTIFHEADER_X-MATERIAL = 'X'.
WA_NOTIFHEADER_X-SERIALNO = 'X'.
APPEND WA_NOTIFHEADER_X TO IT_NOTIFHEADER_X.


DATA : NOT TYPE QMNUM VALUE 300002676.

CALL FUNCTION 'BAPI_SERVNOT_MODIFY_DATA'
   EXPORTING
     NUMBER                   = NOT
    NOTIFHEADER              = IT_NOTIFHEADER
    NOTIFHEADER_X            = IT_NOTIFHEADER_X
* IMPORTING
*   NOTIFHEADER_EXPORT       =
* TABLES
*   NOTIFITEM                =
*   NOTIFITEM_X              =
*   NOTIFCAUS                =
*   NOTIFCAUS_X              =
*   NOTIFACTV                =
*   NOTIFACTV_X              =
*   NOTIFTASK                =
*   NOTIFTASK_X              =
*   NOTIFPARTNR              =
*   NOTIFPARTNR_X            =
    RETURN                   = IT_RETURN
           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =

now this error raised

Function module "BAPI_SERVNOT_MODIFY_DATA" was called

with the parameter "RETURN".

This parameter is not defined.

Read only

0 Likes
1,385

Hi Hady

If you please check your code the RETURN is to be declared under TABLES. Please uncomment tables statement. Right now it is considering it under EXPORTING

Nabheet

Read only

0 Likes
1,385

how can i change the signature of BAPI !!?

any way i make change but it raise the  same error


WA_NOTIFHEADER-EQUIPMENT = '000000000010007264'.
WA_NOTIFHEADER-MATERIAL = 'AH-AP24HME'.
WA_NOTIFHEADER-SERIALNO = '808081'.
APPEND WA_NOTIFHEADER TO IT_NOTIFHEADER.

WA_NOTIFHEADER_X-EQUIPMENT = 'X'.
WA_NOTIFHEADER_X-MATERIAL = 'X'.
WA_NOTIFHEADER_X-SERIALNO = 'X'.
APPEND WA_NOTIFHEADER_X TO IT_NOTIFHEADER_X.


DATA : NOT TYPE QMNUM VALUE 300002676.

CALL FUNCTION 'BAPI_SERVNOT_MODIFY_DATA'
   EXPORTING
     NUMBER                   = NOT
    NOTIFHEADER              = IT_NOTIFHEADER
    NOTIFHEADER_X            = IT_NOTIFHEADER_X
      RETURN                   = IT_RETURN
* IMPORTING
*   NOTIFHEADER_EXPORT       =
* TABLES
*   NOTIFITEM                =
*   NOTIFITEM_X              =
*   NOTIFCAUS                =
*   NOTIFCAUS_X              =
*   NOTIFACTV                =
*   NOTIFACTV_X              =
*   NOTIFTASK                =
*   NOTIFTASK_X              =
*   NOTIFPARTNR              =
*   NOTIFPARTNR_X            =

           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
  IMPORTING
    RETURN        = IT_RETURN .

Read only

0 Likes
1,385

Hady

You should do like this check TABLES is uncommented. RETURN is under tables parameter not EXPORTING

  1. CALL FUNCTION 'BAPI_SERVNOT_MODIFY_DATA' 
  2.    EXPORTING 
  3.      NUMBER                   = NOT 
  4.     NOTIFHEADER              = IT_NOTIFHEADER 
  5.     NOTIFHEADER_X            = IT_NOTIFHEADER_X 
  6. * IMPORTING 
  7. *   NOTIFHEADER_EXPORT       = 
  8. TABLES 
  9. *   NOTIFITEM                = 
  10. *   NOTIFITEM_X              = 
  11. *   NOTIFCAUS                = 
  12. *   NOTIFCAUS_X              = 
  13. *   NOTIFACTV                = 
  14. *   NOTIFACTV_X              = 
  15. *   NOTIFTASK                = 
  16. *   NOTIFTASK_X              = 
  17. *   NOTIFPARTNR              = 
  18. *   NOTIFPARTNR_X            = 
  19.     RETURN                   = IT_RETURN 
Read only

0 Likes
1,385

thanks nabheet

but the return table say Notification   300002676 does not exist

and i am sure it is exist.

how come?

Read only

0 Likes
1,385

Please add leading zero to notification and check again

Read only

0 Likes
1,385

the return message is

1    E    IM    407    No changes made


It  doesn't update notification with equipment.

any suggest?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,385

First execute source code inspector. Then uncomment the return parameter and check returned values once first error raised by SCI corrected.

Then read the BAPI's documentation and add the call of BAPI_SERVNOT_SAVE after this one and before the commit... (or read OSS note 604300 - FAQ: BAPI_ALM_NOTIF* and BAPI_SERVNOT*)

Also you could use BAPI_SERVNOT_GET_DETAIL or any select statement, to insure that data is to be changed.

Regards,

Raymond