ABAP保存文件到服务器

Posted ferzalez

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ABAP保存文件到服务器相关的知识,希望对你有一定的参考价值。

现在AL11 设置路径变量     DIR_Z_IT_XML

1

        CLEAR: LV_FILENAME.

        CALL FUNCTION SD_DOCUMENT_FLOW_GET
          EXPORTING
            IV_DOCNUM        = LS_BIL_INVOICE-HD_REF-BIL_NUMBER
          IMPORTING
            ET_DOCFLOW       = LT_DOCFLOW.

        CLEAR LS_DOCFLOW.
        LOOP AT LT_DOCFLOW INTO LS_DOCFLOW WHERE VBTYP_N = +.
          EXIT.
        ENDLOOP.

        CONCATENATE LS_DOCFLOW-DOCNUM
                    LS_BIL_INVOICE-HD_REF-BIL_NUMBER
                    LS_BIL_INVOICE-HD_GEN-SOLD_TO_PARTY
                    SY-DATUM
                    SY-UZEIT
                    INTO LV_FILENAME SEPARATED BY _.


        DATA:GV_DIRNAME              TYPE DIRNAME_AL11.

        CALL C_SAPGPARAM ID NAME  FIELD DIR_Z_IT_XML
                           ID VALUE FIELD GV_DIRNAME.

        CONCATENATE
                    \SAP-EU-DMS.sapdns.cnIT_TST_XML
                    LV_FILENAME
              INTO  GV_DIRNAME SEPARATED BY ‘.
        CONCATENATE GV_DIRNAME .PDF INTO GV_DIRNAME.

        OPEN DATASET GV_DIRNAME FOR OUTPUT IN BINARY MODE.

        IF SY-SUBRC = 0.
          LOOP AT LT_LINES INTO LS_LINES.
            TRANSFER LS_LINES-TDFORMAT TO GV_DIRNAME .
            TRANSFER LS_LINES-TDLINE   TO GV_DIRNAME .
          ENDLOOP.
          CLOSE DATASET LV_PATH.
        ENDIF.

 

以上是关于ABAP保存文件到服务器的主要内容,如果未能解决你的问题,请参考以下文章

ABAP如何实现上传本地文件到FTP服务器

一步步实现ABAP后台导入EXCEL到数据库

我在哪里更改此 Python 代码片段以将临时文件保存在 tmp 文件夹中?

ABAP写数据到SAP服务器文件并读取

SAP ABAP 上传下载文件到文件服务器

根据图片的url地址下载图片到本地保存代码片段