2010 Oct 14 10:43 AM
HI ABAPERS,
my issue is to costomize LSO_CORRESPONDENCE12 TO GET THE BOOKING AND CANCELLATION STATUS.SAP USER WILL SEND THE ANOTHER SAP USER REGARDING BOOKING AND CANCELATION WITH ATTACHMENTS.SO I HAVE TRIED
THE CODE IN GET_MAIL_ADD_ATTACHMENT METHOD.
DATA: ld_uid TYPE char20, "Unique Indentifier
ls_soli TYPE soli, "Work area for E mail
lt_soli TYPE soli_tab. "Table for Email
CONCATENATE i_recipient-objid i_bus_transaction_info-objid INTO ld_uid.
CONDENSE ld_uid.
Calendar logic begin
ls_soli-line = 'BEGIN:VCALENDAR'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'VERSION:2.0'.
APPEND ls_soli TO lt_soli.* Here based on the notification value we need to call request or cancel method. To know the significance of this method please refer the below URLhttp://stackoverflow.com/questions/45453/icalendar-and-event-updates-not-working-in-outlook
IF i_notif_type EQ 'BUCH'. " Abbr for the course booking
ls_soli-line = 'METHOD:REQUEST'.
ELSEIF i_notif_type EQ 'DELVORM'. "Course Cancellation
ls_soli-line = 'METHOD:CANCEL'.
ENDIF.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'BEGIN:VEVENT'.
APPEND ls_soli TO lt_soli.
CONCATENATE 'UID:' ld_uid INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
Populate the Sequnce number
ls_soli-line = 'SEQUENCE:1'.
APPEND ls_soli TO lt_soli.
CLEAR ls_soli-line.
Email ID of the sender
ls_soli-line = 'ORGANIZER:sender@;;;;'.
APPEND ls_soli TO lt_soli.
CLEAR ls_soli-line.
Populate the Time Stamp
CONCATENATE 'DTSTART:' sy-datum 'T080000Z' INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
CONCATENATE 'DTEND:' sy-datum 'T100000Z' INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
Populate the Location of the course
ls_soli-line = 'LOCATION: This is Course Location'.
APPEND ls_soli TO lt_soli.
This Would appear in Calender file
ls_soli-line = 'DESCRIPTION: Course Participation'.
APPEND ls_soli TO lt_soli.
CONCATENATE 'SUMMARY: Course Participation for '&Give Participant Name&' INTO ls_soli-line SEPARATED BY space.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'END:VEVENT'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'END:VCALENDAR'.
APPEND ls_soli TO lt_soli.
Convert the data to Txt format
CALL FUNCTION 'SO_RAW_TO_RTF'
TABLES
objcont_old = lt_soli[]
objcont_new = e_contents_txt.
e_no_add = space.
e_doc_type = 'ICS'.
e_obj_descr = 'Name of the Calender file'.
FORM send_mail TABLES pt_packing_list TYPE t_sopcklsti1
pt_header TYPE t_solisti1
pt_content TYPE t_solisti1
pt_receiver TYPE t_somlreci1
USING ps_document_data TYPE sodocchgi1
CHANGING p_sent_to_all TYPE sy-binpt
p_new_object_id TYPE sofolenti1-object_id
p_rc.
send mail
CLEAR p_rc.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = ps_document_data
commit_work = 'X'
IMPORTING
sent_to_all = p_sent_to_all
new_object_id = p_new_object_id
TABLES
packing_list = pt_packing_list
object_header = pt_header
contents_txt = pt_content
receivers = pt_receiver
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.
p_rc = sy-subrc.
keep error message
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO l_msg_text.
ENDIF.
ENDFORM. " send_mail
BUT STILL I AM NOT GETTING MAILS.SO PLZ SOLVE THE ISSUE AND GIVE ME SOME CORRECT CODES.
WAITING FOR REPLY.
SAROJ
HI ABAPERS,
my issue is to costomize LSO_CORRESPONDENCE12 TO GET THE BOOKING AND CANCELLATION STATUS.SAP USER WILL SEND THE ANOTHER SAP USER REGARDING BOOKING AND CANCELATION WITH ATTACHMENTS.SO I HAVE TRIED
THE CODE IN GET_MAIL_ADD_ATTACHMENT METHOD.
DATA: ld_uid TYPE char20, "Unique Indentifier
ls_soli TYPE soli, "Work area for E mail
lt_soli TYPE soli_tab. "Table for Email
CONCATENATE i_recipient-objid i_bus_transaction_info-objid INTO ld_uid.
CONDENSE ld_uid.
Calendar logic begin
ls_soli-line = 'BEGIN:VCALENDAR'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'VERSION:2.0'.
APPEND ls_soli TO lt_soli.* Here based on the notification value we need to call request or cancel method. To know the significance of this method please refer the below URLhttp://stackoverflow.com/questions/45453/icalendar-and-event-updates-not-working-in-outlook
IF i_notif_type EQ 'BUCH'. " Abbr for the course booking
ls_soli-line = 'METHOD:REQUEST'.
ELSEIF i_notif_type EQ 'DELVORM'. "Course Cancellation
ls_soli-line = 'METHOD:CANCEL'.
ENDIF.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'BEGIN:VEVENT'.
APPEND ls_soli TO lt_soli.
CONCATENATE 'UID:' ld_uid INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
Populate the Sequnce number
ls_soli-line = 'SEQUENCE:1'.
APPEND ls_soli TO lt_soli.
CLEAR ls_soli-line.
Email ID of the sender
ls_soli-line = 'ORGANIZER:sender@;;;;'.
APPEND ls_soli TO lt_soli.
CLEAR ls_soli-line.
Populate the Time Stamp
CONCATENATE 'DTSTART:' sy-datum 'T080000Z' INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
CONCATENATE 'DTEND:' sy-datum 'T100000Z' INTO ls_soli-line.
APPEND ls_soli TO lt_soli.
Populate the Location of the course
ls_soli-line = 'LOCATION: This is Course Location'.
APPEND ls_soli TO lt_soli.
This Would appear in Calender file
ls_soli-line = 'DESCRIPTION: Course Participation'.
APPEND ls_soli TO lt_soli.
CONCATENATE 'SUMMARY: Course Participation for '&Give Participant Name&' INTO ls_soli-line SEPARATED BY space.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'END:VEVENT'.
APPEND ls_soli TO lt_soli.
ls_soli-line = 'END:VCALENDAR'.
APPEND ls_soli TO lt_soli.
Convert the data to Txt format
CALL FUNCTION 'SO_RAW_TO_RTF'
TABLES
objcont_old = lt_soli[]
objcont_new = e_contents_txt.
e_no_add = space.
e_doc_type = 'ICS'.
e_obj_descr = 'Name of the Calender file'.
FORM send_mail TABLES pt_packing_list TYPE t_sopcklsti1
pt_header TYPE t_solisti1
pt_content TYPE t_solisti1
pt_receiver TYPE t_somlreci1
USING ps_document_data TYPE sodocchgi1
CHANGING p_sent_to_all TYPE sy-binpt
p_new_object_id TYPE sofolenti1-object_id
p_rc.
send mail
CLEAR p_rc.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = ps_document_data
commit_work = 'X'
IMPORTING
sent_to_all = p_sent_to_all
new_object_id = p_new_object_id
TABLES
packing_list = pt_packing_list
object_header = pt_header
contents_txt = pt_content
receivers = pt_receiver
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.
p_rc = sy-subrc.
keep error message
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO l_msg_text.
ENDIF.
ENDFORM. " send_mail
BUT STILL I AM NOT GETTING MAILS.SO PLZ SOLVE THE ISSUE AND GIVE ME SOME CORRECT CODES.
WAITING FOR REPLY.
SAROJ
2010 Oct 21 7:58 AM
2010 Oct 21 8:08 AM
Where are you attaching the receiver and passing it..?
Whatb is status sy-subrc after this call..?
Check in SOST tcode doyou see any email waiting for communciation..?
Nabheet
2010 Oct 21 1:02 PM
Nabheet,
MY ISSUE IS :
I AM USING THE TCODE LSO_PSV1 FOR LSO_CORRESPONDENCE12.SO I MADE ZIMPLEMENTATION AND WROTE THE ABOVE CODE.I PUT A BREAK POINT IN METHOD - ENDMETHOD.I RUN THE TCODE LSO_PSV1.BUT THE BADI IS NOT GETTING TRIGERED AT ALL.I COULD NOT FIND OUT WHAT IS THE CAUSE.
PLZ TELL ME MY CODE IS CORRECT OR NOT WHICH I HAVE SPECIFIED EARLIER.IF POSSIBLE GIVE ME SOME CORRECT CODES.
SAROJ
2010 Oct 21 1:55 PM
Do you have any sense of forum etiquette? Stop typing in capital letters!!! And if you expect others to read your post, then format it properly. That's why you didn't get a response in the first place...
Now, if you would simply debug your code, you will find the problem.
2010 Oct 21 2:21 PM
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
Thread locked
Thomas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |