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

SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Likes
1,320

Hi Experts,

I am using FM 'SO_NEW_DOCUMENT_SEND_API1'.

I am looking for somewhere to type the mail-address.

Can someone give me some idea?

BR,

King

12 REPLIES 12
Read only

former_member207661
Active Participant
0 Likes
1,276

Hello King,

I am not sure where exactly you want to type email address?

1) In case of direct FM execution from SE37, pass email ids in table-receivers

2) If you are using this FM somewhere in your code, you can have a screen element for Email address and pass that...

I am not sure if your question was something else. In that case please explain your query.

Warm Regards,

Shyam

Read only

0 Likes
1,276

Thanks Shyam.

I am directly using FM execution from SE37. I passed email ids (XXXX@gmail.com)in table-receivers. 

Then exception: PARAMETER_ERROR occur after running the FM.

What parameter am I missing?

BR,

King

Read only

0 Likes
1,276

Hi King,

You need to pass Receiver Type also in RECEIVER table for all email IDs.

Please check.

Warm Regards,

Shyam

Read only

0 Likes
1,276

Thanks Shyam.

In RECEIVER table, I need to pass Receiver Type.

Is that means the folIowing?

Create a table with table type for Receiver in se11.

Insert email IDs

Pass the type in RECEIVER table.

BR,

King

Read only

0 Likes
1,276

Hello King,

No. No need to create anything in SE11.

As you are trying to execute it in SE37, you just need to pass value for field Receiver_Type in RECEIVER table for each row you are passing an email-id.

When I say you need to pass some values, it means fill the value in required structure-field.

Warm Regards,

Shyam

Read only

0 Likes
1,276

Hello Shyam,

It seems that I solved the problem. I was missing fields in RECEIVER table in left.

I run the FM with no exception now.

I am waiting 2-5 min to see if I can receive the mail.

BR,

King

Read only

0 Likes
1,276

Hello Shyam,

I am sorry to ask one more question.

I found T-code : SCOT to set up a mailsever.

However, is there any T-code to show a mailsever is setup or not?

BR,

King

Read only

0 Likes
1,276

hi King

Goto tcode SMICM, then menu->goto->services, you will see the SMTP with port 25,if the SMTP server is running, it`s should be actived with green.

Archer

Read only

0 Likes
1,276

Thanks so much!

I saw a green click under field 'Actv' but there are no SMTP service info available.

Is that still means SMTP sever is running?

BR,

King

Read only

Former Member
0 Likes
1,276

hi King

using the parameter 'receivers' in this function.

regards,

Archer

Read only

0 Likes
1,276

Hi,

Please consider below code:

DATA rec_tab LIKE somlreci1 OCCURS 1 WITH HEADER LINE.



MOVE: "your reciever email ID" TO rec_tab-receiver,
       'U' TO rec_tab-rec_type.
       APPEND rec_tab.


Pass this receiver tab in FM SO_DOCUMENT_SEND_API1


CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
         EXPORTING
           document_data              = document_data
           sender_address             = ''Sender E-mail ID
           sender_address_type        = 'B'
         TABLES
           packing_list               = plist
           contents_bin               = so_ali
           receivers                  = rec_tab " This table contains receiver address
         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 e208(00) WITH 'Error in sending email'.
       ENDIF.





Regards,

Ramiz

Read only

matt
Active Contributor
0 Likes
1,276

King Kong wrote:

Hi Experts,

I am using FM 'SO_NEW_DOCUMENT_SEND_API1'.

Don't use that FM. Use the CL_BCS and associated classes. There is a lot of material on how to use these if you will search.