Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Inserting a new row in SyncBO, Well or badly?

Hi, i want insert new row from PDA, my steps are:

- I create a new button that go to new window that appear the fields of the data:





- In the new window, there a new button that insert the data:





The problem, i think that is in this method, i insert new test row:
private String Insert() {
String[] newValues = new String[4];
newValues[0] = "6";
newValues[1] = "Prueba";
newValues[2] = "Probando";
newValues[3] = "10.10.2007";
SmartSyncDBAccess p = new SmartSyncDBAccess();
try {
p.addRowInDB(currentSyncBoName, newValues);
} catch (Exception e) {
e.printStackTrace();
}
return JSP_INSERT;
}

This method is called when press the button before...

The method addRowInDB is create automatically:
public void addRowInDB(String syBName, String[] newValues)
throws SmartSyncException, PersistenceException {
String syncBoName = syBName;
SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
SmartSyncTransactionManager transactionManager;

// Create new syncbo
SyncBo newsyncBo = dataFacade.createEmptySyncBo(sbd);
// A transaction manager is valid for one action starting with beginTransaction and ending with commit/rollback
// In this example we commit (save) every row we add - no rollback.
transactionManager = dataFacade.getSmartSyncTransactionManager();
transactionManager.beginTransaction();
for (int i = 0; i < arrayHeaderFieldNames.length; i++) {
if (newValues != null) {
setHeaderFieldValue(
newsyncBo,
arrayHeaderFieldNames
,
newValues);

}

}

dataFacade.insertSyncBo(newsyncBo);

//Commit the transaction

transactionManager.commit();

}

When i execute the application, appear all correctly, but i donĀ“t see the new row, are there any wrong?

Thanks,

Former Member
Former Member replied

Unfortunately I am a Microsoft Guy, using MSN and Skype.... Any chance with that?

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question