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

problem while sending output document using 'SO_NEW_DOCUMENT_SEND_API1'

Former Member
0 Likes
1,384

Hi,

i am trying to send an output using VF01.

it is failing with subrc = 2.

DOCUMENT_NOT_SENT.

please suggest me for further process.

thanks

vinod

11 REPLIES 11
Read only

Former Member
0 Likes
1,288

Hi,

Please check if you are sending the following:


CLEAR: gs_packing_list,
         gs_reclist.
  REFRESH: gt_packing_list[],
           gt_reclist[].

* Fill the document data.
  DESCRIBE TABLE gt_message LINES gv_cnt.
  READ TABLE gt_message INTO gs_message
                                INDEX gv_cnt.
  gs_doc_chng-doc_size   = ( gv_cnt - 1 ) * 255 + STRLEN( gs_message ).
  gs_doc_chng-obj_langu  = sy-langu.
  gs_doc_chng-obj_name   = 'CONJOB'.
  gs_doc_chng-obj_descr  = text-017.
  gs_doc_chng-sensitivty = 'F'.

* Fill the receiver list
  gs_reclist-rec_date    = sy-datum.
  gs_reclist-rec_type    = 'U' .         " For Internet Address
  gs_reclist-com_type    = 'INT'.
  gs_reclist-notif_ndel  = c_x.
  gs_reclist-receiver    = p_email.       "Email addr of Recip
  APPEND gs_reclist TO gt_reclist.
  CLEAR gs_reclist.

  gs_packing_list-transf_bin = space.
  gs_packing_list-head_start = 1.
  gs_packing_list-head_num   = 0.
  gs_packing_list-body_start = 1.
  DESCRIBE TABLE gt_message LINES gs_packing_list-body_num.
  gs_packing_list-doc_type   = 'RAW'.
  APPEND gs_packing_list TO gt_packing_list.

  gs_packing_list-transf_bin = c_x.
  gs_packing_list-head_start = 1.
  gs_packing_list-head_num   = 0.
  gs_packing_list-body_start = 1.
  DESCRIBE TABLE pt_attachment LINES gs_packing_list-body_num.
  gs_packing_list-doc_type   = 'RAW'.
  gs_packing_list-obj_descr  = gv_atch_name.
  gs_packing_list-obj_name   = gv_atch_name.
  gs_packing_list-doc_size   = gs_packing_list-body_num * 255.
  APPEND gs_packing_list TO gt_packing_list.

* Send the document
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       EXPORTING
            document_data              = gs_doc_chng
            put_in_outbox              = c_x
       TABLES
            packing_list               = gt_packing_list
            contents_txt               = gt_message
            contents_bin               = pt_attachment
            receivers                  = gt_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.

Read only

0 Likes
1,288

Hi sneha,

thanks for your quick responce.

i am passing all as you posted and you forgot to use COMMIT_WORK.

i am using the same.

my problem is this is an upgrade from ERP5.0 to ECC6.

in ERP5.0 it is working fine but in ECC6.0 the error was coming.

thanks

vinod

Read only

Former Member
0 Likes
1,288

Hi,

Check the whether receivers are present or not in tab.

Read only

0 Likes
1,288

Hi Rajashekar,

i have checked and receivers are present.

thanks

vinod

Read only

0 Likes
1,288

Hi,

What is the return code you receive after execution function module? In case it is 0 then check if mail is available in SCOT or SOST transaction.

KR Jaideep,

Read only

0 Likes
1,288

Hi jaideep,

return code is 2.

thanks

VInod

Read only

0 Likes
1,288

Hi,

Check if the number range is created in ECC6.0 for object SO_OBJ_.

KR Jaideep,

Read only

0 Likes
1,288

Jaideep,

can you tell me what is this number range, where will this get created, how to check this.

please suggest.

thanks

Vinod

Read only

0 Likes
1,288

Hi,

You can maintain number range using following path:

Tools-> ABAP/4 Workbench -> Development -> Other Tools -> Number ranges

Enter object name one by one of the following:

SO_OBJ_&FX

SO_OBJ_&ML

SO_OBJ_&UX

SO_OBJ_ADR

SO_OBJ_ALI

SO_OBJ_BIN

SO_OBJ_DLI

SO_OBJ_EXT

SO_OBJ_FAX

SO_OBJ_FOL

SO_OBJ_GRA

SO_OBJ_MSG

SO_OBJ_OBJ

SO_OBJ_OTF

SO_OBJ_RAW

SO_OBJ_RCP

SO_OBJ_SCR

SO_OBJ_USR

SO_OBJ_WFL

SO_OBJ_XXL

KR Jaideep,

Read only

0 Likes
1,288

Hi Vinod,

Check the below type of Receivers are valid.

check what type of receiver you are sending...

Type of RECEIVER entry.

The following values are permitted:

ADR_TYPE...

'B' : SAP user name

' ' : SAPoffice name

'C' : Shared distribution list

'F' : Fax number

'U' : Internet address

'R ' : Remote SAP name

'X' : X.400 address

and also chcek.........

Communication method used to send the document. This field is only relevant if the recipient is an address number, that is, if the document is sent externally via address management. If the field is empty, the standard communication type specified in address management is used.

The following values are permitted:

COM_TYPE......

'INT' : Send via Internet

'FAX' : Send as a fax

'X40' : Send via X.400

'RML' : Send in another SAP system

Prabhu

Read only

0 Likes
1,288

Hi vinod,

I am also facing the same problem with return code 2 ,Please provide the solution if u had already done.

Regards,

Bharat Kumar