cancel
Showing results for 
Search instead for 
Did you mean: 

programming for virtual attribute of BOR

Former Member
0 Kudos

Hi,

I extended BOR and added a new attribute

for the definition of this BOR there is bit of a logic involved to find its value , so i am trying to write the logic in GET_PROPERTY...........END_PROPERTY

i am facing problems here

1) reading other attributes -

for this logic i need to read other attributes of this business object

so i thought i can find them in object-<attributename>

but i cant find it, i dont know who to read the attribute. should i use the macro SWC_GET_PROPERTY

this isnt a method , its an attribute definition, still do i needto use this macro ?

2) writing to the new attribute

i am even not able to write to the new attribute

the system generated a template for this new attribute by itself in the program

the template looks like this

GET_PROPERTY APPROVERS CHANGING CONTAINER.

SWC_SET_TABLE CONTAINER 'Approvers' OBJECT-APPROVERS.

END_PROPERTY.

but when i write OBJECT-APPROVERS = 'test'. it gives me syntax error saying OBJECT-APPROVERS cannot be converted to type C. while my declaration for the atribute is PA0002-CNAME which should definitely take charaters.

could you please provide some guidance on this programming, how to read and write to attributes of the BO ?

thanks in advance

R

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I got the second part. Its a multiline attribute so i have to write - append 'test' to object-approvers.

but i stil cant get the first part - i have extended business object BUS2012 (purchase order)

and i am trying to read the attribute release strategy.

so if i say -

move object-releasestrategy to v_frgsx

then i get error :

The data object "OBJECT" does not have a component called "RELEASESTRATEGY".

imthiaz_ahmed
Active Contributor
0 Kudos

Use SWC_GET_ELEMENT for single line item / SWC_GET_TABLE for multiline (table), Refer to the "Release" method of that BO and you will get an idea.

Regards, IA

Former Member
0 Kudos

hi Imthiaz,

SWC_GET_ELEMENT did not work

I need an attribute and not container element

I need it in attribute definition (of another attribute than which i need to read) and not a method.

could you kindly advice ?

i used SWC_GET_PROPERTY , but it didnt work

thanks

Former Member
0 Kudos

You have to USE MACRO

SWC_GET_PROPERTY SELF "attribute name" Variable to store

Thanks

Arghadip

imthiaz_ahmed
Active Contributor
0 Kudos

It should work. SWC_GET_PROPERTY is to read attribute of another object.

Regards, IA

Former Member
0 Kudos

Hi,

I checked all of this below :

1) SWC_GET_ELEMENT CONTAINER 'ReleaseStrategy' v_frgsx.

2) SWC_GET_PROPERTY SELF 'ReleaseStrategy' v_frgsx.

3) data : object1 type swc_object.

object1 = 'SELF'.

SWC_GET_PROPERTY object1 'ReleaseStrategy' v_frgsx.

None of these is working. to Imthiaz - I checked the method release of business object like you said. But I didnt find it reading any attribute, its reading the container that is its parameters.

Kindly advice.

thank you in advance

Former Member
0 Kudos

I need to create the attribute somewhat like ReleaseAgent attribute of BUS2081 busines object.

Here also , the object key is read in order to build logic for determining one of the attributes ReleaseAgent

I need to know another attribute and not key.

Is it so that the other attributes are not available at all when defining an attribute as all attributes would be determined at the same time ??

imthiaz_ahmed
Active Contributor
0 Kudos

I think your point is valid, since all the attributes are determined at the same time within an object, it will always fail. Therefore apply same logic to determine that attrbute(to be read attrbiute) value again in your attribute.

regards, IA

Former Member
0 Kudos

yes ok....thank you, thread closed.

Former Member
0 Kudos

Hi All,

we have similary requirement where 1. we needs to create a virtual attribute for BOR type BUS2121 could you please detail the step by step procedure fro this.

2.dose this needs to use the access key for making the above changes.

Regards,

Vinod

Answers (0)