2013 Sep 26 9:31 AM
Hi Experts,
When I tried to park FI document using the SAPSQL_ARRAY_INSERT_DUPREC with the help of user exit. I am getting error message as "Express document "Update was terminated" received from author. Also In ST22 getting error message as "SAPSQL_ARRAY_INSERT_DUPREC" in program "SAPLF042"
Information on where terminated
Termination occurred in the ABAP program "SAPLF042" - in "VBKPF_SCHREIBEN".
The main program was "RSM13000 ".
In the source code you have the termination point in line 163
of the (Include) program "LF042U11".
The program "SAPLF042" was started in the update system.
The termination is caused because exception "CX_SY_OPEN_SQL_DB" occurred in
procedure "VBKPF_SCHREIBEN" "(FORM)", but it was neither handled locally nor
declared
in the RAISING clause of its signature.
Kindly advice on the solution.
2013 Sep 26 9:52 AM
you say:
"When I tried to park FI document using the SAPSQL_ARRAY_INSERT_DUPREC with the help of user exit."
What do you mean with that ?
Can you give us the code of the user exit ?
2013 Sep 26 9:51 AM
Hi
That means the following code lines are failing:
if insert_flag eq space.
modify vbkpf from table xvbkpf1.
else.
insert vbkpf from table xvbkpf1.
endif.
so you can have 2 problems:
Or you can try to insert a document already stored
Or you have duplicated records in internal table XVBKPF1
How do you park the document?
Max
2013 Sep 26 9:58 AM
Hi Max,
Exactly im getting error message in the insertion.
if insert_flag eq space.
modify vbkpf from table xvbkpf1.
else.
insert vbkpf from table xvbkpf1.
endif.
I am parking the document using BAPI "BAPI_ACC_GL_POSTING_POST" and exit
EXIT_SAPLACC4_001
READ TABLE extension INDEX 1.
IF sy-subrc EQ 0 AND extension-field1 = 'BAPI-PARK'.
MOVE 2 TO t_acchd-status_new.
ENDIF.
Code in my program for extension:
*
ls_extention-field1 = 'BAPI-PARK'.
ls_extention-field2 = '1'.
APPEND ls_extention TO lt_extention.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = ls_header
* IMPORTING
* OBJ_TYPE =
* OBJ_KEY =
* OBJ_SYS =
TABLES
accountgl = lt_accountgl
currencyamount = lt_currency
return = lt_return
extension1 = lt_extention.
Please provide me solution.
2013 Sep 26 9:52 AM
you say:
"When I tried to park FI document using the SAPSQL_ARRAY_INSERT_DUPREC with the help of user exit."
What do you mean with that ?
Can you give us the code of the user exit ?
2013 Sep 26 9:56 AM
Hi Peter,
Please find my code in the user exit: EXIT_SAPLACC4_001
READ TABLE extension INDEX 1.
IF sy-subrc EQ 0 AND extension-field1 = 'BAPI-PARK'.
MOVE 2 TO t_acchd-status_new.
ENDIF.
Code in my program for extension:
*
ls_extention-field1 = 'BAPI-PARK'.
ls_extention-field2 = '1'.
APPEND ls_extention TO lt_extention.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = ls_header
* IMPORTING
* OBJ_TYPE =
* OBJ_KEY =
* OBJ_SYS =
TABLES
accountgl = lt_accountgl
currencyamount = lt_currency
return = lt_return
extension1 = lt_extention.
2013 Sep 26 10:14 AM
Hi
The problem is on the values of key fields of VBKPF:
AUSBK
BUKRS
BELNR
GJAHR
So I suppose the document you're trying to store has document number already used, or XVBKPF1 has 2 equal records (I means records with same key....but I don't think it because the BAPI can transfer only one header, so only one document)
Are you transfering the document number too?
Max
2013 Sep 26 10:44 AM
Hi Max,
I am not transferring document number in the header. I am just passing BUKRS, GJAHR, BLART, BUDAT, BLDAT.
2013 Sep 26 10:48 AM
2013 Sep 26 11:53 AM
2013 Sep 27 6:32 AM
Hi Max,
The problem arises in the number range and standard program considering only the document number without fiscal year. Hence if there is any document number avail in the previous fiscal year, its showing same error. Kindly advice on this.
2013 Sep 27 10:12 AM
2013 Sep 27 10:32 AM
Hi Max,
The above is the number range used for year 2012 and 2013 respectively.
2013 Sep 27 10:49 AM
Hi
it seems to be ok, the last number used for 2013 is 912000428, so there's this document in your system?
After the dump the range is updated with the next number?
Max
2013 Sep 27 11:08 AM
2013 Sep 27 11:12 AM
Hi
So now you should check the data in internal table xvbkpf1
You can check it by debug setting UPDATE DEBUGGING option, in this way the system should stop your program as soon as the function modules in update task are called in particular PRELIMINARY_POSTING_DOC_WRITE
Max
2013 Sep 27 12:41 PM
Hi Max
As per your reply, I put an update debug over there and System also stop at the PRELIMINARY_POSTING_DOC_WRITE. How to over come the error..
2013 Sep 27 2:55 PM
Hi
You shoud go to the code line just before the INSERT (where the dump occurs)....and when you're here check what the table xvbkpf1 has.
if insert_flag eq space. <------Stop here and check the internal table xvbkpf1
modify vbkpf from table xvbkpf1.
else.
insert vbkpf from table xvbkpf1.
endif.
Max