cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt with generation of code WD ABAP Using Wizard

former_member215786
Participant
0 Kudos

Dear Experts.

I am reading documentation, Wikis, etc for WD ABAP.

[original link is broken]

However my doubt is in this moment when I am generating the code using the Wizard. For example:

In this moment I am creating an application of example using:

Using Select-Options in Web Dynpro for ABAP.

However I want know how is generated this code:

 
METHOD WDDOINIT .
  DATA: LT_RANGE_TABLE TYPE REF TO DATA,
        RT_RANGE_TABLE TYPE REF TO DATA,
        READ_ONLY TYPE ABAP_BOOL,
        TYPENAME TYPE STRING.

  DATA: LR_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER,
        L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

* create the used component
  L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
  IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
    L_REF_CMP_USAGE->CREATE_COMPONENT( ).
  ENDIF.
  WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
* init the select screen
  WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).

  WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
                              I_DISPLAY_BTN_CANCEL  = ABAP_FALSE
                              I_DISPLAY_BTN_CHECK   = ABAP_FALSE
                              I_DISPLAY_BTN_RESET   = ABAP_FALSE
                              I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).

* create a range table that consists of this new data element
  LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE( I_TYPENAME = 'S_CARR_ID' ).
* add a new field to the selection
  WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'S_CARR_ID'
  IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY ).

ENDMETHOD. 

The page of example is:

Moderator Message: Illegal external link removed.

Remove the * in the page of above

Anyone can help me with suggestions.

I want learn WD ABAP.

Regards

Carmen G

Edited by: Thomas Jung on Jan 5, 2011 1:02 PM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm not sure I understand the specifics of your question. You want to know how the above code is generated. However It doesn't look wizard generated. It looks like something someone had to code. Do you have some question about what this code means?

former_member215786
Participant
0 Kudos

My doubt is with the code:

This code is generate with Wizard?

How I know the that do this methods?


  WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
* init the select screen
  WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
 
  WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
                              I_DISPLAY_BTN_CANCEL  = ABAP_FALSE
                              I_DISPLAY_BTN_CHECK   = ABAP_FALSE
                              I_DISPLAY_BTN_RESET   = ABAP_FALSE
                              I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).

Regards

Carmen G

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>This code is generate with Wizard?

Probably not, but what difference does it make either way.

>How I know the that do this methods?

What? I have no idea what you are asking.

If you just want to know what these lines of code are doing, here is an explanation.

WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).

This line of code is storing an object reference to the Selection Options Component Interface (necessary for accesing interface methods of the reuable select-options component).

WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).

Using the reference to the component interface from the first line of code, this line now calls a method of the selection option component that initializes the selection screen. It returns an object reference to the select option handler. This handler object can be used to set options of the selection screen.

WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(

I_DISPLAY_BTN_CANCEL = ABAP_FALSE

I_DISPLAY_BTN_CHECK = ABAP_FALSE

I_DISPLAY_BTN_RESET = ABAP_FALSE

I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).

Using the handler object from the previous line of code, this line now sets the global configuration objects of the selection screen. For instance it makes all the default buttons (cancel, check, reset and excuate) hidden.

former_member215786
Participant
0 Kudos

How do know What methods have WD_THIS->?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> How do know What methods have WD_THIS->?

Not sure what you mean. WD_THIS is the alias object for the current Web Dynpro controller. Its like using ME-> in normal ABAP classes. So the objects being referenced above are attributes of the current controller.

former_member215786
Participant
0 Kudos

Hello Thomas. Thanks.

You says WD_THIS is the alias object for the current Web Dynpro controller.

In this moment is my doubt is: Where I can found for example the method M_WD_SELECT_OPTIONS.

My doubt is for know What other methods have this Alias for the Web Dynpro Controler.


  WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
* init the select screen
  WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
 
  WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
                              I_DISPLAY_BTN_CANCEL  = ABAP_FALSE
                              I_DISPLAY_BTN_CHECK   = ABAP_FALSE
                              I_DISPLAY_BTN_RESET   = ABAP_FALSE
                              I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).

For close this post.

Thanks in advance for your help,

Regards

Carmen G.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>In this moment is my doubt is: Where I can found for example the method M_WD_SELECT_OPTIONS.

M_WD_SELECT_OPTIONS isn't a method. Its an object reference. It points to a class instance. If you want to see which class type it is look at the definition of M_WD_SELECT_OPTIONS on the attribute tab of the controller. That is where it must be declared. You can then forward navigate to the class builder for that class type to see what methods are available for it.

Answers (0)