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.
Assign the created function module to outbound port which is assigned to iDoc configuration in we21.
If you have any questions about any of the steps in generating iDoc file names, please leave a comment below.
Hi, I am Isuru Fernando, Senior SAP Integration Consultant with 10 years of SAP full-cycle implementation and support project experience.From the early days, I had a passion for coding, software development, and everything tech-related. I started my carrier as an ABAP developer and soon found my love for system integration when I learned SAP XI 3.0 in 2008. Playing a variety of roles from an offshore technical consultant (ABAP, PI/PO, BW, BOBJ) at the beginning of my career to a technical lead managing a team of consultants in different countries, I have gained immense experience in SAP project implementation life cycle.Having the opportunity to work on SAP implementation projects in USA, EU, and Asia, I learned valuable ins and outs of global business processors in Sales and Distribution (SD), Material Management, Retail, Customer Relationship Management (CRM), and Finance and Controlling (FICO).Through this blog, I want to share my expertise in SAP technical areas such as SAP ABAP, PI/PO, AIF, and Basis. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world!