Creating a SAP shortcut for any transaction and sending it by mail

Refer to SAP wiki: http://wiki.sdn.sap.com/wiki/display/Snippets/Creating+a+SAP+shortcut+for+any+transaction+and+sending+it+by+mail

 

Key Points:

1. Create the shortcut content for the required transaction
  CALL FUNCTION 'SWN_CREATE_SHORTCUT'
    EXPORTING
      i_transaction           = transaction
      i_parameter             = parameter
      i_sysid                 = sy-sysid
      i_client                = sy-mandt
      i_user                  = recipient_user_id
      i_language              = sy-langu
      i_windowsize            = 'Normal window'
    IMPORTING
      shortcut_string         = content
    EXCEPTIONS
      inconsistent_parameters = 1
      OTHERS                  = 2.

 

2. 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.

 

Shortcut Example.

[System]
Name=QA1
Description=
Client=800
[User]
Name=
Language=EN
[Function]
Title=
Command=ZAPR
Type=Transaction
[Configuration]
GuiSize=Maximized
[Options]
Reuse=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值