Ejemplo n.º 1
0
  public void extractItemShipmentDetailSN1(Loop inLoop) throws OBOEException {
    Segment segment = null;
    // valid = false;
    try {
      segment = inLoop.getSegment("SN1");
    } catch (Exception exc) {
    }
    if (segment == null) {
      errorMsgs.add("Segment SN1 missing");
      setValid(false);
      return;
    }
    String shippedQtyS = getField(segment, 2, true, "Missing Number of Units Shipped");
    if (shippedQtyS == null) {
      errorMsgs.add("Number of Units Shipped is null");
      setValid(false);
      return;
    }

    int shippedQty = 0;
    try {
      shippedQty = Integer.parseInt(shippedQtyS);
    } catch (Exception exc) {
      errorMsgs.add("Invalid value of item shipped number: " + shippedQtyS);
      setValid(false);
      return;
    }
    ediInp856ItemVw.setShippedQty(shippedQty);

    String uom = getField(segment, 3, true, "Missing Unit (Basis) for Measurement Code");
    if (uom == null) {
      errorMsgs.add("UOM is null");
      setValid(false);
      return;
    }
    ediInp856ItemVw.setUom(uom);
    return;
  }