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

using CL_DEMO_OUTPUT to display Internal Table

Yasin
Active Participant
29,482

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
Read only

Yasin
Active Participant
13,391

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
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Kudos
13,391

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

-- Tomas --
Read only

Yasin
Active Participant
0 Kudos
13,391

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 ...

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Kudos
13,391

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 --
Read only

Yasin
Active Participant
0 Kudos
13,391

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 ).

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
13,391

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 --
Read only

Sandra_Rossi
Active Contributor
0 Kudos
13,391

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

Read only

Sandra_Rossi
Active Contributor
13,391

Maybe then, same 7.40 but different SP level.

Read only

Sandra_Rossi
Active Contributor
0 Kudos
13,391

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

Read only

Yasin
Active Participant
13,391

Hi Sandra

Regards

Read only

Yasin
Active Participant
13,392

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

Read only

DoanManhQuynh
Active Contributor
13,391

remove header line is better way to go

Read only

Sandra_Rossi
Active Contributor
0 Kudos
13,391

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.

Read only

0 Kudos
13,391

Thank you.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Kudos
13,391
Read only

0 Kudos
13,391

Hi Horst

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

Thanks for sharing.