How to attach Microsoft 2007 files (.docx, .xlsx) using SO_DYNP_OBJECT_SEND

Hi,
Would anyone know how to attach a file with extension .docx or .xlsx to an email using function module SO_DYNP_OBJECT_SEND?
I am able to successfully attach .doc or .xls documents.
The problem stems from the fact that the packing list field 'file_ext' takes a 3-character file extension.  This will not work for .xlsx or .docx since they are 4-character extension.
I found a few suggestions that said I have to add the filename to the attachment header table....like this:
data: wa_content TYPE soli.
CONCATENATE '&SO_FILENAME=' lv_filename INTO wa_content.
APPEND wa_content TO gt_att_head.
I then pass gt_att_head to fm 'SO_DYNP_OBJEC_SEND'.
   CALL FUNCTION 'SO_DYNP_OBJECT_SEND'
     EXPORTING
       object_hd_change = l_title
       object_type      = 'RAW'
       raw_editor       = abap_true
       starting_at_x    = '5'
       starting_at_y    = '1'
       ending_at_x      = '120'
       ending_at_y      = '20'
       edit_title       = 'X'
       external_commit  = abap_true
     TABLES
       packing_list     = gt_packing_list
       att_head         = gt_att_head
       att_cont         = gt_total_att_cont
       exclude_fcode    = i_exclude_fcode
     EXCEPTIONS
       object_not_sent  = 1
       owner_not_exist  = 2
       parameter_error  = 3
       OTHERS           = 4.
However, when I try to open an .xlsx file, I get the warning:
"Excel found unreadable content in 'TestFC2.xlsx'. Do you want to recover the contents of this workbook?  If you trust the source of this workbook, click Yes."
Has anyone else encountered this problem and found a solution?
Thanks,
Jennifer

Hi Andrés,
Thank you for the suggestions.  I did as you said, but it still did not work.
   DATA: wa_content TYPE soli.
   CONCATENATE '&SO_FILENAME=' lv_filename INTO wa_content.
   APPEND wa_content TO gt_att_head.
   CLEAR:wa_content.
   wa_content = '&SO_FORMAT=BIN'.
   APPEND wa_content TO gt_att_head.
I am already sending the obtyp as 'EXT' in the packing list.
* Static data
   gs_packing_list-file_ext = lv_ext.
   gs_packing_list-transf_bin = 'X'.
   gs_packing_list-objla = sy-langu.
   gs_packing_list-objtp = 'EXT'.
   gs_packing_list-objdes = lv_filename.
   gs_packing_list-objnam = 'Attachment'.
   gs_packing_list-head_start = 1.
   gs_packing_list-head_num = 1.
I can see that the document is attached but when I open the XLSX document, I get the error about unreadable content.
Any further suggestions are appreciated.
Thank you,
Jennifer

Similar Messages

  • How to attach a text file as an attachment to email message?

    Hello Everybody,
    I have a .csv file, in which details about emp-id, emp-name, e-expenses for Reimbursement and email address are stored.
    My application reads this .csv file, and sends a mail to each employee with his id, salary details in text format. (by changing content type to "text/plain") The code is working fine. But,
    My problem is:
    The message is sent as message body to the end user.
    The end user / the person who receives this mail will not be a technical person. So,
    1) If he trys to take a print out of this e-mail, He get only half of it.(as no. of colums will be more than paper size).
    2) I am finding alignment problem. IF employee name is too big, other columns will shift to right and data will not be exactly under column header. (it is going in zig zag way)
    So, I thought sending text file with all the details as an attachment might do well.
    But, I don't know how to attach a text file to email-message body.
    code
    try
                   {               String s1="";
                                  File f1 = new File(the path);
                                  FileInputStream fstream = new FileInputStream(f1); //new
                                  BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
                                  int count=0;
                                  while((s1=br.readLine())!=null )
                                                 count++;
                                                 //out.println("within while loop "+count);
                                                 StringTokenizer st = new StringTokenizer(s1,",");
                                                 if ((st.hasMoreTokens())&&(count>1))
                                            String a=st.nextToken().trim();
                                                 String b=st.nextToken();
                                                 String c=st.nextToken();
                                                 String d=st.nextToken();
                                                 String e=st.nextToken();
                                                 String f=st.nextToken();
                                                 String g=st.nextToken();
                                                 String h=st.nextToken();
                                                 String i=st.nextToken();
                                                 String j=st.nextToken();
                                                 String k=st.nextToken();
                                                 String l=st.nextToken();
                                                 String m=st.nextToken();
                                                 String n=st.nextToken();
                                                 String o=st.nextToken();
                                                 String p=st.nextToken();
                                                 String q=st.nextToken();
                                                 String mail=st.nextToken();
                                                 String s=st.nextToken();
                                                 //out.println("b="+b+"c="+c+"d="+d+"e="+e+"f="+f+"mail="+mail);
                                                 %>
    <%
                                            String to =mail;
                                                 String from =request.getParameter("fromadd");                                        
                                                 String subject ="Statement of Expenses";
                                                 String smtp ="mail.xxxxxxxxxx.com";
                                                 String message="";                                        
                                                 message=message.concat("EMP ID");
                                                 message=message.concat("     ");
                                                 message=message.concat("Name");
                                                 message=message.concat("          ");
                                                 message=message.concat("Dept No.");
                                                 message=message.concat("     ");
                                                 message=message.concat("Acc No.");
                                                 message=message.concat("     ");
                                                 message=message.concat("*****************************************************************************************");     
                                                 message=message.concat(a);
                                                 message=message.concat("     ");
                                                 message=message.concat(b);
                                                 message=message.concat("          ");
                                                 message=message.concat(c);
                                                 message=message.concat("     ");
                                                 message=message.concat(d);
                                                 Properties props = System.getProperties();
                                                 // Puts the SMTP server name to properties object
                                                 props.put("mail.smtp.host", smtp);
                                                 // Get the default Session using Properties Object
                                                 Session session1 = Session.getDefaultInstance(props, null);
                                                 // Create a New message
                                                 MimeMessage msg = new MimeMessage(session1);
                                                 // Set the From address
                                                 msg.setFrom(new InternetAddress(from));
                                                 // Setting the "To recipients" addresses
                                            msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                                            /* // Setting the "cc recipients" addresses
                                            msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(cc, false));
                                            // Setting the "Bcc recipients" addresses
                                            msg.setRecipients(Message.RecipientType.BCC,InternetAddress.parse(bcc, false)); */
                                            // Sets the Subject
                                            msg.setSubject(subject);
                                            // set the meaasge in HTML format
                                            msg.setContent(message,"text/plain");
                                            // Set the Date: header
                                            msg.setSentDate(new java.util.Date());
                                            // Send the message
                                            Transport.send(msg);
                                            // Display Success message
                                            result =result.concat("<tr><td>"+b+"</td>"+"<td>"+to+"</td></tr>");
                                                      }//end of if of hasmore element
                                       }// end of while loop
                        out.println(result);                    
    }catch(Exception e)
                        // If here, then error in sending Mail. Display Error message.
                        result="Unable to send your message";
                        out.println("e="+e);
    Any help will be appreciated.
    Thanks and regards.
    Ashvini

    <html>
    <p>
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText("Your Messages");
    MimeBodyPart mbp2 = new MimeBodyPart();
    FileDataSource fds = new FileDataSource("Your Attachments");
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setFileName(fds.getName());
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    msg.saveChanges();
    msg.writeTo(System.out);
    msg.setSubject(subject);
    Transport.send(msg);
    </p>
    <B><U>See you can add above code in your program and see the magic</U></B>
    Bye
    regards--
    Ashish
    </html>

  • How to attach a PDF file TO the form so that recipients can access the file as a resource?

    How to attach a PDF file TO the form so that recipients can access the file as a resource?

    Sorry we do not support this. What you can do though is add a Formatted Text element and add a link to a PDF. To insert a link add some text, select the text and right click on the text (or look under the Insert menu in the top right of the scene)
    Gen

  • How to attach a .pld file in oracle Designer

    When we try to generate a form out of designer we are getting the error ilke
    sample.pld file is required. The Questions on it are,
    1. What is a .pld file in a designer mean.
    2. How to attach a .pld file in oracle designer for the generation of forms.
    Thanks,
    Ramesh.R

    Hi Erik,
    Thanks for the update.
    My problem in designer is in the desginer under the generator preference dialog window the property "Form/Libr" attachment the "module specific library attachment" has the value like "ABC". I am having ABC.pld file in my system. I have included the file path in the pll file path in the Generator options tab.
    While generating the forms from designer i am getting the error "CDG-01373 ERROR: Module ABC: Unable to attach library ABC".
    My Questions are how to attach the ABC.pld file for this error. Thanks in advance
    Thanks,
    Ramesh.R

  • Can any one tell me how to attach a pdf file to the mail through workflow

    I have a smart which i am able  to convert it to a pdf file...now.. can any one tell me how to attach a pdf file to the mail through workflow

    Hi,
    To create the task for attachment
    Use the BOR SELFITEM and method NOTES_APPEND.
    The out come of this task contain a link called attachment with a clip attached. Clisk on that icon and choose the type of attachment u want . RAW , EXCEL , TXT , PDF... Then using the import icon u can attach the document u like.
    But the TYPE : OBJ.
    Similarly using NOTE_DISPLAY method u can display the documents u like.
    In any work item u have the facility to attach any atttchment for further circulation .
    Attchment @ WORKITEM
    1.Click the workitem for which you want to create the attchment
    2.Press create attachment
    3. Add the attachment u like (PDF)
    Reward points for useful answer.
    Richard A

  • "dtutil", how to tell which configuration file for packages using after deployment?

    Hello All, 
    Trying to achieve this feature, 
    Using DOS command to automatic my deployment process--glad I found dtutil. However, it doesnt give you any chance to identify which configuration file to be used by SSIS packages after deployment.
    Deployment Method: file deployment
    Configuration sued: XML file and SQL Table. IN XML file, it tells which DB connection for packages to look up the configuration table.
    Who can share some thoughts on this?
    Derek

    It is NOT about sequence.
    It is about how to point which configuration file to be used by deployed packages as during the "dtutil.exe"
    deployment, you dont have chance to identify which physical location confg files to be used.
    Derek
    That you do only at the time of execution of packages. By default it uses configuration settings created at design time within the package. If you want to override it, you can use \Configfile switch of dtexec for that. You can also set explicit values for
    properties using /SET switch
    http://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
    See this to understand how configs are applied in runtime
    http://technet.microsoft.com/en-us/library/ms141682(v=sql.105).aspx
    and this to understand behaviour difference in ssis 2008 
    http://technet.microsoft.com/en-us/library/bb500430(v=sql.105).aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    how can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
    What you can do is use one of Adobe's online subscription services. Two provide for PDF  to Word export.
    There's ExportPDF and PDF Pack.
    Be well...

  • How can I change the file download time using Adobe Send? Adobe SendNow had a lot more options.

    How can I change the file download time using Adobe Send? Adobe SendNow had a lot more options.I don't see nay with Adobe Send.

    There isn't a feature in Adobe Send for setting and end-date for a file's availability. At any time, you can Unshare the file, however.

  • How to attach that object_library to a form using jdapi?

    Hi!
    I am doing a migration process from Forms 6i to Forms 10g, and I need to attach an object_library object to a specific form using jdapi. The object_library that I want to attach is the web_util object_library.
    How to attach that object_library to a form using jdapi?
    Thanks.

    I had never used JDAPI before reading your post, but the attached code creates a minimal WebUtil-enabled form from scratch -- adapting it to update an existing form should be fairly straightforward. I've only been coding in Java for about a year, so consider this only as a starting point -- there may be better, easier ways of doing this.
    import oracle.forms.jdapi.*;
    public class Driver {
      public Driver() {
        /* create a minimal form */
        FormModule frm = new FormModule("JDAPI_DEMO");
        Block dummyBlock = new Block(frm, "BLK_DUMMY");
        Canvas dummyCanvas = new Canvas(frm, "CVS_DUMMY");
        Item textItem = new Item(dummyBlock, "TXT_DUMMY");
        textItem.setCanvasObject(dummyCanvas);
        /* open WebUtil object library */
        ObjectLibrary olWebUtil = ObjectLibrary.open("c:/ora10g/forms/webutil.olb");
        /* attach WebUtil PL/SQL library */
        AttachedLibrary alWebUtil = new AttachedLibrary(frm, "c:/ora10g/forms/webutil.pll");
        /* loop through each tab in object library */
        for (JdapiIterator it=olWebUtil.getObjectLibraryTabs(); it.hasNext();) {
          ObjectLibraryTab olt = (ObjectLibraryTab) it.next();
          /* loop through each object in tab */
          for (JdapiIterator it2=olt.getOwnedObjects(); it2.hasNext();) {
            JdapiObject obj = (JdapiObject)(it2.next());
            String className = obj.getClassName();
            /* handle module parameters */
            if (className.equals("ModuleParameter")) {
              ModuleParameter mp =
                new ModuleParameter(frm, obj.getName(), (ModuleParameter) obj);
            /* handle object groups */
            if (className.equals("ObjectGroup")) {
              ObjectGroup og = new ObjectGroup(frm, obj.getName(), (ObjectGroup) obj);
        frm.compile();
        frm.save("c:/jdapi_demo.fmb");
      public static void main(String[] args) {
        Driver drv = new Driver();
    }

  • HOW TO ATTACH A MUSIC FILE TO PDF ?

    Is it possible to a attach a music file to a pdf slidehow on PSE 3.2 ?

    Hi Gail,
    It's pretty hard to find comparisons, but I think I found a couple. I'm
    going to see if I can dig up more for the future.
    Cheers
    http://www.adobe.com/products/photoshopelwin/upgrade/
    Compares last two paid consumer products with each other PhotoShop
    Elements 5, 6 and the suite that includes Premiere Elements.
    http://www.adobe.com/digitalimag/pdfs/pse2-ps7_comparison_chart.pdf
    Compares an older consumer version to an older professional version. I
    know it's not what you are looking for, but I thought people might like
    to see how the two categories roughly stack up...
    Interesting... nothing on PSA SE thus far.

  • How to attach the PDF file in spool to an email?

    Dear friends,
        I need to attach the PDF file generated in the spool (SP01) to email.
    The PDF file is generated from VL02N at the time of Post Goods Issue .
    Thanks,
    Vidya.

    Hi,
    Refer to the link it is explained how to configure the output type to send the email with PDF attachment on saving the Billing Document.. you need to do the same way..
    Email Billing document as PDF Attachment while saving from VF01/02

  • How to attach the .emp files and .rar files in this forum.

    Dear Sir ,
                          I want to attach the ".emp" file or .emp file stored in the "rar", how to attach these files in this forum because whenever I am going to attch the .emp file or .rar file , it is showing the error that " The contents of the attachment doesn't match its file type".

    Well, you might think that. But you would be wrong.
    I'm not aware of any unix OS with an undelete function at the filesystem level.
    Such things don't tend to work well in a multiuser/server environment where lots of things are writing to the disk in the background.
    And trying to guess what the filesystem used to look like is a good way to court random file system corruption.

  • How to read and upload microsoft word file into database using forms9i

    Hi,
    How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
    Thanks in advance
    Mahesh Ragineni

    The webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
    Regards
    Grant Ronald
    Forms Product Management

  • How to attach a single file in e-mail (Yosemite)?

    When i am writing a new mail and i try to attach a single file that i have saved a minute ago from certain folder i cannot do that. When i click on the folder to open it and select the specific file to attach, the mail does not open the folder but automatically attach the whole folder to e-mail.
    Any help?
    Thanks.

    Hello dejanfromzagreb,
    That is interesting that it is grabbing the entire folder. Have you tried switching the view within the Finder window to Column View to select the right file to attach? Another alternative is to locate the file in Finder and drag it op top of the Email that you are preparing to attach it. Take a look at the article below. 
    Mail (Yosemite): Add attachments
    https://support.apple.com/kb/PH19142
    Regards,
    -Norm G. 

  • How to attach a word file in JAVA mail

    I am a JAVA rookie and I have a problem in attaching a word file using javamail. I searched almost all the forum but still couldn't find the solution.
    Sorry for the reposting. But can anybody please help me out? Your any words or links will be highly appreciated!
    Lakobe

    Sorry, this forum is for questions about the javadoc tool.
    There won't likely be JavaMail experts here.
    I'm not sure where else to send you.

Maybe you are looking for

  • Ipod not recognized by itunes

    My ipod mounts on the pc, itunes does not see it. An error pops up saying that the ipod is write protected...???? I restored it, reinstalled, rebooted. Not sure what other steps to take.. Thansk for any help.

  • Clicking on an email address in a pdf opens MS Word

    Hi, a little advice if I may. I am in the situation where people often send me an email with a .pdf attached. If I click on the attachment, it opens in Adobe Reader, as I would expect. There is an email address in the .pdf document, which is "clickab

  • FA retirement error

    Hi Dear; when i am trying to create a retirement document, i get the following error message 21151: error while posting asset document: '10000006' NB: in the logfile in the temp folder i get the following message Time     AppID     ExtID     Sev     

  • Where can we find the new iPod Touch 2.0 software to download it?

    I am in the United States in Northern Ca.. It is Friday early Morning after 12 and after 1, I was wondering if anyone knows if the New iPod Touch software 2.0 is or will be ready soon for download or do we all have to wait till 8 in the morning to do

  • Color management:  RGB values

    Working mass production with Aerial Photography. 8 bit color, scanline tifs Client request RGB values of light gray areas be within 5 of each other. For example: Red 130, Green 132, Blue 135. Need batch routine to run on 15,000 images. If it is even