How can I call the Class and have a PDF appear in seperate window?.

I would like to call the class/interface ZCL_UIU_PRN_ACCOUNT2, method Collect_data and have a Smartform executed to produce a PDF document in a Seperate window.
Where I have an issue is in opening another window to display the PDF.
I know the Standard PDF Facsheet does exactly this, but that is triggered via the Web browser and calls a Java script, avoiding and events and round-server trip processing. I would have changed the button values so that when pressed it does process the various events and eventually ends up at EH_ONPREVIEW for the BP_HEAD/Overview. I know just need to open a new window and call the process to create the PDF via Smartform.
Any suggestions would be more than welcome. I have spent so much time on this, and have gained no real ground, so far.
Jason

Hi,
in the method
data: zcontrol TYPE SSFCTRLOP.
zcontrol-device = 'PRINTER'.
zcontrol-langu = sy-langu.
zcontrol-no_dialog = 'X'.
zcontrol-getotf = 'X'.
data: job type SSFCRESCL.
data: devtype type RSPOPTYPE.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
IMPORTING
e_devtype = devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
data: output_options type SSFCOMPOP.
output_options-tdprinter = devtype.
call function FM_NAME
EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
   CONTROL_PARAMETERS         = zcontrol
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
   OUTPUT_OPTIONS             = output_options
*   USER_SETTINGS              = 'X'
IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
   JOB_OUTPUT_INFO            = job
*   JOB_OUTPUT_OPTIONS         =
  TABLES
    t_texto                    = t_texto
  EXCEPTIONS
    FORMATTING_ERROR           = 1
    INTERNAL_ERROR             = 2
    SEND_ERROR                 = 3
    USER_CANCELED              = 4
    OTHERS                     = 5.
if sy-subrc <> 0.
endif.
data: DOCTAB_ARCHIVE type TABLE OF DOCS,
LINES type TABLE OF TLINE.
*CALL FUNCTION 'CONVERT_OTF_2_PDF'
** EXPORTING
**   USE_OTF_MC_CMD               = 'X'
**   ARCHIVE_INDEX                =
** IMPORTING
**   BIN_FILESIZE                 =
*  TABLES
*    otf                          = job-otfdata
*    doctab_archive               = doctab_archive
*    lines                        = lines
* EXCEPTIONS
*   ERR_CONV_NOT_POSSIBLE        = 1
*   ERR_OTF_MC_NOENDMARKER       = 2
*   OTHERS                       = 3
data:  l_pdf_len type i,
l_pdf_xstring type XSTRING.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring
TABLES
otf = job-otfdata
lines = lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc is initial.
DATA: cached_response TYPE REF TO cl_http_response.
CREATE OBJECT cached_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->if_http_response~set_status( code = 200
reason = 'OK' ).
cached_response->if_http_response~server_cache_expire_rel(
expires_rel = 180 ).
data guid type GUID_32.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
data display_url type string.
CONCATENATE url '/' guid '.pdf' INTO
display_url.
cl_http_server=>server_cache_upload( url = display_url
response = cached_response ).
*GV_DISPLAY_URL & GV_PRINTON are class attributes
CLEAR: gv_display_url, gv_printon.
MOVE display_url TO gv_display_url.
gv_printon = 'X'.
ENDIF.
Send me you e-mail i cannot post the code that is used in the view.htm.
Best Regards,
Caíque Escaler
Edited by: Caíque Escaler on Nov 26, 2010 5:00 PM

