cancel
Showing results for 
Search instead for 
Did you mean: 

params for getlist Bapi Wrapper.....

Former Member
0 Kudos

Hi! I want to know if the following scenario is

feasible.This has already been discussed in the forum but

I could not understand it fully...

My scenario is as follows.

There is one Student table(studentID is the Primary

Key) who opted for a Particular Course(course ID)..

Now in the GetList BapiWrapper I want to get the student

records who opted for a particular Course ID.This course

ID I want to give in the import Parameters of the GetList.

Ie the GetList Bapi Wrapper will be like this.

select * from student where courseID = <value>

Now I want to pass this value of the courseID( which is

the import Param of the GetList) from the application.

Application I mean from the client..Is there a way to

pass the import param of the GetList Bapi Wrapper using

some API. I want to know whether it is feasible or not.

I dont know if this is realizable or may be

illogical,but I want to understand...

Thank you.....

Accepted Solutions (1)

Accepted Solutions (1)

kishorg
Advisor
Advisor
0 Kudos

Hi Veerabhadram,

If you do not have large volume of data to be downloaded to the client device based on the student Id only , then u can follow as Rahul mentioned .(Persist the entire data corresponding to the Student ID in the client device).

One more thing ,,

In place of the import parameter of the GETLIST Wrapper , u have the provision to put the one Structure field or even the Structure with number of fields ....

If u have large volume of data based on Student ID ,

then as a work around u can follow as mentioned in this forum ..

we have already discussed a scenario like this in this the above mentioned forum...

carefully go throught this forum and let me know , if u have doubts ...

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishore!

Thanks for you reply.I tried to undestand the scenario you have already mentioned in the forum. I have some doubts regarding this.Please do kindly bear with me.

1) So I want to know whether it is technically possible to directly pass import values to a

getList Bapi wrapper from the application in the client and then synchronize with backend,so

that we can get the data corresponding to the particular parameter (in this case CourseID)

after synchronization.

I want to know whether this is possible with MI API.If not, Is it that we can we use

the import parameter only for the ME_SYNC_USER to fetch the client specific data(in the case of S01).

2) You have explained a senario which will effectively fetch the student records

who opted for a particular CourseID in the getDetail bapi wrapper of some syncBO.

In your solution you sugested to create a dummy courseID table in the backend.

This will be the header of my getList bapi wrapper. I also have to create

Create and modify Bapi wrapper in the syncBO...

First I have to create a new enrty in the table(using the create bapi wrapper) and

then use the alreay created value as the import parameter of the getDetail bapi wrapper.

