Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with data declaration

Former Member
0 Likes
1,669

Hi guys,

I tried to use the code in the following link in SE38:

Expose BI Query as RESTful Service - SAP NetWeaver Business Warehouse - SCN Wiki


TYPE-POOLS: rrx1 .

DATA: r_dataset TYPE REF TO cl_rsr_data_set.

DATA: lcount TYPE i .

DATA: xcount TYPE i .

DATA: i_var TYPE rrx1_t_var.

DATA: i_var_final TYPE rrx1_t_var.

DATA: wf_variant TYPE variant .

DATA: wa_axis LIKE LINE OF r_dataset->n_sx_version_20a_1-axis_data .

DATA: wa_axis_info LIKE LINE OF r_dataset->n_sx_version_20a_1-axis_info .

DATA: wa_chars LIKE LINE OF wa_axis_info-chars .

DATA: tmp_char TYPE rrws_thx_axis_chars.

DATA: wa_tmp_char TYPE rrws_sx_axis_chars .

DATA: wa_attrinm TYPE rrws_s_attrinm.

DATA: wa_cell LIKE LINE OF r_dataset->n_sx_version_20a_1-cell_data .

DATA: wa_textsymbols LIKE LINE OF r_dataset->n_sx_version_20a_1-txt_symbols .

DATA: wa_textsymbols1 LIKE LINE OF r_dataset->n_sx_version_20a_1-txt_symbols .

DATA: wa_set LIKE LINE OF wa_axis-set.

DATA: tmp_set TYPE rrws_tx_set.

DATA: wa_tmp_set TYPE rrws_sx_tuple .

DATA: wa_dattrinm TYPE rrws_s_attributes .

DATA: i_iset_iobjnm TYPE  rsd_iobjnm ,

      e_iobjnm TYPE  rsd_iobjnm .

DATA: error_message TYPE string ,

      xml_out TYPE string .

DATA: q_variables TYPE rrxw3tquery .

DATA: error_string TYPE string.

DATA: no_of_chars TYPE  i ,

      no_of_keyf TYPE i .

DATA: var_nam(10) .

DATA: iobj_detail TYPE bapi6108 .

DATA: iobj_details TYPE bapi6108_t .

DATA: it_fieldcat TYPE lvc_t_fcat,

      is_fieldcat LIKE LINE OF it_fieldcat.

DATA: return TYPE bapiret2_tab .

FIELD-SYMBOLS: <ltable> TYPE ANY TABLE,

               <l_line>  TYPE ANY,

               <l_field> TYPE ANY.

TYPES: BEGIN OF metatype ,

       fieldname(30),

       outputlen(6) TYPE n,

       datatype(4) ,

       scrtext_l(40),

       END OF metatype .

DATA: meta_data TYPE STANDARD TABLE OF metatype ,

      wa_meta_data TYPE metatype .

DATA: off  TYPE i,

    moff TYPE i,

    mlen TYPE i.

DATA: iobj_return TYPE bapiret2_tab .

DATA: wf_ip TYPE rsinfoprov ,

      wf_query TYPE rszcompid ,

      wf_view TYPE rszviewid .

DATA: i_axis_info TYPE  rrws_thx_axis_info ,

      i_cell_data TYPE  rrws_t_cell ,

    i_axis_data TYPE  rrws_thx_axis_data ,

    i_txt_symbols TYPE  rrws_t_text_symbols .

DATA: n_counter(3) TYPE n .

DATA: char_count TYPE i .

DATA: wf_fldnm(40) .

DATA: struct_type TYPE REF TO cl_abap_structdescr,

tab_type TYPE REF TO cl_abap_tabledescr ,

    comp_tab TYPE cl_abap_structdescr=>component_table,

    comp LIKE LINE OF comp_tab,

    dref TYPE REF TO data ,

    dref1 TYPE REF TO data ,

    op_len TYPE i .

DATA: fields TYPE tihttpnvp .

DATA: wa_fields TYPE ihttpnvp ,

      wa_var TYPE w3query .

CLEAR :fields, q_variables ,i_axis_info,i_cell_data,i_axis_data,i_txt_symbols.

REFRESH: fields, q_variables,i_axis_info,i_cell_data,i_axis_data,i_txt_symbols .

CALL METHOD request->get_form_fields

  CHANGING

    fields = fields.

IF NOT fields[] IS INITIAL .

  CLEAR wa_fields .

  LOOP AT fields INTO wa_fields WHERE name CS 'VAR_'.

    CLEAR wa_var .

    MOVE-CORRESPONDING wa_fields TO wa_var .

    TRANSLATE wa_var-name TO UPPER CASE .

    APPEND wa_var TO q_variables .

    CLEAR wa_fields .

  ENDLOOP .

I have this error : field request is unknown.

How can i solve it?

Thanks.

Amine

10 REPLIES 10
Read only

Former Member
0 Likes
1,599

This message was moderated.

Read only

vamsilakshman_pendurti
Active Participant
0 Likes
1,599

Hi

You need to create Object for the Reference Variable REQUEST like as below code

Create Object Request .

Then you can use that Variable Request to call any component of the CLASS which referred by the Variable Request   .

Thanks ,

Vamsi .

Read only

Former Member
0 Likes
1,599

Hi guys,

Thanks for your answers.

The isse is that i don,t know the class name, when i click on get_form_fields, the system doesn,t take me to the class.

I have instead an error message :

Incorect cursor position.

Thanks.

Amine

Read only

david_escofettrenado
Participant
0 Likes
1,599

Dear Amine,

This code is for a BSP page. You should create the BSP in transaction SE80 instead of SE38. This call should be added to oninitialization event.

Best Regards,

David

Read only

Former Member
0 Likes
1,599

Hi guys,

I tried to use the program in another way, i m hving a short dump at this line of code:

ASSIGN COMPONENT wa_set-chanm OF STRUCTURE <l_line> TO <l_field>.


GETWA_NOT_ASSIGNED


How can i solve it please?


thanks.


Amine

Read only

0 Likes
1,599

Can you post the full code?

Read only

0 Likes
1,599

Hi Praba,

Here it is.

Read only

0 Likes
1,599

Hi. I didn't see any code.

Read only

0 Likes
1,599

Look at the attached file please in my last message.

Read only

0 Likes
1,599

Hi,

Please provide ST22 dump analysis. I feel its better write sy-subrc check after assign component statement. so that you can avoid dump.