示例#1
0
  public boolean test() {
    // Have a bash...
    FunctionHandler functionHandler2 = null;
    try {
      // Maintain
      System.out.println("--------------------------- MA1");
      functionHandler2 = FunctionToolboxStub.getFunctionHandler(user, "SESSIONID", "");
      functionHandler2.doNewTransaction("MA1", "");

      FunctionData functionData2 =
          functionHandler2.getFhd().getScreenSetHandler().rtvScrnSetCurrent().getFunctionData();

      functionData2.chgFieldInputValue("MAB_AB", "0000");
      functionData2.chgFieldInputValue("MAB_AN", "0000001");
      functionData2.chgFieldInputValue("MAB_AS", "001");
      functionHandler2.applyRetrieveTransaction();

      functionHandler2.applyTransaction();

      Toolbox.printList(functionHandler2.print());
      FunctionToolboxStub.printMessages(functionHandler2.rtvFunctionMessages().getMessages());

      JournalHeader journalHeader = functionHandler2.getFhd().getJournalHeader();
      if (journalHeader != null) {
        System.out.println("Journal 2=" + journalHeader);
      } else {
        System.out.println("Journal 2=" + "ERROR");
      }

      return (journalHeader != null);
    } catch (Exception e) {
      e.printStackTrace();
      return false;
    } finally {
      cleanUp();
    }
  }
  public boolean test() {
    // Have a bash...
    FunctionHandler functionHandler = null;
    try {
      System.out.println("------------------------------- 1");
      functionHandler = FunctionToolboxStub.getFunctionHandler(user, "SESSIONID", "");
      functionHandler.doNewTransaction("RLX", "");
      FunctionData functionData =
          functionHandler.getFhd().getScreenSetHandler().rtvScrnSetCurrent().getFunctionData();

      String LNR =
          Toolbox.formatDate(Calendar.getInstance(), Toolbox.TIMESTAMP_FORMAT)
              .replaceAll(" ", "")
              .replaceAll(":", "");
      String LNR2 = LNR.substring(LNR.length() - 13);

      if (externalInputTest) {
        LNR2 = "7.08150344998";
      }

      functionData.chgFieldInputValue("LNP", "CR2");
      functionData.chgFieldInputValue("LNR", LNR2);
      // functionData.chgFieldInputValue("BRNM", "");
      functionData.chgFieldInputValue("CUS", "312162");
      functionData.chgFieldInputValue("CLC", "789");
      functionData.chgFieldInputValue("CCY", "GBP");
      functionData.chgFieldInputValue("DLA", "10T");
      functionData.chgFieldInputValue("SDT", "011299");
      functionData.chgFieldInputValue("CTRD", "011299");

      functionData.chgFieldInputValue("RAT", "10");
      functionData.chgFieldInputValue("IDB", "10");
      functionData.chgFieldInputValue("CPI", "N");
      functionData.chgFieldInputValue("RPYM", "1");
      functionData.chgFieldInputValue("SCHC", "2");

      functionData.chgFieldInputValue("NPY", "10");
      functionData.chgFieldInputValue("RPQ", "V01");
      functionData.chgFieldInputValue("RPA", "");
      functionData.chgFieldInputValue("FTA", "");
      functionData.chgFieldInputValue("FDT", "010100");
      functionData.chgFieldInputValue("DIF", "N");
      functionData.chgFieldInputValue("MDT", "");
      functionData.chgFieldInputValue("AB", "9132");
      functionData.chgFieldInputValue("AN", "234567");
      functionData.chgFieldInputValue("AS", "001");
      functionData.chgFieldInputValue("SAP", "N");

      functionData.chgFieldInputValue("PYT", "KBC");

      functionData.chgFieldInputValue("RCCY", "GBP");
      functionData.chgFieldInputValue("RAMT", "10T");
      functionData.chgFieldInputValue("PCCY", "USD");

      functionData.chgFieldInputValue("XREF", LNR2);
      functionData.chgFieldInputValue("RMTR", "Remitter Id");

      functionData.chgFieldInputValue("NST1", "GBP R");
      functionData.chgFieldInputValue("SAD1", "Sender line 1");
      functionData.chgFieldInputValue("SAD2", "Sender line 2");
      functionData.chgFieldInputValue("SAD3", "Sender line 3");
      functionData.chgFieldInputValue("SAD4", "Sender line 4");

      functionData.chgFieldInputValue("NST2", "BARUSD");
      functionData.chgFieldInputValue("OAN1", "Beneficiary account number");
      functionData.chgFieldInputValue("BAD1", "Beneficiary line 1");
      functionData.chgFieldInputValue("BAD2", "Beneficiary line 2");
      functionData.chgFieldInputValue("BAD3", "Beneficiary line 3");
      functionData.chgFieldInputValue("BAD4", "Beneficiary line 4");

      functionData.chgFieldInputValue("OAN2", "A/c with inst account number");
      functionData.chgFieldInputValue("AAD1", "A/c with inst line 1");
      functionData.chgFieldInputValue("AAD2", "A/c with inst line 2");
      functionData.chgFieldInputValue("AAD3", "A/c with inst line 3");
      functionData.chgFieldInputValue("AAD4", "A/c with inst line 4");
      functionData.chgFieldInputValue("US1", "A/c ref 1");
      functionData.chgFieldInputValue("US2", "A/c ref 2");

      functionHandler.applyTransaction();
      FunctionToolboxStub.printMessages(functionHandler.rtvFunctionMessages().getMessages());

      // retrieve journal header
      System.out.println(LNR2);
      JournalHeader journalHeader = functionHandler.getFhd().getJournalHeader();
      if (journalHeader != null) {
        System.out.println("Journal 1=" + journalHeader);
      } else {
        System.out.println("Journal 1=" + "ERROR");
      }

      return (journalHeader != null);
    } catch (Exception e) {
      e.printStackTrace();
      return false;
    } finally {
      if (functionHandler != null) {
        if (functionHandler.getFhd().getFunctionSession() != null) {
          SupervisorToolbox.removeSession(
              functionHandler.getFhd().getFunctionSession(),
              functionHandler.getFhd().getEquationUser().getEquationUnit());
        }
      }
      cleanUp();
    }
  }