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

Notification modification with BAPI

Former Member
0 Likes
649

Greetings,

I am using the bapi BAPI_ALM_NOTIF_DATA_MODIFY

for modifiying an existing notification.

Below is the code extract.

data : LT_NOTIFHEADER type BAPI2080_NOTHDRI .

data : LT_NOTIFUPDATEX type

bapi2080_NOTHDRI_X .

data : LT_EXPORTHEADER type bAPI2080_NOTHDRE.

data : LT_RETURN type table of BAPIRET2 with header line.

data : EQUIPMENT type EQUNR.

data : NOTIFHEADER type BAPI2080_NOTHDRE .

data : SAVE_RETURN type table of BAPIRET2 with header line.

data : COMMITRETURN type table of BAPIRET2 with header line.

data : LD_QMNUM type qmnum.

data : number like BAPI2080_NOTHDRE-NOTIF_NO.

if P_EQUI_TECHID is not initial.

select single EQUNR from ITOB into EQUIPMENT where TIDNR = P_EQUI_TECHID.

if SY-SUBRC = 0.

EQUIPMENT = ITOB-EQUNR.

else.

exit.

endif.

endif.

LT_NOTIFHEADER-REFOBJECTTYPE = 'QMEL'.

LT_NOTIFHEADER-EQUIPMENT = EQUIPMENT.

LT_NOTIFHEADER-FUNCT_LOC = P_FUNCTIONAL_LOCATION_ID.

LT_NOTIFHEADER-PRIORITY = P_NOTIF_PRIORITY_ID.

LT_NOTIFHEADER-BREAKDOWN = P_BREAKDOWN_IND.

LT_NOTIFHEADER-STRMLFNDATE = P_START_DATE_MLFN.

LT_NOTIFHEADER-STRMLFNTIME = P_START_TIME_MLFN.

LT_NOTIFHEADER-REPORTEDBY = P_REPORTED_BY_ID.

LT_NOTIFHEADER-CODE_GROUP = P_CODE_GROUP_ID.

LT_NOTIFHEADER-CODING = P_CODE_ID.

LT_NOTIFUPDATEX-REFOBJECTTYPE = 'X'.

LT_NOTIFUPDATEX-EQUIPMENT = 'X'.

LT_NOTIFUPDATEX-FUNCT_LOC = 'X'.

LT_NOTIFUPDATEX-PRIORITY = 'X'.

LT_NOTIFUPDATEX-BREAKDOWN = 'X'.

LT_NOTIFUPDATEX-STRMLFNDATE = 'X'.

LT_NOTIFUPDATEX-STRMLFNTIME = 'X'.

LT_NOTIFUPDATEX-REPORTEDBY = 'X'.

LT_NOTIFUPDATEX-CODE_GROUP = 'X'.

LT_NOTIFUPDATEX-CODING = 'X'.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

INPUT = P_NOTIF_NO

importing

OUTPUT = LD_QMNUM.

call function 'BAPI_ALM_NOTIF_DATA_MODIFY'

exporting

NUMBER = LD_QMNUM

NOTIFHEADER = LT_NOTIFHEADER

NOTIFHEADER_X = LT_NOTIFUPDATEX

importing

NOTIFHEADER_EXPORT = LT_EXPORTHEADER

tables

RETURN = LT_RETURN.

read table LT_RETURN with key TYPE = 'E'.

number = LD_QMNUM.

if SY-SUBRC ne 0.

call function 'BAPI_ALM_NOTIF_SAVE'

exporting

NUMBER = number

importing

NOTIFHEADER = NOTIFHEADER

tables

RETURN = SAVE_RETURN.

endif.

read table SAVE_RETURN with key TYPE = 'E'.

if SY-SUBRC ne 0.

call function 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = COMMITRETURN.

endif.

If i test the three functions in sequence manually, i am

able to update the notification.But if i do the same through

the above given code ,i am not able to update it.

Could you have a look into the above code.

please note that i want to update the header only.

Points will be rewarded.

Regards,

Jinesh.

1 REPLY 1
Read only

Former Member
0 Likes
450

answered