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
749

Hi,

i had read 3 fields(AUART FKARV FKARA.) data into itab.

now i want to check fkarv and fkara is initial.

what i am doing is reading single record into work area and checking

if wa-fkarv is initial.

append objky.

elseif wa-fkara is initial

append objky.

endif.

am i right?

can any one suggest me the better or it is ok.

Regards,

Ratna.

7 REPLIES 7
Read only

Former Member
0 Likes
716

Hi,

Loop at internal table where fkarv ne space and fkara ne space.

Process the logic.

endloop.

Regards,

Read only

Former Member
0 Likes
716

You mean to say

//now i want to check fkarv and fkara is initial.

1. if both are initial then you have to append the table is this ur criteria?

or

2. any "one" is initial then it has to append means either one of them.

if your option is 2. then your code it works .

if you want option 1 use "and" logic.

regards,

vijay.

Read only

Former Member
0 Likes
716

SORRY CANNOT GET YOUR ACTUAL REQUIREMENT CAN SAY IT IN MORE ELABORATE WAY? WITH SOME MORE CODINGS

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
716

Do in the following way.

loop at ITAB into wa

where wa-fkarv is initial.

do processing.

endloop.

loop at ITAB into wa

where wa-fkara is initial.

add you logic

endloop.

Read only

Former Member
0 Likes
716

hi,

loop at itab where fkarv = ' ' or fkara = ' '.

if sy-subrc eq 0.

do append or what u want.

endif.

endloop.

regards.

Read only

former_member508729
Active Participant
0 Likes
716

Hi Ratna,

Instead of reading each record you can directly loop on it with where condition as

below.

clear wa.

loop at itab into wa where fkarv eq space and

fkara eq space.

do your processing here.

clear wa.

endloop.

Regards

Ashutosh

Reward points if helpful

Read only

Former Member
0 Likes
716

1. If both are initial and u want to append the table , then u can use AND

   loop at itab into wa.
       if wa-fkarv is initial AND
         wa-fkara is initial.
          apend objky.
       endif.
  endloop.

2. If any one of them is initial and u want to append the table then u can use OR

 loop at itab into wa.
       if wa-fkarv is initial OR
         wa-fkara is initial.
          apend objky.
       endif.
  endloop.