2019 Sep 05 7:27 AM
Hello Guru's,
I have a function module having update statement, and i tried to execute the same FM from 2 sessions by keeping breakpoint at update statement.
In first session record updated in table, for second session sy-subrc = 4, since there is same record available in table.
for second session also record should be inserted into table with count increasing(we have count field in table as keyfield)
Actually i have taken two sessions as example, in real time there are N number of sessions...
Could any one give effective solution.... i dont want to miss any record.
Many Thanks,
Praneeth Ch.
2019 Sep 05 9:36 AM
Hi,
is the table being locked for editing in your first session? This might explain why the second session is not able to create new data.
2019 Sep 05 10:17 AM
Hello Mahesh,
I have time stamp as well. At particular time i.e., assume 11:00:00 around 10 records are inserting some time, and yes i have requirement to make count as key field.
Thank you for response.
2019 Sep 05 11:51 AM
Praneeth Chintapalli, I still don't recommed to use the count as the key field. another best option for you is to use the number range:
https://wiki.scn.sap.com/wiki/display/ABAP/How+to+Create+you+own+Number+Range++SNRO
Tip: You can click on comment and reply to answers instead of posting a new answer.
Thanks,
Mahesh
2019 Oct 04 12:07 PM
2019 Sep 05 1:41 PM
I would suggest you to use the GUID as the key fields to do this. you don't need to worry anymore about the count of these records and anyways you wil have the timestamp to find out which is the latest inserted data. Even most of the SAP applications follow this, using count is not very reliable in these parallel session scenarios.
Or you have any business requirement to have count as the key?
Update:
Praneeth Chintapalli, I still don't recommed to use the count as the key field. another best option for you is to use the number range:
https://wiki.scn.sap.com/wiki/display/ABAP/How+to+Create+you+own+Number+Range++SNRO
Thanks,
Mahesh