Quantcast
Channel: SCN : Unanswered Discussions - SAP Business Process Management
Viewing all articles
Browse latest Browse all 3160

SO_NEW_DOCUMENT_ATT_SEND_API1 Link Transaction (Missing)

$
0
0

Hi Good day,

 

i am using above FM :   SO_NEW_DOCUMENT_ATT_SEND_API1 to send the mail with attachment to SAP INBOX.

 

BUT :

 

How can i link my TRACTION CODE to the FM?

 

This is my CODE :

 

   DATA: doc_chng  LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix,
      body_start LIKE sy-tabix.
DATA: it_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: it_objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: it_objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: it_reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: it_shortcut_param LIKE zst_shortcut_par OCCURS 0 WITH HEADER LINE.
DATA: content TYPE string.

*** Pass the required parameters and create the shortcut
CLEAR it_shortcut_param.
REFRESH it_shortcut_param.

it_shortcut_param-fieldname = 'CCIHT_IAL-IALID'.
it_shortcut_param-fieldvalue = '00000000000000003341'. "Employee number
APPEND it_shortcut_param.

it_shortcut_param-fieldname = 'CCIHT_IAL-IATYPE'.
it_shortcut_param-fieldvalue = 'OPS'. " Address Infotype
APPEND it_shortcut_param.

CALL FUNCTION 'ZFM_CREATE_SHORTCUT'
  EXPORTING
    recipient_user_id = '9997500'
    transaction       = 'PA20'
  IMPORTING
    content           = content
  TABLES
    shortcut_param    = it_shortcut_param.


*** Mail Subject
doc_chng-obj_descr = 'TOMS IS BEEN changed'.
*** Mail Contents
CONCATENATE ' The requested change has been made to your temporary address.'
' Please double click on the attachment and choose display to view the updated address'
INTO it_objtxt.
APPEND it_objtxt.

*** Creation of the entry for the document
DESCRIBE TABLE it_objtxt LINES tab_lines.
CLEAR it_objpack-transf_bin.
it_objpack-head_start = 1.
it_objpack-head_num = 0.
it_objpack-body_start = 1.
it_objpack-body_num = tab_lines.
it_objpack-doc_type = 'RAW'.
APPEND it_objpack.

*** Populate attachment content
CLEAR : tab_lines, it_objbin.
CONCATENATE content it_objbin-line INTO it_objbin-line.
APPEND it_objbin.
DESCRIBE TABLE it_objbin LINES tab_lines.

*** Creation of the entry for the compressed attachment
it_objpack-transf_bin = 'X'. "Will get content from content_bin
it_objpack-head_start = 1.
it_objpack-head_num   = 1.
it_objpack-body_start = 1.
it_objpack-body_num   = tab_lines.
it_objpack-doc_type   = 'EXT'.
it_objpack-obj_name   = 'SAPSHORTCUTMAIL'.
it_objpack-obj_descr  = 'DisplayAddress.SAP'.
it_objpack-doc_size   = tab_lines * 255.
APPEND it_objpack.


*** target recipent(s)
CLEAR it_reclist.
it_reclist-receiver = '9997500'.
it_reclist-rec_type = 'B'.
APPEND it_reclist.


*** Sending the document to recipients with the shortcut attachment
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    document_data              = doc_chng
    put_in_outbox              = 'X'
    commit_work                = 'X'
  TABLES
    packing_list               = it_objpack
    contents_bin               = it_objbin
    contents_txt               = it_objtxt
    receivers                  = it_reclist
  EXCEPTIONS
    too_many_receivers         = 1
    document_not_sent          = 2
    operation_no_authorization = 4
    OTHERS                     = 99.

TOMS INBOX.jpg

 

when i click it does not take me to the TCODE : CBIH82.

 

am sure that i am missing something but cant find what it is, your input will be highly appriciated.

 

thank you,

J.

 


Viewing all articles
Browse latest Browse all 3160

Trending Articles



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