ITPub博客

首页 > 应用开发 > IT综合 > sap strans 资料

sap strans 资料

原创 IT综合 作者:sandong8 时间:2023-11-07 09:37:09 0 删除 编辑

st程序:

<?sap.transform simple?>

<tt:transform xmlns:tt="

<tt:root name="userInf"/>

<tt:template>

<header>

<sid>

<tt:value ref="userInf.sid"/>

</sid>

<pwd>

<tt:value ref= "userInf.pwd"/>

</pwd>

</header>

</tt:template>

</tt:transform>



调用程序:

*&---------------------------------------------------------------------*
*& Report  YSTRANS001
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report  ystrans001 .

data : gv_xml  type string ,
      li_binary_tab   type  standard  table  of char255  with  header  line .


data : lv_filename  type string ,
      lv_path  type string ,
      lv_fullpath  type string ,
      lv_user_action  type  i .

data : begin  of gs_result ,
          sid  type char10 ,
          pwd  type char20 ,
          end  of gs_result .

gs_result -sid  = 'zgh' .
gs_result -pwd  = '123456' .

call transformation ytest0001
  source userinf  = gs_result
  result xml gv_xml .

call  function  'CONVERT_STRING_TO_TABLE'
   exporting
    i_string          = gv_xml
    i_tabline_length  =  '255'
   tables
    et_table          = li_binary_tab .



concatenate  '财务月度报表' sy -datum  into lv_filename .

call  method cl_gui_frontend_services =>file_save_dialog
   exporting
    default_extension     =  'xlsx'
    file_filter           = cl_gui_frontend_services =>filetype_excel
    default_file_name     = lv_filename
   changing
    fullpath              = lv_fullpath
    filename              = lv_filename
    path                  = lv_path
    user_action           = lv_user_action
   exceptions
    cntl_error            =  1
    error_no_gui          =  2
    not_supported_by_gui  =  3
     others                =  4 .

call  function  'GUI_DOWNLOAD'
      exporting
*     BIN_FILESIZE                    =
       filename                         = lv_fullpath
       filetype                         =  'BIN'
        append                           =  ' '
*     WRITE_FIELD_SEPARATOR           = ' '
*     HEADER                          = '00'
*     TRUNC_TRAILING_BLANKS           = ' '
*     WRITE_LF                        = 'X'
*     COL_SELECT                      = ' '
*     COL_SELECT_MASK                 = ' '
*     DAT_MODE                        = ' '
*     CONFIRM_OVERWRITE               = ' '
*     NO_AUTH_CHECK                   = ' '
*     CODEPAGE                        = ' '
*     IGNORE_CERR                     = ABAP_TRUE
*     REPLACEMENT                     = '#'
*     WRITE_BOM                       = ' '
*     TRUNC_TRAILING_BLANKS_EOL       = 'X'
*     WK1_N_FORMAT                    = ' '
*     WK1_N_SIZE                      = ' '
*     WK1_T_FORMAT                    = ' '
*     WK1_T_SIZE                      = ' '
*     WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
*     SHOW_TRANSFER_STATUS            = ABAP_TRUE
*   IMPORTING
*     FILELENGTH                      =
      tables
       data_tab                         = li_binary_tab[]
*     FIELDNAMES                      =
     exceptions
      file_write_error                 =  1
      no_batch                         =  2
      gui_refuse_filetransfer          =  3
      invalid_type                     =  4
      no_authority                     =  5
      unknown_error                    =  6
      header_not_allowed               =  7
      separator_not_allowed            =  8
      filesize_not_allowed             =  9
      header_too_long                  =  10
      dp_error_create                  =  11
      dp_error_send                    =  12
      dp_error_write                   =  13
      unknown_dp_error                 =  14
      access_denied                    =  15
      dp_out_of_memory                 =  16
      disk_full                        =  17
      dp_timeout                       =  18
      file_not_found                   =  19
      dataprovider_exception           =  20
      control_flush_error              =  21
       others                           =  22
              .

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9522162/viewspace-2993194/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: sap strans 表格
请登录后发表评论 登录
全部评论

注册时间:2014-10-05

  • 博文量
    6
  • 访问量
    6314