메뉴 건너뛰기

SAP 한국 커뮤니티

FTP 호출 프로그램 예제

sapjoy 2014.11.28 09:43 조회 수 : 5642

report rsftp002.

parametersuser(30type lower case,
            pwd(30type lower case,
            host(64type lower case,
            cmd1(80type lower case,
            cmd2(80type lower case,
            cmd3(80type lower case,
            dest like rfcdes-rfcdest default 'SAPFTP',
            compress type default 'N'.

datahdl type i,
      key type value 26101957,
      slen type i.

databegin of result occurs 0,
      line(100type c,
      end of result.

set extended check off.
slen strlenpwd ).

AUTHORITY-CHECK OBJECT 'S_ADMI_FCD'
         ID 'S_ADMI_FCD'
         FIELD 'SFTP'.
IF sy-subrc <> 0.
  MESSAGE 'no_authorization' type 'E'.
  exit.
*     Keine Berechtigung zum Ändern der Aktivierung einer ID
ENDIF.

CALL FUNCTION 'HTTP_SCRAMBLE'
  exporting
    source      pwd
    sourcelen   slen
    key         key
  importing
    destination pwd.

call function 'FTP_CONNECT'
  exporting
    user            user
    password        pwd
    host            host
    rfc_destination dest
  importing
    handle          hdl.

if cmd1 ne ' '.
  call function 'FTP_COMMAND'
    exporting
      handle        hdl
      command       cmd1
      compress      compress
    tables
      data          result
    exceptions
      command_error 1
      tcpip_error   2.
  loop at result.
    write at / result-line.
  endloop.
  refresh result.
endif.

if cmd2 ne ' '.
  call function 'FTP_COMMAND'
    exporting
      handle        hdl
      command       cmd2
    tables
      data          result
    exceptions
      command_error 1
      tcpip_error   2.
  loop at result.
    write at / result-line.
  endloop.
  refresh result.
endif.

if cmd3 ne ' '.
  call function 'FTP_COMMAND'
    exporting
      handle        hdl
      command       cmd3
    tables
      data          result
    exceptions
      command_error 1
      tcpip_error   2.
  loop at result.
    write at / result-line.
  endloop.
  refresh result.
endif.

call function 'FTP_DISCONNECT'
  exporting
    handle hdl.

call function 'RFC_CONNECTION_CLOSE'
  exporting
    destination dest
  exceptions
    others 1.

* password not visible

at selection-screen output.

  loop at screen.
    if screen-name 'PWD'.
      screen-invisible '1'.
      modify screen.
    endif.
  endloop.
번호 제목 글쓴이 날짜 조회 수
327 <img src=d.gif>찾고자하는 화면을 쉽게찾을수있는 방법[추천:e-abap] [7] file 양키 2010.06.18 5826
326 온라인 프로그램에서 유지보수뷰 연결할때 유용하게 쓸수 있습니다. [4] 천지개벽 2009.01.29 5814
325 Python과 SAP RFC 통신 [3] 홍성현 2007.08.09 5808
324 SAP Table의 E-R Diagram 보기 BlackBean 2007.05.09 5797
323 SAP GUI 접속시 'sapdp00' unknown 에러가 뜰때 [7] 밤톨™ 2008.03.05 5789
322 SAP 귀차니즘 유저를 위한 팁 [2] SARA 2007.03.27 5785
321 SAP 오피스의 메일박스에 메일 전송하는 함수 꿀단지 2011.10.11 5761
320 [For Power User]Dynamic Casting Symbol Variable [3] 양키 2011.01.19 5755
319 <img src=d.gif>구매오더 아카이브 방법[추천:e-abap] [14] file 양키 2009.08.14 5754
318 내역으로 T-CODE 찾기 SEARCH_SAP_MENU file sapjoy 2014.12.30 5738
317 AT 구문에 대한 설명입니다. [6] 김창훈 2007.08.16 5734
316 " " 와 ' ' 의 차이점 ( SPACE ) [4] sapjoy 2007.04.04 5730
315 Implement screen exit for MM01,MM02,MM03 [6] file 노름마치 2009.07.10 5697
314 ▲123,456' 으로 표시하게 한다 [3] 꿀단지 2011.10.11 5695
313 시간 계산, time difference [2] sapjoy 2014.05.16 5694
» FTP 호출 프로그램 예제 [2] sapjoy 2014.11.28 5642
311 Word Wrab 기능을사용해보자. [2] file 양키 2011.07.19 5597
310 플랜트로 회사코드와 기준통화 찾기 [8] file 김창훈 2007.08.16 5594
309 SAP와 JAVA간 Interface방법 [4] file 명신용 2007.04.03 5586
308 ALV Subtotal 맨위에 표기하기 [8] 양키 2013.03.26 5576