on 07-21-2011 2:06 PM
Hi Friends,
My Requirement is to display Purchase Requisition Header text in POP UP Window in SRM , i used RFC_READ_TEXT function module , data is coming into internal table, but not able to fill the text in POP up Window, its giving DUMP, Cn any please help me
Thnx
Kumar Srini
my Code :
DATA lo_nd_header TYPE REF TO if_wd_context_node.
DATA lo_el_header TYPE REF TO if_wd_context_element.
DATA ls_header TYPE wd_this->element_header.
* navigate from <CONTEXT> to <HEADER> via lead selection
lo_nd_header = wd_context->get_child_node( name = wd_this->wdctx_header ).
DATA : lt_rel TYPE TABLE OF bbp_pds_hrel,
ls_rel TYPE bbp_pds_hrel.
DATA : ls_guid TYPE crmd_orderadm_h-guid.
DATA : doc_no TYPE be_object_id.
DATA lo_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .
TYPES: BEGIN OF ty_ibiptextln,
mandt TYPE mandt,
tdobject TYPE tdobject,
tdname TYPE tdobname,
tdid TYPE tdid,
tdspras TYPE tdspras,
counter(3) TYPE n,
tdformat TYPE tdformat,
tdline TYPE tdline,
END OF ty_ibiptextln.
DATA: lt_ibiptextln TYPE TABLE OF ty_ibiptextln,
ls_ibiptextln TYPE ty_ibiptextln.
DATA : LV_TEXT TYPE STRING,
LV_DOC_TEXT TYPE STRING.
* *****> DATA DECLARATION FOR CALLING POPUP WINDOW
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component type ref to if_wd_component.
* data lo_window type ref to if_wd_window.
* @TODO handle non existant child
* IF lo_nd_header IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_header = lo_nd_header->get_element( ).
* @TODO handle not set lead selection
IF lo_el_header IS INITIAL.
ENDIF.
* get all declared attributes
lo_el_header->get_static_attributes(
IMPORTING
static_attributes = ls_header ).
ls_guid = ls_header-guid.
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = ls_guid
TABLES
e_header_rel = lt_rel.
LOOP AT lt_rel INTO ls_rel.
IF ls_rel-objid_a IS NOT INITIAL.
doc_no = ls_rel-objid_a.
ENDIF.
ENDLOOP.
IF doc_no IS NOT INITIAL.
ls_ibiptextln-mandt = ''.
ls_ibiptextln-tdobject = 'EBANH'.
ls_ibiptextln-tdname = doc_no.
ls_ibiptextln-tdid = 'B01'.
ls_ibiptextln-tdspras = sy-langu.
APPEND ls_ibiptextln TO lt_ibiptextln.
CALL FUNCTION 'RFC_READ_TEXT' DESTINATION 'TD1CLNT400'
TABLES
TEXT_LINES = lt_ibiptextln.
ENDIF.
* ****> Get Refrence of Component Controller .
lo_COMPONENTCONTROLLER = wd_this->get_componentcontroller_ctr( ).
IF lt_ibiptextln IS NOT INITIAL.
LOOP AT lt_ibiptextln INTO lS_ibiptextln where tdline is NOT INITIAL.
lv_text = lS_ibiptextln-TDLINE.
CONCATENATE LV_DOC_TEXT lv_text INTO LV_DOC_TEXT SEPARATED BY space . " CONCATANATION OF THE PRODUCT DESCRIPTION
ENDLOOP.
* ************* CALLING METHOD OF COMPONENT CONTROLLER
lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).
lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).
lo_componentcontroller->fill_doc_text(
lt_doc_text = lv_text " string
).
DATA lo_window TYPE REF TO if_wd_window.
"_*AT THIS POINT I AM GETTING SHORT DUMP_*
lo_window = lo_window_manager->create_window(
window_name = 'ZSRM_WIN'
title = 'Text Description'
message_display_mode = if_wd_window=>co_msg_display_mode_selected
button_kind = if_wd_window=>co_buttons_close
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_close
).
else.
lo_componentcontroller->fill_doc_text(
lt_doc_text = 'THERE IS NO TEXT FOR THIS Document Number' ).
lo_window = lo_window_manager->create_window(
window_name = 'ZSRM_WIN'
title = 'Text Description'
message_display_mode = if_wd_window=>co_msg_display_mode_selected
button_kind = if_wd_window=>co_buttons_close
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_close
).
endif.
lo_window->open( ).
You haven't created lo_window_manager
you are missing the following two lines of code:
lo_api_component = wd_this->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
Put them just before you get your dump.
Good luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
adding to above what chris suggested .... just make sure that you have embed your view also in the window..
regards,
sahai.s
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
What error you are getting,. May some initial problem
Goto ST22 and check..
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.