Application Development 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: 

iDOC creation from a flat file

Former Member
0 Kudos

We currently receive a large volume of invoices from freight companies that move our product from point A to B.

I will receive a file from the vendor with 10 fields. The fields are BOL, shipdate, shipfrom_pt, shipto_pt, volume, rate, surcharge, total, invoice_no, invoice_dt.

I may also get them to plug in the Vendor number on creation.

Currently, our staff uses paper invoice with the BOL & shipdate to locate the PO in our system, then lookup the PO, and if the total in SAP matches to the total on the paper invoice, it is marked for payment (that is the short of it).

We have eVision already in place which I use to build an iDOC for our Utility bills we receive. But these occur once a month, whereas we may receive 50+ invoices from a freight vendor.

Do I have enough information to create an iDOC in SAP, in which SAP will know how to locate and reconcile? The invoic01 documentation is extensive and examples are nill. Help on identifying the segments, fields and values necessary to generate an iDOC.

The alternative is to import the file into SAP and write an ABAP pgm, with BAPI's to search and create the invoice.

I wanted to go with iDOC as it is SAP's proprietary form for handling inbound records.

Ralph

4 REPLIES 4

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Ralph!

In general: if this information is enough to do it manually, than it has to be enough for an IDOC, too.

Of course you will need some additional information (like partner settings) - but normally this can be filled with default settings / additional selections in user exits / customizing in case of IDOC partner settings.

Have a look into WE60 to get a list of idoc fields, documentation of the fields is now defined in data element documentation - so use SE11 to get a closer look. Sometimes segments are very general: two fields identifier / value. Then fixed value list will tell you: identifier 001 expects sales organization, 002 = distribution channel and so on.

Regards,

Christian

Former Member
0 Kudos

Hi Ralph,

In my opinion, you must have a PO Number for Invoice if you want to use standard functionality. You will probably need to create IDOC using an ABAP program which reads this file and search for PO based on the information available to you. I also notice that you are missing material number as well, how do you match the item number in the PO ?

I don't see a way aroung without writing an ABAP program to handle this logic, but you can still use IDOC ( which comes with the standard processing logic and that is a big advantage ) so that you need to write only the PO matching logic.

or if you are not inclined to write a separate program for uploading file into SAP and formatting IDOC, you can write your own process code (FM)for INVOICE01. Inside this process code (FM), you can put your PO matching logic and then call standard FM (process code). This is what I usually do.

Cheers,

Sanjeev

Cheers,

Sanjeev

Former Member
0 Kudos

Hi Ralph;

I have had the distinct pleasure of implementing a very similar scenario! The answer to you question rests on how you want to bring the data into the system. If you want to bring an FI invoice, which you may be doing with you utility payments, then a standard IDoc is possible.

If, however, you want to post the freight charges on an MM-based invoice (against a PO line item) then you can not just do the freight charges on a standard IDoc. In that scenario, you would need to use BAPI_INCOMING_INVOICE_CREATE. You can still front-end all of that with an IDoc if you want to, you would just need to develop a custom inbound process code to process the data.

Cheers,

John

Former Member
0 Kudos

Hi Ralph,

1. If you are trying to post the idoc in the same SAP system, i wouldnt recommend an IDOC. esp when you have FMs and Bapi's to do teh same job for you.

2. If you still persist on going ahead with IDOCS, of if it is to a different SAP system, then here r some points.

As some other said, you will have to ahve an abap program to read the lines from text file and populate the idoc fields. Actual creation of idoc (outbound) and sending can be done by using standard SAP FMs. for eg, u can use master_idoc_distribute..

Similarly at the inbound, u will ahve standard FMs to post the idocs.

Reg,

Prabhu.