on 08-24-2023 7:19 PM
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
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Juan and Raymond for your response.
Yes BDC will be an option I might have to use. But before that I am trying to figure out if the BAPI approach can be made to work.
During my several tries when I passed I_BAPI = 'X', it worked the first time. Then later when I passed I_BAPI = ' ' and again I_BAPI = 'X' (basically to confirm my finding) the SER02 table clearing did not work. I am not clear on the internal memory usage of the function group and the parameter I_BAPI usage. Any light on this would be very helpful.
Thank you.
User | Count |
---|---|
97 | |
8 | |
6 | |
6 | |
5 | |
4 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.