cancel
Showing results for 
Search instead for 
Did you mean: 

Popup creation - syntax error

Former Member
0 Kudos

Hi,

I am developing a webdynpro application.am creating pop-up window for that when am trying to declare a attribute called WD_COMP_Controller type ig_componentcontroller for a view, It s throwing an error like "Field Wd_comp_controller is unknown". its neither in one of the specified tables nor defined by a data statement."

In this line *lo_api_component = wd_comp_controller->wd_get_api( )*. am getting syntax error

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window(

window_name = 'MAIN'

  • title =

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true

button_kind = if_wd_window=>co_buttons_ok

message_type = if_wd_window=>co_msg_type_none

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

please help me out.

Thanks and Regards.

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

From where are you trying to create the popup?

wd_comp_controller is an attribute that exits in the views or in windows... This attribute refers to the component controller of your WebDynpro.

If you are trying to create it directly from the component controller you must to use wd_this.

But, better use the code wizard to generate the code in order to create a popup

Former Member
0 Kudos

Hi Ricardo,

I am using wizard only to generate a code. immediately am doing check, its showing an error like this component is not declared.

Thanks and regards,

Vijay Vikram

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

try with this;

DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).

  DATA lo_api_component TYPE REF TO if_wd_component.
  lo_api_component = lo_componentcontroller->wd_get_api( ).

Former Member
0 Kudos

Hi ricardo ,

i tried your code but its showing get_componentcontroller_ctr is unknown or protected or private.

Thanks and Regards,

Vijay

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

i didn't see your last message,

If you've deleted the component you need to add it again in the tab properties in your view. Pushing the button "Create Controller usage" (page in blank) and adding your COMPONENTCONTROLLER. With this the attribute WD_COMP_CONTROLLER must appears again.

Former Member
0 Kudos

Hi Everyone,

i got the solution for this,

In view properties tab i have added a component controller.

it is working fine

Thanks for everyone who has replied to this thread.

Thanks and Regards,

Vijay

Answers (4)

Answers (4)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Refer steps mentioned in http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproapplicationtodisplayaPop-upwindowonthebrowser

Thanks,

Chandra

Former Member
0 Kudos

Hi,

wd_comp_controller will be default and check in your view with properties tab

Try The following code.for popup

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window(

window_name = 'xxxx' "-->window name

  • title =

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true

button_kind = if_wd_window=>co_buttons_ok

message_type = if_wd_window=>co_msg_type_none

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

Hope it helps.

Regards,

Basuvaraj.P

Former Member
0 Kudos

Hi everyone,

By mistake i have deleted that component.

In VIEW attributes tab i want to add it again.

1.I tried to declare it but its showing an error wd_comp_controller should not start with wd is not defined.

2. I tried to define implicitly in a method also , its giving an error like getapi is private or public...

so please guide me in this process.

Thanks and regards,

Vijay Vikram

Former Member
0 Kudos

Hi Vijay

The code written to open a pop up is right.

wd_comp_controller is a DEFAULT reference to the COMPONENT CONTROLLER which will be declared by default in the attributes tab of every View. If you are not already having this attribute then check in properties tab of the view if the component is added to this view and add if not added under component usage.

If the current component is added then there will be a default reference to the compcontroller in the view and there is no need to explicitly declare/create an attribute.

Thanks & Regards,

Gayathri Shanbhag

Former Member
0 Kudos

Hi,

Check with attributes it is already declared and why you going to declare it .check with attributes tab.

Regards,

Basuvaraj.P

Former Member
0 Kudos

HI Basavraj,

I have checked the attributes of the view, wd_comp_controller is not there.

thanks

Vijay