Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Processing Multiple FILES :(

Former Member
0 Likes
958

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

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
741

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

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
741

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

Read only

0 Likes
741

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

Read only

ferry_lianto
Active Contributor
0 Likes
742

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

Read only

0 Likes
741

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