Unconfirmed line items getting deleted in SNC

I’m going to post this as the question and solution exchange I had over email with a fellow SNC Consultant. Hope it helps you if you have a similar issue:

The Issue:

Hello,

Need your help in understanding a strange issue we are facing in SNC.
PO confirmations sent from supplier backend system is deleting lines in the PO in SNC. For example, if the PO in SNC has 4 line items and supplier sends a PO confirmation (ROC_in XML) from his backend system for only one of those lines, the confirmation for that line gets processed successfully, but deletes the remaining 3 lines from the PO in SNC for which confirmations are not sent in the ROC_in XML. Therefore subsequent PO confirmations sent by supplier for the remaining lines fail.

Did you ever face this issue ? Any advice would be of great help.

The suggested Solution:

There is one possible explanation for this.

Note 1712211 says: SNC expects that all items of the Purchase Order are included in the ROC_in message, even those items that have cancelled status. This is a general design for handling XML messages. XML has to contain all items.

Ignore the cancellation reference. basically can you check if your inbound xml from supplier backend contains all items? That’s why its deleting the other items in SNC. Even if they are not confirmed, the items need to be in xml..

Resolution 
Provide all PO items to SNC, or Implement Badi /SCA/BIF_I_REPLORDC method after_conversion to add the missing items into the XML. Check Note 1712211 in service marktetplace.

The Response:

We implemented the BADI you mentioned below and it fixed the issue. Even if the partner sends only a sub set of line items we are able to process the confirmations successfully.

Supplier sends goods from multiple Ship-from locations

This is regarding the scenario where a supplier can supply goods from multiple ship from locations. Let me explain this using examples:

  • I have 2 vendors in ECC V1 50000000  and V2 50000005. Both are diff ship-from addresses for the same organization
  • I transfer both to SNC – where they create 2 locations (V1) 0050000000 and (V2) 0050000005
  • I assign them both to business partner 50000005
  • I now create a Purchase order in ECC to Vendor 50000000
  • I have already maintained transportation lanes for that material in both locations (V1) 0050000000 and (V2) 0050000005
  • I’m a user for BP 50000005. I should see this PO in my list
  • When the business partner does an Order Confirmation: He can confirm Qty, Date & Price. Location does not come into the confirmation schedule line. It is at Line item level
  • When the supplier does ASN (Shipping Notification) – he can create a separate ASN for each Ship from location quantity (in ASN Ship From is at header level)
  • I have a PO & Conf for 10 EA. I created one ASN of 6 for ship-from location 50000000 and another ASN for ship-from location 50000005 of 4 EA
  • The 2nd ASN gives errors because certain SNC validations need to be turned off. Once the below validation is turned off, it’ll allow 2 diff ASNs from 2 diff Ship From locations
SHIP_FROM_LOC_MATCH_PO Ship-From Location in ASN Header Matches Ship-From Location in PO The ship-from location in the ASN and the ship-from location in the purchase order are the same.

Critical points to remember:

  • When vendors are CIF’ed to SNC – select option “Create locations” – you can manually create a BP and assign to both. Since the 2nd BP is superflous
  • Maintain the material’s transportation lane for both vendor locations to plant
  • Turn off ASN Validation SHIP_FROM_LOC_MATCH_PO

Hope that helps.

Tolerances in PO Confirmation with Approval

This is a bit of a doh! moment for me  – but I thought it deserves a mention since its not mentioned anywhere in black & white

For PO Confirmation with Approval process:

  • You use Consensus rules to set tolerances if you want any tolerance other than zero – based on which PO Confirmation will go for an approval
  • You use the PO Under/Over delivery tolerances for ASN quantity tolerance checks

On Supplier Confirmation – RON_Out XML is published even though there are no changes

When the supplier posts a confirmation through the WebUI, a ReplenishmentOrderConfirmation_Out message is generated which carries the confirmation information. When the supplier makes confirmation changes, ReplenishmentOrderNotification_Out message is also generated to carry the PO changes to ECC and modify the ECC PO.

