How to retrive the archived (in PDF) smartform as a email attachment.

Hi ,
I have a requirement where the smartform is archived in PDF mode and I have to retrieve the archived smartfrom and send the mail with PDf attachment.
I referred the sdn forum for the same and I could some posts posted earlier and quite a few are solved. I implemented the sample code provided by some of the posts and I still get the same error when I try to open the mail/attachment in SOST transaction. But I didnt understand what exactly they did to get away with the error when we try to open the attachment.
Please help me with the correct code to get this issue solved.
Thanks a lot in advance.
Regards,
Naresh

Hi Sim,
The Error says:
"Adobe reader could not open 'InvoiceDetails_20110228094610.709_X.pdf' because it is either not a supported file or because the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decorded).
Below is the sample code that I got from one of the forum postings. I implemented the same and got the same error that the earlier posting was referring. From that step, I didnt know what to do further.
*// Internal Table Declarations
DATA : li_toa01 TYPE TABLE OF toa01,
       li_archivobject TYPE TABLE OF docs,
       li_binarchivobject TYPE TABLE OF tbl1024,
       li_objcont TYPE TABLE OF soli,
       li_receivers TYPE TABLE OF soos1.
*// Work Area Declarations
DATA : lwa_toa01 TYPE toa01,
       lwa_objcont TYPE soli,
       lwa_receivers TYPE soos1,
       lwa_archivobject TYPE docs,
       lwa_binarchivobject TYPE tbl1024.
*// Variable Declaration
DATA : lv_length   TYPE num12,
       lv_binlength TYPE num12,
       lv_buffer TYPE xstring,
       lv_x TYPE i.
DATA : wa_objbin TYPE solisti1,
       i_objbin TYPE TABLE OF solisti1,
       wa_objtxt TYPE solisti1,
       i_objtxt TYPE TABLE OF solisti1.
DATA : wa_doc_chng TYPE sodocchgi1,
       w_l1 TYPE i.
DATA : wa_objpack TYPE sopcklsti1,
       i_objpack TYPE TABLE OF sopcklsti1.
DATA : wa_reclist TYPE somlreci1,
       i_reclist TYPE TABLE OF somlreci1.
CALL FUNCTION 'ARCHIVOBJECT_GET_TABLE'
          EXPORTING
            archiv_id                      = 'ZF'
            document_type                  = 'PDF'
            archiv_doc_id                  = 'DF88D06227DFAEF1A31D0050568361B1'
*           ALL_COMPONENTS                 =
*           SIGNATURE                      = 'X'
*           COMPID                         = 'data'
          IMPORTING
            length                         = lv_length
            binlength                      = lv_binlength
          TABLES
            archivobject                   = li_archivobject
            binarchivobject                = li_binarchivobject
*         EXCEPTIONS
*           ERROR_ARCHIV                   = 1
*           ERROR_COMMUNICATIONTABLE       = 2
*           ERROR_KERNEL                   = 3
*           OTHERS                         = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT li_binarchivobject INTO lwa_binarchivobject.
  CONCATENATE lv_buffer lwa_binarchivobject-line INTO lv_buffer
  IN BYTE MODE.
ENDLOOP.
lv_x = 0.
DO.
  wa_objbin-line = lv_buffer+lv_x.
  APPEND wa_objbin TO i_objbin.
  lv_x = lv_x + 255.
  IF lv_x GT lv_binlength.
    EXIT.
  ENDIF.
ENDDO.
wa_objtxt = 'Test Mail'.
APPEND wa_objtxt TO i_objtxt.
CLEAR wa_doc_chng.
wa_doc_chng-obj_name = 'Invoice Details'.
wa_doc_chng-obj_descr = 'Invoice Details'.
DESCRIBE TABLE i_objtxt LINES w_l1.
READ TABLE i_objtxt INTO wa_objtxt INDEX w_l1.
wa_doc_chng-doc_size = ( w_l1 - 1 ) * 255 + strlen( wa_objtxt ).
CLEAR wa_objpack-transf_bin.
wa_objpack-head_start = 1.
wa_objpack-head_num = 0.
wa_objpack-body_start = 1.
wa_objpack-body_num = w_l1.
wa_objpack-doc_type = 'PDF'.
APPEND wa_objpack TO i_objpack.
CLEAR wa_objpack.
wa_objpack-transf_bin = 'X'.
wa_objpack-head_start = 1.
wa_objpack-head_num = 1.
wa_objpack-doc_type = 'DAT'.
wa_objpack-body_num = w_l1 .
wa_objpack-doc_size = w_l1 * lv_binlength .
wa_objpack-obj_name = 'TEST'.
wa_objpack-obj_descr = 'Naresh'.
APPEND wa_objpack TO i_objpack.
wa_reclist-receiver =   -->emailaddress given.
wa_reclist-rec_type = 'U'.
APPEND wa_reclist TO i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
  document_data = wa_doc_chng
  put_in_outbox = 'X'
  commit_work = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
  packing_list = i_objpack
