Application Development and Automation 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: 
Read only

FM SO_NEW_DOCUMENT_ATT_SEND_API1 problem

Former Member
0 Likes
1,508

Hi experts,

I am using SO_NEW_DOCUMENT_ATT_SEND_API1 FM to send a mail to vendors....this is the logic they have written..

LT_MAIL1[] having 4 mails id's...but problem is mail is not going.... can any body plz help me...

DATA: LT_MAIL1 LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.

IF LT_CONTENT[] IS NOT INITIAL AND LT_MAIL1[] IS NOT INITIAL.

  • LOOP AT lt_mail1.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

DOCUMENT_DATA = LV_DOC_HEADER "subject of message

PUT_IN_OUTBOX = 'X'

COMMIT_WORK = 'X'

TABLES

PACKING_LIST = OBJPACK

OBJECT_HEADER = OBJHEAD "file name

CONTENTS_BIN = OBJBIN "attachment content

CONTENTS_TXT = OBJTXT

RECEIVERS = LT_MAIL1 "Mail id

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

OPERATION_NO_AUTHORIZATION = 4

OTHERS = 99.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

MESSAGE S000(MES).

ENDIF.

  • ENDLOOP.

ENDIF.

ENDIF.

Thanks & regards,

Praveena..

17 REPLIES 17
Read only

Former Member
0 Likes
1,378

Hope you can try this way:

DATA l_sender TYPE soextreci1-receiver.

  
  CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = v_emailattr
      put_in_outbox              = 'X'
      sender_address             = l_sender
      sender_address_type        = 'INT'
      commit_work                = 'X'
    TABLES
      packing_list               = it_objpack
      object_header              = it_objhead
      contents_bin               = it_objbin
      contents_txt               = it_objtxt
      receivers                  = it_reclist
    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

Edited by: K.Manas on Dec 15, 2010 10:56 AM

Read only

Former Member
0 Likes
1,378

Have you checked the transaction SOST. Are there errors from this FM call.

Read only

0 Likes
1,378

Hi martin..

Thank for giving reply...

Ya i am getting errors? is it technical problem?

Read only

0 Likes
1,378

Hi martin...

Can you plzzz give me reply...

Read only

0 Likes
1,378

what errors is the FM giving?

Read only

0 Likes
1,378

Hi...

It is showing

via Internet Payment From XXX Limited For Vendor 2000002095 some name email id

and one more column i there status i.e error symbol

is it technical problem?

can you plzzz help me..

Read only

0 Likes
1,378

Hi manas..

This is the exact error i am facing

Cannot process message, no route from 90003427 to mail id..

can you tell me is it technical problem?

Read only

0 Likes
1,378

Veena,

At what point is the FM raising this exception and what exactly is this route from 90003427 to mail id.

Check if return for FM is equal to 0 i.e. sy-subrc = 0.

Read only

0 Likes
1,378

yes manas..

sy-subrc is eq 0 only...

Read only

0 Likes
1,378

Did you check your NACE settings properly. Ask your functional consultant to check it.

Try using some other test scenarios. If it works fine then the issue is with the doc no supplied.

Do you have any output type setting for this program?

If all above are proper then it's a tech problem.

Read only

0 Likes
1,378

HI manas

Thanks a lot for giving reply...

I will check with my Functional consultent i will let u know....

ThanQ

Read only

0 Likes
1,378

Veena,

Do check with other invoice no too..The cause may be with the invoice no given to be tested. Anyhow check the settings for the output types, transmition medium etc

Read only

0 Likes
1,378

Also check that the mail ids have been maintained for sender and receiver in transaction SU01.

Read only

0 Likes
1,378

Hi manas...

My problem was solved....actaully There is no SMTP connection.

Read only

Former Member
0 Likes
1,378

Please ensure that the SCOT configurations are in place.

Read only

Former Member
0 Likes
1,378

HI,

Has the sender user linked an e-mail in his data user ?

Read only

Former Member
0 Likes
1,378

Hi Veena

Not the vendor must to have e-mail, but the sap user sender must to have e.mail assigned in SU01

best regards