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

append statment_numeric field

naveen_inuganti2
Active Contributor
0 Likes
679

Hi all....

Iam having one internal table with five fields and 10 records...

Now iam going to add one more record to that internal table in my program by using append statement...

itab-f1 = ' '.

itab-f2 = ' '.

itab-f3 = ' '.

itab-f4 = 'india '.

itab-f5 = ' '.

append itab.clear itab.

with above syntax i have to get four spaces and one entry....

but i am getting 0 for the last field, which is the numeric field...

how to avoid that zero...

there is no chanse to change numeric as char or others....

and

one more thing is iam dispalying this internal table by using table control, not with normal reporting!!!!

thank you,

naveen.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
660

hi Naveen

do this it will work

define ur last field in this way when ur declaring an internal table ok

data :

f5(5) type numc .

now after this do this

itab-f5 = ' '.

now append ok so it will resolve problem.

plz reward .

thanku

snehi chouhan

7 REPLIES 7
Read only

Former Member
0 Likes
660

Hi,

Please refer example below:


WRITE: '000123',
     / '000123' NO-ZERO.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
660

Hello,

For numeric fields the initial value is zero. Check if you can change the field type to character.

Regards,

Read only

Former Member
0 Likes
660

hye naveen,

Declare in the structure of internal table for the fifth coloumn as char. otherwise the defualt for an integer is 0.

Reward if helpful.

Thanks.

Read only

Former Member
0 Likes
661

hi Naveen

do this it will work

define ur last field in this way when ur declaring an internal table ok

data :

f5(5) type numc .

now after this do this

itab-f5 = ' '.

now append ok so it will resolve problem.

plz reward .

thanku

snehi chouhan

Read only

0 Likes
660

hi...

thank you for your answer....

but here there is no chanse to declare that field as you said, because it was database table field and using in some otherr reports and also in this report for different conditions(calculating)....

showing error like...

LENGTH SPECIFICATION NOT ALLOWEDWITH TYPE '<f5>'.

??????

(any way you wl get marks but solve my problem completely for max...)

Thank you,

Naveen.

Read only

prasanth_kasturi
Active Contributor
0 Likes
660

hi,

i have a example top suit your requirement

modify according to your need.

while your using write statement use no-zero addition with numeric field. i feel that solves your prob

ex : write itab-f5 no-zero.

data :begin of itab occurs 0,

a(3) type c,

c(3) type c,

b(3) type n,

end of itab.

itab-a = ''.

itab-c = 'abc'.

itab-b = '' .

append itab.

itab-a = 'ABC'.

itab-c = ''.

itab-b = '123'.

append itab.

loop at itab.

write : / itab-a,

itab-c,

itab-b no-zero.

endloop.

REWARD IF HELPFUL

prasanth

Read only

Former Member
0 Likes
660

Well we have two solutions:

1) Well it seems you are Using STD DDIC Structure/Table

eg. tables: table or

data: Stru1 type table1

Well in that case you have define the structure manually

i.e with

begin of stru

All stru conponents (make sure you difine urr numeric field as char or num c)

and your remaining code will remain as it is or

2) create anothe stucture of same type excpet that field and use move command before display

i.e

move numberic to char.

and displlay..

No Rewards Plz