2016-03-14 21 views
0

我想創建一個發票,並填寫現場pftext(TN2)一個名爲ytdescription另一TN2字段的內容另一TN區。珠璣-ERP:複製TN場與EDP /外延

我的問題是,我一直有我在pftext文本框的路徑,但不是我的文本框的內容。

1日試EDP的頭信息:

kunde;artex;pftext;mge 
'M|ytkdnr';'M|ytartnr';'M|ytdescription';'M|ytmge' 

第二次嘗試:

kunde;artex;*pftext;mge; 
'M|ytkdnr';'M|ytartnr';'M|ytdescription';'M|ytmge' 

當然我可以創建一個T254場和存儲M的內容| ytdescription在新的領域,但隨後我堅持最大3000字符的內容。

許多其他的嘗試,隨後,但沒有成功:-(
任何幫助,高度讚賞!

回答

3

我不知道的選項,每EDP做到這一點,但有一個解決方案,這樣做每AJO:

public int run(DbContext dbContext, String[] args) {   

    /* 
    * Get the object to copy data from, in this case a customer with idno 70001 
    */ 

    String idno = "70001"; 

    SelectionBuilder<Customer> selectionBuilder = SelectionBuilder.create(Customer.class); 
    selectionBuilder.add(Conditions.eq(Customer.META.idno, idno)); 
    Customer customer = QueryUtil.getFirst(dbContext, selectionBuilder.build()); 
    VendorEditor vendorEditor = null; 

    // Read the original content to a StringWriter 
    StringWriter originalFreeText = new StringWriter(); 
    try {   
     customer.getFreeText(originalFreeText); 

     // Create a new object to write the values to. In example a Supplier 

     vendorEditor = dbContext.newObject(VendorEditor.class); 
     vendorEditor.setSwd("Searchword"); 
     vendorEditor.setAddr("Vendor Name"); 


     if (!originalFreeText.toString().equals("")) { 
      vendorEditor.setFreeText(new StringReader(originalFreeText.toString())); 
     } 

     vendorEditor.commit(); 

    } catch (IOException e) { 
     dbContext.out().println(e.getMessage()); 
    } finally { 
     if (vendorEditor != null) {     
      if (vendorEditor.active()) { 
       vendorEditor.abort(); 
      } 
     } 
    }  
    return 0; 
} 
+0

THX此解決方案,不幸的是我需要在這種情況下,EDP /外延的解決方案,但良好的知道它將如何與AJO來解決! –