cancel
Showing results for 
Search instead for 
Did you mean: 

can webdynpro get data from BW query?

Former Member
0 Kudos

hi, experts,

can webdynpro get data from BW query?

pls give me some sample,

hunger for ur advice and thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes it can, you have to use the BIAplicationFrame for that.

But I give you also a warning. Once you have that data you can only display it.

How i did it:

method wddomodifyview .

data:

lt_parameters type if_wd_bi_applframe_method_hndl=>tt_name_value,

ls_parameters type if_wd_bi_applframe_method_hndl=>t_name_value,

l_sel_nodename type string,

l_sel_iobjnm type string,

l_sel_child type string,

l_sel_query type string,

lr_node type ref to if_wd_context_node,

lr_element type ref to if_wd_context_element,

ls_kostenstelle type if_main=>element_kostenstelle,

ls_costcenthier type if_main=>element_costcenthier,

ls_queries type if_main=>element_queries,

lr_context_node type ref to if_wd_context_node,

lv_show_variables type wdy_boolean,

l_sel_costcenthier type string.

define add_parameter.

clear ls_parameters.

ls_parameters-name = &1.

ls_parameters-value = &2.

append ls_parameters to lt_parameters.

end-of-definition. "add_parameter

if first_time = abap_true.

wd_this->m_bi_application_frame1 ?= view->get_element( 'REPORT1' ).

wd_this->m_bi_method_handler1 ?= wd_this->m_bi_application_frame1->_method_handler.

wd_this->m_bi_application_frame2 ?= view->get_element( 'REPORT2' ).

wd_this->m_bi_method_handler2 ?= wd_this->m_bi_application_frame2->_method_handler.

wd_this->m_bi_application_frame3 ?= view->get_element( 'REPORT3' ).

wd_this->m_bi_method_handler3 ?= wd_this->m_bi_application_frame3->_method_handler.

wd_this->m_bi_application_frame4 ?= view->get_element( 'REPORT4' ).

wd_this->m_bi_method_handler4 ?= wd_this->m_bi_application_frame4->_method_handler.

wd_this->m_bi_application_frame5 ?= view->get_element( 'REPORT5' ).

wd_this->m_bi_method_handler5 ?= wd_this->m_bi_application_frame5->_method_handler.

endif.

lr_node = wd_context->get_child_node( 'QUERIES' ).

lr_element = lr_node->get_lead_selection( ).

lr_element->get_static_attributes( importing static_attributes = ls_queries ).

l_sel_query = ls_queries-reportid.

case l_sel_query.

when 'REPORT1'.

wd_this->m_bi_application_frame1->set_visible( 02 ).

wd_this->m_bi_application_frame2->set_visible( 01 ).

wd_this->m_bi_application_frame3->set_visible( 01 ).

wd_this->m_bi_application_frame4->set_visible( 01 ).

wd_this->m_bi_application_frame5->set_visible( 01 ).

when 'REPORT2'.

wd_this->m_bi_application_frame1->set_visible( 01 ).

wd_this->m_bi_application_frame2->set_visible( 02 ).

wd_this->m_bi_application_frame3->set_visible( 01 ).

wd_this->m_bi_application_frame4->set_visible( 01 ).

wd_this->m_bi_application_frame5->set_visible( 01 ).

when 'REPORT3'.

wd_this->m_bi_application_frame1->set_visible( 01 ).

wd_this->m_bi_application_frame2->set_visible( 01 ).

wd_this->m_bi_application_frame3->set_visible( 02 ).

wd_this->m_bi_application_frame4->set_visible( 01 ).

wd_this->m_bi_application_frame5->set_visible( 01 ).

when 'REPORT4'.

wd_this->m_bi_application_frame1->set_visible( 01 ).

wd_this->m_bi_application_frame2->set_visible( 01 ).

wd_this->m_bi_application_frame3->set_visible( 01 ).

wd_this->m_bi_application_frame4->set_visible( 02 ).

wd_this->m_bi_application_frame5->set_visible( 01 ).

when 'REPORT5'.

wd_this->m_bi_application_frame1->set_visible( 01 ).

wd_this->m_bi_application_frame2->set_visible( 01 ).