However when the supplier makes no confirmation changes, the RON_Out is still generated and is superfluous.

Solution:

With validation check PO_PUBLISH_CHANGED_ITEMS_RON only PO items which were changed (request quantity, request delivery datetime, requested components) are published via ReplenishmentOrderNotification XML to the customer backend. Make validation check PO_PUBLISH_CHANGED_ITEMS_RON “ACTIVE “ in IMG > Supply Network Collaboration > Basic Settings > Validation > SAP Standard Settings > Display Settings for Standard Validation Profiles

Published ASN from WebUI does not generate DDN_Out XML.

When using SNC 7.0 (702) and running PO Collaboration – When you publish an ASN via the WebUI – it shows as published successfully but there is no DDN_Out xml generated. You get a POSTING_ILLEGAL_STATEMENT ABAP dump instead in GUI.
If  you then execute /N/SCA/DLV_PUBLISH – it publishes the DDN_Out successfully. But you are unable to do it via the WebUI.

The short dump occurs at the “commit” statement. The Short dump details are:
Category : ABAP Programming Error
Runtime Error : POSTING_ILLEGAL_STATEMENT
ABAP PRogram : SAPLSYDB
Application Component : BC-DB-DBI
Keywords suggested in dump:  “POSTING_ILLEGAL_STATEMENT” ” “/ “SAPLSYDB” or “LSYDBU27” / “DB_COMMIT”

Solution: 
The Short Dump occurs due to error in generation of Time Stream IDs associate with the Inventory Alerts.
Execute the report /SCA/INVALERTSWRITE once in dialog mode (Use any Location  / Product in selections) and try publishing the ASNs again.

RON_In Delivery Date error

When running PO Collaboration, the PO sent from ECC fails inbound to ECC due to Delivery Date format. This is a common issue with PO Collaboration and is solved easily using SAP Note 888599.

Note 888599 – Section 2(a)

When you use the PORDCR102 IDoc (as of SAP ERP 2005) for the purchase order integration, the following symptoms occur:
a) Message processing in SAP ICH or SAP SNC inbound terminates with an error during the conversion of the delivery date.

Reason and Prerequisites

The delivery date transferred in the PORDCR102 IDoc does not correspond to the external standard.

Resolution:

Call transaction SE19 and create an implementation of the ES_BADI_ME_BAPI enhancement spot for the ME_BAPI_PO_CUST BAdI definition. Copy the example code contained in the ‘BAPI_Outbound.txt’ attachment to the IF_EX_ME_BAPI_PO_CREATE_02~OUTBOUND method. Save and activate the method. Copy the example code contained in the ‘BAPI_Inbound.txt’ attachment to the IF_EX_ME_BAPI_PO_CREATE_02~INBOUND method. Save and activate the method. Activate the BAdI implementation.

BAPI_Inbound.txt:

DATA: lv_delvdat LIKE syst-datum.

FIELD-SYMBOLS: <ls_schedule>  TYPE bapimeposchedule,

<ls_schedulex> TYPE bapimeposchedulx.

* convert internal to external format

LOOP AT ch_schedule ASSIGNING <ls_schedule>.

IF NOT <ls_schedule>-delivery_date IS INITIAL.

lv_delvdat = <ls_schedule>-delivery_date.

CALL FUNCTION ‘PERIOD_AND_DATE_CONVERT_OUTPUT’

EXPORTING

internal_date   = lv_delvdat

internal_period = ‘1’

IMPORTING

external_date   = <ls_schedule>-delivery_date

external_period = <ls_schedule>-del_datcat_ext.

IF sy-subrc <> 0.

ENDIF.

ENDIF.

ENDLOOP.

* adjust X-structure

LOOP AT ch_schedulex ASSIGNING <ls_schedulex>.

<ls_schedulex>-del_datcat_ext = ‘X’.

ENDLOOP.

BAPI_Outbound.txt