Similar Messages

  • How can i lock the position and size of all of my .app windows?

    I have had this problem for a few months now; I would size the window of one of my apps (lets use safari for example) exactly the size i want it, then i position it exactly in the center of my screen because I'm OCD like that, then I'm just browsing the internet and i accidentally move the window so then i have to move it back. Sometimes it gets even worse and for whatever reason, my cursor is down in the lower right part of my window and i accidentally size it, then i have to go back and resize it to where it was. Please help me! there has to be a way to lock my windows positions and sizes! is there a widget or a program out there that can save my life?! Thanks haha

    AFAIK, there isn't. All I can suggest is that you quit clicking and dragging the cursor. Use the arrow keys to scroll up and down. I don't have a laptop, but there might be a trackpad setting for the various swipe stuff that comes with them.

  • How can I call the jFreeChart to plot graph and get the result in Servlet?

    I want to use jFreeChart to plot time series graph, and then output the result in Servlet. How can I call the jFreeChart to plot graph and get back the result? Any source code for example? Thanks a lot!!

    Dave,
    ServletDemo1 and others were not in the distribution that I got (jfreechart-0.9.4). I found them under the premium demos somewhere in com/refinery/chart/demo/premium, but could not compile. They're complaining, among other things, about missing classes/packages com.refinery.date.SerialDate and com.refinery.ui. Am I using a wrong version of jfreechart?
    Thanks,
    -Alla
    There is a very simple servlet demo in the JFreeChart
    distribution:
    src/com/jrefinery/chart/demo/ServletDemo1.java
    This simply sends back an image to the browser.
    A second demo, which embeds the chart in an HTML page
    is:
    src/com/jrefinery/chart/demo/ServletDemo2.java
    src/com/jrefinery/chart/demo/ServletDemo2ChartGenerator
    java
    ...includes a time series chart as one of three
    options.
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    http://www.object-refinery.com/jfreechart/index.html

  • How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account an

    How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently
    it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account and in the past syncing was no problem.  What setting has changed?

    The phone number format as well as the date language and format and the time format are controlled by the Region Format setting. Go to Settings > General >International > Region Format.  When you change a region format, you can go back one page (to International) and see an example of the date/time/phone number format that your selected region format will produce.

  • How can I sync the calendar and contacts from my icloud account to the new icloud account we set for him.  I have already set up the Family connections.

    How can I sync the calendar and contacts from my icloud account to the new icloud account we set for my husband on his iPad and iPhone 5S?  I have already set up the Family connections but they are not syncing.
    Thanks.
    Jenny

    Oops my bad...I see that during my troubleshooting I inadvertently left Ringtones unchecked in iTunes.

  • How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go??? Last week I was on holiday in HK,  and  from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!  Why THIS WEEK, can't I use my HS

    Apple_ID_card_declined_for_this_country
    How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go???
    Last week I was on holiday in HK,
    and
    from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!
    Why THIS WEEK, can't I use my HSBC Platinum Credit Card from Vietnam,
    for my Singapore Apple ID account ,
    while working here in Vietnam???

    Unfortunately, this is a problem that is driven by the DRM Dictatorship.  Despite the proliferation of mobile devices and the fact that there are many of us who do a lot of international travel, content providers don't want you to have access to their products outside of your homeland.  The Balkanized mentality of the DRM Dictatorship is way out of touch with the modern world.
    At least Apple, to its credit, allows you to use your accounts outside of your homeland as long as you have the proper credentials for them.  Most other services use the more Draconian geolocation filtering which does require you to be physically present in your homeland.  For the most part, you are not allowed to leave home if you want access to your favorite entertainment!

  • Hello my iphone 3gs just been stolen how can i block the iphone and how could i track it i don't know for sure if i have find my iphone? please help i got many accounts on it and i don't have a passcode :((

    hello my iphone 3gs just been stolen how can i block the iphone and how could i track it i don't know for sure if i have find my iphone? please help i got many accounts on it and i don't have a passcode :((

    It was never free for the 3GS.
    It is if the initial sign-up is done on an iPhone 4, iPad or iPod touch 4th gen.
    From http://support.apple.com/kb/HT4436:
    After I sign up for Find My iPhone for free, can I use it on other iOS devices?
    Yes, if your devices are running iOS 4.2. For example, you can sign up for Find My iPhone for free on your iPad and use the same account information to sign in to MobileMe on your iPhone 3GS and turn on Find My iPhone.

  • I have a new ipad and a iphone 5 which are under same Apple ID. I lso have a macbook that uses an older apple ID. How can I get the macbook to have same Apple ID as the other 2 devices

    I have a new ipad and a iphone 5 which are under same Apple ID. I lso have a macbook that uses an older apple ID. How can I get the macbook to have same Apple ID as the other 2 devices

    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • I have lock iPhone 5 from Japan, i don't know from which carrier it  is belongs to currently I am in Saudi Araiba, how can i unlock the phone and use here)

    I have lock iPhone 5 from Japan, i don't know from which carrier it  is belongs to. currently I am in Saudi Arabia, how can i unlock the phone and use here)
    <Personal information edited by Host>

    You can't.

  • How can I publish the alterations I have made to my iWeb pages when the ' Publish Site' button and 'Publish Site Changes' on the file dropdown are grey?

    How can I publish the alterations I have made to my iWeb pages when the ' Publish Site' button and 'Publish Site Changes' on the file dropdown are grey?

    this is a perfect question for the users in the iWeb forum.  https://discussions.apple.com/community/ilife/iweb.  Good luck.

  • My mac disk is full and i cant transfer files from Mac to USB. saying the format is not good, how can i change the format and what happened to the files i have on USB?

    my mac disk is full and i cant transfer files from Mac to USB. saying the format is not good, how can i change the format and what happened to the files i have on USB?

    Once something similar happened to me. The external drives I had set up for FCP to use for some reason were not mounted, and FCP put all its render files on the main drive and I couldn't find them anywhere.
    Go to applications, and control-click (and hold down) on your FCP icon; you should get a pop up menu that says "show package contents". Select that, select the "contents" folder, then the "mac OS" folder. See if your quicktime file is in there, or if you've got render files in the "render" folder or audio render files in the "audio render" folder that don't belong there.
    That's where FCP sticks stuff when your documents FCP project folders are not available or when external drives you've selected aren't available.

  • Hello  i have installed above CC   and without my knowledge the machine has now adobe cc and cc 2014  how can i remove the CC and move the lug ins to the new CC 2014

    Hello
    i have installed above CC
    and without my knowledge the machine has now adobe cc and cc 2014
    how can i remove the CC and move the lug ins to the new CC 2014

    Hi
    well could you confirm me, the plug-ins you have installed in Photoshop cc, are you able to use the same in the Photoshop cc 2014
    you just have to remove the Photoshop cc from the add or remove program in the control panel
    and you can go to this link and copy all the plugins to the Photoshop cc 2014
    http://glyndewis.com/plug-ins-adobe-photoshop-cc-2014/

  • My husband and I each have iphones, how can we share the contact and calender info we have have in our iclouds with each other?

    My husband and I each have an iphone 4S, how can we share the contact and calender info we have in our iclouds with each other?

    You can make one or more calendars of one iphone sharable and the other user will be able to have those sharable calanders synced.  Unfortunately, you can't do that with contacts.  But you could go to the computer account used by you or your husband, perform a backup of the contacts (see the file menu), copy the file to the other account used to sync the other iphone, and restore.  It's a manual process that has to be performed periodically, but doable.
    The other method is for each of you to use the same iCloud ID and have both iphones synced to be identical.  But I don't recommend that otherwise you'll each get the same text messages and who knows what else.

  • HT1725 I have paid for a movie rental, when trying to download but wifi got interrupted , therefore I can't see the movie in the download section , it's disappear and I have paid for it , how can I find the movie and continue the download ?

    I have paid for a movie rental, when trying to download but wifi got interrupted , therefore I can't see the movie in the download section , it's disappear and I have paid for it , how can I find the movie and continue the download ?

    In the "Store" menu, click "Check for Available Downloads"

  • How can I Call the MainVI from its SubVI, and this happen recursively?

    Hi All,
    How can I Call the MainVI from its SubVI, and this happen recursively?
    Actually, LAbView 7.1 doesn't support recurssion?
    Plz help me out!

    Dear GerdW,
    Thanks a lot 2 all of u guys,for all the brilliant responses.
    Actually, my basic aim is to call the Main VI, containing a SubVI.....
    Now, I want to call my main VI from this SubVI...recursively!!!!!..but whenever I tried to put the MainVI in this SubVI..an error message pops out saying recursive calling is not possible.
    I also tried using "Call by reference" but tht also didn't worked...an d error is somewat like...VI is invalid..or type matching..or state matching error.
    Here, Im attaching the snapshot of the MainVI... Im calling the SUBvi from it... It is running GOOD n FINE...
    But prob arrives when I call the Main from the SUBvi, which looks like same as MainVI(with little differences).
    I hope, Im clear in my words n not being ambigous.
    Plz, correct me where ever  im wrong.
    Thank You.
    Mishra_RnD
    Attachments:
    ScrShot.JPG ‏272 KB

Maybe you are looking for

  • Nokia 5800 Low GPRS connection Problem In canada /...

    Hi , i bought a Nokia 5800 phone , from Middle East , but they come from europe in general I live in Canada thought and my Connection to FIDO GPRS is veryyy Loww take a minute to log on evry page .....a friend told me that the problem is because you

  • Director Survey - results are out

    Hi all, I have finally finished collating all the data from the survey after a few very intense days of working through all the responses. There were 227 responses in total. Since the survey gave the respondent the ability to choose features rather t

  • Editing a record using Objects SAP2007a

    Hi I  wrote a program using SAP objects to store contact information for one of our customers. I created a SAP object which handled the master table and 2 transactions tables There was very little code in the program but the screens are quite complic

  • TV out doesn't work for some videofiles

    I am using the GEforce 2 mx 400 64 mb I have configured the driver as 'klone' . Now i've got two outputs of the card at the same time; one to monitor, one to tv (with s-vhs cable) It works fine, except for  playing videofiles (Mpeg, WMV etc, In media

  • Elements 3.0 help

    I had Elements 3.0 installed on my home computer. My computer crashed and everything had to be re-installed. I can not put my hands on the disc for 3.0 but I do have my serial number. I downloaded PSE 10.0 and every time I try to use it, it shuts dow