2012 Apr 20 12:59 PM
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
2012 Apr 20 1:12 PM
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
2012 Apr 20 1:27 PM
Hi,
The msd id is SO, msg no : 013 and msg type :A. (Database error for <&> <&>).
Regards,
Kalyan
2012 Apr 20 1:32 PM
2012 Apr 20 1:52 PM
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.
2012 Apr 20 2:02 PM
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.
2012 Apr 20 5:55 PM
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 ............
2012 Apr 20 1:57 PM
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).
2012 Apr 20 2:04 PM
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.
2012 Apr 20 5:55 PM
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."
2012 Apr 20 6:42 PM
thanks Break-Point ..... I will remember this next time .............
2012 Apr 20 6:51 PM
Let's also bear in mind that the OP didn't ask for help with code, just the error analysis.
Rob