Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP shortcut is send with spaces between every character

I've got the following program:

However when I test this an email is send with a SAP shortcut fille in attachment.

However the shortcut is not working correctly because every character is seperated by a space.

[ S y s t e m ]

N a m e = D E V

D e s c r i p t i o n =

C l i e n t = 0 1 0

[ U s e r ]

N a m e = T L E Y S

L a n g u a g e = E N

[ F u n c t i o n ]

T i t l e =

C o m m a n d = M E 5 5 p _ f r g a b = O R ;

T y p e = T r a n s a c t i o n

[ C o n f i g u r a t i o n ]

G u i S i z e = N o r m a l w i n d o w

REPORT  zrp_mail_shortcut.
***    Report to send mail to employee to release his Purchase requisitions   ***
*** Declarations for attachment creation
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 = 'p_frgab'.
it_shortcut_param-fieldvalue = 'OR'. " Release code
APPEND it_shortcut_param.

    recipient_user_id = 'XXXX'
    transaction       = 'ME55'
    content           = content
    shortcut_param    = it_shortcut_param.

*** Mail Subject
doc_chng-obj_descr = 'Purchase requisitions require release'.
*** Mail Contents
CONCATENATE ' Please release Purchase requisition.'
' You can use the attached link to jump to the transaction and realease the purchase requisition(s)'
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  = 'Release_PR.SAP'.
it_objpack-doc_size   = tab_lines * 255.
APPEND it_objpack.

*** target recipent(s)
CLEAR it_reclist.
it_reclist-receiver = 'email'.
it_reclist-rec_type = 'U'.
APPEND it_reclist.

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

Not what you were looking for? View more on this topic or Ask a question