cancel
Showing results for 
Search instead for 
Did you mean: 

Chronicle order of credit or debit memos

Former Member
0 Kudos

I have a requirement in which we need to send the chronicle order of credit or debit memos against original invoice.

Basically we are sending all invoice data created in a day in SAP to legacy system.

As credit or debit memo can be created anytime in invoice life cycle, legacy wants that chrocle order of CM or DM.

e.g. we have 3 credit memos and 2 debit memos against one particular original invoice. We need to know whether any particular credit memo is first, second or third etc against original invoice.

Does this chronicle order of credit or debit memos get stored in any of the SD tables?

Any pointers to this will be highly rewarded.

Thanks,

Prasad

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks a lot Chandan. I appreciate your help.

You have got my requirement correctly, there is adjustment number field which is nothing but a chronicle order number (counter) of any CM/DM against original invoice which I need to send.

As I had said earlier this option of creating a Z table and getting the details accordingly has been there in my to-do list however wanted to check whether standard SAP maintains this chronicle order somewhere or not.

It's pretty straight forward that when we see the document flow from VF03, we get all the CMs/DMs associated with it but there is NO order in terms of numbers irrespective of CM/DM(e.g.first, second,third etc) maintained anywhere in SD/FI tables. It's all specific to CM or DM.

Lets see how things move on.

Prasad

Former Member
0 Kudos

Actual my requirement is more specific. Legacy doesn't maintain the classification of CM/DM as such of original invoice. It's just adjustment number against original invoice for them.

Chronicle order number should be irrespective of CM/DM which are there in VBFA.

As I am sending invoice data on daily basis, if any CM is created tomorrow for original invoice in SAP and lets say it's 4th one in all CM/DMs against that particular invoice then I should send adjustment # (chronicle order) as 4 considering that previous 3 CM/DMs data have already been sent.

I have one option of maintaining the data with this adjustment number and CM/DM# which has been sent to legacy in Z table however it will be unnecessarily a extra resourse and have to avoid.

Former Member
0 Kudos

Prasad,

Here's what I would do assuming I understood your question correctly. Write a piece of code in your program that saves the last run date and time somewhere in a Z table. Assuming your extract program runs at 11 PM everyday:

Invoice Created on Oct 01 4 PM

Program run on Oct 01 11 PM: Your program sends Invoice to legacy. Updates last run date and time as Oct 01 11 PM.

Dr. Note Created on Oct 02 4 PM

Program Run on Oct 02 11 PM: Program gets data from VBFA where VBELV= u2018Your Original Invoiceu2019 and ERDAT and ERZAT greater than last run date and VBTYP_N = u2018Credit or Debitu2019. This will get the Dr. Note for you to send to your legacy. Program will update last run date as Oct 02 11 PM.

Cr. Note Created on Oct 03 09 PM

Program Run on Oct 03 11 PM: Program gets data from VBFA where VBELV= u2018Your Original Invoiceu2019 and ERDAT and ERZAT greater than last run date and VBTYP_N = u2018Credit or Debitu2019. This will get the Cr. Note for you to send to your legacy. Program will update last run date as Oct 03 11 PM.

So, you need to change your program in such a way that it continues send original invoices to legacy and also pickup Dr. and Cr. Notes as explained above. This way the only change you will make is have a 2 column Z table for Program Name and Last run date/time.

I hope this helps! Even if this was not your exact question, I hope you can use something similar to achieve what you need.

Chandan

Former Member
0 Kudos

Prasad,

All documents that are linked are stored in a table called VBFA. This is the table that is used to display the document flow. You can use this table to get what you are looking for.

For example, open SE16 and type in VBFA table name. Input the Invoice number in the VBELV field and see the results that you are getting. You should see all the subsequent documents (your credit and debit) that were created with reference to the invoice and the date and time when they were created. Using the date and time you can tell the order.

Regards,

Chandan

Former Member
0 Kudos

hello, friend.

a possible solution to your requirement is to use table VBFA (document flow), and fields VBELV (preceding document, for example your invoice) and VBELN (subsequent documents, for example your CMs and DMs). when creating the report, you can enter your invoice numbers in field VBELV and search for VBELN = your CM and DM document numbers.

as to the order, it depends on whether you use internally generated document numbers. if so, then the document numbers can be displayed in your report in ascending or descending order. if the numbers are external (unlikely), then you may use the field for date (or even time).

the field for document types can also be a possible search filter, but the field name escapes me now. will try to get back to you with this.

regards.