So logically we are getting the work done( dynamically displaying the info using the value

sent during the runtime by getDetail bapi wrapper. Now onwards we can change the entry of

this table using the modify bapi wrapper..

This is what I understood.

Thank you..

kishorg
Advisor
Advisor
0 Kudos

Hi Veerabhadram,

carefully go through this ...

<<<<1>>>>>

I think it is not possible to pass import values to a getlist BAPI Wrapper from the mobile device itself.The filtering we can carry out in the MI server only. We can set a maximum of 3 filters for the GETLIST BAPI Wrapper.

The filter values itself we have to put as VALUE IDs in the MI server. The value IDs could be a SYSTEM field , MI field or even Hard coded values .. So the values to this filter field for the GETLIST BAPI wrapper is limited to these values only.

If we set filters , this will be considered during runtime.(for SYSTEM fields nd MI Fields ). eg - ME-SYNC_USER , SY-UNAME like these ...

<<<<<2>>>>>

Here u just think like this ..

First u have a sync BO for handling the Course IDs only. Let us consider this have only GETLIST nd GETDETAIL Wrapper . This SyncBO acts like a master data table for All course IDs. This only contain the Course IDs. In the MI client we have to persist the Course IDs always.(Master Data) . Here the whatever the importing parameter , the output is all the Course IDs(Hope this course IDs are common to all Students . thats why.)

In the MI client , we have the Student ID which is also a user in the MI server .. So during Sync , if we have filter as ME-SYNC_USER (Mi field) , then it will be filled with the Student ID .. this thing is common..

Now about the second Sync BO ...

Let us imagine .. we have these two Sync Bos in our application nd imagine , during first sync , the First Sync BO will fetch all the Course IDs irrespective of the Student ID .. right ?..

So in the MI client we have all the course IDs .. nd for the Second Sync BO we do not have any data ...

Now in the MI client , we can have a drop down for all the Course Ids ...

We are going to create an instance of the Second Sync BO ...

Here the Wrapper could be like this...

GETLIST

-


(This wrapper must select the header values from a dummy table .. fresh table for keeping the Course ID only .. this must not be the one for selecting all the course ids for the first syncbo)

Import param -- We can use filter , ME-SYNC_USER.. right ..

Table Param -- The structure we set as table param here will have only one field and it must be for filling with the Course ID (we have from first Sync BO)..

So that in the GETDETAIL

-


we can filter the values based on the Student ID and Course ID .. This can be set as key fields for selection.

CREATE Wrapper

-


Its architecture will be like this ...

As,

Import param -- we have to put the table param of getlist here .. am i right ?(prerequisite of Wrapper).

Table Param -- This must be the table params of GETDETAIL .. right ? . (right now we dont have to fill the ITEM during creation ).

Export Param -- The export param must be the key field from the Table param of GETLIST .. So we have the course ID . This must be set .bcoz after creation , the GETDETAIL is executed with this key value ...

So in the MI client ,

For the second sync BO , we have to create a new instance of the Sync BO and set the header only .(course ID only).. and no items first ... right ?..

So during sync ,,

This will create a new instance of the second sync bo . Header with course ID .. nd we are have exported this Course ID for Create Wrapper . So this course ID will use for executing the GETDETAIL wrapper .. So that we will get the values based on course ID also as table param of GETDETAIL .. am i right .....

So after the first creation ,

We will have the Course ID details (as items of GETDETIAL , that will depends upon ur logic .. which data u need base on this course ID ) in the MI client.. rihgt ..

Now onwards we have to modify the created header instance only .. So that we will get the Course ID related data on each Sync ....

Your MODIFY wrapper logic must be like this ( this must modify the first created Course ID in the Dummy table )...

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi! Kishore.

Thanks for your suggestions.I have doubts in implementing the create bapi wrapper.

Here I need to create a header row.Can I directly use the addRowinDB method of smartSyncDBAcess class. I instantiated this class in the doInitilize method of the main controller class and used the addRowinDB method of this class.Iam not able to create the new header item this way.While debugging the syncboDescriptor object contains null value.

2) Even though I included the create Bapi wrapper in the creation of the syncbo, for the all fields of the Top row I am getting the following entry.

<Input type="create">false</Input>

Can you please guide in this issue.

kishorg
Advisor
Advisor
0 Kudos

Hi Veerabhadram,

<<Can I directly use the addRowinDB method of smartSyncDBAcess class.>>

Sure , you can use this standard method for inserting values in to the header instance of the syncbo.

<<<

I instantiated this class in the doInitilize method of the main controller class and used the addRowinDB method of this class.Iam not able to create the new header item this way

>>>

Here you dont have to explicitly initialize the object of SmartSyncDBAccess. The instance of this class is automatically get created within the <b>instance(String syncBo)</b> method of the TableContentProvider.

We can see the method call(instance(String syncBo)) method call (of TCT) within the main controller .

Just check the <b>private String showSyncBoNames() {}</b> method in the main Controller. Within this ,they are creating an instance of the TCP and hence the instance of SmartSyncDBAccess..

You can call the method of the SmartSyncDBAccess through a method in the TCP. So u only have to create a method in the TCP which have the parameters (SyncBO anme and the values to be inserted in to the header)...

During particular event , u have to call , u have to capture the values from the request object within the controller . then pass these values (to be inserted) to the method of the TCP.. dont ahve to directly call the method of the SmartSyncDBAccess from the controller itself..

<<<Input type="create">false</Input>

>>

This i dont know exactly . i also have the same doubt...

You can refer these forums ..

i have already given some code tempaltes for creating , modifying nd getting values of the SyncBo instances in these forums...

Actually in the standard methods which are in the generated code , they have not handled some null pointer exceptions... In these code templates i have handled those exceptions .. use those methods ...

go through these forums....

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi! Kishore

Thank you very much for your suggestions and ideas.They are highly helpful and now I created a synBo as you have guided, that fetches the data as per user selection.

Once again thanks for your constant help and guidence

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Veer,

No. It is not possible to do so.

The import parameters for GetList bapi wrapper take their values from the default values which are hard coded in the SyncBo at design time of the syncBo.

This parameters cannot be assign value at run time. Thus it is not possible to send import parameters from the client.

However, I can suggest you one thing...wouldn't it be possible for you get all the students on the client and display only the students belonging to that course on the screen.

Regards,

Rahul