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: 

how to assign a variable with a space

Former Member
0 Kudos

i am working on reports i need to assign a variable with space. i have give

data: target type i.

target is a difference between two date, suppose the end date if i find is greater then the target field should be empty( with no values, not even zero), i need to assign this target field to a another field which i will be using it to display in the alv grid.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Then you shouldn't use TYPE I. Use TYPE C instead.

report zrich_0001.

data: target<b>(5) type c</b>.

parameters: p_dat1 type sy-datum,
            p_dat2 type sy-datum.


start-of-selection.

  target = p_dat1 - p_dat2.

  if target < 0.
    clear target.
  endif.

  write:/ target.

REgards,

Rich Heilman

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Then you shouldn't use TYPE I. Use TYPE C instead.

report zrich_0001.

data: target<b>(5) type c</b>.

parameters: p_dat1 type sy-datum,
            p_dat2 type sy-datum.


start-of-selection.

  target = p_dat1 - p_dat2.

  if target < 0.
    clear target.
  endif.

  write:/ target.

REgards,

Rich Heilman