Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue while inserting record in to z database table

former_member244346
Participant
0 Kudos

Hello Experts,

I have an issue while inserting data in to z database table. one z table using inside function module and that function module type is RFC fm and that table key field is sequence. So in source code logic is there like first we are checking highest entry of sequence field then in loop we are increasing that sequence field count and passing remaining field data to workarea along with count value and then inserting workarea data to z table. So in first loop suppose we increased count as 10 and inserted then second loop count will be 11 but before inserting fm is type RFC so entries will inserting from PI system 11 sequence number, so when here we are inserting again its giving dump.

Anyone can help me on this how to handle this issue.

Thanks,

1 ACCEPTED SOLUTION

pokrakam
Active Contributor

Use a number range object, it's the standard way to do numbered keys.

8 REPLIES 8

pokrakam
Active Contributor

Use a number range object, it's the standard way to do numbered keys.

0 Kudos

Hi Mike,

Thanks for your comment.

Can you give one one example, really i am not getting.

Thanks,

pokrakam
Active Contributor

UweFetzer_se38
Active Contributor

Or use GUIDs if you don't need numeric keys.

jagannatha_pucha
Explorer
0 Kudos

if my understanding is correct, sequence number is determined and sent from PI. if yes, then ignore that and always read the highest number in RFC FM and increment in each loop.

you cannot have the sequence determination at 2 different systems.

0 Kudos

So you have a system telling 124 and the backend ignoring it and putting 215.

Data consistency?

0 Kudos

Hi Jagannatha,

Your understand is correct, but already (sequence number is determined and sent from PI. if yes, then ignore that and always read the highest number in RFC FM and increment in each loop.) this logic is there inside this fm and that fm is a RFC fm. But if you read my post i have clearly mentioned there while second loop time what sequence i am incremented same sequence number already was there in table before inserting my logic and same way i tried in my quality system there i am getting sy-subrc = 4 not dump. Can you help me on this.

Thanks.

Former Member
0 Kudos

is the Z table available in target system?what message u are getting in dump..did u activate external debugging.