コード例 #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();
  }