Skip to Content
avatar image
Former Member

Inbound Idoc ORDCHG for Rejecting sales order Line

I am trying to reject/cancel a sales order line with an Idoc ORDCHG passing Action Code '003'(Cancel a line) in E1EDP01 item segment and ABGRU value and the IDoc passed but it is not updating the sales order line with the reason code . Then I tried passing 002 in Action (Change a line) then it added a new line with reason code but did not do any changes to the original line I am trying to update. Can anyone has any idea what else I can do to achieve this result?

action-002.png (30.0 kB)
action-003.png (28.4 kB)
addednewline.png (23.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 19 at 01:18 PM

    Hi Hema

    It will create a new item IF it cannot recognise the line item you are trying to change - basically the POITEM. Check the PO item field (POSEX not VBAP-POSNR) to see if you can use this in the idoc. I tried several variations of this idoc and did not manage to get it working. A clue is to reference the PO number (BSTNK) but I could not pinpoint the exact idoc segment where I could reference this but at least provides you with more info to go on. I am close so will try again over the coming days to see if I can sort it out.

    Where there is a will there is a way! Should not be this difficult though!

    Stay Tuned!

    Thanks

    Phil Cooley

    Add comment
    10|10000 characters needed characters exceeded

    • Agree. I did try a large amount of scenarios to get this to work and really should not be that difficult. As you say, the doc number (VBELN) and item number (POSNR) should be sufficient as this is unique to identify the correct order to change. Will try again soon to see if I can get this to work.

  • Apr 18 at 03:11 PM

    I haven't dealt with this specific scenario on practice but your option with 002 (Change) looks OK and I'd expect it to work. It's really odd that it adds a new line. I'd just make sure to have the correct line number and also try to remove any other data (WERKS and MATNR here) from the segment. You could use debugger to see what's happening with the data.

    Make sure to check for SAP Notes (maybe ANST transaction can help if you run IDoc in foreground?). If all else fails, I'd contact SAP Support.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 28 at 08:02 AM

    OK Former Member found out the solution. I was seriously close before. Last time I populated the item number with 1 (as the PO item field on the line item contained 1) however it is a CHAR 6 field so should be 000001. When I populated this it worked.

    So - to get this fully working you need to populate the following segments and contents.

    E1EDK01 - fill ACTION field with '003'

    E1EDK14 - create 3 segments each with

    • QUALF = '006' for Division and ORGID = Division code value from sales order (VBAK-SPART)
    • QUALF = '007' for Distribution Channel and ORGID = Distribution Channel value from sales order (VBAK-VTWEG)
    • QUALF = '008' for Sales Organisation and ORGID = Sales org value from sales order (VBAK-VKORG)

    E1EDKA1 - fill with PARVW = 'AG' for Sold-to party AND PARTN = Sold-to party customer number from sales order.

    E1EDK02 - fill with QUALF = '001' AND BELNR = Sales document number you wish to change AND POSNR = VBAP-POSEX. I have provided screenshots. Even though the Item number (POSNR) is '000010' the PO Item field contains 1 (or '000001'). This needs to be passed back in so that it finds the correct item number to reject.

    E1EDP01 - fill with POSEX = VBAP-POSEX (from original order) in my case for the example it is '000001' AND ACTION = '002' AND ABGRU = 'Z2'

    Underneath the E1EDP01 (child) populate segment E1EDP19 with QUALF = '002' and IDTNR = material number (of the item number) you are rejecting.

    If you populate all of these segments it will reject the item as you can see in my screenshots.

    Segments you need in the idoc.

    Key segment where POSNR = POItem field (POSEX) value. BELNR is the sales order you are changing.

    Key segment where POSEX = POItem field (VBAP-POSEX) value. This is a CHAR 6 field so even though it shows as 1 in the sales order entry screen it is in fact populated as 000001.

    You can see below item 10 (or POItem 1) has been successfully rejected. You can see my previous try on item 40 (where it added an item to the order!).

    If you follow the population guide you will succeed.

    Thanks

    Phil Cooley

    Add comment
    10|10000 characters needed characters exceeded