Application Development and Automation 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: 
Read only

Issue while inserting record in to z database table

Former Member
0 Likes
1,838

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
Read only

pokrakam
Active Contributor
1,635

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

8 REPLIES 8
Read only

pokrakam
Active Contributor
1,636

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

Read only

Former Member
0 Likes
1,635

Hi Mike,

Thanks for your comment.

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

Thanks,

Read only

pokrakam
Active Contributor
0 Likes
1,635
Read only

UweFetzer_se38
Active Contributor
1,635

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

Read only

jagannatha_pucha
Explorer
0 Likes
1,635

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.

Read only

0 Likes
1,635

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

Data consistency?

Read only

0 Likes
1,635

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.

Read only

Former Member
0 Likes
1,635

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