Skip to Content
Author's profile photo Prabhu Rajesh

How to display SAP archived document using ABAP webdynpro

Dear All;
Thought to share a document on how to display SAP archived document from ABAP webdynpro application;

Step1: Create Webdynpro application to display the required business document for (e.g Sales Order). 

Step2: On lead selection display the list of attachments (table)

Step3: On lead selection from the attachment table launch a new window to display the archived document.

*- Data declaration



          lv_OBJECT_ID     LIKE  TOAV0-OBJECT_ID,

  lit_uri                  TYPE standard table of toauri,

  lo_window_manager  TYPE ref to if_wd_window_manager,

  lo_api_component   TYPE ref to if_wd_component.

  lo_window          TYPE ref to if_wd_window,

  ld_url type string.

*- End of data declaration

*- call function module “ARCHIVOBJECT_GET_URI”

call function
      objecttype    = Lv_OBJECTTYPE
      object_id     = Lv_OBJECT_ID 
      location      = ‘F’
      http_url_only = ‘ ‘
      uri_table     = lit_uri.

*- Read the internal table with the key for the document selected by the user

read table lit_uri into lwa_uri with key arc_doc_id = lwa_alist-arc_doc_id.

*- If above read is sucess call the method “create_external_window” from  if_wd_window_manager

if sy-subrc eq 0.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).
ld_url = lwa_uri-uri.
call method lo_window_manager->create_external_window
        url = ld_url
        window = lo_window.
lo_window->open( ).


Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.