Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error while sending email

0 Kudos
523

Hi All,

I am using the FM SO_DOCUMENT_SEND_API1 to send the mails in my report program. When I execute the report I am getting the error in FM ADDR_PERS_COMP_COMM_GET after which it exits the report. I have tried searching for this error but couldnt find anything abt it.I would like to know what this error is and why i an getting this error.

How can i resolve this error.

TIA.

Regards,

Kalyan

11 REPLIES 11

Former Member
0 Kudos
438

Hi Kalyan

What is the exact error message that you are receiving?

I'm going to take a bit of a chance here, but did you look at your user's setting in su01?
I've come across it before that the email address wasn't maintained and the mailing would not work...
As I said its just a thought...

Regards
Vic

0 Kudos
438

Hi,

The msd id is SO, msg no : 013 and msg type :A. (Database error for <&> <&>).

Regards,

Kalyan

Clemenss
Active Contributor
0 Kudos
438

CL_BCS

former_member214878
Active Participant
0 Kudos
438

Hi KV,


Try using this -

   * THIS ROUTINE WILL TAKE CARE OF THE EMAIL SENDING

  CLEAR: NOTE[], NOTE, TEXT, TEXT[], LV_C_SEND_FLAG.
   
  TRY.
*     -------- CREATE PERSISTENT SEND REQUEST ------------------------
      SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).

*     -------- CREATE AND SET DOCUMENT -------------------------------
*     CREATE DOCUMENT FROM INTERNAL TABLE WITH TEXT
      PERFORM GET_EMAIL_BODY USING LV_TRACK_NO 'POSTING'.
      LV_EMAIL_SUB  = 'This is an email subject'.
       DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                      I_TYPE    = 'RAW'
                      I_TEXT    = TEXT
                      I_LENGTH  = '30'
                      I_SUBJECT = LV_EMAIL_SUB ).
*     ADD DOCUMENT TO SEND REQUEST
      CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).

*     --------- CREATE AND SET NOTE ----------------------------------
      PERFORM GET_EMAIL_NOTE USING LV_TRACK_NO.
      CALL METHOD SEND_REQUEST->SET_NOTE( NOTE ).


*     --------- SET SENDER -------------------------------------------
*     NOTE: THIS IS NECESSARY ONLY IF YOU WANT TO SET THE SENDER
*           DIFFERENT FROM ACTUAL USER (SY-UNAME). OTHERWISE SENDER IS
*           SET AUTOMATICALLY WITH ACTUAL USER.

      SENDER = CL_SAPUSER_BCS=>CREATE( LV_USERNAME_CREATOR ).
      CALL METHOD SEND_REQUEST->SET_SENDER
        EXPORTING
          I_SENDER = SENDER.

*     --------- ADD RECIPIENT (SAP USER) -----------------------
*     CREATE RECIPIENT
      RECIPIENT = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).

*     ADD RECIPIENT WITH ITS RESPECTIVE ATTRIBUTES TO SEND REQUEST
      CALL METHOD SEND_REQUEST->ADD_RECIPIENT
        EXPORTING
          I_RECIPIENT = RECIPIENT
          I_EXPRESS   = 'X'.


*     ---------- SEND DOCUMENT ---------------------------------------
      CALL METHOD SEND_REQUEST->SEND(
        EXPORTING
          I_WITH_ERROR_SCREEN = 'X'
        RECEIVING
          RESULT              = SENT_TO_ALL ).
      IF SENT_TO_ALL = 'X'.
        MESSAGE S025(ZFICIR).
      ENDIF.
      COMMIT WORK.
* -----------------------------------------------------------
* *                     EXCEPTION HANDLING
* -----------------------------------------------------------
    CATCH CX_BCS INTO BCS_EXCEPTION.
      MESSAGE S026(ZFICIR).
      EXIT.
  ENDTRY.

It works like a cream

Cheers

Ravindra Sonar.

0 Kudos
438

You should read moderator Rob's comments in another post on a similoar subject.  Are you posting your employer-owned code for free usage by the clueless? Somebody paid for that code and they own the rights to it.  Or did you cut and paste from SAP's owned code to post as owned work? 

People who copy entire programs and paste into posts should be banned, IMHO.  This is not a free code forum;  it is a forum to help people with specific problems by suggesting how to do something or where to look for more information.

0 Kudos
438

oooppppssss that was quite rough ............

FYI ... neither I did copy from SAP's standard one nor I steal it from my customer ....... I just worked around 30-45 minutes to build a sample code and pasted it here. No harm done to SAP/Customer...... I would never do that too either.

Also didn't copy paste a whole code here just CL_BCS ...... nothing else .....

Hope its fine with SDN's standards ............

Former Member
0 Kudos
438

Step 1.  Read the dump

Step 2. Run in debug if you don't understand the dump

Step 3.  See what the failure is and what you need to do in the code to remedy that failure.

step 4.  Ignore spoon-fed code supplied in this forum and post, and write good stuff that you understand and that works.

Step 5. Upgrade your techniques and skills.  If you continue to use out-of-date tools, you may find employment prospects bleak, unless WalMart is in your options.  (see Clemens dead-on post).

0 Kudos
438

Hey Break Point,

To actually implement the supplied code, anyone has to make a lot of recurssion on his skills.

So I guess if I might help him to start digging and showing the exact place to dig, could help him in getting sucess in overcoming his ostacle today.

I might wrong but I think in this way ......

No offense to your judgement and reply.

Thanks and regards,
Ravindra Sonar.

0 Kudos
438

SAP has many demonstration programs and the SCN has articles for how to do this stuff.  Why not just point the user there, instead of spoon-feeding code?  Unfortunately, much of the spoon-fed code posted in these forums is of very questionable quality, and some is simply outright and inappropriate copy of customer-owned or SAP-owned code. 

I think a much more appropriate help would be:

"Search the Forum and see SAP-written demonstration programs, named like BCS*,  which provide working code for a variety of email usages, based on class CL_BCS. I'm sure you'll see one that can be used as a model for your needs. CL_BCS is the current email technology in SAP."

0 Kudos
438

thanks Break-Point ..... I will remember this next time .............

0 Kudos
438

Let's also bear in mind that the OP didn't ask for help with code, just the error analysis.

Rob