Application Development 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: 

express mail not appering in pop up window...

former_member185116
Active Participant
0 Kudos

hello all,

i have written a code to get express mail when ever the user logins,

my code is like below,

****************************************************************************************


loop at it_bg INTO wa_bg.


   READ TABLE it_ekko INTO wa_ekko with KEY ebeln = wa_bg-zzebeln.

   if sy-subrc eq 0.

* Data Declarations

* Recipients
LT_MAILRECIPIENTS-REC_TYPE  = 'B'.
lt_mailrecipients-rec_id = wa_ekko-ernam.
LT_MAILRECIPIENTS-EXPRESS = 'X'.
APPEND LT_MAILRECIPIENTS .
CLEAR LT_MAILRECIPIENTS .
* Subject.
LT_MAILSUBJECT-OBJ_NAME = 'TEST'.
LT_MAILSUBJECT-OBJ_LANGU = SY-LANGU.


data : lv_dat1(10) type c,
        lv_dat2(10) type c.

CONCATENATE wa_bg-zzddbgdt+6(2)'.'wa_bg-zzddbgdt+4(2)'.'wa_bg-zzddbgdt(4) INTO lv_dat1.



CONCATENATE 'Bank Gurantee No' wa_bg-zzddbgno 'dated' lv_dat1 'expiring shortly' INTO LT_MAILSUBJECT-OBJ_DESCR SEPARATED BY space.
*LT_MAILSUBJECT-OBJ_DESCR = 'Bank Guarantee expired '.
* Mail Contents

CONCATENATE wa_bg-zzvalend+6(2)'.'wa_bg-zzvalend+4(2)'.'wa_bg-zzvalend(4) INTO lv_dat2.


CONCATENATE 'Bank guarantee No' wa_bg-zzddbgno 'for agreement ' wa_bg-zzebeln 'will be expired on' lv_dat2 INTO lt_mailtxt SEPARATED BY space.
*LT_MAILTXT = 'This is a test mail'.
APPEND LT_MAILTXT. CLEAR LT_MAILTXT.
* Send Mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
   EXPORTING
     DOCUMENT_DATA              = LT_MAILSUBJECT
   TABLES
     OBJECT_CONTENT             = LT_MAILTXT
     RECEIVERS                  = LT_MAILRECIPIENTS
   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 EQ 0.
   COMMIT WORK.
*   Push mail out from SAP outbox
   SUBMIT RSCONN01 WITH MODE = 'INT' AND RETURN.
ENDIF.

endif.
endloop.


********************************************************************************************


but i am not getting the message as express mail(i.e in a pop window),


it simply appearing the inbox...


what could be the reason ,


thanks in advance....


2 REPLIES 2

naveenvishal
Contributor
0 Kudos

Hi Vinay,

Pl check in SO16, 'Execution of Express messages in New session' should be checked.

Hope this helps.

Rgds,

Naveen

0 Kudos

hi naveen,

as u said i have checked the corresponding check box,

still the express mail is not coming....