* OBJECT_HEADER =
  contents_bin = i_objbin
  contents_txt = i_objtxt
  receivers = i_reclist
EXCEPTIONS
  too_many_receivers = 1
  document_not_sent = 2
  document_type_not_exist = 3
  operation_no_authorization = 4
  parameter_error = 5
  x_error = 6
  enqueue_error = 7
OTHERS = 8
IF sy-subrc = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Similar Messages

  • How to retrive the archive PR

    How to retrive the archive PR
    or
    anyway that user can view it in display mode
    Edited by: shakir on Jun 5, 2010 2:07 PM

    Check this link
    [retrive the archive PR|http://help.sap.com/erp2005_ehp_03/helpdata/EN/8d/3e4b63462a11d189000000e8323d3a/frameset.htm]

  • How to convert a workbook into PDF and broadcast as Email attachment

    Hello Gurus,
    i have installed the ADS (Adobe Document services). I would like to broadcast workbooks as a pdf file to some user.
    When i open the workbook and go to Broadcast --> Setup a broadcast setting for this workbook. The distribution type is
    Broadcast E-mail; Broadcast E-mail (Bursting); Broadcast Portal; Broadcast Multichannel and Output Format only MS Workbook and Link to current Data. Here i miss the possibility as PDF.
    Where can i set up that the workbook should be broadcast as PDF.
    Any help appreciated.
    Thanks and kind rgerads,
    Murat

    Thanks all for your answers,
    i also read that with changing the format in Report designer then broadcasting via PDF. Is there no possibility for PDFs for MS Excel Workbooks? How does it work when opening the query in Report designer? What do i have to do there but it is no solution for us because in the workbooks we use GET BEX DATA formulas and just show parts of the analyisis grid. I need a proper solution how to use broadcaster converting workbooks into PDF an send them as email attachment
    Thanks,
    Murat

  • *HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY*

    HOW TO DELETE THE ARCHIVE LOGS ON THE STANDBY
    I have set the RMAN CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY; on my physical standby server.
    My archivelog files are not deleted on standby.
    I have set the CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default on the Primary server.
    I've checked the archivelogs with the FRA and they are not beign deleted on the STANDBY. Do I have to do something for the configuation to take effect? Like run a RMAN backup?
    I've done a lot ofresearch and i'm getting mixed answers. Please help. Thanks in advanced.
    J

    Setting the Policy will not delete the Archive logs on the Standby. ( I found a thread where the Data Guard product manager says "The deletion policy on both sides will do what you want" ). However I still
    like to clean them off with RMAN.
    I would use RMAN to delete them so that it can use that Policy are you are protected in case of Gap, transport issue etc.
    There are many ways to do this. You can simply run RMAN and have it clean out the Archive.
    Example :
    #!/bin/bash
    # Name: db_rman_arch_standby.sh
    # Purpose: Database rman backup
    # Usage : db_rman_arch_standby <DBNAME>
    if [ "$1" ]
    then DBNAME=$1
    else
    echo "basename $0 : Syntax error : use . db_rman_full <DBNAME> "
    exit 1
    fi
    . /u01/app/oracle/dba_tool/env/${DBNAME}.env
    echo ${DBNAME}
    MAILHEADER="Archive_cleanup_on_STANDBY_${DBNAME}"
    echo "Starting RMAN..."
    $ORACLE_HOME/bin/rman target / catalog <user>/<password>@<catalog> << EOF
    delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-8';
    exit
    EOF
    echo `date`
    echo
    echo 'End of archive cleanup on STANDBY'
    mailx -s ${MAILHEADER} $MAILTO < /tmp/rmandbarchstandby.out
    # End of ScriptThis uses ( calls an ENV) so the crontab has an environment.
    Example ( STANDBY.env )
    ORACLE_BASE=/u01/app/oracle
    ULIMIT=unlimited
    ORACLE_SID=STANDBY
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2
    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    LIBPATH=$LD_LIBRARY_PATH:/usr/lib
    TNS_ADMIN=$ORACLE_HOME/network/admin
    PATH=$ORACLE_HOME/bin:$ORACLE_BASE/dba_tool/bin:/bin:/usr/bin:/usr/ccs/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/lbin:/GNU/bin/make:/u01/app/oracle/dba_tool/bin:/home/oracle/utils/SCRIPTS:/usr/local/bin:.
    #export TERM=linux=80x25 wrong wrong wrong wrong wrong
    export TERM=vt100
    export ORACLE_BASE ORACLE_SID ORACLE_TERM ULIMIT
    export ORACLE_HOME
    export LIBPATH LD_LIBRARY_PATH ORA_NLS33
    export TNS_ADMIN
    export PATH
    export MAILTO=?? your email hereNote use the env command in Unix to get you settings.
    There are probably ten other/better ways to do this, but this works.
    other options ( you decide )
    Configure RMAN to purge archivelogs after applied on standby [ID 728053.1]
    http://www.oracle.com/technetwork/database/features/availability/rman-dataguard-10g-wp-1-129486.pdf
    Maintenance Of Archivelogs On Standby Databases [ID 464668.1]
    Tip I don't care myself but in some of the other forums people seem to mind if you use all caps in the subject. They say it shouting. My take is if somebody is shouting at me I'm probably going to just move away.
    Best Regards
    mseberg
    Edited by: mseberg on May 8, 2012 11:53 AM
    Edited by: mseberg on May 8, 2012 11:56 AM

  • Retrive the archive sales order

    Hi gurus,
    Can we retrive the archived sales order?
    How?
    thanx in advance.
    rgds,
    Anand

    Hi,
    goto SE11 - give the table name CDHDR.
    you can find out your deleted sales orde number.
    regards,
    Sumith

  • How to retrive the data from a sqlite file(.db3) in windows phone 8.1(runtime)

    hey guys
    i installed the sqlite and sqlite-net as requested in other answers i found, changed to x86, and add the .db3 file in my project.
    but the problem is how to retrive the data that already in the file( i am not creating any table or data in the app, just read)
    all the answer i found is to create a table first and then read the table, i tried to skip the step of creating a table, and read from the table directly, but failed with " no such table", by the way, i set the property of the .db3 file as "content",
    "copy if newer"
    can anyone please help? i appreciate that !

    Hello,
    From your description, you want to read data from available sqlite file. When you add the sqlite file into your project, you need to change the sqlite file build action to content. After deploying to device, the sqlite file is located in installation folder,
    you need to copy that file into storage folder before reading data. Please try the following code snippets.
    private async void Button_Click_9(object sender, RoutedEventArgs e)
    //check if file exists in storage folder, and then copy to local storage
    bool flag = await FileExistsAsync("Data.db3");
    if (!flag)
    var folder = await Package.Current.InstalledLocation.GetFileAsync("Data.db3");
    await folder.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder);
    // open sqlite and read data
    public async Task<bool> FileExistsAsync(string fileName)
    try
    await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync(fileName);
    return true;
    catch (FileNotFoundException)
    return false;
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • How to send the output to PDF format in reports 6i?

    Hi,
    How to send the output to PDF format in reports 6i? I given Mode = BITMAP.
    DESTYPE = File, DESFORMAT = PDF, DESNAME = C:\x.pdf.
    Report is running fine. But PDF file not generated. I don't know what i missed. Any one can help this?
    Thanks
    Kavitha

    Hello,
    Do you get this problem only for DESFORMAT=PDF ?
    Test with :
    DESFORMAT = RTF, DESNAME = C:\x.rtf
    or
    DESFORMAT = HTMLCSS, DESNAME = C:\x.html
    does it work ?
    Check if DESNAME is modified in the reports itself.
    Regards

  • How do I view/print a pdf document in an email? I'm not getting the little hand icon.

    How do I view/print a pdf document in an email? I'm not getting the little hand icon.

    Ah, yes, I'm using Adobe Reader!  That makes sense.  Thanks so much for your reply.  At the moment, I scan Word documents into my computer and they're automatically converted to PDFs.  If I had Adobe Acrobat on my computer, and scanned in documents, would they open in Reader automatically or could I open them in Acrobat and therefore add password protection?

  • How to call the new page in smartforms

    Hi friends,
    How to call the new page in smartforms.
    Thanks,
    Ravi

    Hi,
    Create a command node and click the 'Go to new page' check box specifying the page u want to go.
    You can enter your condition for which it should branch to a new page in the 'conditions' tab.
    Regards
    Shiva

  • How to retrive the deleted data in Z table

    Hi Gyes,
    How to retrive the deleted data in Z table.
    Thanks & Regards,
    Suresh

    Hello Suresh
    If you have not activated the technical setting "Log data changes" in the definition of your z-table (which is unlikely) then there will be no change documents available.
    If you have downloaded your z-table entries sometimes you could use these data for recovery.
    Otherwise your last change is to ask your <b>basis team</b> when the last backup has been made.
    Regards
      Uwe

  • How to retrive the deleted entries in the ztable

    please let me know how to retrive the deleted entries in the ztable.

    >
    Naseer uddin wrote:
    > Hi,
    >
    >   While creating a table have u activated the buffering (full).
    >   if not then it is not possible to retrive the lost data, and if u have activated the full buffering of table then it is possible to retrive data, up to some extent, using transaction Code se14.
    Complete Nonsense.*
    buffering doesn't mean that it will buffer the records back in database ,once you deleted.it means it will allow the buffer the table to memory only while read access.

  • How to retrive the overwritten SAP Default Configuration

    Hi There,
    I was trying to enhance the component BT115IT_SLSO to add some new fields into the table view Items.
    I copied the view configuration to my Z config key but by mistake & added the fields into the default view and saved the changes. Now the default configuration is screwed up.
    Can some one point out how to retrive the SAP standard configuration( where it is stored ). In the configuration tab of the view the configuration looks ok but in Web UI I see all the columns available in the context node, and makes the view useless, when I go to the personlization of the view all fields shows the message < Error in Meta data > and I can not see the details of the fields.
    I have already backed off my enhancement. Now I want to retrive the view configuration.
    Your help will be highly appreciated.
    Thanks,
    Vikash.

    Issue resolved.
    Solution was In BSP workbench when I went to choose configuration I saw that just next to std conf there was column for cust conf. and both were marked X so I deleted the conf and that gave me the standard conf back.
    Thanks,
    Vikash.

  • PLEASE HELP ME.  Some important emails have gone to an archive mail box and i really need them.  Can someone please help me with how to view the archive email box and the emails that are in there?

    PLEASE HELP ME.  Some important emails have gone to an archive mail box and i really need them.  Can someone please help me with how to view the archive email box and the emails that are in there?

    http://kb.mozillazine.org/Recovering_deleted_mail_accounts

  • MessageFileUpload how to retrive the file name?

    Hi there guys,
    maybe it's a stupid question but i cannot find the answer :_( any of you knows how to retrive the file name i am going to upload from the messageFIleUpload item?
    Thank You, Pier Paolo.
    Edit: Found in another post!! eeheh LAZY ME!! :_)
    Message was edited by:
    PandreoL

    Nice to know that you found the solution. You could have as well used the javadoc for the same.
    --Shiv                                                                                                                                                                                                                   

  • How to access the archive folder in jive forums programiticaaly

    hi
    how to access the archive folder in jive forums programitically using weblogic 10.3
    Thanks
    Rani

    Ah, I'm sorry - I thought it was the private folder in C drive that I had managed to get into the previous week but it was the private folder in mass storage ...
    If you want to thank someone, just click on the blue star at the bottom of their post

Maybe you are looking for

  • Automatic Payment Programme for multiple vendors process

    Hi SAP FICO Experts, Please send Automatic Payment Programme for multiple vendors process Step by step Regards Maran

  • Output device issue in smartform

    Hi All, I have configured smartform and driver program throough nace and testing output . I am facing the problem of  alignment of  output which is changing  depening on Printer. i.e., for printer one the field KOMVD-KBETR(VAT) is prining properly .B

  • Oracle RAC 10g on VMware

    I am installing Oracle RAC on 2 virtual machines using RHEL 3-U7, basically I have been able to install RAC and the software for the database. However when I run dbca to configure ASM, I get Error When starting ASM instance on node node1 PRKS-1009: F

  • MuVo TX FM radio prob

    Hi! I have a muvo tx fm (256mb) player which was bought in France. For a while the fm radio worked just fine. Then the player started to freeze if I try to tune to any station. Out of approximately 0 attempts I can get the radio work only once. But e

  • Photos on iWeb (closer looks)

    Hello! How do you set up photos on iWeb so that when they are published, you can click on them and they open a separate window and show you a close up? Thanks! bg