cancel
Showing results for 
Search instead for 
Did you mean: 

How to create/view/edit tables in DB2E?

Former Member
0 Kudos

Hi,

I have some questions regarding DB2E within MAM:

Have anyone ever created a custom database table inside the DB2E of your MAM application? Basically, what we want to do is to have a custom table that will store some data unique to our MAM application, such as a country table that contains a code (i.e. CA for Canada), English name, French name, and the currency (i.e. USD for US Dollars). If so, how did you "deploy" the table + data to users? And what DB tools did you use to view/edit the data? Is this possible?

Many Thanks!

Jeffrey

Accepted Solutions (1)

Accepted Solutions (1)

sandeep_rs
Advisor
Advisor
0 Kudos

Hi Jeffrey,

MI does not expose any APIs for table creation. Depending on the sync BOs registered for the application all the needed tables are created by MI itself.

So for creating your own table from your application you may have to use the java.sql.DriverManager yourself and get a connection to the DB2e database and then execute your own DB statements.

For viewing/editing ur tables, there is a command line tool that DB2e provides. You just need to put that in the same folder as your table files and then you can play around with the data using DB2e commands in the Command Line Prompt.

Best Regards,

Sandeep

Former Member
0 Kudos

Thanks for the info, Sandeep! Do you know where I can find this DB2E Command Line tool?

Many thanks!

Jeffrey

Former Member
0 Kudos

hello jeffrey,

one way to create a "table" for your application is to use

the local SyncBo feature - a SyncBo having a suppressUpload

and suppressDownload attributes set to TRUE.

you can them insert/modify/delete these SyncBos from your

data facade just like the normal SyncBo. their only difference

is that no delta data nor delta download request is sent to

the middleware; i.e. your data is available only local.

i would rather suggest you to use this rather than defining

a table directly on the underlying database which might

break if you use a different persistence layer like FileIO.

hope this help

regards

jo

Former Member
0 Kudos

Hi Jo

How do we develop and implement this SyncBo with the suppress upload and suppress download attribute( in which we can insert/ update / delete and it wotn go back to SAP backend on sync ).

Do we need a Getlist BAPI and other BAPI ( insert/update/delete ) for this?

Thanks

Vipin

Former Member
0 Kudos

hello vipin,

local syncbos are generally used to locally store an image

of a syncbo especially in cases of error wherein you might

need to make a copy of your syncBo to a local copy for

retrieval later. if this is your case, you can just copy

an existing syncbo definition and set its suppressUpload

and suppressDownload attribute.

e.g. copy SAP_EXM002 -> SAP_EXM003 then check those atts

as local syncbo. so you don't necessary need another BAPI

to do these.

in case that you want to define a different structure,

you can manually edit your meRepMeta xml or copy an existing

SyncBo having your desired fields in it, and mapped only

those fields you want. thus no need for BAPIs.

regards

jo

Former Member
0 Kudos

Hi Jo,

What are the steps to create a local syncbo? I have created the entry in the meRepMeta.xml file. What actions do I need to perform in the backend? Also, how can I fill the local syncbo with data from a db2e table. Please refer to my thread:

Thanks,

Mahwish

Former Member
0 Kudos

hi mahwish,

i had answered your query on local syncbo on the different thread.

>What actions do I need to perform in the backend?

local syncbo doesn't require any backend preparations however, you will need to

define your syncbos IF you are to generate them using the syncbo builder. i would

suggest you to manually include your syncbos in the meRepMeta.xml and deploy

it with your application.

>Also, how can I fill the local syncbo with data from a db2e table.

so you already have some data on your db2e table? well you can make use of

jdbc apis to connect and reed your db2e tables, then create your local syncbo;

setting each fields and/or row items with the values from the record you retrieved.

to insert new syncbo (local), SmartSync APIs could still be used e.g.

SyncBoDataFacace.createSyncBo and insertSyncBo

regards

jo

Answers (1)

Answers (1)

former_member304703
Contributor
0 Kudos

Hi Jeffrey,

Just for your information: MAM itsef has a couple of "custom" tables that are local and are not supposed to be synchronised.

This functionality was implemented way before Local SyncBo concept was introduced to MI client. Data is stored in local serialized table using

com.sap.ip.me.api.services.MultiObjectFileStorage

Examples are: UVM manager thata stores list of activated lists, Inventory managment keeps local inventory table. You can see it in classess

com.sap.mbs.mam.inventory.util.InventoryLocalDeltaMgmt and

com.sap.mbs.mam.list.MAMListPersistanceMgr.

This is and alternative approach to using local SyncBo.

Cheers,

Larissa

Former Member
0 Kudos

hi larissa, jefrrey,

the use of local SyncBo and direct object serialization somewhat differs in the

context of "governorship". the local SyncBo is under the MI framework while objects

serialized by the application is only known to the application itself and not by the

underlying MI framework. thus when a client data reset is performed, the MI framework

doesn't know about those serialized objects and are left after the reset. this is the

reason why MAM itself has its own reset process rather the standard reset procedure

of the framework.

regards

jo