cancel
Showing results for 
Search instead for 
Did you mean: 

Data fetch for range of value inside an assistance class

former_member187692
Participant
0 Kudos
150

I want to create an assistance class where I can fetch data for the range of values selected ( basically when I select a range of sales order ).

I was only only successfully in creating parameters, passing single values.

Regards,

Krishna.

View Entire Topic
former_member222068
Active Participant
0 Kudos

Hi Krishna,

Logic to fetch the data of range ( implement in the method  )

   data : lv_matnr TYPE string VALUE 'MATNR',
            lr_matnr TYPE REF TO data.

FIELD-SYMBOLS : <lr_matnr> TYPE ANY TABLE.

************ Method to call range of data ************************


CALL METHOD wd_this->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
  EXPORTING
    I_ID               = lv_matnr
  RECEIVING
    RT_RANGE_TABLE     = lr_matnr.

ASSIGN lr_matnr->* to <lr_matnr>.

*************** call the method of the assistance class

wd_assist->GET_DATA( EXPORTING IR_MATNR = <lr_matnr> ).

****************** parameters of the method in the assistance class ********************

Hope this helps you

Thanks & Regards,

Sankar Gelivi

former_member187692
Participant
0 Kudos

what do you mention in the "where condition in ur select query"..... (since the parameter is of table, then    what'll ur 'matnr' be equal to  ___ .).

Mine is like this

Eg:

select

         KUNNR

         VBELN

         LAND1

         NAME1

         ERDAT

         ERNAM

         VKORG

         POSNR

     FROM <table>
     INTO TABLE <itab>
     WHERE KUNNR = <IM_KUNNR> .   


ramakrishnappa
Active Contributor
0 Kudos

Hi Krishna,


data lr_range_table type ref to data.

"get range table

  • m_select_options->get_range_table_of_sel_field(

               exporting

                    i_id = 'KUNNR'

               importing

                    rt_range_table = lr_KUNNR_DATA ).

  field-symbols: <im_kunnr> type any.

               assign lr_kunnr_data->* to <im_kunnr>.

select

         KUNNR

         VBELN

         LAND1

         NAME1

         ERDAT

         ERNAM

         VKORG

         POSNR

FROM <table>
     INTO TABLE <itab>
     WHERE KUNNR  in <IM_KUNNR>


Here: <im_kunnr> is a range table, hence we have use "in" operator


Hope this helps you.


Regards,

Rama

former_member187692
Participant
0 Kudos

Thanks Rama.

Thanks Sankar.

Also got some info from this site below. I will post it, it may be useful.

http://wiki.scn.sap.com/wiki/display/WDABAP/Assistance+class+functionality+in+WDA