Skip to Content
-3

Issue while inserting record in to z database table

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,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Aug 16, 2017 at 02:32 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 16, 2017 at 03:24 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 16, 2017 at 06:54 PM
    -1

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • avatar image
    Former Member
    Aug 16, 2017 at 07:29 PM

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

    Add comment
    10|10000 characters needed characters exceeded