2007 Nov 20 3:23 PM
Hi everyone,
We have a requirement where we need to get the next FI document (BKPF-BELNR) that will be generated when we post a document in MIR4.
Someone can help me we this?
Thanks in advance.
Regards,
Leo.
2007 Nov 20 3:36 PM
Hi,
Please check FM MRM_INVOICE_NUMBER_GENERATE.
This FM is used FM NUMBER_GET_NEXT to get next document number.
Regards,
Ferry Lianto
2007 Nov 20 3:42 PM
Hi Ferry,
Thanks for your answer. I tried this FM but it didn't work. Also, this FM doesn't use BKPF table.
Do you know another FM that works with BKPF table?
Thanks again for your help.
Leo.
2007 Nov 20 3:38 PM
Try with this:
DATA: L_BELNR LIKE BKPF-BELNR.
SELECT MAX( BELNR )
INTO L_BELNR
FROM BKPF
WHERE GJAHR = SY-DATUM+0(4)
AND AWTYP = 'RMRP'. "<< reference type for Invoices
WRITE: L_BELNR.
L_BELNR = L_BELNR + 1.
WRITE: / 'new', L_BELNR.
Regards,
Naimesh Patel
2007 Nov 20 4:00 PM
Hi,
Please try FM NUMBER_GET_NEXT with object RF_BELEG.
Regards,
Ferry Lianto
2007 Nov 20 6:18 PM
Hi Ferry,
I tried to run this FM, but I don't know how I have to complete the others parameters:
NR_RANGE_NR =
OBJECT = RF_BELEG
QUANTITY =
SUBOBJECT =
TOYEAR = 2007
IGNORE_BUFFER =
Can you tell me this?
Thanks.
Leo.
2007 Nov 20 4:34 PM
Sorry, but i have a similar problem, how i get the FI DOC. number after SAVE with trans. MIRO ?
I'm working with MM (trans MIRO) when i SAVE i need to execute a Program, but the parameters contains the FI DOC. how i take it??? because isnt created yet.
thanks in advence. SK
2007 Nov 20 6:42 PM
Hi,
It depends on how the FI document number range setup in your system (transaction SNRO). You can try something like this ...
NR_RANGE_NR = '01'
OBJECT = RF_BELEG
QUANTITY = '1'
SUBOBJECT = '0001'
Regards,
Ferry Lianto