Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Remove Application toolbar option in PDF

Hi all,

I'm displaying PO document like in ME29N print preview.In which i have used IFRAME UI Element to pass the PO data by converting the OTF File format to PDF using FM - 'CONVERT_OTF'. But it shows with Application Toolbar of PDF with PRINT and SAVE Option. I dont want to show that option in IFRAME. Is there any option of removing/hiding those option . Or is there anyway of showing the PO document without print and save option. Can anyone help me with this. below is my coding,

CALL FUNCTION fname

EXPORTING

output_options = outopt

control_parameters = conpar

  • user_settings = ' '

ls_ekko = l_doc-xekko

ls_nast = l_nast

IMPORTING

document_output_info = docout

job_output_info = jobout

job_output_options = jobopt

TABLES

i_ekpo = l_doc-xekpo

t_eket = l_doc-xeket

t_ekkn = l_doc-xekkn

t_komv = l_doc-xtkomv

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

  • MAX_LINEWIDTH = '100'

  • PDF_DELETE_OTFTAB = 'X'

importing

bin_filesize = l_pdf_len

bin_file = l_pdf_xstring

tables

otf = jobout-otfdata

lines = lt_lines.

create object cached_response

type

cl_http_response

exporting

add_c_msg = 1.

l_pdf_len = xstrlen( l_pdf_xstring ).

cached_response->set_data( data = l_pdf_xstring

length = l_pdf_len ).

cached_response->set_header_field( name = if_http_header_fields=>content_type

value = 'application/pdf' ).

cached_response->set_status( code = 200 reason = 'OK' ).

cached_response->server_cache_expire_rel( expires_rel = 180 ).

call function 'GUID_CREATE'

importing

ev_guid_32 = guid.

call method cl_wd_utilities=>construct_wd_url

exporting

application_name = 'APPLICATION_NAME'

importing

out_host = host

out_port = port

out_protocol = protocol

out_local_url = local_url

out_absolute_url = abs_url.

concatenate abs_url '/' guid '.pdf' into display_url.

cl_http_server=>server_cache_upload( url = display_url

response = cached_response ).

DATA lo_nd_url TYPE REF TO if_wd_context_node.

DATA lo_el_url TYPE REF TO if_wd_context_element.

DATA ls_url TYPE wd_this->element_url.

DATA lv_linkurl LIKE ls_url-linkurl.

  • navigate from <CONTEXT> to <URL> via lead selection

lo_nd_url = wd_context->get_child_node( name = wd_this->wdctx_url ).

  • get element via lead selection

lo_el_url = lo_nd_url->get_element( ).

  • get single attribute

lo_el_url->set_attribute(

EXPORTING

name = `LINKURL`

value = display_url ).

Regards,

Ramesh

Former Member
Not what you were looking for? View more on this topic or Ask a question