BW: Sid conflict: Problem description and handling by greed_zy

Source: Internet
Author: User

Problem 1:

When 0coorder is used to upload data, a Sid conflict is prompted. (For errors, see problem simulation)

Problem 2:

An error is prompted when DSO is activated.

The error log is as follows:

Cocould not enter feature 410000278286 with Sid 3775474 into Table/bi0/scoorde

Search in the s table and find that this Sid is occupied:

Problem Analysis:

In the program that manually creates an order, use the ABAP code to calculate the maximum value of the current Sid, and Add 1 to the s table of 0coorder. During data loading, SAP calls the system's number range object (the number pool) to obtain the number and assign it to the SID.

In this case, the ticket number created manually occupies a Sid, which is unknown to the system. The SID is determined based on the number pool status. That is to say, the Sid used during system loading is occupied by manual orders.

Problem simulation:

Next we will simply simulate this process:

  • Tcode: snro

    Bim1_394 (this can be obtained through the search description in table: tnrot)

    First, let's look at the current encoding:

    When SAP uploads data, it updates the status of the encoding stream. This status is 750128.

  • Tcode: Z100

    When creating an order, manually write 0 coorder, take the maximum value of Sid, and Add 1.

    The related code is as follows:

    Select single max (SID) from/bi0/scoorder into l_scoorder-sid

    Where coorder <> ''.

    L_scoorder-sid = l_scoorder-sid + 1.

    L_scoorder-coorder = p_order.

    Insert/bi0/scoorder from l_scoorder.

    After filling in z00112010022, we can see that the current encoding in the number pool is still 750128, and in the s table, the SID value 750129 is occupied.

  • Tcode: rsa1

    We simulate the ETL of SAP, mainly to test how the s table handles the issue of SID occupation when DTP extracts data from PSA to 0coorder.

    Table:/bi0/scoorder

    First, we create three new data items in PSA of the z_coorder data source.

    Upload DTP later, and an error is prompted:

    Then, we checked the records in the s table and found:

    At 111111111117, we found that the SID was occupied and skipped the data and reported an error. 111111111118 and 111111111119 are successfully added.

    PS: we followed the current 0coorder P table and found that there are no newly loaded data. However, two records have been filled in the s table.

    The current status of the number range object is 750131.

    Load DTP again. Upload successful.

    The problem is solved as follows:

    When loading DTP again, the system searches for the p table and finds that the data does not exist. Then, it applies for three Sid IDs. At this time, the number pool number is 750134, this loading only adds a record in the s table, 111111111117, and its Sid is 750132. In this case, a hop occurs. That is to say, as long as the SID is occupied, the system will continue to apply for the SID. If the requested data volume is large enough and exceeds the SID entered manually, no error will be reported during the upload.

    This is why a DTP upload error occurs and the upload succeeds again.

    PS: the data in Table P exists.

    Solution:

    Using the system standard function, you can directly retrieve the data in the number pool to avoid Sid conflicts.

    The related code is as follows:

    Call function 'Number _ get_next'

    Exporting

    Nr_range_nr = '01'

    Object = 'bimparts 394'

    Importing

    Number = l_scoorder-sid.

    PS: if the data is manually entered at the same time as the data uploaded by the system, you may obtain the same number. You can also use the 'number _ range_enqueue 'and 'number _ range_dequeue' of the system to solve the problem.

    The related code is as follows:

    Call function 'Number _ range_enqueue'

    Exporting

    Object = 'bimparts 394'

    Exceptions

    Foreign_lock = 1

    Object_not_found = 2

    System_failure = 3

    Others = 4.

    Case sy-subrc.

    When 1.

    Message e024 (NR ).

    When 2.

    Message 'object _ not_found 'Type 'E '.

    When 3.

    Message 'System _ failure 'Type 'E '.

    When 4.

    Message 'others' type 'E '.

    Endcase.

    If sy-subrc EQ 0.

    Call function 'Number _ get_next'

    Exporting

    Nr_range_nr = '01'

    Object = 'bimparts 394'

    Ignore_buffer = 'X'

    Importing

    Number = o_int.

    Call function 'Number _ range_dequeue'

    Exporting

    Object = 'bimparts 394'

    Exceptions

    Object_not_found = 1

    Others = 2.

    Endif.

    In this way, when a program uses this number pool, an error is reported:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.