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: 

code

Former Member
0 Kudos

Hi Experts,

See this code:

LOOP AT T_EDPAR .

CLEAR T_LIKP_LIPS .

READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR

BINARY SEARCH.

IF SY-SUBRC EQ 0 .

MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.

MODIFY T_LIKP_LIPS TRANSPORTING SNDPRN .

ENDIF.

ENDLOOP.

Wheni done Extended syntax check for this giving an error (Problematic statement)

like this:

Indirect Index Access to Internal Table T_LIKP_LIPS

Outside a LOOP, this causes a short dump

What may be the problem?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

change modify statement to this

MODIFY <b>TABLE</b> T_LIKP_LIPS TRANSPORTING SNDPRN

9 REPLIES 9

Former Member
0 Kudos

change modify statement to this

MODIFY <b>TABLE</b> T_LIKP_LIPS TRANSPORTING SNDPRN

Former Member
0 Kudos

use like this

LOOP AT T_EDPAR .

CLEAR T_LIKP_LIPS .

READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR

BINARY SEARCH.

IF SY-SUBRC EQ 0 .

MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.

MODIFY T_LIKP_LIPS <b>INDEX SY-TABIX</b>.

ENDIF.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

former_member181962
Active Contributor
0 Kudos

Aling with chandu's suggestion, you should also make this change to avoid run time dumps:

LOOP AT T_EDPAR .

CLEAR T_LIKP_LIPS .

READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR

BINARY SEARCH.

IF SY-SUBRC EQ 0 .

MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.

MODIFY <b>table</b> T_LIKP_LIPS TRANSPORTING SNDPRN <b>index sy-tabix</b>.

ENDIF.

ENDLOOP.

0 Kudos

Hi all,

thanks

kostas_tsioubris
Contributor
0 Kudos

Hi,

try this

data lv_tabix like sy-tabix.
LOOP AT T_EDPAR .
CLEAR T_LIKP_LIPS .
READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR
BINARY SEARCH.
IF SY-SUBRC EQ 0 .
lv_tabix = sy-tabix.
MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.
MODIFY table T_LIKP_LIPS index lv_tabix TRANSPORTING SNDPRN .
ENDIF.

ENDLOOP.

Former Member
0 Kudos

hi,

do this way

data : lv_tabix like sy-tabix.

LOOP AT T_EDPAR .

<b> lv_tabix = sy-tabix.</b>

CLEAR T_LIKP_LIPS .

READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR

BINARY SEARCH.

IF SY-SUBRC EQ 0 .

MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.

MODIFY T_LI<b></b>KP_LIPS client specified index lv_tabix TRANSPORTING SNDPRN .

ENDIF.

Former Member
0 Kudos

LOOP AT T_EDPAR .

CLEAR T_LIKP_LIPS .

READ TABLE T_LIKP_LIPS WITH KEY KUNNR = T_EDPAR-KUNNR

BINARY SEARCH.

IF SY-SUBRC EQ 0 .

MOVE T_EDPAR-KUNNR TO T_LIKP_LIPS-SNDPRN.

MODIFY <b>table</b> T_LIKP_LIPS <b>index sy-tabix</b> TRANSPORTING SNDPRN .

ENDIF.

ENDLOOP.

Former Member
0 Kudos

Try this :

"U are looping t_EDPAR and modifying T_LIKP_LIPS it is not correct ", chk follwing logic:

loop at T_LIKP_LIPS.

read table T_EDPAR with key kunnr = T_LIKP_LIPS-kunnr binary search.

if sy-subrc ....

.

.

." Rest is ok.

endloop.

Reward if Helps.

Jogdand M B

Former Member
0 Kudos

Hi,

Use TABLE Keyword while Modifying.

The line to be changed is determined by the fact that the content of the table key matches the content of the corresponding components in the wa work area. For tables with a key that is not unique, the first entry that is found is changed.

Or else use

MOVE T_EDPAR-KUNNR TO WA.

MODIFY TABLE Itab from WA TRANSPORTING comp1.

with regards,

Jay