Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Do I have to embed File_get_name in a process code?

Former Member
0 Likes
1,296

Folks

I am new to SAP EDI. I learned about EDI in bits and pieces. Can some body please explain following things:

1. Where does SAP store the newly received EDI messages?

2. I know File_get_name converts a logical file name into physical file name and stores it in physical directory but how does it know which file to choose for it and how it is called? Is it called as an independent program or is it embedded in the process code?

Thanks in advance.

Sunny

1 ACCEPTED SOLUTION
Read only

tkaess
Participant
0 Likes
1,247

1. Transaction WE02 / BD87, Table EDIDC, EDI*

2. The functional module convert the logical file, which you created in the transaction FILE, in the physical file. In the FILE you can create logical file and logical path with variables, parameters, separated by operation systems. The file_get_name you can give the filename and you get the whole path (incl. filename) back. Then you use the generate path for "OPEN DATASET...".

7 REPLIES 7
Read only

tkaess
Participant
0 Likes
1,248

1. Transaction WE02 / BD87, Table EDIDC, EDI*

2. The functional module convert the logical file, which you created in the transaction FILE, in the physical file. In the FILE you can create logical file and logical path with variables, parameters, separated by operation systems. The file_get_name you can give the filename and you get the whole path (incl. filename) back. Then you use the generate path for "OPEN DATASET...".

Read only

Former Member
0 Likes
1,247

Thomas

Thanks for your reply.

My question is should I use FILE_GET_NAME inside the function module which is used by process code? and when I have all the data of this flat file in my internal table, I should append this to EDIDC and EDIDD tables?

How does this data added to EDIDD table which contains information is added to other tables?

Thanks

Sunny

Read only

Former Member
0 Likes
1,247

Yes you can use it!

call function 'FILE_GET_NAME' exporting logical_filename = plogical
                                   importing file_name = serverfolder
                                   exceptions file_not_found = 1
                                              others = 2.

Read only

0 Likes
1,247

When you work with the normal IDOC / ALE process, the IDOC is created and SAP start your function modul behind the process code (when the process code is configured in WE20, behind the partner (the partner in table EDIDC).

At EDI process (when we get edifact files) we use a converter system before SAP - the converter system read the edifact, convert it, make the mapping to the IDOC structure and generate the IDOCs via RFC in SAP.

When you would like to read the edifact file directly in SAP (with your own program) you can add the IDOCs (create entries in EDIDC / EDIDD) with the function modul:

INBOUND_IDOC_PROCESS

IDOC_INBOUND_ASYNCHRONOUS (tRFC)

The function modules have a small description. This function modules create the entries with the function module IDOC_INBOUND_WRITE_TO_DB..

Read only

Former Member
0 Likes
1,247

Thank you, that was insightful.

Read only

Former Member
0 Likes
1,247

Thomas

I have some more questions,

1. since a converter is used to send files between SAP and a non-SAP system so we create RFC connection from SAP to this converter, right?

2. When a port is created and assigned to the partner profile (Converter), then SAP and converter start listening to each other through that port, is it correct?

3.How does a converter know, to whom it has to send that IDOC received from SAP?

Thanks

Sunny

Read only

0 Likes
1,247

1. the converter open a rfc connection to sap via programm id / registered server programm (as a listener) (is a service on the sub system)

2. behind the port is a rfc connection to the converter (rfc connection from point 1 ). SAP use this way for the outgoing (from SAP) communcation

3. on the converter you have a own configuration for communication / business partner. With the data in the control segment the converter decide, what he has to to. E.g. to convert the IDOC to an edifact format, to a XML, to *.csv. (or in the other direction - from different formats to an IDOC). Then the converter open the connection to the targed system and transfer the object.