Posted: Tue Feb 24, 2009 4:47 pm Post subject: Delete mail in SAP Inbox Folder
This snippet code will show how to delete email from SAP Inbox Folder.
My previous program is display Inbox Folder content and display mail content. Now I add new delete mail function in my previous program.
Code:
*---------------------------------------------------------------------*
* CLASS LCL_MAIN DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
*Class Definition
*Adding DELETE_MAIL method.
CLASS lcl_main DEFINITION.
PUBLIC SECTION.
METHODS: display_inbox,
display_mail IMPORTING im_mailid TYPE string,
delete_mail. " -- added code --
EVENTS: message EXPORTING value(msg1) TYPE string
value(msg2) TYPE string OPTIONAL
value(msg3) TYPE string OPTIONAL
value(msg4) TYPE string OPTIONAL.
PRIVATE SECTION.
METHODS: clear_data,
get_inbox_content.
*---------------------------------
* L.O.C.A.L D.A.T.A.
*---------------------------------
DATA: user TYPE soudnamei1,
udat TYPE soudatai1,
fdat TYPE sofoldati1,
it_fdat TYPE TABLE OF sofolenti1,
wa_fdat TYPE sofolenti1.
DATA: msg1 TYPE string,
msg2 TYPE string,
msg3 TYPE string,
msg4 TYPE string.
DATA: fold_id TYPE soodk,
mail_id TYPE soodk.
DATA: wa_objcont TYPE soli,
it_objcont TYPE TABLE OF soli,
object_hd_display TYPE sood2.
IF sy-subrc NE 0.
RAISE EVENT message EXPORTING msg1 = 'Error delete mail.'.
ELSE.
RAISE EVENT message EXPORTING msg1 = 'Email Deleted !'.
ENDIF.
ENDMETHOD. "DELETE_MAIL
display_mail implementation
we have to change display_mail implementation by adding new delete icon
at the top of screen, so user can delete current mail.
METHOD display_mail.
MOVE im_mailid TO mail_id.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.