Skip to Content
author's profile photo Former Member
Former Member

Billing of pre-selected orders in a specific sequence


my customer uses manual data entry of sales orders with data he gets from a bunch of papers thus generating a lot of sales orders each day. When the time comes to bill these orders - one bill per order ⚠️ - of different content (customers, billing dates etc.), he selects them using a client specific report - depending on application oriented criteria - and wants them afterwards be billed in a background job / without any further user interaction in the sequence of the order numbers.

The reason for it is, that he has to check the printed bills with the bunch of paper he used for data entry of the sales orders and he has to add some of these papers to the bills to be sent out via mail afterwards.

So the sequence of both has to be the same for obvious reasons. The sequence of the bunch of papers is reflected in the sales order numbers, the sequence of the bills in the bill numbers. Bill numbers are generated internally thus depending on the sequence in which the sales orders were billed.

I tried VF06 giving it sales order numbers to be billed in the proper sequence. But it seems that VF06 sorts these orders first by bill date and/or customers thus destroying the order of sales orders.

Additionally I tried a couple of VF06 runs, one per sales order. But these runs are computed in parallel thus again destroying my preselected sequence. If I could change the job attributes of such a sequence ob VF06 jobs - one depending on the finishing of the prevoius one, this would solve the problem. But unfortunately the jobs are already "planned" so that I can't add a dependency between them after creation via VF06.

Does anyone has a good idea? Additions to my suggestions above? Or fresh and new ideas?

Thank you very much in advance.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 04, 2008 at 04:06 PM

    Hello Gerald,

    sounds like a quite curios process.

    The standard transactions (VF04/VF06) are more or less written to deal with mass processing, so i don't think you could influence them the way you need.

    If you need the invoices in the order of the ordernumbers, the only way is to book them one by one using VF01.

    You could use a background job if you write a little own program performing these steps:

    - selecting order-Number to be billed,

    - sorting them

    - calling vf01 for each order via call transaction

    ( with Update option 'S') .

    Make sure that this program can only run once in the system ( using an lock object).

    As a small solution that could work.

    A bigger (and better) solution would be scanning this 'bunch of paper', connecting the documents to the orders inside SAP.

    Regards Wolfgang

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Wolfgang,

      it seems that I've got the solution by my own after posting this question. My solution is a bit like your proposal with several VF01 jobs.

      I've done some code inspection of report RV60SBAT that is run during transaction VF06. There one or more jobs are created - and sveral steps for different customers depending on the selected values in the selection dynpro (number of customers per step).

      So I wrote my program collecting and sorting the orders to be billed, opened one background job and populated it with as many steps as I have orders - one step per order - running the same program SDBILLDL that is used in VF06. At the end I closed the job as usual.

      This works - thanks to the sequencing done by the steps - and produces bills with bill numbers in the same order as the sales order numbers. Unfortunately still the bills in the printer tray are not sorted in this sequence. But they are when I use synchronous mode in the SDBILLDL calls. So the problem is solved.

      Thank you for your answer.


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.