Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

Re: send mail with attachment not PDF But Link to the transaction (Searched a lot)

$
0
0

Hey Jacob,

 

Sure. I am sending you the code which i am written. If its helpful reward.

 

*--- Function Module to create a T-code Link :

   CALL FUNCTION 'SWN_CREATE_SHORTCUT'

     EXPORTING

       I_TRANSACTION  = '<Give the T-Code>'

       I_PARAMETER    = V_PARAM

       I_SAPLOGON_ID  = V_LOGON_ID

       I_SYSID        = SY-SYSID

       I_USER         = V_USER

       I_LANGUAGE     = V_LANGU

       I_WINDOWSIZE   = 'Normal window'(016)

       I_CUSTOM       = V_SCRAP

     IMPORTING

       SHORTCUT_TABLE = V_ATTACH

     EXCEPTIONS

       OTHERS         = 1.

 

   IF SY-SUBRC <> 0.

     REFRESH V_ATTACH.

     EXIT.

   ENDIF.

 

 

*--- Packing for Work item :

   DESCRIBE TABLE V_ATTACH LINES V_COUNT1.

   APPEND LINES OF V_ATTACH TO IT_CONTENT.

 

*--- To Send the Work Item Link :

     CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

        EXPORTING

             DOCUMENT_DATA              = V_DOCUMENT_DATA

*           put_in_outbox              = ' '

        IMPORTING

             SENT_TO_ALL                = V_SENT_TO_ALL

             NEW_OBJECT_ID              = V_NEW_OBJECT_ID

        TABLES

             PACKING_LIST               = IT_PACKING

             OBJECT_HEADER              = IT_HEADER

             CONTENTS_TXT               = IT_CONTENT

             RECEIVERS                  = IT_REAL_RECIPIENTS

        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.

 

     COMMIT WORK.

     IF SY-SUBRC EQ 0.

       E_FLAG = V_SENT_TO_ALL.

     ENDIF.

   ELSE.

     E_FLAG = SPACE.

   ENDIF.



So do the where used list for the FM which is gave to you and check in standard how they have used the FM to create the link will be helpful for u.

 

Good Luck bro.


Viewing all articles
Browse latest Browse all 10548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>