Home > Default > ERROR WHILE USING SO_NEW_DOCUMENT_ATT_SEND_API1

ERROR WHILE USING SO_NEW_DOCUMENT_ATT_SEND_API1

October 11Hits:0
Advertisement
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "ENTRY_NEU" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
In the function "SO_NEW_DOCUMENT_ATT_SEND_API1", the STRUCTURE parameter
"CONTENTS_HEX" is typed in such a way
that only actual parameters are allowed, which are compatible in Unicode
with respect to the fragment view. However, the specified actual
parameter "I_OBJBIN" has an incompatible fragment view.
*Declararions Used
*Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
*Work Area declarations
w_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
Please help me thanks in advance
Points will be rewarded

Answers

Sending External Mail via ABAP
REPORT ZSENDEXTERNAL.
DATA: OBJPACK   LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD   LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST   LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG  LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Send External Mail'.
Mail Contents
OBJTXT = 'Minimum bid : $250000'.
APPEND OBJTXT.
OBJTXT = 'A representation of the pictures up for auction'.
APPEND OBJTXT.
OBJTXT = 'was included as attachment.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
(Assume that the data in OBJBIN is in BMP format)
*OBJBIN = ' \O/ '. APPEND OBJBIN.
*OBJBIN = ' | '. APPEND OBJBIN.
*OBJBIN = ' / \ '. APPEND OBJBIN.
*DESCRIBE TABLE OBJBIN LINES TAB_LINES.
*OBJHEAD = 'PICTURE.BMP'.
*APPEND OBJHEAD.
Creation of the entry for the compressed attachment
*OBJPACK-TRANSF_BIN = 'X'.
*OBJPACK-HEAD_START = 1.
*OBJPACK-HEAD_NUM = 1.
*OBJPACK-BODY_START = 1.
*OBJPACK-BODY_NUM = TAB_LINES.
*OBJPACK-DOC_TYPE = 'BMP'.
*OBJPACK-OBJ_NAME = 'PICTURE'.
*OBJPACK-OBJ_DESCR = 'Representation of object 138'.
*OBJPACK-DOC_SIZE = TAB_LINES * 255.
*APPEND OBJPACK.
Completing the recipient list
RECLIST-RECEIVER = '[email protected]'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
*RECLIST-RECEIVER = 'SAPUSERNAME'.
*RECLIST-REC_TYPE = 'P'.
*APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
   DOCUMENT_DATA = DOC_CHNG
   PUT_IN_OUTBOX = 'X'
TABLES
   PACKING_LIST = OBJPACK
   OBJECT_HEADER = OBJHEAD
   CONTENTS_BIN = OBJBIN
   CONTENTS_TXT = OBJTXT
   RECEIVERS = RECLIST
EXCEPTIONS
   TOO_MANY_RECEIVERS = 1
   DOCUMENT_NOT_SENT = 2
   OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
   WHEN 0.
   WRITE: / 'Result of the send process:'.
LOOP AT RECLIST.
   WRITE: / RECLIST-RECEIVER(48), ':'.
   IF RECLIST-RETRN_CODE = 0.
      WRITE 'The document was sent'.
   ELSE.
      WRITE 'The document could not be sent'.
ENDIF.
ENDLOOP.
WHEN 1.
   WRITE: / 'No authorization for sending to the specified number',
            'of recipients'.
WHEN 2.
   WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
   WRITE: / 'No send authorization'.
WHEN OTHERS.
   WRITE: / 'Error occurred while sending'.
ENDCASE.
Reward if helpful
Regards
Vodka.

Read other 4 answers

Tags:

Related Articles

  • ERROR WHILE USING SO_NEW_DOCUMENT_ATT_SEND_API1October 11

    An exception occurred that is explained in detail below. The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was not caught in procedure "ENTRY_NEU" "(FORM)", nor was it propagated by a RAISING clause. Since the ca

  • Error in Sending MailOctober 11

    Hi Experts I am Converting smartform into PDF and send mail to the mailid mentioned in the vendor master. Upto PDF conversion its working fine, sending mail is the problem here, am getting value for sy-subrc is '2'. Iam attaching the code below, plea

  • Error getting while sending the Mails using 'SO_NEW_DOCUMENT_ATT_SEND_API1'October 11

    Hi ALL,    I HAVE THE REQUIREMENT AS SEND A REPORT AS A MAIL. IAM USING FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' WHILE EXECUTING ITS NOT SHOWING ANY ERROR. BUT IAM NOT GETTING ANY MAIL. I CHECKED IN 'SOST' TCODE. THERE I SEE A MESSAGE LIKE 'CANNOT PROCESS

  • Error while sending Excel attachment thro FM 'SO_NEW_DOCUMENT_ATT_SEND_API1October 11

    Experts: I am working on sending Excel as an email attachment thro the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' I am able to send mail successfully but I face the following two issues while opening the attachment. 1. While opening it says 'un

  • Error in SO_NEW_DOCUMENT_ATT_SEND_API1. Unable to open the pdf attachmentOctober 11

    Hi all, I'm currently using SO_NEW_DOCUMENT_ATT_SEND_API1 to send out the email and together with a pdf attachment. However when I tried to open the attachment, it has the decoded incorrectly error. What am I missing? Thanks. Below is the code, this

  • Error Sending Mail Using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'November 30

    Dear All,     I am calling the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' inside the program to send mail to ( i.e [email protected]) either yahoo or gmail or etc. After calling this function module i am getting error message ''Document could no

  • Error in using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'November 30

    Hi,Guy ,    Now I want to send mail with attachment in my workflow step to the approver . someone advise me to use the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' .  but, when I run the report ,the system show me the error message 'Document no sent' . whehter

  • SO_NEW_DOCUMENT_ATT_SEND_API1 Error (Email not received)November 30

    Hi all,<br><br> I am using following code just to send out an email to Users Notifying that Directory is Not empty. No attachment is required. <br><br><pre> data: p_file type salfile-longname. data: ifile type table of  salfl

  • Output File error  (SO_NEW_DOCUMENT_ATT_SEND_API1)October 11

    Dear Experts, I am sending a text attachment through SO_NEW_DOCUMENT_ATT_SEND_API1, the mail attachment contains everything right till 127th char, after that the data is  not coming instead some special characters are coming. Below I am sending the 

  • SO_NEW_DOCUMENT_ATT_SEND_API1 ERRORNovember 30

    Hi Everyone,                 I am facing problem when i am calling the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'  the attachment is automatically getting converted into encripted form. Actually my attachment having only 3 records after the call

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.644 s.