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

Former Member
0 Likes
726

hi frnds...

data: begin of itab occurs 0,

name(14) type i,

sal(8) type n,

end of itab.

itab-name = 'xxx'.

itab-sal = '20000'.

itab-name = 'yyy'.

itab-sal = '40000'.

*******header line value*****

write:/ itab-name,itab-sal.

append itab.

loop at itab1.

write:/ itab-name,itab-sal.

endloop.

this is my logic

iam getting out put like dis..

yyy 40000

yyy 40000

but iam not getting my req output..

req out put shld be like dis::::

header line value

yyy 40000

body value

xxx 20000

yyy 40000

please reply with the correct logic and axplanation where i went wrong..

thanx in adv

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
691

Hi,

loop at itab1.   "<--------- it should be itab not itab1, thats why u r getting same value
write:/ itab-name,itab-sal.
endloop.

Regards

Bala Krishna

5 REPLIES 5
Read only

Former Member
0 Likes
691

Hi,

The correct logic:

data: begin of itab occurs 0,

name(14) type i,

sal(8) type n,

end of itab.

itab-name = 'xxx'.

itab-sal = '20000'.

append itab. <<<Add This

itab-name = 'yyy'.

itab-sal = '40000'.

*******header line value*****

write:/ itab-name,itab-sal.

append itab.

loop at itab1.

write:/ itab-name,itab-sal.

endloop.

Read only

Former Member
0 Likes
691

give your code like this



data: begin of itab occurs 0,
name(14) type i,
sal(8) type n,
end of itab.

itab-name = 'xxx'.
itab-sal = '20000'.
append itab. clear itab.

********header line value******
write:/ itab-name,itab-sal.

itab-name = 'yyy'.
itab-sal = '40000'.
append itab. clear itab.



loop at itab1.
write:/ itab-name,itab-sal.
endloop.

Read only

former_member585060
Active Contributor
0 Likes
692

Hi,

loop at itab1.   "<--------- it should be itab not itab1, thats why u r getting same value
write:/ itab-name,itab-sal.
endloop.

Regards

Bala Krishna

Read only

0 Likes
691

balakrisha sorry it was a typing mistake..

and thanx all for replying me...

will give points for all...

Read only

Former Member
0 Likes
691

thanx all for helping me..

thanx sdn team