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
Thank you.
Hey Isuru, Can we use the same method to trigger inbound IDocs?
Hi Waruna, This is to set the file name of the outbound iDocs. To trigger inbound iDocs you should create a program with function module "IDOC_INBOUND_FROM_FILE".
questo significa che non esiste un programma standard che legga il/i file arrivati e li processa automanticamente?
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.