cancel
Showing results for 
Search instead for 
Did you mean: 

How can we access the context node structure from a method of Assistance Class or how can we send the context stureture( to create the Internal table of type context strcture) from any action method to assistance class ?

Former Member
0 Kudos

Hi Experts,

I am developing a very big webdynpro componet as per the requriement, but before developing it I need to follow the MVC architecture pattern using Assistance class concept. But this is first time I am using Ass. Class, and I am facing the following deficulties. Please guide me the solution.

Scenario:

I am having a context ,Demo_context,which is my custom defined type(combination of some DDIC structure with my own additonal attributes) in main view of some webdypro component zwdy_comp.

To fill the above component , I am  taking  input from the user using select options  which are also binded to some attibutes of other node used in the same view.

On triggering the action, after giving the input, I am doing the following tasks.

My Task:

  • Now my task is to write a select query to fill the internal table of the type my custom context, Demo_context and using the select option values In the where condition.
  • Here I am using Assistance Class concept. So how can I use the assistance class concept in this case.
  • As per my knowledge, the select qurey shold be written in one method, FetchData, which is delcared under the methods of Ass. Class.
  • To write the Select Query in the Ass. Class,  the internal table type ( i.e. sturcute of my custom context, Demo_context ) and the select option vauels which are stored in one range table.(or field symbols) must be sent/available in side the method body(as a parametes or so).
  • I can send the select option values as a patameter type as DATA.
  • But my doubt is how can I create/access  the internal table type ( i.e. sturcute of my custom context, Demo_context ).
  1. I know , one easy way  is to create a custom structure in DDIC (SE11) and can use the same in method level and context creation level as a reference. But If my component is having many such custom contexts, its not good practice to create all of them in se11 and use it here. Is this method is right one to do in case of ass.class in our scenario?

Or.

  2.  We can have any other / right or generic method to access them in methods.?

Can you plese tell me the solution and standards using them?

Thanks in Advance,

Nary

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

please use below code in WDDOINIT METHOD OF COMPONENT (HER  IN LT_FLIGHTS I HAVE TAKEN FEW FIELDS FROM TABLE)

Create  method as below

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nary,

For internal table you can use the data type 'ANY TABLE'.

You can use the concept of helper class.

Please follow the link, in the appendix you can find how we can use helper class to access context node details outside the main component.

Hope it helps.

Regards,

Sayan

ChandraMahajan
Active Contributor
0 Kudos

Hi,

you need to create sturcuture and table types in SE11 to use in assistance class methods.

Thanks,

Chandra

Former Member
0 Kudos

Hi ,

you can declare structure and internal table same as context node  inside method of class then use it

Thanks

Ashish