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

splitter container

Former Member
0 Likes
344

Hi Friends,

I am not able to get the output for the report which is shown below.

Can anybody solve the my problem?

Thanks,

REPORT ZREPORT10 .

DATA: splitter TYPE REF TO cl_gui_splitter_container,

alv_list1 TYPE REF TO cl_gui_alv_grid,

CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

alv_list2 TYPE REF TO cl_gui_alv_grid,

CONTAINER_TOP TYPE REF TO CL_GUI_CONTAINER,

CONTAINER_BOTTOM TYPE REF TO CL_GUI_CONTAINER,

G_FCAT TYPE LVC_T_FCAT,

W_FCAT TYPE LVC_S_FCAT.

TYPES : BEGIN OF ig_ekt1,

c1 TYPE t001-bukrs,

c2 TYPE t001-butxt,

END OF ig_ekt1.

data ig_ek type ig_ekt1 occurs 0 with header line.

start-of-selection.

SELECT bukrs butxt FROM t001 INTO TABLE ig_ek.

W_FCAT-FIELDNAME = 'BUKRS'.

W_FCAT-TABNAME = 'IG_EKT1'.

W_FCAT-REF_FIELD = 'BUKRS'.

W_FCAT-REF_TABLE = 'T001'.

W_FCAT-COLTEXT = 'COLUMN1'.

W_FCAT-OUTPUTLEN = '20'.

APPEND W_FCAT TO G_FCAT.

W_FCAT-FIELDNAME = 'BUTXT'.

W_FCAT-TABNAME = 'IG_EKT1'.

W_FCAT-REF_FIELD = 'BUTXT'.

W_FCAT-REF_TABLE = 'T001'.

W_FCAT-COLTEXT = 'COLUMN2'.

W_FCAT-OUTPUTLEN = '20'.

APPEND W_FCAT TO G_FCAT.

CALL SCREEN 221.

&----


*& Module STATUS_0221 OUTPUT

&----


  • text

----


module STATUS_0221 output.

SET PF-STATUS 'SCREEN_0221'.

CREATE OBJECT CONTAINER EXPORTING CONTAINER_NAME = 'CUST'.

CREATE OBJECT SPLITTER EXPORTING PARENT = CONTAINER

ROWS = 2

COLUMNS = 1.

CALL METHOD SPLITTER->GET_CONTAINER EXPORTING ROW = 1

COLUMN = 1

RECEIVING CONTAINER =

CONTAINER_TOP.

CALL METHOD SPLITTER->GET_CONTAINER EXPORTING ROW = 2

COLUMN = 1

RECEIVING CONTAINER =

CONTAINER_BOTTOM.

create object alv_list1

exporting i_parent = CONTAINER_TOP.

create object alv_list2

exporting i_parent = CONTAINER_BOTTOM.

CALL METHOD alv_list1->set_table_for_first_display

CHANGING

it_outtab = ig_ek[]

IT_FIELDCATALOG = G_FCAT.

CALL METHOD alv_list2->set_table_for_first_display

CHANGING

it_outtab = ig_ek[]

IT_FIELDCATALOG = G_FCAT.

endmodule. " STATUS_0221 OUTPUT

&----


*& Module USER_COMMAND_0221 INPUT

&----


  • text

----


module USER_COMMAND_0221 input.

CASE SY-UCOMM.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

endmodule. " USER_COMMAND_0221 INPUT

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
316

Hello Raj

I see several problems within your coding:

(1) Data selection: change to

SELECT bukrs butxt FROM t001 
  INTO CORRESPONDING FIELDS OF TABLE ig_ek.

(2) Fieldcatalog: use the function module LVC_FIELDCATALOG_MERGE

- Call this function module using 'T001' as structure/table. Then delete the obsolete fields like this:

* ... call function module
  DELETE g_fcat WHERE ( fieldname ne 'BUKRS'   OR
                                        fieldname  ne 'BUTXT' ).

(3) PBO module: Check if container has already been instantiated

  IF ( container IS NOT BOUND ).
* ... create container
* ...
  ENDIF.

Regards

Uwe

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
317

Hello Raj

I see several problems within your coding:

(1) Data selection: change to

SELECT bukrs butxt FROM t001 
  INTO CORRESPONDING FIELDS OF TABLE ig_ek.

(2) Fieldcatalog: use the function module LVC_FIELDCATALOG_MERGE

- Call this function module using 'T001' as structure/table. Then delete the obsolete fields like this:

* ... call function module
  DELETE g_fcat WHERE ( fieldname ne 'BUKRS'   OR
                                        fieldname  ne 'BUTXT' ).

(3) PBO module: Check if container has already been instantiated

  IF ( container IS NOT BOUND ).
* ... create container
* ...
  ENDIF.

Regards

Uwe