Quantcast
Channel: SCN : All Content - SAP NetWeaver Administrator
Viewing all articles
Browse latest Browse all 5139

VB coding in BEx Analyzer – writing first custom functions

$
0
0

A large variety of custom VB functions can be created and used in BEx analyzer. That method may be useful especially when somebody don’t know ABAP.  

 

As an example creating VB functions converting 0fiscper value into full date is described here.

 

First, we have to be sure that macros can be saved in the workbook we use. Standard MS workbook .xlsx can’t do that. On such occasions I save the workbook as The Excel 97 - Excel 2003 file format.

 

After doing this you have to save the workbook on the server again

saveworkbook.png

 

Now we can add macros to the workbook. We can do this in VB editor (Alt-F11)  

If we want to store our macros locally (as in this example) we should add a new module

 

vb creating module.png

and write down the code for the macro

vb writting a code.png

If we have the code stored in .bas file it can be imported here (we can do this when we want to use the same code in many workbooks).

vb importing module.png

  After writing or importing the code the workbook should be saved on the server with the “Save workbook” button.

saveworkbook.png

 

Now function we stored in workbook can be used like this:

vb function usage.png

Please find attached file containing the code that was used here (the extention of the file has been changed to .txt so that the file could be stored in SCN server).

 

Regards, Leszek


Viewing all articles
Browse latest Browse all 5139

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>