Skip to Content
avatar image
Former Member

Source Structure determination Dynamically

Hi ,

I got a requirement to develop a File to IDoc scenario. Below are requirement details.

1. Source system application creates maximum 9 XML files of different strucure for each run. File name is generated dynamically by the source application.

2. Each file represents one message(MATMAS, ORDERS01,etc.,) in SAP R/3 (IDoc)

3. Each file has two sections one is header and another details section.

4. Header section structure is same for all the files. and it has a key to determine the document type.

5. Details section structure differs from file to file.

6. PI has to process the source files in the order its created on the source system.

Process flow is : PI has to pick the file/s from the sources system and post the data on SAP R/3 system after data transfermations.

Hope above details help in understaning the requirement. Please suggest me how can i achive this functionaly.

Please give me some light....

Thanks & Regards

Sree

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 03, 2009 at 08:53 PM

    Hi,

    all file are dropped in the same directory? If it is, If there is any patter to generate the files' names?

    Regards

    Ivan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ivan,

      Yes all files are stagged in same folder. File name will be in the below pattern.

      XXXX_MATMAS.xml

      XXXX_ORDERS.xml

      ...

      ..

      .

      XXXX_ZCLASS.xml

      Here XXXX is the source application dynamically generated random number. And files needs to be processed in the order of its created.

      Thanks & Regards

      Sreeni

  • avatar image
    Former Member
    Aug 03, 2009 at 09:57 PM

    HI Jonnavarapu,

    I dont think it is possible using the standard file adapter funcitonality because of the dynamic nature your items are having. For this you need to have an adapter module where you put your own code and then deploy the same and use it.

    Else since your header is same for all the files and details are differnet. If you can ask the source file system guys to generate a file in this format:

    first 10 fields are for Orders and next 10 fields are for matmas etc. Then you can create a source message type with 20 fields and read that file. Based upon the data inside the items you can route to the corresponding idoc. If they cannot generate this format then you cannot achieve your requirement.

    Else you can request them to put the files in different folders and then you can create that many no. of interfaces.

    or you need to come up with some generic file communication channel and then use java modules as mentioned in this blog:

    /people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter

    Regards,

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 04, 2009 at 07:09 PM

    you can use the file adapter.

    you can use extended receiver determination to map to the correct structure based upon the header field that identifies each file.

    simple.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sreeni,

      Try to develop a unix script which check the presence of all the files, if all the files are present than rename the filename with prefix as "XX" and mention the filename in sender channel with prefix "XX".

      As there is a dependency, try to put a wait between the files to get rename in the script.

      regards,

      Chandra Shekhar.