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

ALV SUM error

Former Member
0 Likes
1,466

Hi all !!

I'm dipalying CURR field on alv. When trying to do sum on i get short dump.

that is my fieldcat definition:

ls_fieldcat-fieldname = 'NETWR'.

ls_fieldcat-ref_fieldname = 'NETWR'.

ls_fieldcat-ref_tabname = 'VBRP'.

ls_fieldcat-datatype = 'CURR'.

ls_fieldcat-cfieldname = 'WAERK'.

ls_fieldcat-ctabname = 'VBRK'.

What is my error ??

BR, JAcek

8 REPLIES 8
Read only

Former Member
0 Likes
1,089

add this and try ..

ls_fieldcat-fieldname = 'NETWR'.
ls_fieldcat-ref_fieldname = 'NETWR'.
ls_fieldcat-ref_tabname = 'VBRP'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-cfieldname = 'WAERK'.
ls_fieldcat-ctabname = 'VBRK'.
<b>ls_fieldcat-do_sum = 'X'.</b>

Read only

0 Likes
1,089

will be the same as doin sum with button on alv

BR, JAcek

Read only

0 Likes
1,089

change the datatype and try out

ls_fieldcat-datatype = 'QUAN'.

Read only

0 Likes
1,089

it still dosent work correctly

BR< JAcek

Read only

Former Member
0 Likes
1,089

Hi Jacek,

do you mean: ls_fieldcat-cfieldname = 'WAERK'

or

ls_fieldcat-cfieldname = 'WAERS'

Regards, Dieter

Sorry the field is in VBRK,

But why do you use

ls_fieldcat-cfieldname = 'WAERK'.

ls_fieldcat-ctabname = 'VBRK'.

Try without this Lines.

regards, Dieter

Message was edited by: Dieter Gröhn

Read only

Former Member
0 Likes
1,089

Hi Jacek,

The problem is that the total value that is resulted is bigger than the capacity of the variable.

Declare the variable as a bigger one.

for example. if vbrp netwr is of type p (17,2) 17 before decimal and 2 after it, use another data element which has (19,2) 19 places before decimal and 2 after it.

YOu can change the data type of the variable or

you can give the fie;dcatalog parameters:

ls_fieldcat-ref_fieldname = 'VKWRT'.

ls_fieldcat-ref_tabname = 'AUBF'.

Regards,

Ravi

Read only

0 Likes
1,089

Nothing of that doesnt work fine on my system (4.7).

(ST22 Error): MESSAGE_TYPE_X

...

assign component

<ls_fieldcat>-fieldname of structure rt_data to <g_field>.

if sy-subrc ne 0.

message x000(0k).

endif.

...

or when using in fieldac:

ls_fieldcat-cfieldname = 'WAERS'.

what was suggested in similiar problem in that formum sone times ago:

(st22)

Invalid dynamic line component.

..

When the ABAP program "SAPLSKBH" attempted to process the internal

table "RT_COLLECT00[]" with "SORT", a component "WAERS " was specified

dynamically

as the contents of the field "L_UFIELDNAME".

One of the following errors then occurred:

- The line type "u" of the internal table "RT_COLLECT00[]" contains no

component "WAERS ".

- "WAERS " contained an invalid offset or length specification (for

example, you may have tried to access part of a field with type I or

STRING).

- The program "SAPLSKBH" is a Unicode program. In Unicode programs, you

can only apply offset/length access to a structure within its

character-type initial section. The system went beyond the

boundaries of "WAERS " 's initial section in this case.

- "WAERS " contains a declaration of the form "A->B" for dynamically

accessing an object attribute. At present, attributes can only be

addressed in this way statically.

- "WAERS " contained significant trailing spaces (only possible with type

STRING).

Message was edited by: Jacek Slowikowski

Read only

Former Member
0 Likes
1,089

dear jacek

(ST22 Error): MESSAGE_TYPE_X

...

assign component

<ls_fieldcat>-fieldname of structure rt_data to <g_field>.

if sy-subrc ne 0.

message x000(0k).

endif.

i think the above mentioned is the error in st22.

can u pls tell wht is the value in <ls_fieldcat>-fieldname and also please check that the same value is available in ur internal table which is used for listing the ALV output.

thanks

ambily