cancel
Showing results for 
Search instead for 
Did you mean: 

BPath - Customer Namespace

janine_graszies
Discoverer
0 Kudos

Hello,

I would like to read a relation that I´ve created via AET using Bpath. Unfortunately I get an exception (CX_WCF_BPATH_PARSING_ERROR).

Short code example:

LR_ENTITY ?= LR_ENTITY->GET_RELATED_ENTITIES_BY_BPATH( 'BTOrderHeader/*$')->get_first( ).
==>possible

LR_ENTITY ?= LR_ENTITY->GET_RELATED_ENTITIES_BY_BPATH( '/XYZ/EXT_BOL_RELAT0001/*$)->get_first( ). ==> error

To my mind the problem is caused by the used customer namespace '/XYZ/'.

So, how can use BPath when using a customer namespace, or is it not possible?

Thanks

Janine

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Janine,

I had a similar Problem the Solution is to mask the /XYZ/ Relation Name like this:

....get_related_entities_by_bpath( '\/XYZ\/EXT_BOL_ ...')

Also See SAP Note 1535509 which is about that topic.

Best regards,

Hendrik

faisal_pc
Active Contributor
0 Kudos

Hi Janine,

What if you give LR_ENTITY ?= LR_ENTITY->GET_RELATED_ENTITIES_BY_BPATH( 'BTOrderHeader/EXT_BOL_RELAT0001/*$')->get_first( ).

But this relation should exist.

Thanks,

Faisal

janine_graszies
Discoverer
0 Kudos

Hi Faisal,

I´ve tried that as well. This is also not possible.

The relation is correct.

The following coding is possible:

LR_ENTITY  ?=  lr_entity->get_related_entities_by_bpath('BTOrderHeader/*$')->GET_FIRST( ).

LR_ENTITY ?=   LR_ENTITY->get_related_entity( IV_RELATION_NAME = '/XYZ/EXT_BOL_RELAT000001').

Thanks, Janine

ceedee666
Active Contributor
0 Kudos

Hi Janine,

as / is used as a separator in BPath expressions I would expect that using a custom name space in a relation is not possible. Although I haven't debugged the BPath parser/interpreter I would expect that your relation name ''/XYZ/EXT_BOL_RELAT000001' is interpreted two relations. Therefore the interpreter would first try to find a relation XYZ, which is not there, and consequently return an error.

If you like to add a custom name space to your relation I'd suggest using an other character to separate the name space (e.g. "-").

Christian

ps.: I guess you are aware of the following document: