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

internal table problem

Former Member
0 Likes
443

Hi Friends,

I am not an expert in ABAP, but I seem to have a weird problem with the following piece of code. When I uncomment the write statement in the first loop code and execute, it actually displays values for

itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.

But

when I have the code exactly as shown below, it displays just the itab_zsel-zdate1, itab_zsel-ztime1 and not itab_zsel-zvar_log

Can you tell me wht is wrong with this code?

****************************************************

itab_log and itab_sel are internal tables

****************************************************

loop at itab_log.

loop at itab_zsel where zdate1 = itab_log-zbatchdate and zhr = itab_log-zhrmin.

itab_zsel-zvar_log = itab_log-zlogid.

modify table itab_zsel.

*write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.

endloop.

endloop.

loop at itab_zsel.

write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zvar_log.

endloop.

***********************************************

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
419

Seems your internal table is not getting modified with your code.

Just replace

MODIFY TABLE itab_zsel.

with

MODIFY ITAB_ZSEL.

Cheers.

Sanjay

2 REPLIES 2
Read only

Former Member
0 Likes
419

Hi Deepthi,

I did not understand what you are trying to do,

but try this and see if it helps

loop at itab_log.

clear lw_tabix.

lw_tabix =sy-tabix.

read table itab_zsel with key zdate1 = itab_log-zbatchdate zhr = itab_log-zhrmin.

if sy-subrc = 0.

itab_zsel-zvar_log = itab_log-zlogid.

modify itab_zsel index lw_tabix.

*write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zhr, itab_zsel-zvar_log.

endif.

endloop.

loop at itab_zsel.

write:/ itab_zsel-zdate1, itab_zsel-ztime1, itab_zsel-zvar_log.

endloop.

***********************************************

Regards,

Ravi

Read only

Former Member
0 Likes
420

Seems your internal table is not getting modified with your code.

Just replace

MODIFY TABLE itab_zsel.

with

MODIFY ITAB_ZSEL.

Cheers.

Sanjay