cancel
Showing results for 
Search instead for 
Did you mean: 

SUP and RFC

Former Member
0 Kudos

Hello everyone, hope everything's all right.

I'm developing an offline app and I'm having troubles. Can someone help please?

I'd like to know how to storage the return of my RFC. I called it and now I have to storage it to manipulate.

My app is using SUP 2.1.3 and it's all HWC.

Thanks in advance!

Regards,

Luis

Accepted Solutions (1)

Accepted Solutions (1)

rakshit_doshi
Active Contributor
0 Kudos

Hi,

If you want to store the data for further usage you can think of creating an sqlite table and then load the data returned from the RFC into the table and then try to show the data/modify it querying the sqlite table.

Refer to the following link to get idea of sqlite using javascript

http://cookbooks.adobe.com/post_Store_data_in_the_HTML5_SQLite_database-19115.html

Hope this helps,

Thanks,

Former Member
0 Kudos

Hello Rakshit,

Thanks for the direction, that really helped!

But do you know how to take the return? Like if I make an online request, it should return a list ? or does it return a key?

Thank you!!

rakshit_doshi
Active Contributor
0 Kudos

Hi,

So what i understand is that you pass some table or parameter to the RFC and it takes that thing and processes and returns some list.

For this you can create a personalization key on the attribute which is to be passed as an input and then programmatically set the value of personalization key and then synchronize.

It will hit the BAPI and then bapi will process it to the logic which is written and send an output.

You can read the output in the same from as suggested earlier.

For eg.

There is a function module which takes username as input and gives details as list or more probably as a table as output.

Your MBO will have username as input and output as a table.

Say the attribute is username. Create a personalization key for the attribute clicking on the MBO and then from Attributes--> Load parameters and assign the personalization key to the attribute.

then in the code you can have something like

PersonalizationParameters pp=....................DB.getPersonalizationParameters(),

pp.setUsername(your parameter to be passed)

pp.save()

..........DB.synchronize(),

Hope this helps,

Thanks,

Former Member
0 Kudos

Hi,

I followed this doc to create my Personalization Keys:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e01a0d25-5d38-2e10-aea6-808682271...

But he just create the pp and then set in > MBO > Synchronization > Add and select the combo box titled 'Personalization Key'. Should I do anything more?

And about this code:

PersonalizationParameters pp=....................DB.getPersonalizationParameters(),

pp.setUsername(your parameter to be passed)

pp.save()

..........DB.synchronize(),

I am developing only HWC, I believe it's only for specific platforms, isn't it?

Thanks!

Former Member
0 Kudos

Hi Luis,

When you make an online request in your app it will surely return a list.

Now what you have to do is :

1. In your custom.js, You have to write a JS code to get the MBO output list.

   

if(destScreenKey === 'ScreenName')//Custom Appl MBO key name

{

  var message = getCurrentMessageValueCollection();

  var itemList = message.getData("MBO Name");

  var items = itemList.getValue();

  //alert("Working");

  var numOfItems = items.length;

  var i = 0;

   while ( i < numOfItems )

   {

  

     var currItem= items[i];

  

     var var1 = currItem.getData("MBOName_ATTRIBUTNAME_attribKey").getValue();

   }

}

If you see the while loop,It reads one record at a time from your MBO List.

2. Now you can follow the link given by Rakshit and store this values in sqlite table.

Regards,

Abhishek Wajge

  

    

 

Former Member
0 Kudos

Hello Abhishek,

Thanks very much, that's work! I got my key list and I can manipulate the data.

Do you know a way or a document to synchronize ? Is there any kind of lib or a specific command?

Thanks again!

Regards,

Luis

rakshit_doshi
Active Contributor
0 Kudos

Hi,

What do you mean by synchronize. What do you want to synchronize. Can you be a little more specific.

Thanks,

Former Member
0 Kudos

Hi Luis,

Even i am also looking at it.

So far i dint find any way to synchronize using any command or libs.

Regards,

Abhishek Wajge

Former Member
0 Kudos

Hi Abhishek,

We found a solution and I will have to work in this way...but what we have done?

Simply created a RFC which will be sent to back-end..and then update a table

Answers (0)