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 REPORT ISSUE

Former Member
0 Likes
1,794

Dear experts,

I am working on alv grid report.Here I fetch data from vbak table and display on o/p/

when I check my code by ctrl+f2, its showing an information error that,

IN UNICODE PROGRAM THE '_' CHARACTER, CAN NOT APPEAR IN NAMES,AS IT DOES HERE AS NAME IT_VBAK.  WHY its comming ???

Also when I am doing execute, data is coming to it-vbak but its going to dump when i pass it by reuse_alv_grid_isplay fm .

Please check and give me some guide....

Kind Regards,

Ajit

1 ACCEPTED SOLUTION
Read only

kethanuppalapati
Explorer
0 Likes
1,764

Hi Ajit,

The dump will come because of various reasons. Please see the reason in ST22. In your case it might be because of data type mismatch.

Plesase check the ALV field catlog once. The field names in the internal table and ALV field catalog should be same. Also make sure you check the captial letters while naming field catalog. That is if you are declaring field name with T_VBELN in internal table then field catalog also should have the same name. make sure even the capital and small letters match while giving in quotes.

TYPES: BEGIN OF TY_VBAP,

     T_VBELN TYPE VBELN,

     END OF TY_VBAP.

     DATA: GT_VBAP TYPE TABLE OF TY_VBAP.


Field catalog:


GS_VBAP_FCAT-COL_POS = '1'.

GS_VBAP_FCAT-FIELDNAME 'T_VBELN'.

GS_VBAP_FCAT-TABNAME = 'GT_VBAK'.

GS_VBAP_FCAT-SELTEXT_M = 'VBELN'.

APPEND GS_VBAP_FCAT TO GT_VBAP_FCAT.

CLEAR GS_VBAP_FCAT.


Also check the data types of the fields declared.


Regards,

Kethan


Hi Ajit,

The dump will come because of various reasons. Please see the reason in ST22. In your case it might be because of data type mismatch.

Plesase check the ALV field catlog once. The field names in the internal table and ALV field catalog should be same. Also make sure you check the captial letters while naming field catalog. That is if you are declaring field name with T_VBELN in internal table then field catalog also should have the same name. make sure even the capital and small letters match while giving in quotes.

TYPES: BEGIN OF TY_VBAP,

     T_VBELN TYPE VBELN,

     END OF TY_VBAP.

     DATA: GT_VBAP TYPE TABLE OF TY_VBAP.


Field catalog:


GS_VBAP_FCAT-COL_POS = '1'.

GS_VBAP_FCAT-FIELDNAME 'T_VBELN'.

GS_VBAP_FCAT-TABNAME = 'GT_VBAK'.

GS_VBAP_FCAT-SELTEXT_M = 'VBELN'.

APPEND GS_VBAP_FCAT TO GT_VBAP_FCAT.

CLEAR GS_VBAP_FCAT.


Also check the data types of the fields declared.


Regards,

Kethan


13 REPLIES 13
Read only

Former Member
0 Likes
1,764

Hi,

   Please provide more information about declarations.I think replace it-vbak with it_vbak.

Read only

former_member187748
Active Contributor
0 Likes
1,764

Hi Ajit,

if possible please paste your whole code, where you are getting error.

What you have declared it as a data, or what ?

Read only

former_member585060
Active Contributor
0 Likes
1,764

Hi,

Check the fieldcatalog for ur ALV or u may not passing all the required parameters to the display function module.

Read only

kethanuppalapati
Explorer
0 Likes
1,764

Hi Ajit,

Replace the '-' with ''_'' in internal table declaration.

Change it-vbak to it_vbak. Unicode check does not support ''-'' so you are getting this warning message.

Regards,

Kethan

Read only

0 Likes
1,764

Thanks Ketan,

I changed and resole the 1st issue but please check why its going to dump while i execute.

Regards,

Ajit

Read only

0 Likes
1,764

Ajit,

please paste your code as attachment, then only one can look into the problem.

Read only

Former Member
0 Likes
1,764

Dear,

type-pools: slis.

types: begin of ty_vbak,

               vbeln type vbak-vbeln,

               ernam type vbak-ernam,

               auart  type  vbak-auart,

              end of ty_vbak.

types : begin of ty_vbap,

               vbeln type vbap-vbeln,

               posnr type vbap-posnr,

               matnr type vbap-matnr,

end of ty_vbap.

data: it_vbak type standard table of ty_vbak,

        it_vbap type standard table of ty_vbap,

          wa_vbak type ty_vbak,

          wa_vbap type ty_vbap.

start-of-selection.

perform fetch_data.

end-of-selection.

perform display_data.

from display_data.

call fumction 'reuse_alv_grid_display'

exporting

i_callback_program = sy-cprog

I_structure_name = ' ty_vbak '

tables

t_outtab = it_vbak

end display_data.

from fetch_data.

select vbeln ernam auart from vbak into table it_vbak up o 10 rows.

end of fetch_data.

