cancel
Showing results for 
Search instead for 
Did you mean: 

Select options range table to be passed to Assistance class

Former Member
0 Kudos

Hi Guru's,

I have an assistance class where I have to write all my select queries. I have a selection screen with multiple Select options (as input fields). Now I want to pass the select options range table to assistance class.

Please let me know if you have any sample code for this which may also include building range tables for select options.

Thanks,

Pradeep

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In addition to declaring the table with the TYPE RANGE OF, you can also create a special type of TABLE TYPE in the Data Dictionary.

[http://help.sap.com/saphelp_nw70/helpdata/EN/00/958fb7e42b11d295f700a0c929b3c3/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/00/958fb7e42b11d295f700a0c929b3c3/frameset.htm]

You can then even use this table type as the type of the inporting parameter of your assistance class method.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pardeep,

U can use following code: for field ERDAT

data: rt_ERDAT type ref to data,

R_ERDAT TYPE RANGE OF VIQMEL-ERDAT,

R_ERDAT_line LIKE LINE OF R_ERDAT,

field-symbols: <fs_ERDAT> type table.

  • Retrieve the data from the select option

rt_ERDAT = wd_this->m_handler->get_range_table_of_sel_field( i_id = 'ERDAT' ).

  • Assign it to a field symbol

assign rt_ERDAT->* to <fs_ERDAT>.

  • copy field symbols to local variable

R_ERDAT = <fs_ERDAT>.

CALL METHOD WD_ASSIST->"METHOD_NAME"

R_ERDAT = R_ERDAT

where in class method:

R_ERDAT Importing Type ZU5QNM_ERDAT_T

ZU5QNM_ERDAT_T : is a table type of ZU5QNM_ERDAT_R

and ZU5QNM_ERDAT_R has following structure :

SIGN ACE_SIGN CHAR 1 0 Debit/Credit Sign (+/-)

OPTION ACE_OPTION CHAR 2 0 Option for Ranges Tables

LOW ERDAT DATS 8 0 Date on Which Record Was Created

HIGH ERDAT DATS 8 0 Date on Which Record Was Created

I hope this wiol solve ur problem.

Regards,

Vishal.

Former Member
0 Kudos

Hi Vishal,

Thanks for your solution.I guess this will resolve my requirement.

Thanks,

Pradeep