2012 Nov 30 1:37 PM
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 error | OBJECTS_OBJREF_NOT_ASSIGNED |
| Exception | CX_SY_REF_IS_INITIAL |
Some more infos:
SAP_APPL 600 0021 SAPKH60021
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'. |
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
2012 Nov 30 2:12 PM
Solved.
I have just applied Sap Note 1694513 in order to solve the dump.
Ciao,
Guido