cancel
Showing results for 
Search instead for 
Did you mean: 

Offline update operation.

Former Member
0 Kudos

I am creating hybrid App with offline mode in SUP 2.2 and faced problem with update operation. In project for now is only 1 MBO - tasks. I have created an update operation and it works well while online. On TasksDetail screen I have added 2 custom actions :

1. offlineUpdate - (type - Submit hybrid App)

2. onlineUpdate - (type - online request)

Also I have created menu item Update with type - custom and extend custom.js

hwc.customBeforeMenuItemClick = function(screen, menuItem) {

  if (screen === "TasksDetail" && menuItem === "Update") {

        var isDeviceOnline = false;

        isDeviceOnline = window.navigator.onLine;

        var clientInitiated = false;

        if (isDeviceOnline) {

            menuItemCallbackTasksDetailonlineUpdate();

        }

        else {

            if (!clientInitiated) {

                doSaveAction(false);

                menuItemCallbackTasksDetailofflineUpdate();

            }

            else {

                doSaveAction(false);

                doSaveAction(false);

                menuItemCallbackTasksDetailofflineUpdate();

            }

        }

    }

    return true;

};

     In this case clientInitiated is always 'false' , but with 'true' it also does not work the way I want.

So In online mode this code works perfect. In offline mode , when I press Update the App is closed and I see the list of Hybrid apps. I don't want that behaviour. how I can avoid that .

     Thank in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

     If smb has the same problem - issue is to manually (in HybridApp.js) add one more parameter to hwc.doSubmitWorkflow. This function has 5 parameters, the last one has boolean type . If it is empty or false the App will close, if true - App continue works.

Former Member
0 Kudos

Now I faced with another problem! In parameter mappings tab I have linked few parameters to elements on UI. But for some reasons in BAPI all parameters are empty. Is there any specific things I need to use with Submit hybrid App? What could be the reason for empty parameters on BAPI?

midhun_vp
Active Contributor
0 Kudos

This thread might help you,

http://scn.sap.com/thread/3405801

- Midhun VP

Former Member
0 Kudos

I have 2 similar custom actions (online request and submit hybrid app). In first case(online request) it works , but in second case BAPI does not receive any values. Parameter mappings and pers. key mappings sections are the same for these actions.