Skip to Content
author's profile photo Former Member
Former Member

Loading Multiple Flat File around 80+

Hi,

Loading multiple flat file in to BI system.

My issue: I got a scenerio of loading multiple i.e., 80+ flat file into BI system every month and my client want it to be done through process chain r automation with out manual intervention.

Can any one suggest me how can i achiev this one.

Regards,

Prabhakar.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Sep 10, 2008 at 09:05 AM

    Hi,

    You can do that through process chains.

    Take a look at this link:

    http://help.sap.com/saphelp_nw04/helpdata/EN/8f/c08b3baaa59649e10000000a11402f/content.htm

    You would need to think about upload file naming conventions etc.

    In the infopackage there is a provision to create a routine for varying file names.

    Best regards

    Mathew.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Mathew,

      Here in this case the number of files will get varied month by month i.e., in one month number of flat file may be 80 and in the next month they may be 100 file of the same format.

      how can we schedule all these number of file in a sequence, wether to create a single info package and to create a multiple info package for individual file to load data.

      How to proceed in this case, please suggest me the approach.

      Regards,

      Prabhakar.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2008 at 01:24 PM

    Since the no. of files are not fixed, will suggest you to go for one IP for file. This will give you flexibility to add/delete any IP at any time in the proces chain.

    Thanks...

    Shambhu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All,

      We have developed a logic to upload multiple flat file at a time i.e., .CSV file. Please find below is the logic regarding that routine.

      *+ program filename_routine.

      • Global code

      $$ begin of global - insert your declaration only below this line -

      • Enter here global variables and type declarations

      • as well as additional form routines, which you may call from the

      • main routine COMPUTE_FLAT_FILE_FILENAME below

      data : v_filename type string.

      data : v_foldername type string.

      data : v_uploadfile type string.

      data: v_download_file type string.

      data : v_ext(4) type c.

      data : v_FILE_EXISTS type c.

      data : v_file type DXFILE-FILENAME.

      data : v_count(3) type c.

      data : v_length type i.

      TYPES: BEGIN OF TY_file,

      LINE(900),

      END OF TY_file.

      DATA: GIT_file TYPE TABLE OF TY_file.

      $$ end of global - insert your declaration only before this line -

      • -------------------------------------------------------------------

      form compute_flat_file_filename

      using p_infopackage type rslogdpid

      p_datasource type rsoltpsourcer

      p_logsys type rsslogsys

      changing p_filename type RSFILENM

      p_subrc like sy-subrc.

      $$ begin of routine - insert your code only below this line -

      • This routine will be called by the adapter,

      • when the infopackage is executed.

      *

      v_count = 1.

      ************************************************************************

      *****************************************

      *---- As per the folder location of the files & system we have to change

      *the path fo the folder in the below variable i.e., 'c:\............

      v_foldername =

      'C:\Documents and Settings\Prabhakar-HP\Desktop\test\'.

      *---- As per the Prefix of the files like 'CSI_01_..' we have change the

      *prefix if required in the below variable i.e., 'CSI_01_..', IF REQUIRED

      *OR IF WANT TO CHANGE THE PREFIX TO SOME OTHER.

      v_filename = 'CSI_01_'.

      ************************************************************************

      *****************************************

      v_ext = '.csv'.

      condense v_count.

      concatenate v_foldername

      v_filename

      v_count

      v_ext into v_uploadfile.

      v_file = v_uploadfile.

      CALL FUNCTION 'DX_FILE_EXISTENCE_CHECK'

      EXPORTING

      FILENAME = v_file

      PC = 'X'

      IMPORTING

      FILE_EXISTS = v_FILE_EXISTS

      EXCEPTIONS

      RFC_ERROR = 1

      FRONTEND_ERROR = 2

      NO_AUTHORITY = 3

      OTHERS = 4.

      IF SY-SUBRC <> 0.

      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      while v_FILE_EXISTS = 'X'.

      v_file = v_uploadfile.

      CALL FUNCTION 'DX_FILE_EXISTENCE_CHECK'

      EXPORTING

      FILENAME = v_file

      PC = 'X'

      IMPORTING

      FILE_EXISTS = v_FILE_EXISTS

      EXCEPTIONS

      RFC_ERROR = 1

      FRONTEND_ERROR = 2

      NO_AUTHORITY = 3

      OTHERS = 4.

      IF SY-SUBRC <> 0.

      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      if v_file_exists = 'X'.

      CALL FUNCTION 'GUI_UPLOAD'

      EXPORTING

      FILENAME = v_uploadfile

      FILETYPE = 'ASC'

      HAS_FIELD_SEPARATOR = 'X'

      TABLES

      DATA_TAB = GIT_file

      EXCEPTIONS

      FILE_OPEN_ERROR = 1

      FILE_READ_ERROR = 2

      NO_BATCH = 3

      GUI_REFUSE_FILETRANSFER = 4

      INVALID_TYPE = 5

      NO_AUTHORITY = 6

      UNKNOWN_ERROR = 7

      BAD_DATA_FORMAT = 8

      HEADER_NOT_ALLOWED = 9

      SEPARATOR_NOT_ALLOWED = 10

      HEADER_TOO_LONG = 11

      UNKNOWN_DP_ERROR = 12

      ACCESS_DENIED = 13

      DP_OUT_OF_MEMORY = 14

      DISK_FULL = 15

      DP_TIMEOUT = 16

      OTHERS = 17.

      IF SY-SUBRC <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      elseif sy-subrc = 0.

      ************************************************************************

      ************

      **----- As per the REQUIRMENT, want to change the down loading file

      *path means we have to change the path in the below variable i.e.,

      *'c:\.......

      v_download_file =

      'C:\Documents and Settings\Prabhakar-HP\Desktop\test\satheesh.CSV'.

      ************************************************************************

      *************

      CALL FUNCTION 'GUI_DOWNLOAD'

      EXPORTING

      FILENAME = v_download_file

      FILETYPE = 'ASC'

      APPEND = 'X'

      TABLES

      DATA_TAB = git_file

      EXCEPTIONS

      FILE_WRITE_ERROR = 1

      NO_BATCH = 2

      GUI_REFUSE_FILETRANSFER = 3

      INVALID_TYPE = 4

      NO_AUTHORITY = 5

      UNKNOWN_ERROR = 6

      HEADER_NOT_ALLOWED = 7

      SEPARATOR_NOT_ALLOWED = 8

      FILESIZE_NOT_ALLOWED = 9

      HEADER_TOO_LONG = 10

      DP_ERROR_CREATE = 11

      DP_ERROR_SEND = 12

      DP_ERROR_WRITE = 13

      UNKNOWN_DP_ERROR = 14

      ACCESS_DENIED = 15

      DP_OUT_OF_MEMORY = 16

      DISK_FULL = 17

      DP_TIMEOUT = 18

      FILE_NOT_FOUND = 19

      DATAPROVIDER_EXCEPTION = 20

      CONTROL_FLUSH_ERROR = 21

      OTHERS = 22.

      IF SY-SUBRC <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      refresh git_file.

      ENDIF.

      endif.

      if v_file_exists = 'X'.

      if p_subrc = 0.

      v_count = v_count + 1.

      condense v_count.

      concatenate

      v_foldername

      v_filename

      v_count

      v_ext into v_uploadfile.

      endif.

      else.

      endif.

      endwhile.

      v_uploadfile = v_download_file.

      p_filename = v_uploadfile.

      p_subrc = 0.

      $$ end of routine - insert your code only before this line -

      endform. +*

      Reagrds,

      Prabhakar.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 01, 2008 at 09:46 AM

    Resolved by my self

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.