11-20-2007 6:22 PM
Hi folks,
I'm using a batch input on FB60 so as to generate a parked invoice. Furthermore, I'm calling it in complex posting 'cause sometimes it implies posting on asset (posting keys 70 and 75).
The point is that the batch input works fine, but sometimes in the exact same situtation, with non rationnal explanation.
I'm using this :
sl_bdcoption-dismode = 'N'.
sl_bdcoption-racommit = 'X'.
sl_bdcoption-nobinpt = 'X'.
sl_bdcoption-updmode = 'L'. " or A or S, still the same
CALL TRANSACTION 'FB60' USING tl_bdcdata
MESSAGES INTO tl_messtab
OPTIONS FROM sl_bdcoption.
COMMIT WORK AND WAIT.
so that I can catch the number of my created invoice from the message table. Indeed I need this to update BKPF which has some custom fields (on the Basis Data tab). All the transactional controls on my custom fields are deactivated through an Export to Memory and I know how the screen displays with the option sl_bdcoption-nobinpt = 'X', both set before the call.
First I thought my bug was coming from the Update Mode in structure sl_bdcoption, but I've tried to set it to A, S or even L. I've tried many options from that structure, but the bug remains random...
How can I be sure that the call is ended and that my new invoice is created ?
Any oher way I can do this ? Any BAPI I haven't found ?
Thx in advance for your help,
NH
11-20-2007 6:47 PM
11-20-2007 6:47 PM
11-20-2007 7:49 PM
Hi Rob,
thx for the advice, but I'm not sure how I can lock (ENQUEUE, right ?) the record since it doesn't exist before the call: inside the call transaction ?
Actually, the message table from the call sometimes is half empty, as if the caller programme has continued his job too fast. But I'm not sure that's the way it works.
Hence the message line I get the belnr from seems not to exist sometimes.
NH
11-20-2007 7:56 PM
If the table is not complete, then that should be the probelm. I've never seen a case where it didn't include every message it wanted to. Run it in E mode for a situation where this normally arises.
As for locking - I'm not sure how SAP handles locks on BKPF when documents are created. But if the document number comes back, you might try locking and unlocking (with _WAIT = 'X').
Rob
11-20-2007 8:23 PM
Thx, I'll try the E mode. I hope it will solve that issue, it's driving me mad
Actually, even if the context I'm using the Batch Input seems complex, due to the complex posting, the invoice I generate in that particular program is quite simple.
I was hoping that someone has already saw that table half empty
Do you think it may come from the exit in FI used to add some custom fields on the 'Basis Data' tab ?
NH
11-20-2007 8:26 PM
Good question - I have no idea. Does it work correctly for a manual process?
Rob
11-22-2007 10:04 AM
Hi Rob,
Indeed it works fine manually. Well, I've set the Batch Input mode to E, I hope I will see why someone has troubble again when the issue occcur.
Thx for your time, I'm closing the point, since it's abnormal to have the message table not entirely filled in.
NH