Application Development 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: 

BAPI_ALM_NOTIF_CREATE Short dump

Former Member
0 Kudos

Dear Experts,

Good day. I'm getting short dump TABLE_INVALID_INDEX when try to create notification for the same PM order inside the loop.

Im passing equipment(same equipment number as well but different operation) , reported by,short text and order id to the BAPI. Really appreciate your advise for the issue. i have cleared all the input values and use BAPI_ALM_NOTIF_SAVE and BAPI_TRANSACTION_COMMIT commit each time. Please find the dump details below.

    Short Text

    Error in ABAP/4 statement when processing an internal table.

   What happened?

    Error in the ABAP Application Program

    The current ABAP program "SAPLCOBO" had to be terminated because it has

    come across a statement that unfortunately cannot be executed.

Error analysis

    When changing or deleting one or more lines of the internal table

    "\FUNCTION-POOL=COBP\DATA=AFVG_BT[]" or when inserting in the tabl

     "\FUNCTION-POOL=COBP\DATA=AFVG_BT[]", 0 was used as

    the line index. An index less than or equal to zero is not

    allowed.

    The error can occur when using the following options:

    1. "INDEX idx" for specifying the line number in the table

     "\FUNCTION-POOL=COBP\DATA=AFVG_BT[]"

       where you want to change, insert or delete.

    2. "FROM idx" for specifying the start index when deleting a line

       area from or inserting a line area into the table

     "\FUNCTION-POOL=COBP\DATA=AFVG_BT[]".

    3. "TO idx" for specifying the end index when deleting a line

       area from or inserting a line area into the table

     "\FUNCTION-POOL=COBP\DATA=AFVG_BT[]".

    At the time of the termination, the table contained 1 lines.

Information on where terminated

    Termination occurred in the ABAP progra

     "CO_BO_UPDATE_OPR_OF_ORDER".

    The main program was "RS_TESTFRAME_CALL

    In the source code you have the termina

    of the (Include) program "LCOBOU06".

Source Code


  398

  399 *   Update buffer table

  400     MODIFY afvg_bt INDEX ls_afvgd_new-indbt.

  401 * Jetzt auch AFVGD_UPD aktualisieren

>>>>>     MOVE-CORRESPONDING afvg_bt TO afvgd_upd.             " note

  403     IF NOT afvgd_upd-sumnr IS INITIAL.                  " note 4

  404       READ TABLE afvg_bt INTO *afvgb INDEX afvg_bt-indexsumnr.

Thanks and Regards

Shankar



1 ACCEPTED SOLUTION

Former Member
0 Kudos

issue solved.

Thanks everyone.

16 REPLIES 16

pranay570708
Active Contributor
0 Kudos

Check below statement in debugger:

MODIFY afvg_bt INDEX ls_afvgd_new-indbt.


'ls_afvgd_new-indbt' must not be blank which might be causing the dump.

0 Kudos

Dear  Pranay,

I understand that. It is standard SAP code and i can do much as well. Is there is any solution to create more than 1 notification for same workorder ?

Regards

Shankar

0 Kudos

You cannot add multiple notifications at the PM Order Header Level.

You can add multiple Notifications in the Object List.

You can also add a Notification to a PM Order Operation.

0 Kudos

Dear Ron ,

I was passing PM order number to BAPI_ALM_NOTIF_SAVE which i believe will attach the PM order to the object list. but when i do the same thing to second notification( second notification for same PM order), the system throws the  dump.

Thanks and Regards

Shankar

0 Kudos

Please indicate all parameters of the first call, and all parameters of the second call.

0 Kudos

Dear Sandra ,

Please find my code below. All the values for equnr(equipment), uname(username),txt-oper(operation text),priority are same including the pm order.

loop at i_tab_con_temp into wa_con_temp

CLEAR: notifheader,notifheader_export.

       notifheader-equipment  wa_con_temp-equnr.

       notifheader-reportedby = wa_con_temp-uname.

       notifheader-short_text = wa_con_temp-txt_oper.

       notifheader-priority   = wa_con_temp-priority.

       CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'

         EXPORTING

           notif_type         = notif_type

           notifheader        = notifheader

          orderid            = i_tab_con_temp-aufnr

         IMPORTING

           notifheader_export = notifheader_export.

       CALL FUNCTION 'BAPI_SERVNOT_SAVE'

         EXPORTING

           number      = notifheader_export-notif_no

         IMPORTING

           notifheader = wa_notifheader.

       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


