Types: begin of t_para,
FIELDNAME(60),
FIELDVALUE(255),
end of t_para.
DATA: lt_shortcut TYPE soli_tab,
lv_parameter TYPE text255,
lv_tcode TYPE TCODE,
SHORTCUT_TABLE TYPE SOLI_TAB,
lt_shortcut_param type table of t_para,
ls_shortcut_param type t_para.
"1) collect inputs parameters for FBL5N
ls_shortcut_param-fieldname = 'KUN'. "customer no.
ls_shortcut_param-fieldvalue = '123456'.
APPEND ls_shortcut_param to lt_shortcut_param.
CLEAR ls_shortcut_param.
ls_shortcut_param-fieldname = 'BUK'. "company code
ls_shortcut_param-fieldvalue = 'COM1'.
APPEND ls_shortcut_param to lt_shortcut_param.
CLEAR ls_shortcut_param.
it_shortcut_param-fieldname = 'PA_STIDA'. "Open at key date
it_shortcut_param-fieldvalue = '06.06.2021'.
APPEND ls_shortcut_param to lt_shortcut_param.
CLEAR ls_shortcut_param.
CLEAR lv_parameter.
LOOP AT lt_shortcut_param into ls_shortcut_param.
CONCATENATE lv_parameter ls_shortcut_param-fieldname '='
ls_shortcut_param-fieldvalue ';'
INTO lv_parameter.
ENDLOOP.
"2) generate shortcut
CONCATENATE '*' 'FBL5N' INTO lv_tcode.
CALL FUNCTION 'SWN_CREATE_SHORTCUT'
EXPORTING
i_transaction = lv_tcode
i_parameter = lv_parameter
i_sysid = sy-sysid
i_client = sy-mandt
i_user = sy-uname
i_language = sy-langu
i_windowsize = 'Normal window'
IMPORTING
shortcut_string = content
shortcut_table = shortcut_table "here is shortcut
EXCEPTIONS
inconsistent_parameters = 1
OTHERS = 2.
"3) using BCS send email using shortcut as attachment
...normal BCS email generation
*Add Shorcut Attachment
document->add_attachment(
EXPORTING
i_attachment_type = 'SAP' "extension for shortcut
i_attachment_subject = 'FBL5N.SAP'
i_attachment_size = lp_shortcut_size
i_att_content_text = lt_shortcut ).
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |