Esempio n. 1
0
  public VtiUserExitResult execute() throws VtiExitException {

    VtiUserExitScreenField scrPurchOrd = getScreenField("EBELN");
    if (scrPurchOrd == null) return new VtiUserExitResult(999, "Failed to initialise EBELN.");

    long offEbeln = 0;

    try {
      offEbeln = getNextNumberFromNumberRange("YSWB_OFFPO");
    } catch (VtiExitException ee) {
      Log.error("Error creating next Slip No.", ee);
      return new VtiUserExitResult(999, "Unable to generate offline Purchase Order.");
    }

    scrPurchOrd.setFieldValue(Long.toString(offEbeln));

    return new VtiUserExitResult();
  }
Esempio n. 2
0
  public VtiUserExitResult execute() throws VtiExitException {
    VtiUserExitScreenField scrWFSalesOrd = getScreenField("VBELN");
    VtiUserExitScreenField scrWFPurchOrd = getScreenField("EBELN");
    VtiUserExitScreenField scrFTruckReg = getScreenField("REGNO");

    if (scrWFSalesOrd != null)
      if (scrWFPurchOrd != null)
        if (scrWFPurchOrd.getFieldValue().length() == 0
            && scrWFSalesOrd.getFieldValue().length() == 0)
          return new VtiUserExitResult(
              999, "Please select, do not type, the correct registration number.");
    if (scrFTruckReg == null) return new VtiUserExitResult(999, "Failed to initialise TRUCKREG.");

    if (scrFTruckReg.getFieldValue().length() <= 2)
      return new VtiUserExitResult(999, "Please select, the correct registration number.");

    return new VtiUserExitResult();
  }