Generating iDoc File Name SAP ABAP

When configuration outbound iDocs and if you are creating iDoc files though a file port. You should specify the file name format for these outbound files. You may have different outbound iDocs and you should be able to differentiate each type by the file name.

For example Invoice iDocs can be prefixed as “810” and ASNs should be named as “856”. Lets assume you need your file to be named as 810_<iDoc Number>_<Date>_<Time>.

You should create a Z function module for this as no standard function module is configured in such a way that it would create the file name as above.

You can find the standard file name creation function modules using se37 and search with key words *EDI*PATH* or from EDI3 function group.

Create the Z function module to assign the file name.

Note that you can only import the iDoc control data records to create the file name. To create the function module you can copy a standard FM and change accordingly.

Function module coding

You can assign upto 3 parameters to the file name. In this example I have assigned the prefix (810 and 856) to the first parameter, iDoc number to the 2nd and date time stamp to the third. These variables will be separated by “_”.

Assign the function module to the file name generation configuration.

Transaction we55.

Assign the created function module to outbound port which is assigned to iDoc configuration in we21.

Transaction we20.

Test Results

If you have any questions about any of the steps in generating iDoc file names, please leave a comment below.

5 thoughts on “Generating iDoc File Name SAP ABAP

    • Donatella Beltrame says:

      questo significa che non esiste un programma standard che legga il/i file arrivati e li processa automanticamente?

  1. Mae Mar says:

    Hi Isuru,

    I copied EDI_PATH_CREATE_MESTYP_DOCNUM to custom FM but unable to generate the XML file. I followed the steps you have mentioned. Please let me know what did I miss. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *