본문 바로가기
ERP-SAP/BW

How to use FM RRW3_GET_QUERY_VIEW_DATA / RS_VC_GET_QUERY_VIEW_DATA_FLAT ?

by 행복한워니의 기록 2014. 10. 27.
728x90
반응형

Hi ,

    I am extracting the query data using call to the subject FM i am able to extract the data however the selection parameters are not getting correctly passed.

 

Anyon eof you who have used these FM can u please tell me how to pass variable name and value to the table  I_T_PARAMETER STRUCTURE  W3QUERY .

 

I tried passing the variable name and value but it doesnt seem to select the data . it is still extracting the complete query results.

 

Please update me on the same ...help appriciated in advance . Examples with code extraction will go further in my understanding .

 

Thanks

---------------------

 

Hello, did you get a resolution to this question?  it's discussed at length in this blog and attached comments:  /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii

 

However, I have also had trouble with this and even when I pass the correct I_T_PARAMETER name/value pairs for query filter attribute/value it still does not work.  I also get all of the query results, unfiltered.

 

------------------------

 

 

Hi,

 

we created this FM (RRW3_Get_query_view_data) in BW 3.0 (see SAP Note 675000). And we do also have the problem, that the parameters are not correctly passed. We do also get the complete query results!

 

Are there any new ideas how to fix this?

 

Thanks and regards

Ingo

--------------------------------------

 

Hi there,

to correctly identify the name for the parameters for restriction in I_T_PARAMETER,

you have to go to transaction RSA1 to display the properties of the infoprovider(s) involved.

Then browse through the various attributes and get the technical name.

Example:

 

name                    value                 (meaning)

0FISPER3            01                      (fiscal Posting Period)

0FISCYEAR         2008                   (Fiscal Year)

0FISCPER           2008/01               (Fiscal year / period)

 

Regards,

                G. E. Strafforello

-----------------------------------------

 

Hello,

 

Below is the format for the needed RS_VC_GET_QUERY_VIEW_DATA_FLAT :

 

NAME | VALUE

 

VAR_VALUE_EXT | the varaible input value as you need (selections)

VAR_NAME | variable name (technical)

CMD | LDOC

 

Regards,

Shashank

---------------------------------

 

 

I had used FM RRW3_GET_QUERY_VIEW_DATA to execute query .To pass values in i_t_parameter I used an Internal table i_tabparam.

 

There are some possibilities when we have problem with filtering data :

 

1. Whenever we pass all the input data in improper format we get complete output of query without filtering .I used following code for that and it had worked for perfectly for program .

ex :

DATA: V_EXT_NUM(5) TYPE C,

            TL_GRP type /BI0/OITL_GRP.

 

  • Pass value in TL_GRP for whatever input you want query output to be filtered

 

  v_ext_num = 1.

  condense v_ext_num.

 

  concatenate  c_var_name v_ext_num into t_tabparam-name.

  t_tabparam-value = 'ZS_MTGR1'.

  append t_tabparam.

  concatenate  c_var_operator v_ext_num into t_tabparam-name.

  t_tabparam-value = 'EQ'.

  append t_tabparam.

  concatenate c_var_value_LOW_ext v_ext_num into t_tabparam-name.

  t_tabparam-value =  TL_GRP .

  append t_tabparam.

  v_ext_num =  v_ext_num + 1.

  condense v_ext_num.

 

 

*Pass inputs for query execution

  append lines of t_tabparam[] to i_tabparam[].

 

  call function 'RRW3_GET_QUERY_VIEW_DATA'

    EXPORTING

      i_infoprovider          = infopr

      i_query                 = query

      i_view_id               = ''

      i_t_parameter           = i_tabparam

    IMPORTING

      e_axis_info             = i_axis_info

      e_cell_data             = t_cell_data

      e_axis_data             = t_axis_data

      e_txt_symbols           = t_txt_symbols

    EXCEPTIONS

      no_applicable_data      = 1

      invalid_variable_values = 2

      no_authority            = 3

      abort                   = 4

      invalid_input           = 5

      invalid_view            = 6

      others                  = 7.

 

2. sometime you may have some extra characters getting added to variable

ex : TL_GRP = 00050 .

while passed to  t_tabparam-value it is like IBT00050 so you need to change the code as

 

concatenate c_var_value_LOW_ext v_ext_num into t_tabparam-name.

  t_tabparam-value =  TL_GRP + 3.

 

3.Your query may have some mandatory fields in input screen .While executing that query via program you need to pass that parameter also in your i_tabparam[] otherwise you will not get proper output and not even error message .

ex .

if you have  fiscal year as mandatory field then you need to write code for that like

   

V_EXT_NUM = V_EXT_NUM + 1.

  CONDENSE V_EXT_NUM.

 

                  • Fiscal Year

  CONCATENATE  C_VAR_NAME V_EXT_NUM INTO T_TABPARAM-NAME.

  T_TABPARAM-VALUE = '0M_FYEAR'.

  APPEND T_TABPARAM.

  CONCATENATE  C_VAR_OPERATOR V_EXT_NUM INTO T_TABPARAM-NAME.

  T_TABPARAM-VALUE = 'EQ'.

  APPEND T_TABPARAM.

  CONCATENATE  C_VAR_VALUE_EXT V_EXT_NUM INTO T_TABPARAM-NAME.

  T_TABPARAM-VALUE = FSCYR+3(4).

  APPEND T_TABPARAM.

 

remember you need to increment V_EXT_NUM  by 1.If you are looping through query for multiple inputs of a field then also you need to increment .

 

4.There was one situation that we faced for one query that we have a multiprovider on which query was build up and it has two cube .The field we are using for filtering was present only in one cube so whenever we were executing the query it was giving all the records .But n this case RSRT output and FM output will be same .

 

Hope you will find these points helpful .

 

Regards,

Jaya Tiwari

 

728x90
반응형