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

PM Notification - Update breakdown duration error using BAPI

Former Member
2,856

Hello,

I am using the following functions to update a PM notification.

BAPI_ALM_NOTIF_DATA_MODIFY

BAPI_ALM_NOTIF_SAVE

BAPI_TRANSACTION_COMMIT

The function BAPI_ALM_NOTIF_DATA_MODIFY does not return a value for the breakdown duration field (DOWNTIME) or (AUSZT). This field is not updated properly or returned in the BAPI whenever I change the malfunction end date and the breakdown flag is selected. This field is automatically calculated when using transaction IW22, but the BAPI does not update this field or return the value.

Has anyone experienced this or does anyone have a solution for this?

Thank you,

Rhonda

6 REPLIES 6
Read only

Former Member
0 Likes
1,778

Hi,

IMPORTING parameter NUMBER is of type BAPI2080_NOTHDRE-NOTIF_NO (data element = domain = QMNUM). The domain QMNUM has a conversion routine ALPHA meaning that it fills any number with leading zero up to 12 digits.

Thus, I assume that the BAPI will work if you are using the following coding:

CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'

EXPORTING

NUMBER = '000010000847'

TABLES

NOTIFTASK = notiftask

NOTIFTASK_X = notiftask_X

  • RETURN = RETURN

However, more reasonable is the following coding:

data: ld_qmnum TYPE qmnum,

lt_return TYPE bapirettab.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = '100000847' " or the variable holding the number

IMPORTING

output = ld_qnnum.

CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'

EXPORTING

NUMBER = ld_qmnum

TABLES

NOTIFTASK = notiftask

NOTIFTASK_X = notiftask_X

RETURN = lt_return. " fetch the returned messages and...

"... evaluate them (either success or failure)

LOOP AT lt_return TRANSPORTING NO FIELDS

WHERE ( type CA 'AEX' ).

EXIT.

ENDLOOP.

IF ( syst-subrc = 0 ).

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_COMMIT_WORK'

EXPORTING

wait = 'X'. " synchronous

ENDIF.

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,778

Hi,

I have a same problem when using the BAPi 'BAPI_ALM_NOTIF_DATA_MODIFY' the breakdown duration doesn't update. When I did the conversion of the notification number before passing it to the BAPI it is the same result. Did you find the solution of this problem?

Thank you.

Mani

Read only

0 Likes
1,778

Good Morning,

Did you ever get a solution to this problem? We have the same problem updating PM notifications using this BAPI.

Regards

Richard

Read only

Former Member
0 Likes
1,778

Hi,

I am facing same issue in my project. If you have solved the issue please let me know.

Read only

Former Member
0 Likes
1,778

We solved this problem with the following code:

&----


*& Form BDC_HEADER

&----


  • text

----


FORM bdc_header USING p_program "value(p_2227)

p_screen. "value(p_2228).

CLEAR t_bdcdata.

MOVE p_program TO t_bdcdata-program.

MOVE p_screen TO t_bdcdata-dynpro.

MOVE 'X' TO t_bdcdata-dynbegin.

APPEND t_bdcdata.

ENDFORM. " BDC_HEADER

&----


*& Form BDC_DATA

&----


  • text

----


FORM bdc_data USING p_fnam "value(p_2232)

p_fval. "value(p_2233).

CLEAR t_bdcdata.

MOVE p_fnam TO t_bdcdata-fnam.

MOVE p_fval TO t_bdcdata-fval.

APPEND t_bdcdata.

ENDFORM. " BDC_DATA

&----


*& Form F_GRAVA_TEMPO_PARADA

&----


  • text

----


FORM f_grava_tempo_parada USING p_ordem

p_horafim.

REFRESH t_bdcdata.

PERFORM bdc_header USING 'SAPLIQS0'

'0100'.

PERFORM bdc_data USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_data USING 'RIWO00-QMNUM'

p_ordem.

PERFORM bdc_header USING 'SAPLIQS0'

'7200'.

PERFORM bdc_data USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_data USING 'VIQMEL-AUZTB'

p_horafim.

PERFORM bdc_header USING 'SAPLIQS0'

'7200'.

PERFORM bdc_data USING 'BDC_OKCODE'

'=BUCH'.

CALL TRANSACTION ln_trans USING t_bdcdata MODE ln_mode MESSAGES INTO t_bdcmsg.

ENDFORM. " F_GRAVA_TEMPO_PARADA

-


Best regards,

Fernando Montenegro

Read only

mauro_blanc3
Active Participant
1,778

This note will help you:

1619709 - Notification breakdown duration not populated by BAPI call