03-28-2006 3:20 AM
Hello:
The code: (S_NUMBER is sequence number)
SELECT
*
FROM <table>
INTO TABLE ITAB
SORT ITAB BY ZNUMBER.
LOOP AT ITAB.
S_NUMBER = ITAB-ZNUMBER.
ENDLOOP.
WA-ZNUMBER = S_NUMBER + 1.
WA-ZNAME = NAME.
WA-ZUSER_ID = ID.
CONCATENATE SY-DATUM SY-UZEIT INTO PTIME.
WA-ZTIME = PTIME.
INSERT INTO <table> VALUES WA.
When two person print different documents at one time.the printer work automatic,but S_NUMBER is same,and can not insert the wa into the table.
Hope someone can give me some helps.
Regards&Thanks
zagory
03-28-2006 4:59 AM
Hi zagory,
In your program you may need to lock your table when you update the record and unlock it back so that the database entries remain consistent.
See http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm for SAP Locking example.
Regards,
Wenceslaus.
03-28-2006 4:59 AM
Hi zagory,
In your program you may need to lock your table when you update the record and unlock it back so that the database entries remain consistent.
See http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm for SAP Locking example.
Regards,
Wenceslaus.
03-28-2006 5:10 AM
I believe that table locking would be "overkill." One of the many benefits of SAP is the ability to leverage it's client/server architecture INCLUDING it's table lock management.
I would suggest creating a number range in config.
Or if the actual number is not needed... just a unique value is needed... then I would suggest creating a GUID on the fly for uniqueness.