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: 

using CL_DEMO_OUTPUT to display Internal Table

Yasin
Active Participant

Hi,

is it possible to use CL_DEMO_OUTPUT class with Internal Table? when i pass
internet table : cl_demo_output=>display_data( i_final ).

am getting error : Data type not yet supported ...

Regards

1 ACCEPTED SOLUTION

Yasin
Active Participant

Hi

I was able to solve the issue by adding [] to the Internal Table name

cl_demo_output=>display_data( i_final[] ).

now am able to display Internal Table

Regards

15 REPLIES 15

Tomas_Buryanek
Active Contributor
0 Kudos

Yes it is possible. Read the blog/s with examples? https://blogs.sap.com/2016/05/10/cldemooutput-part-1-of-2-usage/

-- Tomas --

Yasin
Active Participant
0 Kudos

Hello Tomas,

in the blog he is using, mmm open SQL while in my case

SELECT    VBRP~VKORG_AUFT VBRP~MATNR  vbrp~fkimg 
         INTO CORRESPONDING FIELDS OF TABLE  i_final
         FROM vbrp
         WHERE  VBRP~MATNR IN S_MATNR.

cl_demo_output=>display_data( i_final ).

here am getting error: Data type not yet supported in DEMO output ...

0 Kudos

Why are you using display_data method? Have you tried method display (which is used in the blog examples)? What has SQL to do with this? How exactly is the i_final typed?

-- Tomas --

Yasin
Active Participant
0 Kudos

Hi Tomas

even with Display only am getting same error

TYPES : BEGIN OF ty_i_final,
       matkl    TYPE VBRP-matkl,
       mfrnr    TYPE mara-mfrnr,
       vkorg    TYPE vbrk-vkorg,
       bstkd    TYPE vbkd-bstkd,
END OF ty_i_final.
.... SQL Statement ..

DATA : i_final TYPE STANDARD TABLE OF ty_i_final WITH HEADER LINE.
cl_demo_output=>display( i_final ).

am able to display the i_final on ALV Grid. but it fail with cl_demo_output=>display( i_final ).

That is strange. I am on same version (740) and it displays internal table defined exactly like yours without a problem.
Try internal table without HEADER LINE (it is quite old concept using header lines). It could be problem because there is a difference between i_final and i_final[]...

-- Tomas --

Sandra_Rossi
Active Contributor
0 Kudos

Why SAP stopped using header lines, because it's prone to errors...

Sandra_Rossi
Active Contributor

Maybe then, same 7.40 but different SP level.

Sandra_Rossi
Active Contributor
0 Kudos

See the "not yet", maybe knowing your ABAP version could be of some interest here...

Yasin
Active Participant

Hi Sandra

Regards

Yasin
Active Participant

Hi

I was able to solve the issue by adding [] to the Internal Table name

cl_demo_output=>display_data( i_final[] ).

now am able to display Internal Table

Regards

DoanManhQuynh
Active Contributor

remove header line is better way to go

Sandra_Rossi
Active Contributor
0 Kudos

Stop using those obsolete header lines (since 6.10?), they are so prone to errors. And if you used ABAP Objects, as recommended "now" (for 20 years?), header lines automatically generate syntax errors.

0 Kudos

Thank you.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yasin
Active Participant
0 Kudos

Hi Horst

Nice Blog it will be very helpful for everyone want to explore CL_DEMO_OUTPUT

Thanks for sharing.