‎2007 Oct 24 7:30 PM
Hi all, I have a requirementin Inbound 856. I have a directory where I will get idoc files for each partial delivery. so the file name shouldnot be the same. let say idoc1.txt , idoc2.txt. Now I have to process these two files one after other and this should be a automatic process. Can anyone help me how to proceed ?
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Oct 24 10:31 PM
Hi,
As I mentioned earlier, you need to create a custom report via SE38.
REPORT ZTEST.
PARAMETERS: P_DIR LIKE EPSF-EPSDIRNAM,
P_FILE LIKE EPSF-EPSFILNAM DEFAULT 'IDOC*.TXT'.
DATA: FILE_LIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
FILE LIKE EDI_PATH-PTHNAM.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
DIR_NAME = P_DIR
FILE_MASK = P_FILE
TABLES
DIR_LIST = FILE_LIST
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
READ_DIRECTORY_FAILED = 5
TOO_MANY_READ_ERRORS = 6
EMPTY_DIRECTORY_LIST = 7
OTHERS = 8.
IF SY-SUBRC = 0.
LOOP AT FILE_LIST.
CONCATENATE P_DIR '/' FILE_LIST-NAME INTO FILE.
SUBMIT RSEINB00 WITH P_FILE = FILE
AND RETURN.
ENDLOOP.
ENDIF.
Regards,
Ferry Lianto
‎2007 Oct 24 7:42 PM
Hi,
You can write a custom program to get list of IDoc files with file mask 'idoc*.txt' using FM EPS_GET_DIRECTORY_LISTING. Then loop through the return file list and perform submit program RSEINB00 by passing the file name.
Regards,
Ferry Lianto
‎2007 Oct 24 10:15 PM
Thanks Ferry, I was looking for such thing. Can you tell me where to call this FM and then the program RSEINB00. Thanks in advance
‎2007 Oct 24 10:31 PM
Hi,
As I mentioned earlier, you need to create a custom report via SE38.
REPORT ZTEST.
PARAMETERS: P_DIR LIKE EPSF-EPSDIRNAM,
P_FILE LIKE EPSF-EPSFILNAM DEFAULT 'IDOC*.TXT'.
DATA: FILE_LIST LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
FILE LIKE EDI_PATH-PTHNAM.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
DIR_NAME = P_DIR
FILE_MASK = P_FILE
TABLES
DIR_LIST = FILE_LIST
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
READ_DIRECTORY_FAILED = 5
TOO_MANY_READ_ERRORS = 6
EMPTY_DIRECTORY_LIST = 7
OTHERS = 8.
IF SY-SUBRC = 0.
LOOP AT FILE_LIST.
CONCATENATE P_DIR '/' FILE_LIST-NAME INTO FILE.
SUBMIT RSEINB00 WITH P_FILE = FILE
AND RETURN.
ENDLOOP.
ENDIF.
Regards,
Ferry Lianto
‎2007 Oct 24 10:53 PM
Thanks for the Code Ferry, I have one doubt now. If i use this code then Do the FM EDI_DATA_INCOMING runs.Does this code calls IDOC_INPUT_DESADV internally ? or else we have to include in the code? .
Message was edited by:
abap beginner