Showing posts with label function modules. Show all posts
Showing posts with label function modules. Show all posts

Friday, January 2, 2026

ABAP Function Group RS_GENERAL

Among ABAP class CL_RSAR_FUNCTION there are also other useful places of ABAP code important to BW development. This time I picked up Function Group RS_GENERAL. It bundles generic helper function modules that are reused across SAP. It contains following Function Modules:

RRSV_SYSTYPE_GET                                Determine System Type (SAP/Customer)

RSAR_DATE_CHECK_PLAUSIBILITY             Plausibility Check for Date

RSBB_URL_PREFIX_GET                           Return of Protocol, Server, and Port

RSDG_MSG_APPEND_TO_PROTOCOL          Add Message to Application Log

RSDG_WORD_WRAP                                Divides a String into Substrings of Defined Length (Word Wrap)

RSPC_SHOW_DOCUMENTATION                 Display Documentation for a Process Type

RSRA_GET_DEFAULT_LANGUAGE                Returns Default Language of System

RSR_SYSTEM_GET_UNIQUE_ID                  Temporary Wrapper of SYSTEM_unique_ID_GET

RSSM_ADD_TIMESTAMPS                          Adds Two Time Stamps (One of Which Is Earlier Than 1.1.0001)

RSSM_CHECK_ASSERT_BREAKLUXM_ON     break_luxm stuff

RSSM_CONVERT_DAYSEC2TIMESTAMP        Converts Days and Seconds into Date, Time, and Time Stamp

RSSM_CONVERT_TIMESTAMP2DAYSEC        Converts Date and Time or Time Stamp into Days and Seconds

RSSM_EVENT_RAISE                                Trigger BP_Event_Raise; Can Be Called Using RFC

RSSM_GET_TIME                                     Get Time

RSSM_GET_TIME_INT INTERNAL:               Get Time from Enqueue Server

RSSM_ICON_CREATE                               Create Icon with Quick Info Longer Than 30 Chars (132 Bytes in Total)

RSSM_SLEEP_DEBUG                               Sleep Debug User / Sap - System

RSSM_SUBSTRACT_TIMESTAMPS               Subtracts Two Time Stamps from One Another

RSSM_UNIQUE_ID                                   Temporary Wrapper for SYSTEM_UNIQUE_ID_GET

RS_POPUP_TO_CONFIRM_ONLY_ONCE        Confirmation Popup "Do Not Show This Question Again"

RS_RFC_IS_GUI_ON                                Determine Whether GUI Is Available for Popups and so On

 

The functions in there are focused to:

General BW operations: various supporting fields and functions (time etc).

Monitoring and Data Loading/Processing: functions used during BW data loading processes (e.g. RSSM_GET_TIME that handles timing and monitoring operations during BW data processes).

Especially FM RSSM_CHECK_ASSERT_BREAKLUXM_ON checks the breakpoint of SAP internal BW backend developer called Matthias Lux. He is mentioned in quite a few of BW objects I wrote about it here - Most famous BW backend SAP developer :)

Notice the functions in this group are not released to be used!


Tuesday, August 7, 2018

Unified Connectivity (UCon) framework part 2

I wrote about the UCon already few years ago see here: NetWeaver Unified Connectivity (UCON).
This post has refreshed info on the topic.

I introduced whitening / blacking (list) features of SAP in my older blog spot: White / Black Lists. In SAP terminology a securing of some of SAP objects is also called in as Unified Connectivity (UCON). It was introduced on NetWeaver platform in version 74. Very high level speaking the UCON is all about logging and blocking. By using the UCON only those of remote enabled function modules (RFM or BAPI) that are used in deployed scenarios are allowed to be executed. Execution of rest of them is forbidden and thus the NetWeaver system is secured on server side because possible attack to the system is reduced. 

To identify which RFMs are to be exposed and which are to blocked there are three phase process and toolset provided by the UCON. 

