cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.2 HWC Create Operation Offline

Former Member
0 Kudos

Hello Experts,

I am developing a HWC app with Offline capabilities in SUP 2.2 SP04.The app is working with offline but the  Create operation is not working.I have given the properties of the Create operation as below:-

Type:-Online Request

Invoke Operation:-createopr

Store data in ondevice Cache:-Timeout: Never Expires,

                                             Cache Lookup Policy:Get Results from on device cache first.

Can anyone help me how tomcustomize the Create operation with Offline?

Thanks

Manoj

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

1. Create a menuitem with custom as type.

2. Create 2 custom actions  submit (for offline) and online request (for online) as type.

When device is online use online request method and when the device is offline use method created for submit type.

Keep an external breakpoint in RFC (with same user as used in mobile) to check when the RFC used for operation is triggered in the case of offline.

Sample code can be taken from this discussion,

Midhun VP

Former Member
0 Kudos

Hi Midhun,

Thanks for reply.

I created the Menu Item with Custom type and Custom Actions  submit (for offline) and online request (for online) as type.

I used Online request when the device is Online and it is working fine for the first time when the app is running.When I am running the app for the secondtime the Create RFC is not being called(I am using the option Store data in on-device cache).

Now for the Offline with Type as (Submit Hybrid App) and Invoke Operation as the Create operation The RFC is not being called and it is not working.

I went through the above URI(,Update operation when offline - HWC app, SAP MBO) and I am doing the same with create operation.

Please let me know if you require more information from me.

Thanks

Manoj

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

for the 2nd custom Action "Submit", what type you have selected? Isn't it "Submit Hybrid App?

Can you share the piece of code you would have written? And also custom menu items setting details. Maybe screenshot

Rgrds,

Jitendra

midhun_vp
Active Contributor
0 Kudos

While using the Submit Hybrid app have you selected the operation that you created in the MBO ?

Midhun VP

Former Member
0 Kudos

Midhun,

I have selected the operation Create in the Submit Hybrid App and I checked with return type as true also but still Create RFC is not calling.

Jitendra,

In the Submit Custom Action I have used Submit Hybrid App as type and the code in Custom.js is as below:-

  1. hwc.customAfterMenuItemClick = function(screen, menuItem) {

       if (screen === "Object1create" && menuItem === "Create") {       

var isDeviceOffline = false;

var connectionType = "";

try {

            connectionType = navigator.network.connection.type;//PhoneGap 1.4.1

}

catch (e) {

            connectionType = navigator.connection.type;//PhoneGap 2.0

}

if (connectionType === Connection.NONE || (connectionType === Connection.UNKNOWN)) {

            isDeviceOffline = true;

}

if (!isDeviceOffline) {

menuItemCallbackObject1createOnline_Submit();    

}

else {

doSaveAction(false);

doSaveAction(false);

menuItemCallbackObject1createOffline_Submit();

}

}

};


Thanks

Manoj

Former Member
0 Kudos

I am able to send the the data for Create Operation now for both online and offline but not able to send the Description value from the screen to SAP for Offline mode.Please find the screens below for the Create screen and properties in workflow below:-

The Submit properties as below.

The description box properties.

The offline_Submit properties:-

The parameter mapping for offline submit:-

Thanks

Manoj

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

in the Parameter mapping for offline submit, are you not able to map the key to DESCR parameter (as per last screenshot in above reply)?

Rgrds,

Jitendra

Former Member
0 Kudos

I am able to map the Param key as below but it is not sending the desc value to SAP.

Thanks

Manoj

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

After mapping, did you again deploy the app to the device?

Former Member
0 Kudos

yes but still not able to get the data.

Answers (1)

Answers (1)

Former Member
0 Kudos

"Online Request" type only works when device is online.

Use the Submit operation if you wish for the action to be automatically queued and sent to the server when the device has network connectivity.

Thanks,

Andrew.

Former Member
0 Kudos

Hi Andrew,

I am using Submit Hybrid App for the Offline Submit and adding the Key to the Parameter mappings.When I submit the Offline Create blank values are inserted to SAP.

I have  also added the Custom code to the customAfterMenuItemClick () function but still not able to send.

Thanks

manoj

Former Member
0 Kudos

I would appear your parameter mappings are not done correctly for the Submit operation.  You can see what the client sends up to the server by enabling tracing on the WorkflowClient module on the server.

Please see "Server Side Debugging":

Debugging Hybrid Web Container Development

Thanks,

Andrew.