on 04-07-2006 2:06 PM
below is my program , when i execute it it gives me error. this program is for sending email to external user.
Can anyone find out what is the error ?
When i debug it , it gives me exception - 9 .
" Object not send ".
PARAMETERS: p_line1(70) TYPE c OBLIGATORY,
p_line2(70) TYPE c,
p_line3(70) TYPE c,
p_title LIKE sood1-objdes,
p_user(100) TYPE c OBLIGATORY.
START-OF-SELECTION.
DATA: i_receivers LIKE soos1 OCCURS 0 WITH HEADER LINE,
i_objcont LIKE soli OCCURS 0 WITH HEADER LINE,
i_objhead LIKE soli OCCURS 0 WITH HEADER LINE,
r_object_hd_change LIKE sood1 OCCURS 0 WITH HEADER LINE.
r_object_hd_change-objdes = p_title. "Title
r_object_hd_change-objnam = text-000. "Document name
r_object_hd_change-objla = sy-langu. "Lenguaje
r_object_hd_change-objsns = 'P'. "Atributos del objeto, Privado
r_object_hd_change-vmtyp = 'F'. "Tipe
r_object_hd_change-skips = ' '. "Procesar 1º dynpro no visible
r_object_hd_change-acnam = sy-uname.
i_receivers-recesc = 'U'. "Sap User
i_receivers-recnam = 'VIPIN@IVL.CO.IN'. "Destiny user
i_receivers-sndex = 'X'.
APPEND i_receivers.
i_objcont-line = p_line1.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
IF NOT p_line2 IS INITIAL.
i_objcont-line = p_line2.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
ENDIF.
IF NOT p_line3 IS INITIAL.
i_objcont-line = p_line3.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
ENDIF.
APPEND i_objhead.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = r_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = i_objcont
objhead = i_objhead
receivers = i_receivers
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
OTHERS = 21.
IF sy-subrc <> 0.
WRITE : 'ERROR'.
MESSAGE I000. "Error en el envío de mensaje al responsable
LEAVE SCREEN.
Endif.
Hi Vipin,
Please try this code.
PARAMETERS: P_LINE1 TYPE SOLI-LINE OBLIGATORY,
P_LINE2 TYPE SOLI-LINE,
P_LINE3 TYPE SOLI-LINE,
P_TITLE LIKE SOOD1-OBJDES.
START-OF-SELECTION.
DATA: I_RECEIVERS LIKE SOOS1 OCCURS 0 WITH HEADER LINE,
I_OBJCONT LIKE SOLI OCCURS 0 WITH HEADER LINE,
I_OBJHEAD LIKE SOLI OCCURS 0 WITH HEADER LINE,
R_OBJECT_HD_CHANGE LIKE SOOD1.
R_OBJECT_HD_CHANGE-OBJDES = P_TITLE.
R_OBJECT_HD_CHANGE-OBJNAM = 'TEST EMAIL'.
R_OBJECT_HD_CHANGE-OBJLA = 'S'.
R_OBJECT_HD_CHANGE-OBJSNS = 'P'.
R_OBJECT_HD_CHANGE-VMTYP = ' '.
R_OBJECT_HD_CHANGE-SKIPS = ' '.
R_OBJECT_HD_CHANGE-ACNAM = ' '.
I_RECEIVERS-SNDEX = 'X'.
I_RECEIVERS-SEL = 'X'.
I_RECEIVERS-RECESC = 'U'.
I_RECEIVERS-RECNAM = 'U-'.
I_RECEIVERS-RECEXTNAM = 'vipin@ivl.co.in'.
APPEND I_RECEIVERS.
I_OBJCONT-LINE = P_LINE1.
APPEND I_OBJCONT.
CLEAR I_OBJCONT.
IF NOT P_LINE2 IS INITIAL.
I_OBJCONT-LINE = P_LINE2.
APPEND I_OBJCONT.
CLEAR I_OBJCONT.
ENDIF.
IF NOT P_LINE3 IS INITIAL.
I_OBJCONT-LINE = P_LINE3.
APPEND I_OBJCONT.
CLEAR I_OBJCONT.
ENDIF.
REFRESH I_OBJHEAD.
I_OBJHEAD-LINE = 'Pruebas'.
APPEND I_OBJHEAD.
I_OBJHEAD-LINE = 'Pruebas SapOffice'.
APPEND I_OBJHEAD.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
OBJECT_HD_CHANGE = R_OBJECT_HD_CHANGE
OBJECT_TYPE = 'RAW'
OWNER = SY-UNAME
TABLES
OBJCONT = I_OBJCONT
OBJHEAD = I_OBJHEAD
RECEIVERS = I_RECEIVERS
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
X_ERROR = 20
OTHERS = 21.
IF SY-SUBRC <> 0.
WRITE : 'ERROR'.
ELSE.
WRITE : 'CORRECT'.
SUBMIT RSCONN01 WITH MODE = 'INT'
AND RETURN.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vipin,
Have you configured the outbound SAP to Internet mail Gateway? If you have not, please check this link on how to setup.
http://www.sapgenie.com/faq/basis.htm
Also check this links for sample codes.
http://www.sapgenie.com/abap/code/abap15.htm
http://www.sapgenie.com/abap/code/abap25.htm
Hope this will help.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ferry,
I try it out ur code , now program not showing previous error , but mail is not reaching to that ID , tht I hard coded thr .
Can u pls check it out .
PARAMETERS: p_line1(70) TYPE c OBLIGATORY,
p_line2(70) TYPE c,
p_line3(70) TYPE c,
p_title LIKE sood1-objdes.
p_user(100) TYPE c OBLIGATORY.
START-OF-SELECTION.
DATA: i_receivers LIKE soos1 OCCURS 0 WITH HEADER LINE,
i_objcont LIKE soli OCCURS 0 WITH HEADER LINE,
i_objhead LIKE soli OCCURS 0 WITH HEADER LINE,
r_object_hd_change LIKE sood1 OCCURS 0 WITH HEADER LINE.
r_object_hd_change-objdes = p_title. "Title
r_object_hd_change-objnam = text-000. "Document name
r_object_hd_change-objla = sy-langu. "Lenguaje
r_object_hd_change-objsns = 'P'. "Atributos del objeto, Privado
r_object_hd_change-vmtyp = 'F'. "Tipe
r_object_hd_change-skips = ' '. "Procesar 1º dynpro no visible
r_object_hd_change-acnam = sy-uname.
i_receivers-recesc = 'U'. "Sap User
i_receivers-recnam = 'VIPIN@IVL.CO.IN'. "Destiny user
i_receivers-sndex = 'X'.
APPEND i_receivers.
i_receivers-sndex = 'X'.
i_receivers-recesc = 'U'.
i_receivers-recnam = 'U-'.
i_receivers-recextnam = 'vipin@ivl.co.in'.
APPEND i_receivers.
i_objcont-line = p_line1.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
IF NOT p_line2 IS INITIAL.
i_objcont-line = p_line2.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
ENDIF.
IF NOT p_line3 IS INITIAL.
i_objcont-line = p_line3.
APPEND i_objcont.
CLEAR i_objcont.
i_objhead-line = i_objhead-line + 1.
ENDIF.
APPEND i_objhead.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = r_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = i_objcont
objhead = i_objhead
receivers = i_receivers
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
OTHERS = 21.
IF sy-subrc <> 0.
WRITE : 'ERROR'.
MESSAGE I000. "Error en el envío de mensaje al responsable
LEAVE SCREEN.
ELSE.
WRITE : 'correct'.
ENDIF.
Thanks
Hi Vipin,
Please replace your below code with new code (in BOLD).
i_receivers-recesc = 'U'.
i_receivers-recnam = 'VIPIN@IVL.CO.IN'.
i_receivers-sndex = 'X'.
APPEND i_receivers.
<b>
I_RECEIVERS-SNDEX = 'X'.
I_RECEIVERS-RECESC = 'U'.
I_RECEIVERS-RECNAM = 'U-'.
I_RECEIVERS-RECEXTNAM = 'VIPIN@IVL.CO.IN'.
APPEND I_RECEIVERS.
</b>
Hope this will help.
Regards,
Ferry Lianto
Note: please award point if solved your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vipin,
Please replace your below code with new code (in BOLD).
i_receivers-recesc = 'U'.
i_receivers-recnam = 'VIPIN@IVL.CO.IN'.
i_receivers-sndex = 'X'.
APPEND i_receivers.
[code]
<b>I_RECEIVERS-SNDEX = 'X'.
I_RECEIVERS-RECESC = 'U'.
I_RECEIVERS-RECNAM = 'U-'.
I_RECEIVERS-RECEXTNAM = 'VIPIN@IVL.CO.IN'.
APPEND I_RECEIVERS.</b> [code]
Hope this will help.
Regards,
Ferry Lianto
Note: please award point if solved your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.