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 blank row in internal table having numeric fields

Former Member
0 Likes
1,800

I want to insert blank row in internal table (all the fields are numeric).

I m using ALV grid.

I want to display data like :

Name Amount1 Amount 2 Amount 3

A 1.00 7.00 3.00

B 4.00 1.00 8.00

C 5.00 9.00 8.00

<-----here i want to insert blank row

Total 10.00 17.00 19.00

and i m using :

APPEND INITIAL LINE TO ITAB_FINAL.

Output is :

Name Amount1 Amount 2 Amount 3

A 1.00 7.00 3.00

B 4.00 1.00 8.00

C 5.00 9.00 8.00

0.0 0.0 0.0 <----- Cause all the fields are currency type

Total 10.00 17.00 19.00

What should I do , please help me out.

Edited by: Pooja Rawat on Oct 6, 2009 4:20 PM

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,202

You did correctly with appending initial line, just set in fieldcatalog NO_ZERO = 'X'. it will suppress zeros output, hence will print empty line.

Regards

Marcin

11 REPLIES 11
Read only

Former Member
0 Likes
1,202

That's just not possible.

But why do you even want that?

Read only

Former Member
0 Likes
1,202

make all fields as string type

Read only

Former Member
0 Likes
1,202

If the field types are currency it wont be possible. One way is to declare another internal table with fields of type string and append the lines of the previous internal table to the new one and the try using APPEND INITIAL LINE TO ITAB_FINAL

Read only

MarcinPciak
Active Contributor
0 Likes
1,203

You did correctly with appending initial line, just set in fieldcatalog NO_ZERO = 'X'. it will suppress zeros output, hence will print empty line.

Regards

Marcin

Read only

0 Likes
1,202

I didn't find NO_ZERO = 'X'.

can u send me the syntax.

Read only

0 Likes
1,202

NO_ZERO is in fieldcatalog,

gs_fcat-no_zero = 'X'.

ths gs_fcat is of type slis_fieldcat_alv

Read only

0 Likes
1,202

I m using 'REUSE_ALV_GRID_DISPLAY'.

Read only

Former Member
0 Likes
1,202

You may try creating another internal table with all fields of character type and use the same for appending blank line. Hence pass this internal table to ALV.

Thanks,

Preyansh

Read only

Former Member
0 Likes
1,202

Forget about the initial line and the total line. Use the ALV functionality to calculate any totals.

Read only

0 Likes
1,202

I m using 'REUSE_ALV_GRID_DISPLAY'

How can I use ALV functionality to calculate the total.

Read only

0 Likes
1,202

>

> I m using 'REUSE_ALV_GRID_DISPLAY'

>

> How can I use ALV functionality to calculate the total.

Sorry, but what you really need: add blank line or calculate total? I guess the initial question was different.

As for the component NO_ZERO, it it in SLIS type pool, more precisely type slis_fieldcat_main0 which is part of slis_fieldcat_alv . This one you used for typing fieldcatalog?

Regards

Marcin