First of all, a system parameter ucon/rfc/active needs to be set in tcode RZ11 – system profile parameters. 

In 1st phase (Logging) you need to identify objects that ae accessed from outside systems. Here a tool called ”Phase Tool Unified Connectivity” (tcode UCONPHTL, prog UCON_PHASE_TOOL) is used. Also CCMS contains SAP Unified Connectivity Monitor Templates that are supporting the tool. 

Now in 2nd phase (Evaluation) it checks whether objects are not interrupting deployed business scenarios by being blocked.  Also tcode UCONPHTL is used in here.

And finally in 3rd phase (Activation) it needs to be confirmed that UCON checks will become effective. 

There is also possibility to override blocking settings of some RFM delivered by SAP. This is of course at your own risk. The ABAP program RS_RFC_BLACKLIST_CUSTOM can be used for that. By giving the RFM name to the program you can see what were original settings of the RFM. No need to add that all changes to the settings are logged. So by this way blacklisted RFM can be unblocked. The settings done by the program are transportable.

More information:

Tuesday, July 17, 2018

Issues while setting up SAP RFC Connector for NodeJS (node-rfc) connector

In one of my last posts I wrote about nodejs RFC Connector provided by SAP to connect SAP backend systems. The Connector works very well. However, while I was setting it up I faced few issues. I’m listing them here with solutions how to overcome them; perhaps it will be useful for someone else too.

1. Library MSVCP120.dll missing

One of prerequisites of nodejs RFC Connector is that SAP NW RFC SDK needs to be present on machine which will be used for making called to the SAP system. However sometimes SAP NW RFC SDK is not installed correctly on the machine. Basic check of the installation is to run command rfcexec. In case of issue there is an error like:
The program can’t start because MSVCP120.dll is missing...




Solution is to install Microsoft Visual C++ (2010, 2013, or newer depending on your OS platform) Redistributable component. Once installed there shall be following output of rfcexec:




2. NPM module xyz can’t be found

On attempt to run nodejs app using the Connector call there is a following error thrown:

Error: The specified module could not be found.

Basically the node-rfc tries to find rfc.node in specific folder /build/rfc but it's not in there because by default when it is installed another subfolder is placed there. In my case on OS Windows it is the subfolder "win32_x64". Solution is to just move or copy the rfc.node file to one level up.


3. Issues related to path variable.
As mentioned in point no.1 SAP NW RFC SDK needs to be present on the machine where the calls will be performed from. The folder where the SDK is installed needs to be included in path variable e.g.:

Tuesday, April 17, 2018

How to call BAPI in SAP from nodejs app

Recently I used nodejs RFC Connector provided by SAP. The module called node-rfc provides bindings for SAP NetWeawer RFC Library. Via the library it is possible to call RFC enabled function modules residing in SAP NetWeaver based ABAP system from nodejs, leveraging SAP Remote Function Call (RFC) protocol. For installation of the module into your nodejs framework see here.

Below I provide two example nodejs apps showcasing possibilities to passing values to BAPI’s parameters like single values, structures and tables.

I think that the node-rfc module is great option how to interface with SAP systems from heavily used nodejs app like in case of web based apps.

You can find both examples on my github:

demo_BAPI_params1.js      usage of table and variable parameter

//demo prg to showcase usage of table and variable parameters of SAP's BAPI while called from nodejs app via SAP/node-rfc nodule
"use strict";
var rfc = require('node-rfc');
var abapSystem = {
    user: 'sap_user',
    passwd: 'sap_user_pwd',
    ashost: 'sap.nodomain',
    sysnr: '01',
    client: '800'
};
var client = new rfc.Client(abapSystem);
var MAX_ROWS = 3;
var SELECTION_RANGE_str = {
               PARAMETER: "USERNAME",
               SIGN:      "I",
               OPTION:    "CP",
               LOW:       "A*"
        };     
var SELECTION_RANGE_tab = [SELECTION_RANGE_str];
       