wd_this->m_bi_application_frame3->set_visible( 01 ).

wd_this->m_bi_application_frame4->set_visible( 01 ).

wd_this->m_bi_application_frame5->set_visible( 02 ).

endcase.

lr_context_node = wd_context->get_child_node( 'SCHALTER' ).

lr_context_node->get_attribute( exporting name = 'SHOW_VARIABLES' importing value = lv_show_variables ).

if lv_show_variables eq abap_false.

lr_node = wd_context->get_child_node( 'KOSTENSTELLE' ).

lr_element = lr_node->get_lead_selection( ).

lr_element->get_static_attributes( importing static_attributes = ls_kostenstelle ).

l_sel_nodename = ls_kostenstelle-nodename.

l_sel_iobjnm = ls_kostenstelle-iobjnm.

l_sel_child = ls_kostenstelle-childid.

lr_node = wd_context->get_child_node( 'COSTCENTHIER' ).

lr_element = lr_node->get_lead_selection( ).

lr_element->get_static_attributes( importing static_attributes = ls_costcenthier ).

l_sel_costcenthier = ls_costcenthier-hienm.

if l_sel_child eq '00000000'.

concatenate '1000/' l_sel_nodename+10(4) into l_sel_nodename.

endif.

refresh lt_parameters.

add_parameter 'CMD' 'LDOC'.

add_parameter 'TEMPLATE_ID' 'ZQUERY_TEMPLATE'.

case l_sel_query.

when 'REPORT1'.

wd_this->m_bi_method_handler1->execute_command( lt_parameters ).

when 'REPORT2'.

wd_this->m_bi_method_handler2->execute_command( lt_parameters ).

when 'REPORT3'.

wd_this->m_bi_method_handler3->execute_command( lt_parameters ).

when 'REPORT4'.

wd_this->m_bi_method_handler4->execute_command( lt_parameters ).

when 'REPORT5'.

wd_this->m_bi_method_handler5->execute_command( lt_parameters ).

endcase.

refresh lt_parameters.

add_parameter 'CMD' 'PROCESS_VARIABLES'.

add_parameter 'SUBCMD' 'VAR_SUBMIT'.

add_parameter 'VAR_NAME_1' 'ZKSTKNOT'.

add_parameter 'VAR_VALUE_EXT_1' l_sel_costcenthier.

add_parameter 'VAR_NAME_2' 'ZKSTHIER01'.

add_parameter 'VAR_VALUE_EXT_2' l_sel_nodename.

add_parameter 'VAR_NODE_IOBJNM_2' l_sel_iobjnm.

case l_sel_query.

when 'REPORT1'.

wd_this->m_bi_method_handler1->execute_command( lt_parameters ).

when 'REPORT2'.

wd_this->m_bi_method_handler2->execute_command( lt_parameters ).

when 'REPORT3'.

wd_this->m_bi_method_handler3->execute_command( lt_parameters ).

when 'REPORT4'.

wd_this->m_bi_method_handler4->execute_command( lt_parameters ).

when 'REPORT5'.

wd_this->m_bi_method_handler5->execute_command( lt_parameters ).

endcase.

else.

refresh lt_parameters.

add_parameter 'CMD' 'PROCESS_VARIABLES'.

add_parameter 'VARIABLE_SCREEN' 'X'.

case l_sel_query.

when 'REPORT1'.

wd_this->m_bi_method_handler1->execute_command( lt_parameters ).

when 'REPORT2'.

wd_this->m_bi_method_handler2->execute_command( lt_parameters ).

when 'REPORT3'.

wd_this->m_bi_method_handler3->execute_command( lt_parameters ).

when 'REPORT4'.

wd_this->m_bi_method_handler4->execute_command( lt_parameters ).

when 'REPORT5'.

wd_this->m_bi_method_handler5->execute_command( lt_parameters ).

endcase.

lr_context_node->set_attribute( exporting name = 'SHOW_VARIABLES' value = ' ' ).

endif.

endmethod.

This is just an eyample how to send parameters to a query and retrieve the data in BIApplicationFrame.

I posted the complete thing under the WD4A forum.

good luck

Answers (1)

Answers (1)

Former Member
0 Kudos