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: 

error in field catalog in ALV grid display using classes at do_sum = "X'.

veeranjaneyulub
Explorer
0 Kudos
355

Hi,

I'm using classes in ALV Grid display.

the code for the field catalog is going to dump because of the statement in the field catalog for field 'netwr',do_sum = 'X'.

that do_sum = 'X' is not working and going to dump when executed.with out that do_sum it is working fine. the error in dump analysys is showing sap standard incude LSLVCF01.

assign component

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

if sy-subrc ne 0.

message x000(0k).

endif.

sy-subrc is 4 when the program is being executed.

CODE:

FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.

DATA ls_fcat TYPE lvc_s_fcat.

ls_fcat-fieldname = 'VBELN1'.

ls_fcat-ref_field = 'VBELN'.

ls_fcat-ref_table = 'VBRK'.

ls_fcat-coltext = 'Invoice No'.

ls_fcat-seltext = 'Invoice No'.

APPEND ls_fcat TO pt_fieldcat.

CLEAR ls_fcat.

ls_fcat-fieldname = 'BUDAT'.

ls_fcat-ref_table = 'BKPF'.

ls_fcat-coltext = 'Invoice Date'.

ls_fcat-seltext = 'Invoice Date'.

APPEND ls_fcat TO pt_fieldcat.

CLEAR ls_fcat.

ls_fcat-fieldname = 'NETWR'.

ls_fcat-ref_field = 'NETWR'.

ls_fcat-ref_table = 'VBRK'.

ls_fcat-coltext = 'Value of Invoice'.

ls_fcat-seltext = 'Value of Invoice'.

ls_fcat-datatype = 'CURR'.

ls_fcat-do_sum = 'X'.

APPEND ls_fcat TO pt_fieldcat.

CLEAR ls_fcat.

ENDFORM.

can u please look in the code and rectify the error,

would appeciate ur response.

regards,

veera.

4 REPLIES 4

Former Member
0 Kudos
113

Hello Veera,

Add this line for NETWR.

<b>L_FIELDCAT-CFIELDNAME = 'WAERS'.</b>

Check the field definition .

Declare like this.

<b>NETWR TYPE BWERT.</b>

If useful reward,

Vasanth

Former Member
0 Kudos
113

try

fcat- cfieldname = 'WAERK' for Price field.

Regards

Prabhu

former_member671224
Participant
0 Kudos
113

Hi veera,

you give the internal table name as reference table for the field.and I think no need to give reference field for that field.Try it and see.

Amal.

former_member188685
Active Contributor
0 Kudos
113

Hi,

try this..

ls_fcat-fieldname = 'NETWR'.

ls_fcat-ref_field = 'NETWR'.

ls_fcat-ref_table = 'VBRK'.

ls_fcat-coltext = 'Value of Invoice'.

ls_fcat-seltext = 'Value of Invoice'.

ls_fcat-datatype = 'CURR'.

ls_fcat-do_sum = 'X'.

<b>ls_fcat-cfieldname = 'WAERS'.</b>

APPEND ls_fcat TO pt_fieldcat.

CLEAR ls_fcat.

Regards

vijay