endloop.


Thanks and Regards

Shankar

0 Kudos

sorry a small typo error. Im passing wa_con_temp aufnr to BAPI_ALM_NOTIF_CREATE' orderid .

0 Kudos

Did you use the WAIT option for commit,

Also I hope you manage the RETURN table (just hidden to reduce size of post?)

Regards,

Raymond

0 Kudos

Hi Raymond,

Yes i have also tried wait = 'X' for the commit but it doesn't work .I didn't manage to get anything in return table as i got this dump half way.

Regards

Shankar .

0 Kudos

Did you look for OSS notes suitable for your version?

Regards,

Raymond

0 Kudos

Hi Raymond,

I will try to find any if relevant.

Thanks and Regards

Shankar

0 Kudos

If anybody can try by himself and help Shankar, here is a compiling 7.40 code where data must be replaced with your own values (but I couldn't make it work on my system because of missing customizint):

TYPES : BEGIN OF con_temp,
          equnr    TYPE string,
          uname    TYPE string,
          txt_oper TYPE string,
          priority TYPE string,
          aufnr    TYPE aufnr,
        END OF con_temp,
        tab_con_temp TYPE STANDARD TABLE OF con_temp WITH EMPTY KEY.
DATA: notif_type         TYPE bapi2080-notif_type,
      notifheader        TYPE bapi2080_nothdri,
      notifheader_export TYPE bapi2080_nothdre,
      lt_return          TYPE TABLE OF bapiret2.

DATA(i_tab_con_temp) = VALUE tab_con_temp(
( equnr = '000000000000000001' uname = 'NAME' txt_oper = 'test1' priority = '1' aufnr = '00000000001' )
( equnr = '000000000000000001' uname = 'NAME' txt_oper = 'test2' priority = '1' aufnr = '00000000001' )
).

LOOP AT i_tab_con_temp INTO DATA(wa_con_temp).

  CLEAR: notifheader,notifheader_export.

  notif_type  =  'M1'.
  notifheader-equipment  = wa_con_temp-equnr.
  notifheader-reportedby = wa_con_temp-uname.
  notifheader-short_text = wa_con_temp-txt_oper.
  notifheader-priority   = wa_con_temp-priority.

  CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
    EXPORTING
      notif_type         = notif_type
      notifheader        = notifheader
      orderid            = wa_con_temp-aufnr
    IMPORTING
      notifheader_export = notifheader_export
    TABLES
      return             = lt_return.
  IF line_exists( lt_return[ type = 'E' ] ).
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    CONTINUE.
  ENDIF.

  CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
    EXPORTING
      number      = notifheader_export-notif_no
    IMPORTING
      notifheader = notifheader_export
    TABLES
      return      = lt_return.
  IF line_exists( lt_return[ type = 'E' ] ).
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ENDIF.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING wait = 'X'.

ENDLOOP.

Good luck!

Sandra_Rossi
Active Contributor
0 Kudos

shankar balaji wrote:

Good day. I'm getting short dump TABLE_INVALID_INDEX when try to create notification for the same PM order inside the loop.

I don't understand why you're talking about a "loop", which tends to say you have run a program, as the short dump you have pasted shows it occurs during a manual SE37 test (RS_TESTFRAME_CALL). So, if you did it using SE37, did you do it via a "test sequence" "object", as explained in note 604300 (which applies exactly to your case)?

0 Kudos

Hi Sandra,

I have created a Z function module. Inside the function module I'm using  BAPI_ALM_NOTIF_SAVE. So I'm creating notification based on sub operation of an PM order. A PM order may have several operation and sub operation. So that is why I'm using this BAPI inside the loop.


Regards

Shankar

Former Member
0 Kudos

issue solved.

Thanks everyone.

former_member637499
Participant
0 Kudos

Can you share the solution please