cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion of sales orders does not delete serial number assignment

rinrosglo
Explorer
0 Kudos
826

Hi,

I have created sales order using BAPI_SALESORDER_CREATEFROMDAT2 and then added serial numbers to it using SERNR_ADD_TO_AU and SERIAL_LISTE_POST_AU. Now the serial numbers are visible in VA03->extras->technical data, also an entry is added in SER02 table.

Now when I manually delete the sales order in VA02, though the sales order is deleted, the entry in SER02 remains.

Whereas if the sales order is created using VA01 with Serial numbers added and then when i delete the sales order in VA02, the corresponding entry in SER02 also gets deleted.

I am using SERNR_ADD_TO_AU as below. Any pointers on why the SER02 entry is not getting deleted and how the issue can be fixed will be very helpful. This logic is required to make sure multiple sales orders are not created for the same serial numbers.

Thanks in Advance.

CALL FUNCTION 'SERNR_ADD_TO_AU'

EXPORTING

SERNR = <sernr>

PROFILE = <marc-sernp>

MATERIAL = <mara-matnr>

QUANTITY = <quantity>

DOCUMENT = <vbak-vbeln>

ITEM = <vbap-posnr>

DEBITOR = <shipto>

VBTYP = 'C'

SD_AUART = 'KE'

SD_POSTYP = 'KEN'

I_BAPI = ' '

* IMPORTING

* ANZSN =

* ZEILEN_ID =

* SERIAL_COMMIT =

EXCEPTIONS

KONFIGURATIONS_ERROR = 1

SERIALNUMBER_ERRORS = 2

SERIALNUMBER_WARNINGS = 3

NO_PROFILE_OPERATION = 4

OTHERS = 5

.

View Entire Topic
ManojYadav
Explorer
0 Kudos

Hi rincyjoseph,

Did you get solution? I am also facing same issue.

Thank you,

Manoj.