cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve SELECT-OPTIONS values from component controller

0 Kudos

Hi experts,

I'm a newbie in WDA and I'm facing a problem. I've finished the "Tutorial 2 - BAPI Usage" from SDN. After that I've finished "WDA Tutorial II: Using Select Options...".

Now, I'm trying to enhance the BAPI example with select options, but in SO tutorial the values retrieval and selection are implemented in a method triggered by the button pressing (there's a comment there telling not to do that, it isn't a good practice).

So, I want to read the values entered in SO in the method created by the wizard in the component controller, but I can't find out how to access those select options parameters, as they are created dynamically and not mapped to any context.

Regards.

Fabio Scaravelli

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I found another thread which suggests saving the value inside of the assistance class.

Please comment if there is a better approach.

Thanks,

Min

Former Member
0 Kudos

I need to do something similiar. All the demos I find are retrieving data from view controller directly. However, the logic needs to reside in component controller. What is the best way to pass select-options value to component controller?

Thanks,

Min

Former Member
0 Kudos

Hi,

Yes, it's tru that Select Option is not mapped to any context. But we can retrive data from Select Option using field symbol.

Here is simple sample code how to retrive data from Select Option:


* Get data from selection
  DATA: RT_DATUM_ID    TYPE REF TO DATA.
  FIELD-SYMBOLS: <FS_DATUM> TYPE TABLE.

* retrive data from select options
  RT_DATUM_ID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'DATUM'  ) . "DATUM is Selection Field ID
  ASSIGN RT_DATUM_ID->* TO <FS_DATUM>.

That is the code to retrive data from Select Option, you just need to change the ID of Selection Field.

Regards,

0 Kudos

Hi Jatra,

Thanks for your response. This is what I've already done, but it only works in methods at view level. I want to access these values from a method at component controller level.

It says:

"Web Dynpro Comp. / Intf. Z_WDC_TASKCENTER_000,Web Dynpro Component Controller COMPONENTCONTROLLER

Method SELECIONAR_TAREFAS

Field "M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(" is unknown. It is

neither in one of the specified tables nor defined by a "DATA"

statement. "DATA" statement. "DATA" statement."

Because M_HANDLER is a view attribute, not accessible from the component controller. I need a way to read it from that.

Regards.

Fabio Scaravelli