Please check..data is comming to it_vbak but in grid fm its going for dump

also in alv list display fm its not showing anything ?????

if i change the structure name to vbak instead of ty_vbak,,showing the same result

plzz chk and let me know.....

regards,

Ajit

Read only

0 Likes
1,764

Hi Ajit,

Please check the field catalog decration once. Here you are declaring field name ''vbeln''

make sure you are giving same in ''vbeln'' to feild catalog structure (eg:GS_VBAK_FCAT-FIELDNAME).

Similarly check for all the fields.


Regards,

Kethan.

Read only

0 Likes
1,764

Hi,

call fumction 'reuse_alv_grid_display'

exporting

i_callback_program = sy-cprog

I_structure_name = ' ty_vbak '    ---> make it 'TY_VBAK'

tables

t_outtab = it_vbak.

Thanks & Regards

Bala Krishna

Read only

0 Likes
1,764

Hi Ajit,

please see the changes i have done , and now create a fieldcatlog, where you have created

your fieldcatlog ?

please see this code, i have done many corrections into it, please changes it accordingly

*&---------------------------------------------------------------------*

*& Report  ZSCN_DATA

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZSCN_DATA.

type-pools: slis.

types: begin of ty_vbak,

                vbeln type vbak-vbeln,

                ernam type vbak-ernam,

                auart  type  vbak-auart,

               end of ty_vbak.

types : begin of ty_vbap,

                vbeln type vbap-vbeln,

                posnr type vbap-posnr,

                matnr type vbap-matnr,

end of ty_vbap.

DATA : V_REPID TYPE SY-REPID.

data: it_vbak type standard table of ty_vbak,

         it_vbap type standard table of ty_vbap,

           wa_vbak type ty_vbak,

           wa_vbap type ty_vbap.

start-of-selection.

perform fetch_data.

perform display_data.

end-of-selection.

form fetch_data.

select vbeln ernam auart from vbak into table it_vbak up to 10 rows.

endform.

fORM display_data.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = V_REPID

I_structure_name = ' TY_VBAK '

tables

t_outtab = it_vbak.

endform . " display_data.

  " of fetch_data.

Read only

kethanuppalapati
Explorer
0 Likes
1,765

Hi Ajit,

The dump will come because of various reasons. Please see the reason in ST22. In your case it might be because of data type mismatch.

Plesase check the ALV field catlog once. The field names in the internal table and ALV field catalog should be same. Also make sure you check the captial letters while naming field catalog. That is if you are declaring field name with T_VBELN in internal table then field catalog also should have the same name. make sure even the capital and small letters match while giving in quotes.

TYPES: BEGIN OF TY_VBAP,

     T_VBELN TYPE VBELN,

     END OF TY_VBAP.

     DATA: GT_VBAP TYPE TABLE OF TY_VBAP.


Field catalog:


GS_VBAP_FCAT-COL_POS = '1'.

GS_VBAP_FCAT-FIELDNAME 'T_VBELN'.

GS_VBAP_FCAT-TABNAME = 'GT_VBAK'.

GS_VBAP_FCAT-SELTEXT_M = 'VBELN'.

APPEND GS_VBAP_FCAT TO GT_VBAP_FCAT.

CLEAR GS_VBAP_FCAT.


Also check the data types of the fields declared.


Regards,

Kethan


Read only

Former Member
0 Likes
1,764

Dear,

Thanks for your valuable answer..

I did the worng code like you said, small letter instead of uppercase letter

Also I declared my fieldcatalog internal table 2 times.

Now I resolve the isse..

Thanks Again...

Regards,

Ajit

Read only

Former Member
0 Likes
1,764

Hi Ajit,

You didnt pass the field catalog in function module 'REUSE_ALV_GRID_DISPLAY'. It is mandatory.

Please declare the field catalog like below,

*internal table

   DATA : gi_fieldcat TYPE slis_t_fieldcat_alv.

*Work area
   DATA : gwa_fieldcat TYPE slis_fieldcat_alv.

and add the field in field catalog internal table and pass it in function module. like below,

   FORM display_data.
  CLEAR : gwa_fieldcat.
  gwa_fieldcat-fieldname = 'VBELN'.
  gwa_fieldcat-seltext_m = 'VBELN'.
  APPEND gwa_fieldcat TO gi_fieldcat.

  CLEAR : gwa_fieldcat.
  gwa_fieldcat-fieldname = 'ERNAM'.
  gwa_fieldcat-seltext_m = 'ERNAM'.
  APPEND gwa_fieldcat TO gi_fieldcat.

  CLEAR : gwa_fieldcat.
  gwa_fieldcat-fieldname = 'AUART'.
  gwa_fieldcat-seltext_m = 'AUART'.
  APPEND gwa_fieldcat TO gi_fieldcat.



  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                = sy-cprog
     i_structure_name                  = 'TY_VBAK'
    IT_FIELDCAT                       = gi_fieldcat
    TABLES
      t_outtab                          = it_vbak

ENDFORM. "display_data.