메뉴 건너뛰기

SAP 한국 커뮤니티

FTP 호출 프로그램 예제

sapjoy 2014.11.28 18:43 조회 수 : 5967

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.
번호 제목 글쓴이 날짜 조회 수
328 내역으로 T-CODE 찾기 SEARCH_SAP_MENU file sapjoy 2014.12.30 5982
» FTP 호출 프로그램 예제 [2] sapjoy 2014.11.28 5967
326 로그 오프 시키는 함수, LOGOFF, 로그오프 [4] sapjoy 2009.12.21 5954
325 New abap 디버거기능소개 [3] 열공아밥 2009.12.21 5933
324 [re] New abap 디버거기능소개 [4] file 낙엽 2009.12.22 5873
323 SE16N 을 이용하여 Add-On Table 데이타 조정하는 방법 [15] file 노름마치 2009.07.10 5870
322 <img src=d.gif>찾고자하는 화면을 쉽게찾을수있는 방법[추천:e-abap] [7] file 양키 2010.06.19 5868
321 온라인 프로그램에서 유지보수뷰 연결할때 유용하게 쓸수 있습니다. [4] 천지개벽 2009.01.30 5864
320 ABAP Program Tips v3 [13] file 2008.09.05 5857
319 SAP GUI 접속시 'sapdp00' unknown 에러가 뜰때 [7] 밤톨™ 2008.03.06 5857
318 Python과 SAP RFC 통신 [3] 홍성현 2007.08.09 5857
317 AT 구문에 대한 설명입니다. [6] 김창훈 2007.08.16 5848
316 SAP 귀차니즘 유저를 위한 팁 [2] SARA 2007.03.28 5831
315 [For Power User]Dynamic Casting Symbol Variable [3] 양키 2011.01.19 5815
314 SAP 오피스의 메일박스에 메일 전송하는 함수 꿀단지 2011.10.11 5807
313 <img src=d.gif>구매오더 아카이브 방법[추천:e-abap] [14] file 양키 2009.08.14 5803
312 인터널 테이블의 사이즈의 의미 [4] 양키(이경환) 2014.02.12 5797
311 Implement screen exit for MM01,MM02,MM03 [6] file 노름마치 2009.07.10 5785
310 BUFFER RESET 등 [2] sapjoy 2007.01.23 5782
309 ▲123,456' 으로 표시하게 한다 [3] 꿀단지 2011.10.11 5752