cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass select-opions values through assistance class in webdynpro

Former Member
0 Kudos

i have selection screen for sales order low and high. i have to extract sales order header and item data based on sales order low and high.

how to extract data through assistance class and how to pass selectoptions values in webdynpro.....

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vishnu,

There are various ways to do this.

1. Create a method in assistance class say GET_SEL_OPT_DATA which returns the Select option range table

Call this from your webdynpro component and get the values in web dynpro

2. Create a node in Webdynpro component with the range data

Create a reference of this node in your assitance class.

Fill the node in the assistance class with your data

Now you can access the data in the assistance class as well as your WD component.

3. Create a global variable with the same structure as the Select option range table in the assistance class.

Fill this with the select options data.

This structure can be directly used in the WD Component using WD_ASSIST.

Former Member
0 Kudos

hi sachdeva can u give me brief information on this....

how to create reference of select option node in assistance class as u said, and how to use the declared parameters in webdynpro using wd_assist.

can u give any simple example on this, it will be more helpful to me.....

Former Member
0 Kudos

1. To create a reference of select option node in assistance class, do the following:

a. Create a method e.g. INITIALIZE in assistance class

b. Create an importing parameter IM_CONTEXT of type ref to IF_WD_CONTEXT_NODE

c. Create a global variable LO_SEL_NODE Type Ref To IF_WD_CONTEXT_NODE

c. Write the following code in the method INITIALIZE of class    

    LO_SEL_NODE = IM_CONTEXT->GET_CHILD_NODE( '<Your select options node name>' ).

d. Call this method from your component controller's WDDOINIT method and pass wd_context as parameter

     WD_ASSIST->INITIALIZE( wd_Context ).

This way you can access the select options node in your assistance class in any method.

2. To access any global variable defined in the assistance class in the WD Component, you use WD_ASSIST variable created in your Component.

e.g.

a. Create a global variable say X type i in Attributes tab of assistance class.

b. To use this variable in your component anywhere in the code, just write WD_ASSIST->X. This will refer to variable X of Assistance class.

Former Member
0 Kudos

Hi Khushboo,

I am also having the same problem

In my WDINIT method i have got all the range tables.

I want to use the range tables in another method. As suggested by you I have created a Asistance class. How do we assign the range table to the global range table.So that I can use this in another methods.

Thanks and regards

Rajender patyal.

Former Member
0 Kudos

Hi,

You should create a range table i.e. T_RANGE_TBL in the Attributes Tab of the class of the same type that you have in WDDOINIT method.

Now in the WDDOINIT method when you get the range table say LT_RANGE, you must use,

WD_ASSIST->T_RANGE_TBL[] = LT_RANGE[].

Former Member
0 Kudos

Hi Khushboo,

Thanks for the reply.

I have written the below code in WDDOINIT method.

DATA : lr_shipment TYPE REF TO data.
FIELD-SYMBOLS: <FS_lr_shipment> TYPE TABLe.

lr_shipment = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD(

           I_ID = 'SHIPMENT' ).

  ASSIGN  lr_shipment->* TO <fs_lr_shipment>.
    wd_assist->t_shipment[] = <fs_lr_shipment>.

or

    

wd_assist->t_shipment[] = lr_shipment.

WD_Assist is the attribute of the assistance class. When I use this it says "WD_ASSIST it is not defined".

As told by you decalre the range table in the attributes of the class. When I declare a range table of Type DATA. It gives an error "Data type is too Generic".

We cant declare global variable or structures/Internal tables that can be used in whole of the program.

Thanks and Regards.

Rajender Patyal.

Former Member
0 Kudos

1. WD_ASSIST is not an attribute of Assistance class.

You have to specify the class you created as the assistance class of your component. When you do so, an attribute WD_ASSIST will be automatically be added to your WD component.

2. To declare the range table in your class, do the following:

Former Member
0 Kudos

Hi Khushboo,

Thanks, I was able to do all of the above.

Can we call standard trasaction eg VT03N using Hotspot on the Web Dynpro ALV of the report by clicking on the shipment number.

Thanks and Regards.

Rajender Patyal