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 related to ALV List Report

Former Member
0 Kudos

Hi All,

I have issue while working in ALV List Report!

Actual issue is:

I have some QUAN[Value] fields in my internal tables.

Though they are getting filled in internal table.

But when i pass that internal table to <b>REUSE_ALV_LIST_DISPLAY</b> the Quantity values are not getting displayed! Other Type[Char] type fields/Columns are getting displayed.

Can anybody tell me what changes i have to make to the program to display amount fields!

Thanks in adavance.

Thanks & Regards,

Prasad.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Why dont you declare a new character type variable which is equivalent to the length of that quantity field and just write the quantity field to that newly declared variable. write <quantity field> to <character equivalent variable>.

Then you just pass the character variable to the ALV List FM.

Hope it should work...

Regards,

Sampath.

18 REPLIES 18

former_member181962
Active Contributor
0 Kudos

Hi Prasad,

If you are using quan type variables, then in the field catalog you have to also fill in some info related to the unit of measurement(qfieldname).

Regards,

Ravi

former_member188685
Active Contributor
0 Kudos

Hi,

check all these ..

did you mention the correct fieldname while building fieldcat.

i think this one is making that .

and also provide your itab defintion and fieldcat for quant field.

Regards

vijay

rahulkavuri
Active Contributor
0 Kudos

can u give us the related code used for fieldcatalog concatenation

Former Member
0 Kudos

Hi,

Why dont you declare a new character type variable which is equivalent to the length of that quantity field and just write the quantity field to that newly declared variable. write <quantity field> to <character equivalent variable>.

Then you just pass the character variable to the ALV List FM.

Hope it should work...

Regards,

Sampath.

0 Kudos

Hi,

Field Catalog information is declared as below:

fieldcatalog-fieldname = 'TYPE'.

fieldcatalog-seltext_m = ''.

fieldcatalog-col_pos = 0.

fieldcatalog-outputlen = 10.

fieldcatalog-emphasize = c_x.

fieldcatalog-key = c_x.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'KOSTL'.

fieldcatalog-seltext_m = 'Resource ID'.

fieldcatalog-col_pos = 1.

fieldcatalog-outputlen = 10.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VERAK'.

fieldcatalog-seltext_m = 'Manager'.

fieldcatalog-col_pos = 2.

fieldcatalog-outputlen = 20.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'KTEXT'.

fieldcatalog-seltext_m = 'Title'.

fieldcatalog-col_pos = 3.

fieldcatalog-outputlen = 20.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'GJAHR'.

fieldcatalog-seltext_m = 'Year'.

fieldcatalog-col_pos = 4.

fieldcatalog-outputlen = 4.

fieldcatalog-emphasize = c_x.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG001'.

fieldcatalog-seltext_m = 'Jan'.

fieldcatalog-col_pos = 5.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG002'.

fieldcatalog-seltext_m = 'Feb'.

fieldcatalog-col_pos = 6.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG003'.

fieldcatalog-seltext_m = 'Mar'.

fieldcatalog-col_pos = 7.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG004'.

fieldcatalog-seltext_m = 'Apr'.

fieldcatalog-col_pos = 8.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG005'.

fieldcatalog-seltext_m = 'May'.

fieldcatalog-col_pos = 9.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG006'.

fieldcatalog-seltext_m = 'June'.

fieldcatalog-col_pos = 10.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG007'.

fieldcatalog-seltext_m = 'July'.

fieldcatalog-col_pos = 11.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG008'.

fieldcatalog-seltext_m = 'Aug'.

fieldcatalog-col_pos = 12.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG009'.

fieldcatalog-seltext_m = 'Sep'.

fieldcatalog-col_pos = 13.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG010'.

fieldcatalog-seltext_m = 'Oct'.

fieldcatalog-col_pos = 14.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG011'.

fieldcatalog-seltext_m = 'Nov'.

fieldcatalog-col_pos = 15.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG012'.

fieldcatalog-seltext_m = 'Dec'.

fieldcatalog-col_pos = 16.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WTG013'.

fieldcatalog-seltext_m = 'Jan'.

fieldcatalog-col_pos = 17.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

And Data Declaration for the same is as:

TYPES: BEGIN OF t_alv_output,

kostl TYPE csks-kostl, "Cost Center

verak TYPE csks-verak, "Person Responsible

ktext TYPE cskt-ktext, "General Name

gjahr1 TYPE coss-gjahr, "Date

type(10) TYPE c,

value01 TYPE coss-wtg001,

value02 TYPE coss-wtg001,

value03 TYPE coss-wtg001,

value04 TYPE coss-wtg001,

