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: 

Looping

Former Member
0 Kudos

Hi,

In my program i have written the code as

V_d= 'no data present'

loop at it_sak where mitkz NE space.

concatenate v_dit_sak-skb1 into v_d seperated by space.

v_a= 'x'.

endloop.

if v_a= 'x'.

message i001 with v_d.

end if.

as its coming under the loop if in the table if atleaset one value of internal table it_sak has some value in mitkz then only the error message is getting displayed.Now in my case by skipping that particular contents the other values should be displayed.How to do it?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Write condition in loop-endloop.

loop at it_sak.

if mitkz NE space.

concatenate v_dit_sak-skb1 into v_d seperated by space.

v_a= 'x'.

else.

"->> write ur logic here

endif.

endloop.

Regards,

Aparna

4 REPLIES 4

Former Member
0 Kudos

Write condition in loop-endloop.

loop at it_sak.

if mitkz NE space.

concatenate v_dit_sak-skb1 into v_d seperated by space.

v_a= 'x'.

else.

"->> write ur logic here

endif.

endloop.

Regards,

Aparna

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

You can display with that loop statement only.

like..,

loop at it_sak .
  if   mitkz NE space.
  write:/ v_d.
  else.
  < DISPLAY YOUR TABLE CONTENTS WITH WRITE STATEMENT>
  endif.
  endloop.

Thanks,

Naveen.I

Former Member
0 Kudos

V_d= 'no data present'

loop at it_sak .

if mitkz NE space.

concatenate v_dit_sak-skb1 into v_d seperated by space.

v_a= 'x'.

else.

write: 'the fields you want to display' .

endif.

endloop.

if v_a= 'x'.

message i001 with v_d.

end if.

Former Member
0 Kudos

Hi ,

Do this way .

loop at it_sak .

If it_sak-mitsk = space.

ur code for values space.

else.

concatenate v_dit_sak-skb1 into v_d seperated by space.

v_a= 'x'.

endif.

endloop.

if v_a= 'x'.

message i001 with v_d.

end if.

Now in the End what all values where = space those values can be displayed..