* Conversion of delivery date to external standard
  DATA: lv_delvdat LIKE syst-datum.

  FIELD-SYMBOLS: <ls_schedule> TYPE bapimeposchedule.

  LOOP AT ch_schedule ASSIGNING <ls_schedule>.

    IF NOT <ls_schedule>-delivery_date IS INITIAL.
      CALL FUNCTION 'PERIOD_AND_DATE_CONVERT_INPUT'
        EXPORTING
          dialog_date_is_in_the_past = space
          external_date              = <ls_schedule>-delivery_date
          external_period           = <ls_schedule>-del_datcat_ext
        IMPORTING
          internal_date              = lv_delvdat
        EXCEPTIONS
          error_message              = 1.

      IF sy-subrc EQ 1.
      ENDIF.

      <ls_schedule>-delivery_date = lv_delvdat.

    ENDIF.

  ENDLOOP.

* The partner role with table POPARTNER is language dependent.
* The ICH integration expects that the partner role is submitted
* in the ERP internal format.

    DATA: lv_parvw TYPE parvw_unv.
    FIELD-SYMBOLS: <fs_popartner> TYPE bapiekkop.

    LOOP AT ch_popartner ASSIGNING <fs_popartner>.

      SELECT SINGLE parvw INTO lv_parvw FROM tpaum
                          WHERE spras = <fs_popartner>-langu AND
                                pabez = <fs_popartner>-partnerdesc.
      IF sy-subrc = 0.
        <fs_popartner>-partnerdesc = lv_parvw.
        <fs_popartner>-langu       = 'D'.
      ENDIF.

    ENDLOOP.

PO Collaboration with Approval – SAP PI implications

For Purchase Order Collaboration with Approval PORDCR1.PORDCR102 Idoc is used.

In SAP PI, PORDCR1.PORDCR102 Idoc comes under the Contract Manufacturing Purchasing Process in SAP PI and not under the Purchase Order Processing process.

Contract Manufacturing Purchasing Process covers two processes:

  1. Purchase order collaboration with contract manufacturing
  2. Purchase Order collaboration with approval

PORDCR1.PORDCR102 Idoc is mapped to ReplenishmentOrderNotification in SAP PI.

PO Collaboration for Text Item POs

This is regarding Po with text item – having no material numbers. These type of POs are normally used for non-stock materials

POs having no material numbers fail in SNC since SNC validations find the material missing.

There are 2 ways to deal with this:

Make the following checks invalid for validation profile:

  1. PO_PRODUCT_ID INVALID
  2. PO PRODUCT_ID_MISSING

The issue with this solution is that you effectively increase the risk of POs for stock materials  successfully transferring to/processing in SNC even if those materials are not maintained in SNC for that vendor

Using a dummy product code in SNC

  1. Create a dummy material code in SNC
  2. Change mapping to PI to replace blank material field in the PO with this dummy material code while transferring the PO to SNC

Change Profiles and Approval Profiles

Change Profiles:

If SNC does not allow the supplier logged in to go into change mode in the Purchase Order it means no Change Profile has been assigned to that vendor.

Change profiles are assigned here: SAP Supply Network Collaboration –> Supply Network Collaboration –> Purchase Order –> Current Settings –> Assign Change Profiles for Purchase and Replenishment Order Items

A change profile can be assigned for a combination of Customer & Supplier. It can be assigned for a Customer alone – thereby making it applicable for all suppliers.

While defining a Change profile ( SAP Supply Network Collaboration –> Supply Network Collaboration –> Purchase Order –> Current Settings –> Create Change Profiles for Purchase and Replenishment Order Items) – you basically define whether the profile has Display only access or not for the following parameters:

  • Order Document Type
  • Distribution Status
  • Distribution Status for Changes
  • Item Status

Approval Profiles

Approval Profiles define the rules for manual or automatic approval requirement for a customer/ supplier or product.

Approval Profiles are created to define the rule for:

  • Approve Confirmations Automatically or Manually
  • Approve Components for Subcontracting scenario – Approve Deviation Manually/ Approve Automatically/ Approve New component Manually
  • Rule for MPN Confirmations
  • Rule for Price Confirmation

These profiles are assigned to a Customer, Supplier, Product or any combination of these