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

What is the wrong in code while creating a container

Former Member
0 Likes
711

Hello all,

what is the wrong in code while creating container.


*&---------------------------------------------------------------------*
*& Report  ZTEST_TREE4
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest_tree4.


*----------------------------------------------------------------------*
*       CLASS lcl_application DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_application DEFINITION CREATE PRIVATE.
  PUBLIC SECTION.
    CLASS-METHODS: run_application.
    METHODS constructor.
  PRIVATE SECTION.
    CLASS-DATA: s_container TYPE REF TO cl_gui_simple_container.

    DATA: container TYPE REF TO cl_gui_simple_container.

ENDCLASS.                    "lcl_application DEFINITION

*----------------------------------------------------------------------*
*       CLASS lcl_implementation DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_application IMPLEMENTATION.
  METHOD run_application.
    IF lcl_application=>s_container IS INITIAL.
      CREATE OBJECT lcl_application=>s_container.
    ENDIF.


  ENDMETHOD.                    "run_application
  METHOD constructor.
    CREATE OBJECT container.
  ENDMETHOD.                    "constructor
ENDCLASS.                    "lcl_implementation DEFINITION
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  CALL METHOD lcl_application=>run_application.
  SET PF-STATUS 'CO_100'.
  SET TITLEBAR 'CO_100'.

ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Module  exit  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE exit INPUT.
  LEAVE PROGRAM.
ENDMODULE.                 " exit  INPUT

START-OF-SELECTION.
  CALL SCREEN 100.

regards,

Lisa.

Edited by: Lisa Roy on Mar 6, 2008 10:15 AM

Edited by: Lisa Roy on Mar 6, 2008 10:29 AM

4 REPLIES 4
Read only

Sm1tje
Active Contributor
0 Likes
640

Lisa,

the syntax seems to be ok, but what is the problem. Are you getting an error message when checking it? If so, what is the message?

P.S. The =>run_application method should be placed after the set pf-status, better yet, in a separate module.

Read only

Former Member
0 Likes
640

Hi Micky,

The progam is dumping at line CREATE OBJECT lcl_application=>s_container.

Can you help me.

Regards,

Lisa

Read only

Clemenss
Active Contributor
0 Likes
640

Hi Lisa,

a container must be placed in a respective screen area. Also the module calls must be implemented in your screen input and output sections. Finally you have to place something (a GUI control) in your container.

I do not see anything like this in your program. So I don't know what you are asking about. Do you get any error message?

Regards,

Clemens

Read only

Former Member
0 Likes
640

Hello clemens,

Can we create a container with out placing a container in screen area?

Regards,

Lisa