cancel
Showing results for 
Search instead for 
Did you mean: 

Mobile Development Kit - Asset Manager ISU Component

02-17-2020 9:01 AM
2702 views 7 comments
0 Likes
SAP Managed Tags
Subscribe

Hi Guys,

I want to develop some additional features for the ISU component of the Asset Manager in Visual Studio Code with the Mobile Development Kit (MDK). Since the standard version of the Asset Manager uses CIM-files to integrate the ISU component, I wanted to ask about the best way to "merge" these projects locally to develop in Visual Studio Code with the MDK.

I already created a running project with the MDK Client SDK, but still I need to prepare the metadata with the ISU component in combination with the standard Asset Manager.

Do you have any idea, what is the best practice for that?

Thank you in advance,

Sher-Chan

0 Likes

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

Hi Bill,

One important note: I used a Windows operation system when I faced the issue I described below. After I set up a Mac OS and using the tutorial https://blogs.sap.com/2019/07/19/debug-sap-asset-manager-with-crew-component-using-vs-code/, I was able to make this scenario work with the ISU component and the standard Asset Manager. It would be very helpful, if you could have a look at that issue for Windows.

In the example of the link I provided above, I recognized, that while executing the command "create-client.cmd" on Windows, the script was looking for the Meter component in a higher directory path (not in the metadata folder, but in the same hierarchy as the SAM.mdkproject) than it was described in the tutorial and therefore did not create the application. Could this be one issue?

___________________________

I followed all of your steps to process the CIM file references and below, you can see the general folder structure.

If I run the build task for the base project, which is sam.definitions (SAPAssetManager), I get the same output you showed on step 7.

However, if I want to debug the application with the component, I only receive the normal SAP Asset Manager without the Metering component.

For your information, I created my debug application with the mdk client sdk and used the basic SAM.mdkproject structure of the SAPAssetManagerMeter (ASSET_MNGR_SDK00_0-80004962 as downloading reference).

I added the extensions to this project and left the metadata empty (except the sam.definitions-folder holding the default SAPMeterManager.cim-file).

The debug app root holding the created application is the following for me:

Apart from that, I built my metadata as shown in the first screenshot. The SAPMeterManager.cim file of my project, which is in the sam.definitions-folder, allows me to navigate to the referenced component file of the MeterManager (in VSC), which gives me the hint, that the reference is recognized.

Unfortunately, while debugging, the source-files don't merge with the target-files of the SAPAssetManager (I for instance changed the header of the Overview.page in the SAPMeterManager, but the change is not applied, although the Overview.page is integrated from the SAPMeterManager to the SAPAssetManager).

Do you have any idea, what I could change to make it work?

Thank you in advance and kind regards,

Sher-Chan Kodirov

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Likes

sherchan_kodirov19

Were you able to resolve your issue? If so, please post an answer so others might benefit from your findings.

Former Member
0 Likes

Hi jitendrakumar.kansal,

I hoped, that you will have an answer for this. Since I use a Mac PC now, I did not try it on Windows any more. Still, my description is pretty precise. The directory path, in which the component is expected by the "create-client.cmd"-command is obviously wrong in the batch-file. You should have a look on that for the creation of a client in your cmd-file.

BR,

Sher-Chan Kodirov

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Likes

Well, I dont have Windows machine to test this, i would propose if you still see same behavior on Windows, please raise a ticket to SAP support for further investigation.

bill_froelich
Product and Topic Expert
Product and Topic Expert

The best option will be to still utilize the CIM files. VSCode can handle merging metadata projects on deploy just like in WebIDE. You will want to create a top level folder that contains all your metadata projects and open that in VSCode.

Just remember to resolve the references so VSCode knows where the base project is.

  1. Open a metadata file from your metadata component projects that references the base app
  2. All the references to SAPAssetManager should show with a red squiggle underline indicating that the reference can't be found
  3. Click on one of the reference and the light bulb should appear to the left
  4. Click the lightbulb to see the MDK: Resolve the application reference option and select it

  5. Select the base application from the list to resolve the references

  6. All the references to SAPAssetManager should not be underlined anymore

  7. When you execute the build in VS Code it will now be able to correctly process the CIM file references

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Likes

This is the solution we provided to your ticket. It will help others if they are looking for similar requirement.

We have fixed this issue as part of MDK 4.3.1 patch.

If you can't upgrade to MDK 4.3, as a temporary workaround for MDK 4.1, you can use the following approach:

Split your metadata projects (samstandard and Meter) out of your .mdkproject and then build the .mdkproject and metadata projects separately.

Here are the steps:

  1. Move the content of the .mdkproject/metadata folder out to a separate folder e.g.
    -meterassetmanager
    - samstandard
    - Meter
    .mdkproject/metadata should be empty
  2. User create-client.command to generate your custom client project. It should succeed since you are not including metadata projects anymore
  3. Next, run Visual Studio Code with Mobile Development Kit Extension for VS Code installed.
  4. Open Settings and search for 'mdk'
    1. Under "Mdk: Debug App Root", enter the path to your generated custom client project
    2. Under "Mdk: Bundler Externals", click Edit in settings.json
    3. Add "utils/utils" inside the "mdk.bundlerExternals" array
    4. Save the Settings.json file and close it
  5. Open the meterassetmanager folder in your VS Code workspace
  6. Go to menu Terminal > Run Task > MDK > MDK: bundle build Asset Manager (your samstandard project)
  7. This should trigger the MDK bundler to bundle your project along with Meter component and copy the resulting project to your custom client project's app folder.