안녕하세요
아래와 같이 p_direc parameter처럼 입력 값으로 특정 directory를 지정하고 싶습니다.
file name을 지정하는 것처럼 pop-up창이 나오고 특정 디렉토리를 지정하면 입력값으로 디렉토리를 지정하고 싶은데요.
function에서 *DIRECTORY*로 찾은 펑션중에 'RSO_DIRECTORY_POP_UP' 해당 펑션이 딱 원하는 결과이긴한데 팝업창이 띄워주고 거기서 possible entry로 디렉토리를 지정하고 싶은데
Program "SAPLBW_BDS_TOOLS " not found.와 같은 에러가 발생하네요.
아마 만들다가 안만들어서 사용못하는거 같은데요.
이와 같은 기능을 하는 다른 펑션좀 부탁드립니다
꾸벅
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
parameters : p_direc type LOCALFILE.
SELECTION-SCREEN END OF BLOCK b1.
at selection-screen on value-request for p_direc.
CALL FUNCTION 'RSO_DIRECTORY_POP_UP'
IMPORTING
E_DIRECTORY = p_direc
EXCEPTIONS
FAILED = 1
CANCELLED = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
댓글 2
-
makeA
2009.11.30 23:18
-
요요
2009.12.01 01:19
p_folder 에 대하여 폴더 존재여부가 점검되면 더 좋겠네요. ^^;
TYPE-POOLS abap.
DATA directory TYPE string VALUE 'c:temp'.
DATA result TYPE abap_bool.
CALL METHOD cl_gui_frontend_services=>directory_exist
EXPORTING
directory = directory
RECEIVING
result = result
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CHECK result IS NOT INITIAL.
* Continue...
이런식으로 하시면 되는데요.
*------SELECTION-SCREEN ---------------------------------------------*
SELECTION-SCREEN BEGIN OF SCREEN 0210 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-003 FOR FIELD p_folder.
SELECTION-SCREEN POSITION 25.
PARAMETERS: p_folder LIKE rlgrap-filename DEFAULT cs_folder.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF SCREEN 0210.
* ---------------------------------------------------------------------*
* AT SELECTION-SCREEN
* ---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
PERFORM get_foldername.
*&---------------------------------------------------------------------*
*& Form GET_FOLDERNAME
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_foldername .
DATA: objfile TYPE REF TO cl_gui_frontend_services.
DATA: pickedfolder TYPE string.
DATA: initialfolder TYPE string.
CREATE OBJECT objfile.
IF NOT p_folder IS INITIAL.
initialfolder = p_folder.
ELSE.
CALL METHOD objfile->get_temp_directory
CHANGING
temp_dir = initialfolder
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3.
ENDIF.
CALL METHOD objfile->directory_browse
EXPORTING
initial_folder = initialfolder
CHANGING
selected_folder = pickedfolder
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3.
IF sy-subrc = 0.
p_folder = pickedfolder.
ELSE.
MESSAGE s000 WITH '폴더를 선택하는 동안 오류가 발생했습니다'.
EXIT.
ENDIF.
ENDFORM. " GET_FOLDERNAME