cancel
Showing results for 
Search instead for 
Did you mean: 

Edit SuperBOM Variant Configuration Selection Condition Outside SAP

Former Member
0 Kudos

Hello,

I am a .NET developer and no nothing about SAP. Somehow I've been given the task to build a superBOM editor in .NET.

The part I'm struggling with are the selection conditions. I will call a bapi that returns superBOM information. The selection condition code will be returned as a long string. They expect me to parse the string and represent the code in a GUI of drop downs, where they can add, delete, modify, etc. Then I must take the user input and build a new selection condition string to pass back to SAP.

Building the code doesn't seem too bad to me. However the code parsing part is giving me trouble. It just seems to me there should be something built into SAP that could parse the selection condition code and just send me all the characteristics and the values.

I understand all the characteristics are stored in a table. So somehow SAP must cross reference this table somehow and compile the selection condition code and get meaning from it.

Any help would be appreciated. Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Ritz
Active Contributor
0 Kudos

Clint Rhodes,

All selection condition may be starting with $SELF.CHARACTERSTIC

and end with value in ' Value'.

$SELF.CHAR = '01'.

or

$SELF.CHAR eq '01'.

You can look out for such expression in string and pick it.

I am not very clear with the issue you explain, if you can add an example of what you are getting and what you are expecting i may try to help.

Thanks

Ritesh

Former Member
0 Kudos

I will have a bapi that returns a superBOM. One of the fields I'll get back for that BOM is a long string which is the code for a selection condition:

($root.CFG_SIZE IN ('90') AND $root.OPT_NAME_MORE IN ('AUD3'))

I am expected to parse this code and present it in a superBOM editor with drop downs. So I will have to do as you said and parse out the CFG_SIZE, then the IN, then the actual value ('90')

I have to give the user the ability to add options as well. So I will need to know all the characteristics available in order to load them into a drop down the user can select from.

It just seems like SAP would have a way of parsing this code ahead of time and just sending me the values and characteristic names.

Flavio
Active Contributor
0 Kudos

Hi ,

I think you are right, the system is parsing the dependency code and returning the characteristics / values satisfying the dependency itself.

A possible solution for your needs could be to read the dependency code. In this way, if we take your example above, it will return all the CFG_SIZE values that are satisfying the precondition, say for instance, something like that:

($root.CFG_SIZE IN ('70', '80', '90', '100') AND .....

To get any dependency code, there is the FM (Remote-enabled): CARD_DEPENDENCY_READ

Here a sample usage in my sandbox system:

set the flag on 'FL_WITH_SOURCE' to get the code back.

Here is my precondition code:

For what concerns characteristic values reading, there is a BAPI for it: BAPI_CHARACT_GETDETAIL.

Here again, a simple test in my sandbox system:

and here the result (in structure CHARACTVALUESCHAR)

Hope this could be of some help.

Just let me know if something is not clear or further details are needed.

Thanks and regards,

Flavio

Former Member
0 Kudos

Hello. Sorry for the long delay. I was off this project now back on.

I looked into the above suggestion. Unfortunately it doesn't solve my issue.

It looks like I'm going to have to write my own code to parse the selection condition string. I just thought that somehow SAP must have a compiler that reads the selection condition and compiles the data and interprets it. Something in SAP makes sense of that code and does something with it.

I was just hoping there was a bapi maybe that would return a better representation of the selection condition.