value05 TYPE coss-wtg001,

value06 TYPE coss-wtg001,

value07 TYPE coss-wtg001,

value08 TYPE coss-wtg001,

value09 TYPE coss-wtg001,

value10 TYPE coss-wtg001,

value11 TYPE coss-wtg001,

value12 TYPE coss-wtg001,

value13 TYPE coss-wtg001,

END OF t_alv_output.

I am able to fill kostl,verak,ktext,type Other fields are not shown in ALV List output though values are present in internal table!

Can anybody tell me what changes i have to make to QUAN/CURR fields!

Thanks,

Prasad.

0 Kudos

Hi as i said,

fieldcatalog-fieldname = 'VLAUE01'.

fieldcatalog-seltext_m = 'Jan'.

fieldcatalog-col_pos = 5.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VALUE02'.

fieldcatalog-seltext_m = 'Feb'.

fieldcatalog-col_pos = 6.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VALUE03'.

fieldcatalog-seltext_m = 'Mar'.

fieldcatalog-col_pos = 7.

fieldcatalog-outputlen = 19.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.....

and also try to give internal table name also.

Regards

vijay

0 Kudos

CHange the field names to those declared in the internal table or change the names of the internal table fields to WTG001 /WTG002 ETC.

0 Kudos

Hi Vijay,

Yes you are right i had not given correct field names.

Many Thanks for your reply.

Now i am able to get correct output.

3 more clarifications.

1. Can we make entries in a column BOLD!

2. In my amount fields, if values are not present it is displaying it as <b>0.00</b>

3. Is there any restriction on amount/Display fields!

what is the max length allwed.

Though i am giving 19 it is showing 10 only.

Thanks,

Prasad.

0 Kudos

Hi,

4. one more issue is how to Round off values[QUAN/CURR].

If it's <b>123.75/123.23</b> it should show as 123.

Thanks,

Prasad.

0 Kudos

Hi,

since you are giving medium,

fieldcatalog-fieldname = 'WTG010'.

fieldcatalog-<b>seltext_m</b> = 'Oct'.

medium is causing that. and if you want that then use long.

fieldcatalog-fieldname = 'WTG010'.

fieldcatalog-<b>seltext_l</b> = 'Oct'.

<b>fieldcatalog-ddictext = 'L'.</b>

Bold not sure.

Regards

vijay

0 Kudos

For rounding

you can use fieldcat-round = provide int value to this

Regards

vijay

0 Kudos

Hi,

2. In my amount fields, if values are not present it is displaying it as 0.00 if i want to make it blank how can i do the same!

is there any solution for the same!

Thanks,

Prasad.

0 Kudos

In the field catalog, specify no_zero = 'X'.

Regards,

Ravi

0 Kudos

Hi,

try with fieldcat-NO_ZERO = 'X'.

this might work.

don't forget to reward points for helpful answers.

Regards

vijay

0 Kudos

Hi,

That option is not working.

It is not making amounts with output as <b>0.00</b> to <b>0/Blank</b>.

Thanks,

Prasad.

0 Kudos

sorry prasad, there is no option as such, it is not possible , you should go with 0.00 only.

Regards

vijay

0 Kudos

Hi,

Thanks for those replies.

I had awarded points.

Now i have only 3 issues pending.

1. I have to see Whether we can make one column entries BOLD!

2. I have to check how can i make <b>0.00</b> entries into <b>0/Blank</b>.

3. Another issue is if value is <b>123.78/123.12</b> we should display it as <b>123</b>.

These are issues pending. I will work it out.

Thanks for all your help.

Thanks & Regards,

Prasad.

Former Member
0 Kudos

Hi prasad,

i tried to display one of the field having QUAN(value) field.

and it is working fine.

here is the code.


REPORT  ZKINTEST_ALV                                                .
type-pools:slis.
tables : COER.
data :   it_fieldcat type slis_t_fieldcat_alv.
          
data : itab2 type table of COER.
data: x_fieldcat type slis_fieldcat_alv.

x_fieldcat-fieldname = '<b>FKIMG</b>'. " QUAN field
x_fieldcat-tabname = 'COER'.
x_fieldcat-col_pos  = 1.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.

select * from COER into table itab2.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program       = sy-repid
i_callback_pf_status_set = 'POPUP'
i_callback_user_command  = 'HANDLE_USER_COMMAND'
i_callback_top_of_page = 'TOP-OF-PAGE'
it_fieldcat              = it_fieldcat
TABLES
t_outtab                 = itab2
EXCEPTIONS
program_error            = 1
others                   = 2.

hope this will help you.

regards,

Kinshuk Saxena