bkkland
2nd February 2006, 20:45
I'm trying to assign a sales order nubmer but it's really not working...
I checked the first free number is 599. I have 4 records in my text file.
When I import it using Exchange scheme with conidtion, the result only shows the last record with sales order nubmer 2402. Why it's not 599???
I checked the log file, all 4 records are processed. That means the sale order was overwritten....how to fix this...please advise... :confused:
table ttcmcs047
if orno = 0 then
select tcmcs047.ffno
from tcmcs047
where tcmcs047.grno = 0
selectdo
return(tcmcs047.ffno)
tcmcs047.ffno = tcmcs047.ffno + 1
endselect
endif
return(orno)
mr_suleyman
3rd February 2006, 08:16
It is a bit strange problem. I think you should control your structure.May be In anywhere, you use tcmcs047 table twice in same time like (insert + read)
That is one posibbilty.There may be problem table's pointers.
Good LUck !
bdittmar
3rd February 2006, 10:37
Hello,
i'm missing the ordertype a.o. in your script.
Do the select based on the table structure of tcmcs047.
table ttcmcs047
if orno = 0 then
select tcmcs047.ffno
from tcmcs047
where tcmcs047._index1 = {tcckon.act.sls, number range}
and tcmcs047.blck = tcyesno.no
|where tcmcs047.grno = 0
selectdo
return(tcmcs047.ffno)
tcmcs047.ffno = tcmcs047.ffno + 1
endselect
endif
return(orno)
You have to select the sales order and the coressponding number range in sales order.
Check if blocked (tcmcs047.blck) is set to no for the selected numer range.
I hope this helps.
Regards
bkkland
3rd February 2006, 18:49
Thanks!!!
Yes, you're right. I didn't specify the type of number so it picked up the fire free number from Purchase order. Anyway, it picks up the right onw.
BUT....it still overwrite the number....
I have 4 records. I checked all 4 are processed but only the last one in the table. How can I make it increase by one?
Instead of 4 order numbers, it shows only one order number with 4 line items?????? It's supposed to be 4 orders with one line item each. :confused:
Please help!!! Thank you...
Darren Phillips
4th February 2006, 02:59
been down this route before creating planned deliveries, if you want to make life easier set the number yourself in the import file and create a new number series and use that, but block the number from use, blocking the number only stops you creating an order in that series using the session, the number can be used in an exchange import and can be maintained in the sessions.That way you don't have to worry about updating the free number and you always know which orders were manual and which were imported.
You may already be aware of this but just adding the sales header and line doesn't duplicate the sales order screen there is quite a bit of logic in that session, there are a lot of other tables that need to be updated. you maybe better off loading them via the edi module.
csecgn
5th February 2006, 00:20
Hi bkkland,
why you cannot use EDI? You've written in another thread it hasn't been your decission and that you cannot change it. In my opinion (and experience. We changed very much there) it needs much time and much more energy to re-program the order entry. And thats what you are trying to do. And, additional, with an unsuitable tool.
Maybe there is another way to do the job with exchange and without reprogramming the order-entry (i.e. loading the data in a temp. table and doing the order entry by AFS).
It is really difficult!
BTW:
You didin't update the tcmcs047 with the new value for the order number. I'm not sure with the commits in exchange, but try something like this
table ttcmcs047
domain tcorno ret.orno
if orno = 0 then
select tcmcs047.ffno
from tcmcs047 for update
where tcmcs047._index1 = {tcckon.act.sls, number range}
and tcmcs047.blck = tcyesno.no
|where tcmcs047.grno = 0
selectdo
ret.orno = tcmcs047.ffno
tcmcs047.ffno = tcmcs047.ffno + 1
db.update(ttcmcs047, db.retry)
endselect
endif
return(ret.orno)
This solution will not work 100%, because what about another user that enters an order at the same time? Or better, has occupied the number you want to get by exchange (we have had the problem...).
Look at include tcmcs0047, deal.first.free.order.number (not shure about the names, I would have to take a look at the source).
Regards
csecgn
toolswizard
6th February 2006, 20:38
By using a #pragma used dll statement you can use the tcmcsdll0004 Deal with First Free Number library. You can check the order series, get the first free number, rewrite and reset it. You must commit after rewriting the number, if you increment it, rewrite it, and read it for updating again, you will get an error.
bkkland
7th February 2006, 20:59
Now, I got the sales order number to work in tdslso40, but I still got error (record rejected) on tdsls041 and tdsls045. I import data for three tables in one batch.
How can the first free number apply to three tables? Can I refer the "orno" field on tdsls041 and tdsls045 to the result of "orno" condition field on tdsls040??? How???
Please advise...THANK YOU!!!