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

Reports.

Former Member
0 Likes
803

I am trying to append data from Work area to another internal table.

- System is appending only ‘values’.

- But not appending ‘ZEROS’ where the value is ‘0’-zero.

While displaying in output (report), system Displaying as space instead of zeros. My requirement is to display ‘0’ instead of spaces where ever the value is zero.

Please help - how to write code.

Thanking You.,

Sanju

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
787

Hi,

Null and Zeros wont get appended in internal table

only in currency and quantity fields zeros will appear....

Regards,

V.Balaji

Reward if usefull

7 REPLIES 7
Read only

Former Member
0 Likes
787

How have you declared that fields?

Read only

Former Member
0 Likes
787

hi,

declare the variable as type N to append the leading zeros


i.e, data : v_num(10) type N.

  v_num = '010'.
  write : v_num.
 

Read only

Former Member
0 Likes
788

Hi,

Null and Zeros wont get appended in internal table

only in currency and quantity fields zeros will appear....

Regards,

V.Balaji

Reward if usefull

Read only

0 Likes
787

Hi BALAJI / all consultants,

Thanks for your response.

I am trying to display the qty field (VBRK-FKIMG).

If the qty = '0', the same is appending to it_output2.

Finally, out put showing as space.

"append wa_it_output1 to it_output2".

Pls advise.,

SANJU

Read only

0 Likes
787

Hi,

do this way...


 v_quant like ekpo-netpr.
data: begin of it_output2 occurs 0,
       .........
      qty(17),

       ...... 
       end     of it_output2. 
   v_quant = '0'.
   write v_quant to it_output2-qty.
   append it_output2.

   loop at it_output2.
     write it_output2-qty.
  endloop.
 

Read only

Former Member
0 Likes
787

Hi,

You can do as below:


loop at itab.

if itab-fieldname = ''.
  move : '0' to itab-fieldname.
  modify itab.
  clear itab.
endif.

endloop.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
787

I think your internal table has fields of character type ...

check for the values in the internal table ...

if itab-f1 is initial.

  • write 0's ...

endif.