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

display problem

Former Member
0 Likes
663

Hi all,

I have problem to display data in this code, please correct me.

REPORT zbtest.

TYPE-POOLS: slis.

FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,

<dyn_wa>.

DATA: alv_fldcat TYPE slis_t_fieldcat_alv,

it_fldcat TYPE lvc_t_fcat.

DATA: it_kna1 TYPE TABLE OF kna1 WITH HEADER LINE.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_kunnr FOR it_kna1-kunnr.

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

SELECT * INTO TABLE it_kna1 FROM kna1

WHERE kunnr IN s_kunnr.

PERFORM build_dyn_itab.

FORM build_dyn_itab.

DATA: index(3) TYPE c.

DATA: new_table TYPE REF TO data,

new_line TYPE REF TO data,

wa_it_fldcat TYPE lvc_s_fcat.

CLEAR wa_it_fldcat.

wa_it_fldcat-fieldname = 'PERIOD' .

wa_it_fldcat-datatype = 'CHAR'.

wa_it_fldcat-intlen = 6.

APPEND wa_it_fldcat TO it_fldcat .

LOOP AT it_kna1.

CLEAR wa_it_fldcat.

wa_it_fldcat-fieldname = it_kna1-kunnr .

wa_it_fldcat-datatype = 'CHAR'.

wa_it_fldcat-intlen = 4.

APPEND wa_it_fldcat TO it_fldcat .

ENDLOOP.

  • create dynamic internal table and assign to fs

call method cl_alv_table_create=>create_dynamic_table

exporting

it_fieldcatalog = it_fldcat

importing

ep_table = new_table.

ASSIGN new_table->* TO <dyn_table>.

  • Create dynamic work area and assign to FS

CREATE DATA new_line LIKE LINE OF <dyn_table>.

ASSIGN new_line->* TO <dyn_wa>.

ENDFORM. "

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
640

> Hi all,

> I have problem to display data in this code, please correct me.

> "

Nick can you give more details about your issue. where is your display part of the code?

Read only

0 Likes
640

it should be ALV display.

ASSIGN new_table->* TO <dyn_table>. not working corect, but why I dont know.

Edited by: Nick Thedick on Jul 19, 2008 11:11 PM

Read only

Former Member
0 Likes
640

Hi,

As per your code, you have data in IT_KNA1 internal table.

Why, do you want to create another dynamic internal table?????

Use REUSE_ALV_GRID_DISPLAY func.module to display the contents in IT_KNA1.

Use LVC_FIELDCATALOG_MERGE and use the structure KNA1 for build the fieldcatalog.

Regards,

Subramanian