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 doesn't display correct data

former_member295881
Contributor
0 Likes
3,773

Hello Experts,

I'm working with ALV report and trying to display data but for some weird reason last two columns have same values as third last column. Here is the table which I use to display ALV.

I use this table (LT_OUTPUT) in FM 'REUSE_ALV_GRID_DISPLAY' but I don't know why last three columns displays the same value. Here is the output of ALV.

Can anybody point out my mistake and suggest how to rectify this issue.

Many thanks in advance.

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
2,781

Please check the fieldcatalog, the field name of internal table provided in fieldcatalog might be incorrect. If possible, paste declaration of lt_output and code where you are building the fieldcatalog.

Regards

8 REPLIES 8
Read only

former_member188827
Active Contributor
0 Likes
2,782

Please check the fieldcatalog, the field name of internal table provided in fieldcatalog might be incorrect. If possible, paste declaration of lt_output and code where you are building the fieldcatalog.

Regards

Read only

0 Likes
2,781

Many thanks for your reply netweaver. Not sure if this is the issue but here is how I've filled my fieldcatalog.

============================================================

   fieldcatalog-fieldname   = 'ZRERATE'.
   fieldcatalog-seltext_m   = 'Re-rating Number'.
   fieldcatalog-col_pos     = 0.
   fieldcatalog-outputlen   = 15.
   fieldcatalog-emphasize   = 'X'.
   fieldcatalog-key         = 'X'.
*  fieldcatalog-do_sum      = 'X'.
*  fieldcatalog-no_zero     = 'X'.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'KUNRG'.
   fieldcatalog-seltext_m   = 'Payer'.
   fieldcatalog-col_pos     = 1.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'AUART'.
   fieldcatalog-seltext_m   = 'Document Type'.
   fieldcatalog-col_pos     = 2.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'INITIATOR'.
   fieldcatalog-seltext_m   = 'Initiator'.
   fieldcatalog-col_pos     = 3.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'NEW_AMT'.
   fieldcatalog-seltext_m   = 'Invoice Amount'.
   fieldcatalog-col_pos     = 4.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'WAERK'.
   fieldcatalog-seltext_m   = 'Document Currency'.
   fieldcatalog-col_pos     = 5.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'ERDAT'.
   fieldcatalog-seltext_m   = 'Date re-rate invoice created'.
   fieldcatalog-col_pos     = 6.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.


   fieldcatalog-fieldname   = 'IDOC'.
   fieldcatalog-seltext_m   = 'IDOC Number'.
   fieldcatalog-col_pos     = 7.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'IDOC ERROR'.
   fieldcatalog-seltext_m   = 'IDOC Error Details'.
   fieldcatalog-col_pos     = 8.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

=======================================================

and here is the structure of the internal table lt_output


BEGIN OF t_output,
         zrerate   type  zrerate,
         kunrg     type  kunrg,
         auart     type  auart,
         initiator type  zrerate_initiator,
         new_amt   type  znew_amt,
         waerk     type  waerk,
         erdat     type  zrerate_date,
         idocnum   type  edidc-docnum,
         idocerror type  edi_help-error_flag,
END OF t_output.


Read only

0 Likes
2,781

Please replace IDOC with IDOCNUM.

 

fieldcatalog-fieldname   = 'IDOCNUM'.

   fieldcatalog-seltext_m   = 'IDOC Number'.

   fieldcatalog-col_pos     = 7.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.

Regards

Read only

0 Likes
2,781

Also, remove space between 'IDOC ERROR'.

fieldcatalog-fieldname   = 'IDOCERROR'.

Regards

Read only

0 Likes
2,781

Hi,

This happened because the name of the field in the output table and field catalog are not the same. Make it same. Your issue will be solved.

fieldcatalog-fieldname   = 'IDOCNUM'.
   fieldcatalog-seltext_m   = 'IDOC Number'.
   fieldcatalog-col_pos     = 7.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

   fieldcatalog-fieldname   = 'IDOCERROR'.
   fieldcatalog-seltext_m   = 'IDOC Error Details'.
   fieldcatalog-col_pos     = 8.
   append fieldcatalog to fieldcatalog.
   clear  fieldcatalog.

Read only

0 Likes
2,781

Many thanks netweaver your suggestions resolved my issue and also learned something new today.

Read only

0 Likes
2,781

Thanks for your help Susmitha.

Read only

0 Likes
2,781

Hi ,

I try to replicate the problem but I got short dump .

Eventually I mange to do some damage...

Then I use "The Consistency Check"
http://help.sap.com/saphelp_nw73/helpdata/en/d6/23253963143e6ae10000000a11402f/content.htm

And we have :

Regards.