client.connect(function(err) {
    if (err) {
        return console.error('could not connect to server', err);
    }  
    client.invoke('BAPI_USER_GETLIST', {
                       MAX_ROWS: MAX_ROWS,
                       SELECTION_RANGE: SELECTION_RANGE_tab
        },
        function(err, res) {
            if (err) {
                return console.error('Error invoking BAPI_USER_GETLIST:', err);
            }
               console.log('Result BAPI_USER_GETLIST:', res);
        });   
});

demo_BAPI_params2.js      usage of structure parameter of SAP's BAPI

//demo prg to showcase usage of structure parameter of SAP's BAPI while called from nodejs app via SAP/node-rfc nodule
"use strict";
var rfc = require('node-rfc');
var abapSystem = {
    user: 'sap_user',
    passwd: 'sap_user_pwd',
    ashost: 'sap.nodomain',
    sysnr: '01',
    client: '800'
};
var client = new rfc.Client(abapSystem);
 
client.connect(function(err) {
  if (err) {
    return console.error('could not connect to server', err);
  }
  var IMPORTSTRUCT = {
    RFCDATA1: 'some value of structure field RFCDATA1',
    RFCDATA2: 'some value of structure field RFCDATA2'
  };
  client.invoke('STFC_STRUCTURE',
    { IMPORTSTRUCT: IMPORTSTRUCT },
    function(err, res) {
      if (err) {
        return console.error('Error invoking STFC_STRUCTURE:', err);
      }
      console.log('Result STFC_STRUCTURE:', res);
  });
});

Thursday, January 11, 2018

Function group is full?

There is actually a limit for number of function modules that can be included in one function group. I wasn’t aware of this until recently when I ran into the limit.

I was about to create a new function module into existing group and I got into this error message:

There are already 99 functions       Message No. FL030
Diagnosis
You attempted to add a function module to a function group that is already full. A function group can contain a maximum of 99 function modules.
Procedure
Create a new function group or reorganize the existing one.


Pretty much is says that there is a technical restriction of how many function modules can be stored in the group. There is no really solution just to use another function group.

Just last note in here the new function modules are created by another function module called RS_FUNCTIONMODULE_INSERT.

Wednesday, March 9, 2016

White / Black Lists

In general similar to any other industry or area of people's interests also in terms of SAP we talk about white and black lists.

Basically anything which is on the white list is approved or recognized or just simply speaking it is considered to be safe. On other hand anything which is on the black list is forbidden, unknown or just not safe.

In terms of SAP we can talk similarly here in here about programming objects. It can be also an access to certain objects where there are some objects that can be accessed (while list) and objects to which an access is denied (black list).

Let focus on e.g. RFC function modules. Some of them can be protected by authorization and therefore are on the white list. Access to some other RFC FM can be forbidden and they are put to black list. Usually the RFC FM are protected by authorization object S_RFC.

last update: 07/08/2018

1664340 - Documentation of authorization object S_RFC is unclear

Tuesday, August 26, 2014

NetWeaver Unified Connectivity (UCON)

See also part two of UCon here: Unified Connectivity (UCon) framework part 2

UCON is new connection framework in SAP NetWeaver aiming to deal also with security aspects of RFC (Remote Function Calls) calls from outside systems into SAP NetWeaver systems. The UCON framework reduces no of Remote Function Modules (RFM) which can be accessed or let say called from outside systems.

SAP ERP solution contains approximately 38k of RFMs. By default one can call all of them without any issues. As typically in customers production systems only few of them are needed so by utilizing UCON one can limit those RFMs which are needed.

What needs to be done in order to deploy the UCON?

- NetWeaver system where UCON will be used must have following system profile parameter UCON/RFC/ACTIVE set to 1.
- Set up and generate communication assembly (CA) in TA UCONPHTL.
- Schedule batch job SAP_UCON_MANAGEMENT to collect RFC statistic recording.

Notice that UCON is only available as of SAP NetWeaver version 7.4.


Further information: