Create Multiple Documents inside one Journal Entry Batch

Rauf

VIP Member
I could create one batch and one document for a custom payment module(using NER). The custom payment module have different kind of categories. So for a specific date and category, I create one batch and one document inside the batch.
This logic create too many batches.

Now, I need to create one batch per date. Each payment category for the date should come as a document inside the batch.
How can I do this ? If I get some standard report, I can dig through and duplicate the logic.
 

wendyfnc

Member
There are some built in business functions that handle journal entry creation. B8300010 is one of them, and it has three function names inside of it: CreateJEInitializeSection, CreateJEDOVariable, and CreateJEEndSection. Every time you run the report, it will just create one batch with multiple Journal Entries inside it. (And if you need a journal entry with multiple lines, you can call CreateJEDoVariable again and again before calling CreateJEEndSection too.)
 

peterbruce

Legendary Poster
Raul,

The R04110Z2 may provide some information for you. As you probably know it creates payment vouchers from entries in the F0411Z1 and the F0911Z1.

To allocate documents to the same batch, all you really need to do is populate the batch columns in all the payment voucher transaction detail rows in the F0411 and the F0911 with the same batch number and type. If you use the batch totals and other detail in the batch header you will need to calculate the values and populate the batch header in the F0011. All this can be done manually or via the appropriate business functions (which you may already be using).
 

Rauf

VIP Member
Thanks Peter and wendyfnc,

The main issue with my logic is...
1. I generate batch number using X0010 - Get Next Number
2. Save to draft temporary table.
3. Call F0911 Begin Document. This generates new document number. Then call F0911 Edit Line.

So the step 3 creates one document for one batch.

Now, I have a temporary document number in the draft table.
I will group all the transaction for a date in one batch with temporary group number.
But how will I tell F0911 Begin Document to process the documents in the passed batch number :-( ?
 
Discover how to build no-code data integrations and business process automations.

johndanter

Legendary Poster
I'll add the text ER print out of one of my UBEs here.

It reads through a cardex tag file and creates GL entries based on consumption for certain LOTs.
So each LOT gets it's own DOC within the whole GL batch

Look in the On Lot/SN Section
Line 138 X0010 Get Next Number
Line 150 F0911 Begin Doc
Line 180 Edit Line (plus a few others depending on the AAI it goes to)

Line 362 End Doc
Line 363 Delete workfile

So you would need to have an index on the date and category you need. Select - Fetch Next in that loop and when it breaks call the relevant BSFNs above
 

Attachments

  • R5541110.txt
    111.3 KB · Views: 39
Last edited:

peterbruce

Legendary Poster
Rauf,

You should be able to use the first run of F0911 Begin document to create the batch and retrieve the batch number returned by F0911 Begin document. Then use the same batch number in subsequent calls to F0911 Begin Document. Entering it instead of retrieving it.
 

Rauf

VIP Member
Hi Peter,

I could create multiple documents inside a batch.

Now, I have a related request and I'm doing with the below functions,

F0011 Open Batch ( In report header)
F0911 Begin Document ( In Company Header)
F0911 Edit Line ( for debit) ( In Details Section)
F0911 Edit Line ( for credit) ( In Details Section)
F0911 End Document ( In Company Footer)
F0911 Delete work File ( In Company Footer)

This will give one batch, one document per company.

Am I in the right track ?

I could generate one batch and one document for detail section, which will create too many documents.
 

peterbruce

Legendary Poster
Rauf,

Without going into your UBE detail (Section data selection and sequencing), "on the surface" it seems OK. I haven't worked with these business functions for some time. Don't forget to close the batch. As with all development - test, test, test.
 
Top