cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the CHILD structure of SyncBo from meRepMeta.xml?

Former Member
0 Kudos

We are developing a mobile project focused in the synchronization between a SAP/R3 layer  and a Java layer on the client side using the Smart Synchronization.

The server side is made of a WAS 640 installation with patch level 13 while on the client side we use the 2.0.13 netweaver development studio and we deploy our java application under the MI-Client 2.5.

We have the following problem:

Having developed a specific Sync Bo to upload data from the client side to the Backend (U01) we have now difficulties reading the metadata structure and populating this sync bo in the local client persistence environment.

We would like to understand how the code must be structured in order to acquire all the information in the header and child structure and to populate the local persistence with this data in all the fields that the syncbo is meant to read.

And finally, we need a short description of the data structure that Java has to manipulate in order to operate with this entities.

Sincerely,

Eliana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hello eliana,

here's a sample:

SmartSyncRuntime ssRuntime = SmartSyncRuntime.getInstance();

SyncBoDescriptorFacade desFac = ssRuntime.getSyncBoDescriptorFacade();

SyncBoDataFacade datFac = ssRuntime.getSyncBoDataFacade();

SyncBoDescriptor boDesc = desFac.getSyncBoDescriptor("ZSYNMP_PO4");

RowDescriptor r010Desc = boDesc.getRowDescriptor("010");

FieldDescriptor r010KeyDesc = r010Desc.getKeyFieldDescriptor();

FieldDescriptor r010MovDesc = r010Desc.getFieldDescriptor("MOV_TYPE");

//create bo

SyncBo boDat = datFac.createEmptySyncBo(boDesc);

//create 010 child row

Row r010Row = boDat.createEmptyRow(r010Desc);

//get field reference

Field fMov = r010Row.getField(r010MovDesc);

//modify field value

fMov.setValue("VALUE");

//insert row

boDat.insertRow(r010Row);

//insert the SyncBO into the data repository

datFac.insertSyncBO(boDat);

for your child row's MOV_TYPE field to be modifiable,

you have to remove the <Input type="modify">false</Input>

or set it true.

regards

jo

Former Member
0 Kudos

Hi Jo,

thanks a lot.

e.

Answers (1)

Answers (1)

kishorg
Advisor
Advisor
0 Kudos

Hi elina,

In meRepMeta.xml ,each synchBo is within this

tag <SyncBO id="ZSYNMP_PO4> , anth fields associated with this represent the header fields.

The child strucures are organised within this <ChildStructure name="010"> tag.

Here one point to note is , the index of the child structures , i mean 010,020,... that depends upon the alphabetical order in which how we are creating that as table parameters in the function module associated with this SynchBo.

Here u can also refer the header just as like item by giving ,

RowDescriptor r010Desc = boDesc.getRowDescriptor("010");

// For child rows

RowDescriptor header = boDesc.getRowDescriptor("TOP");

// For Header

ME2.5 Representation:

These representations are used in interfaces available from 2.5 version such as Field.getValue and Field.setValue methods.

"C" - fixed length characters, Java representation is String.

"N" - fixed length numeric characters, Java representation is java.math.BigInteger.

"D" - 8 length characters, Java representation is java.sql.Date.

"T" - 6 length characters, Java representation is java.sql.Time.

"P" - fixed length decimals, Java representation is java.math.BigDecimal.

<b>and must have a look at the length(attribute) of the field while inserting or modifying the field values.</b>

Elina , do u need any help for reading values form syncbo?.(from header and item).

Regards

Kishor Gopinathan

Former Member
0 Kudos

HI Kishor,

can you help me?

i'm working whit a SyncBO U01 for communication client-> R3. U01 is synchronous or asyncronous?

Former Member
0 Kudos

hello eliana,

your syncBo message synchronousity is defined by the

attribute reqDirectSync. if you want your SyncBo data

to be uploaded synchronously, set this SyncBo attribute

reqDirectSync="true". if this is not specified, it will

be considered an asynchronous.

regards

jo

kishorg
Advisor
Advisor
0 Kudos

HI elina,

at the time of creation of sync bo, u have the provision to select it as synchronous or asynchronous.

one check box is there in the SyncBo builder,

here asynchronous is selected as default (checkbox Default async in the Administration part). if u want to make it synchronous just deselect it.

Regards

Kishor Gopinathan