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

BAPI_SAG_CHANGE: dump OBJECTS_OBJREF_NOT_ASSIGNED

Former Member
0 Likes
781

Hello,

I have just written a custom report that calls BAPI_SAG_CHANGE.

It works fine if run in foreground, but if run in background, with the same data, I get a dump:

Runtime errorOBJECTS_OBJREF_NOT_ASSIGNED
Exception     CX_SY_REF_IS_INITIAL

Some more infos:

  • I'm working on a system with following software component:

          SAP_APPL    600    0021    SAPKH60021

  • I have just applied two more SAP Notes, 1719540 and 1730058 (released with SAPKH60022) but error happen as well
  • Here following I copy source code of my own form. Of course <fs_alv> is assigned and all fields are filled with their own value and just before this piece of code I have just done a CLEAR and a FREE of all tables/structures used by the BAPI


    wa_header-number  = <fs_alv>-ebeln.

    wa_headerx-number = <fs_alv>-ebeln.


    wa_schedule-item_no = <fs_alv>-ebelp.

    wa_schedule-sched_line = <fs_alv>-etenr.

    wa_schedule-quantity   = <fs_alv>-wemng.

    APPEND wa_schedule TO tb_schedule.


    wa_schedulex-item_no = <fs_alv>-ebelp.

    wa_schedulex-sched_line = <fs_alv>-etenr.

    wa_schedulex-quantity   = 'X'.

    APPEND wa_schedulex TO tb_schedulex.


    CALL FUNCTION 'BAPI_SAG_CHANGE'

    EXPORTING

    purchasingdocument= <fs_alv>-ebeln

    header          = wa_header

    headerx         = wa_headerx

    TABLES

    return          = tb_bapiret2

    schedule = tb_schedule

    schedulex       = tb_schedulex.


    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

  • Here following I post the first page of the dump, copied from ST22:

Short Text

    Access via 'NULL' object reference not possible.

What happened?

    Error in the ABAP Application Program

    The current ABAP program "CL_MASTER_CONDITIONS_MM=======CP" had to be

     terminated because it has

    come across a statement that unfortunately cannot be executed.

What can you do?

    Note down which actions and inputs caused the error.

    To process the problem further, contact you SAP system

    administrator.

    Using Transaction ST22 for ABAP Dump Analysis, you can look

    at and manage termination messages, and you can also

    keep them for a long time.

Error analysis

    An exception occurred that is explained in detail below.

    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not

     caught in

    procedure "IF_MASTER_CONDITIONS_MM~GET_PERSISTENT_DATA" "(METHOD)", nor was it

     propagated by a RAISING clause.

    Short Text

    Access via 'NULL' object reference not possible.

What happened?

    Error in the ABAP Application Program

    The current ABAP program "CL_MASTER_CONDITIONS_MM=======CP" had to be

     terminated because it has

    come across a statement that unfortunately cannot be executed.

What can you do?

    Note down which actions and inputs caused the error.

    To process the problem further, contact you SAP system

    administrator.

    Using Transaction ST22 for ABAP Dump Analysis, you can look

    at and manage termination messages, and you can also

    keep them for a long time.

Error analysis

    An exception occurred that is explained in detail below.

    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not caught in

    procedure "IF_MASTER_CONDITIONS_MM~GET_PERSISTENT_DATA" "(METHOD)", nor was it

     propagated by a RAISING clause.

Do anybody have experience about this problem?

Thank you!

Guido

1 REPLY 1
Read only

Former Member
0 Likes
519

Solved.

I have just applied Sap Note 1694513 in order to solve the dump.

Ciao,

Guido