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: 

Issue in So_new_document_att_send_api1

Former Member
0 Kudos
96

Hi,

I am facing with an issue in Quality Environment, Email sent by this FM goes as Attachment and data is incoorectly printed in file.

Could you help me in this , I never faced such issue in Development Test client. Dont know whats going wrong in Quality.

Thanks in Advance!

Code : 

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA
= LV_ATRBT           
DOCUMENT_TYPE
= 'HTM'
PUT_IN_OUTBOX
= 'X'
TABLES
OBJECT_HEADER
= LT_MSG
OBJECT_CONTENT
= LT2_MSG
RECEIVERS
= LV_REC
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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
67

Hi ,

This is solved by using Class CL_BCS and methods to trigger mail insteasd of using FM. It was environment problem, code was working in development but was not working in quality.

Using CL_BCS classes in code , it got resolved.

6 REPLIES 6

Former Member
0 Kudos
67

Hi ,

One more thing to add..

If I open this attached file in Word, it is in correct format, the question is why mail sent attachment Item. I want this all in Mail body not in attachment.

Regards,

hp

Former Member
0 Kudos
67

Hemant,

     Have you checked the content of attachment just before calling the above FM? You can check the correctness of data by debugging the program, check the attachment content when the FM is being called.

     Just a suggestion, its recommended to use OOP based concepts for sending mails as it has better ways of handling the data and the attachments. You can see the example reports available (search for BCS* reports in se38)

~Athreya

0 Kudos
67

Hi Athreya,

Thanks for Your reply!

Everything is working fine in Development only in Quality it is showing attachment. What could be the reason?? can you guess ??

Thanks in advance!

Regards,

Hemant

0 Kudos
67

Hemanth,

     Please check the SCOT settings for body text and device types. See if the settings maintained in Development and testing systems are same.

     One more thing, if the email body is being sent as attachment in the mail then check the configuration maintained in transaction SODIS. There are possibilities that standard disclosure is activated here which leads to the above problem.

Hope this helps,

~Athreya

0 Kudos
67

Thanks Athreya!

Former Member
0 Kudos
68

Hi ,

This is solved by using Class CL_BCS and methods to trigger mail insteasd of using FM. It was environment problem, code was working in development but was not working in quality.

Using CL_BCS classes in code , it got resolved.