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

Insert record into DB - record with data only

Former Member
0 Likes
637

Hi gurus,

I tried to insert data from itab into db.

When there is no data from itab, there is still one row of record as such

00000

0000

in this case, the above record went into my db.

Since, there is really no data, how can i avoid this data into my db?

Many thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
492

hi,

do this way ....


loop at itab.
  if not itab IS INITIAL.
    INSERT ztable FROM itab.
  endif.
endloop.

Regards,

Santosh

4 REPLIES 4
Read only

Former Member
0 Likes
492

Hi,

Simply check in the internal table.

LOOP AT itab.

IF itab IS INITIAL.

DELETE itab.

ENDLOOP.

Regards,

Atish

Read only

Former Member
0 Likes
492

Hi,

I managed to solve it this way too.

IF NOT itab_voc IS INITIAL.

INSERT zeuc127_v FROM itab_voc[].

endif.

Thanks for your help too

Read only

Former Member
0 Likes
492

resolved.

Read only

Former Member
0 Likes
493

hi,

do this way ....


loop at itab.
  if not itab IS INITIAL.
    INSERT ztable FROM itab.
  endif.
endloop.

Regards,

Santosh