on 2014 Feb 27 10:04 AM
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.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
Hi Krishna,
You can achieve your requirement as below
Adding select options into view:
- Create a range table lr_range_table as below
data lr_range_table type ref to data.
lr_range_table = m_sel_options->CREATE_RANGE_TABLE( I_TYPENAME = 'VBELN' ).
m_sel_options->add_selection_field(
exporting
i_id = 'VBELN'
it_result = lr_range_table ).
Plese refer the below link to know, how to add a selection field and get the values of selection field into a range table.
Now, question is how to pass the data to assistance class method and fetch data accordingly
- Get the value of select options into range table by using method m_select_options->get_range_table_of_sel_field(
exporting
i_id = 'VBELN'
importing
rt_range_table = lr_vbeln_data ).
field-symbols: <fs_vbeln> type any.
assign lr_vbeln_data->* to <fs_vbeln>.
- Create a method GET_DATA with parameters so_vbeln of TYPE TABLE selopt ( importing parameter ) and a return parameter rt_result of type your ZST_RESULT
call method as below
wd_assist->GET_DATA(
exporting
so_vbeln = <fs_vbeln>
importing
rt_result = lt_result ).
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a range table type and pass values to that.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.