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: 

Issue When moving Dates

former_member216668
Participant
0 Kudos

Hi,

I am selecting dates from a Database table and moving it to an internal table, When values are present in DB table it copies it correctly whereas when there is no value in DB table a Zero gets stored in the internal table and gets subsequently printed.

I want to avoid this issue and i want only blanks in the internal table when the value in DB is not filled.

Thanks & Rgrds,

Ken

1 ACCEPTED SOLUTION

Former Member
0 Kudos

in internal table change field dats type to char type , then it wil not display zero..

Reward if useful

Ankesh

5 REPLIES 5

Former Member
0 Kudos

in internal table change field dats type to char type , then it wil not display zero..

Reward if useful

Ankesh

Former Member
0 Kudos

data dt type sy-datum.

dt = sy-datum.

write 😕 dt.

clear dt.

if dt is initial.

dt = space.

endif.

write 😕 dt.

does that help???

Former Member
0 Kudos

hi!

As ur variable is in date format its displaying Zeros when there is no data in DB.

By declaring the variable as string r char you can avoid this Zero (or)

fetch all the data as u need in Tab and Loop the Itab for date = 0 and replace 0 to Blank space.

Reward me if its useful.

Regards,

Nagulan

Former Member
0 Kudos

Hi

Write ur date field to a character type field of the same length as follows

data: lv_date(10) type c.

WRITE itab-date to lv_date.

Thanks,

Anon

Former Member
0 Kudos

Hi Ken,

Did the answers help you to solve the problem.

If not quote the problem.

If yes, close the thread..

Thanks,

Anon