메뉴 건너뛰기

SAP 한국 커뮤니티

FTP 호출 프로그램 예제

sapjoy 2014.11.28 09:43 조회 수 : 5633

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.
번호 제목 글쓴이 날짜 조회 수
» FTP 호출 프로그램 예제 [2] sapjoy 2014.11.28 5633
486 sap 화면 웹(web)으로 띄우기(ITS, SAPGUI HTML) [4] file sapjoy 2014.11.14 7166
485 Selection Screeen에서 저장버튼 Disable 처리 [3] 양키(이경환) 2014.11.13 3742
484 릴리즈된 cts 복구 하기 Program : RDDIT076 [2] sapjoy 2014.11.10 7318
483 스크린을 생성하여 팝업창을 띄웠는데요~닫기가 안되요 [3] 흐르는강물처럼 2014.10.06 5361
482 User Profile 설정하기 [4] file 아밥뽀 2014.09.21 2749
481 드롭다운 리스트 key값 조회하기 [4] file 아밥뽀 2014.09.21 3340
480 백그라운드로 프로그램 실행하기 [5] file 아밥뽀 2014.09.21 4805
479 BDC 수행시 COMMAND 명령어 sapjoy 2014.09.18 3298
478 명령어 결과에 따른 SY-SUBRC [5] sapjoy 2014.09.16 6937
477 테이블 inconsistency check 프로그램 [2] file sapjoy 2014.09.11 2109
476 SQL 실행 프로그램 - ZSQL [2] file 아밥뽀 2014.08.23 4682
475 SYST 시스템 변수 정리 [5] 아밥뽀 2014.08.23 16915
474 앞의 0으로 시작하는 문자 모두 지우기 sapjoy 2014.08.20 3342
473 archive 관련 transaction code [1] sapjoy 2014.08.20 2038
472 AL08에서 SAP 서버(인스턴스)별 사용자 확인 [1] sapjoy 2014.08.19 2300
471 SAP 모니터링 T-CODE [11] 아밥뽀 2014.07.08 8668
470 SAPLINK - 소스 업&다운 프로그램 입니다. [5] file abaper_qj 2014.06.18 6979
469 ALV 컬럼 고정하기 [5] file sapjoy 2014.06.18 4574
468 테이블 데이터 엑셀 업로드 프로그램 sapjoy 2014.06.17 4044