on 11-12-2015 3:09 PM
Hello Forum,
I'm extending the service contract form. Behind the form my addin calculates some values. Now I want to save this values to DB. I have also extended the OCTM (table for the service contract) with some user defined columns. Currently I'm creating invisible Textboxes on the form and by saving the calculated values to the textbox.value property I can write them to db.
Is there a easier way? I could create a B1-independent table and write directly into it. But then I will have to rewrite lots of code.
Thanks
Mark
Hi Mark,
Do you want save your hide Textboxes values in user fields in OCTM table?
Regards,
Diego
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mark,
If I understand correctly your need, you can try something like this:
Catch the FormDataEvent when beforeAction is true, the eventType equals (et_FORM_DATA_ADD or et_FORM_DATA_UPDATE) and BusinessObjectInfo.Type equals service contract.
Then:
Catch the dbdatasource: DBDataSource db = this.Form.DataSources.DBDataSources.Item("OCTM");
set the values in specific fields with : db.SetValue("yourField", 0, "yourValue");
then set BubleEvent = true;
Hope it helps.
Regards,
Diego
Oh, I made a mistake: The Service contract table is OCTR.
To answer the question: No.
I want to write calculated values to the OCTR table. The current workaround is to create hidden textboxes on the form, write the calculated values into the textbox and the textbox writes them to the OCTR table because the textbox is databound to my user defined columns in the OCTR table
EDIT: I will try the hint in your second posting.
Hi Mark,
UDTs are under your control. SAP usually doesn't give you trouble (support wise) when using SQL with UDTs. However the official position is: no SQL.
But to add/update you have the UserTable object that allows you to do that with the SDK (SAP compliant way) and is less trouble (no changing of SQL statements if going to HANA).
Best regards,
Pedro Magueija
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.