Thursday, April 30, 2026

Script Logic / BAdI Prompt Strings Limits - A Hidden Pitfall

Recently, I ran into a strange issue related to BPC package execution. The package had several prompts defined and called Script Logic (an LGF file), which in turn invoked a custom BAdI. I observed that not all the data entered into the prompts was being processed. Strangely, when I entered only the data that wasn't calculated on the first run, it was processed correctly.

For some time, I couldn't figure out what was happening and why not all the data was being processed.

Root Cause

The way I entered data into the prompt was by choosing a node in a dimension hierarchy and selecting Base Member as the relationship type. The system then resolved all base members for that node and included them in the prompt. However, some of the dimensions populated this way had a large number of base members. As a consequence, not all of them made it to the Script Logic and subsequently to the BAdI. Those that didn't fit were simply not processed — silently.

It seems there is a certain threshold that limits the size of a prompt value. Most likely, there is an internal buffer of approximately 1,333 characters per variable, possibly tied to the ABAP data type used internally (often STRING or CHAR1333). I wasn't able to find any SAP documentation or SAP Note confirming this exact limit, but the limit is definitely there.

Solution

Instead of selecting Base Member as the relationship type, select Member. This way, only the node value — represented as BAS(<node_name>) — is passed to the Script Logic. The Script Logic then resolves all the base members for the node itself and successfully passes all of them to the BAdI. No truncation occurs.