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: 

ABAP run time error : TABLE_INVALID_INDEX

Former Member
0 Kudos

Dear all,

Kindlyh assist me about my problem in ABAP run time error.

Can any body tell me what to do of run time error below,

"TABLE_INVALID_INDEX"

"SAPLFACG " bzw. "LFACGU03 "

"INTERNAL_DOCUMENT_NUMBER_SET"

f you cannot solve the problem yourself, please send the

ollowing documents to SAP:

Information on where termination occurred

-

-


The termination occurred in the ABAP/4 program "SAPLFACG " in

"INTERNAL_DOCUMENT_NUMBER_SET".

The main program was "SAPF110S ".

The termination occurred in line 241

of the source code of program "LFACGU03 " (when calling the edito

The program "SAPLFACG " was started as a background job.

-

-


002130 * FORM INTERNAL_DOCUMENT_NUMBER_SET

002140 *

002150 * Falls keine Belegnummer gefüllt ist, muß

002160 * Belegnummer temporär vergeben werden - si

002170 * wieder gelöscht!

002180 *

002190 form internal_document_number_set changing e_doc_

002200 data: x_belnr like accit_fi-belnr.

002210 *

002220 clear e_doc_int.

002230 loop at t_bkpf.

002240 x_belnr = x_belnr + 1.

002250 t_bkpf-mandt = sy-mandt.

002260 if t_bkpf-belnr is initial.

002270 e_doc_int = 'X'.

002280 t_bkpf-belnr = x_belnr.

002290 t_bkpf-belnr(1) = '$'.

002300 endif.

002310 modify t_bkpf.

002320 loop at t_bseg where bukrs eq t_bkpf-bukrs.

002330 read table t_bsegz index sy-tabix.

002340 t_bseg-mandt = sy-mandt.

002350 t_bsegz-mandt = sy-mandt.

002360 if t_bseg-belnr is initial.

002370 t_bseg-belnr = t_bkpf-belnr.

002380 t_bsegz-belnr = t_bkpf-belnr.

002390 endif.

002400 modify t_bseg index sy-tabix.

> modify t_bsegz index sy-tabix.

002420 endloop.

002430 endloop.

002440 endform.

2 REPLIES 2

former_member305388
Active Contributor
0 Kudos

Hi,

As there are two loops, sy-tabix will change as per the loops. You better take sy-tabix (whichever you want) into a variable lv_tabix, and try to modify using it.

Hope this helps...

Former Member
0 Kudos
data:W_index type i.
loop at t_bseg where bukrs eq t_bkpf-bukrs.
w_index = Sy-tabix.
 read table t_bsegz index sy-tabix.              " Value of sy-tabix after the read statement will change
 t_bseg-mandt = sy-mandt.
t_bsegz-mandt = sy-mandt.
 if t_bseg-belnr is initial.
t_bseg-belnr = t_bkpf-belnr.
 t_bsegz-belnr = t_bkpf-belnr.
 endif.
modify t_bseg index w_index.                   " Use W_index          
modify t_bsegz index w_index.                 " Use w_index

Just assign the value of sy-tabix into a variable and use..

Regards,

Gurpreet