cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing details from multiline object attribute..

tony_bramhill2
Participant
0 Kudos

Hi Workflowers, help sought..

Can anyone show me how I can access the <u>value</u> attributes of a <u>multiline object reference</u> attribute.

For example, I want to create a new multiline attribute in the <i>SalesOrder</i> object (ZBUS2032) called <b>LineQuantities</b>. ZBUS2032 has a multiline <u>object reference</u> attribute called <i>Items</i>. I want to place the QUANTITY attributes of all of the <i>Items</i> of the SalesOrder into my new <b>LineQuantities</b> attribute. What is the syntax to retrieve all the QUANTITY attributes of the <i>Items</i> to my new multiline attribute of the SalesOrder?

Can I use something like

SWC_GET_TABLE_PROPERTY self 'Items' <b>it_quantity</b>

to retrieve a list of the <i>Items</i> quantity attributes? In that case, <b>it_quantity</b> would need to be defined as a table of object references, and I would still need to get the quantity attribute from each object somehow. There is probably straightforward way to do this, if someone can enlighten me.

Not sure how to do it, any pointers much appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

pokrakam
Active Contributor
0 Kudos

Hi Tony,

'fraid you have to go the long way, just as you would with internal tables:

Something like:

SWC_GET_TABLE_PROPERTY self 'Items' lt_items
loop at lt_items into lv_item. 
  append lv_item-qty to lt_lineqtys.
endloop.
object-linequantities = lt_lineqtys.

Hope that helps,

Mike

tony_bramhill2
Participant
0 Kudos

Hi Mike.

I thought the 'long way' might be the case, but was thinking there might be some other macro or technique i was unaware of. Thanks for your help.

rgds

tony

Answers (2)

Answers (2)

Former Member
0 Kudos

hai Tony Bramhill

SWC_GET_TABLE_PROPERTY <Object> <Attribute> <AttributeValue>.

The value of the specified DWWULEXWH is established. If it is a YLUWXDO DWWULEXWH, this is done

dynamically.

You must pass the object reference in <Object> and the attribute or key field to be

read in <Attribute>. You must declare <Object> with type SWC_OBJECT.

The value of the attribute or key field is returned in the variable <AttributeValue>.

SWC_GET_PROPERTY returns a single value, SWC_GET_TABLE_PROPERTY returns a

multiline value in an internal table

pokrakam
Active Contributor
0 Kudos

Hi Rose,

Hai? DWWULEXWH? YLUWXDO?

Could I please have some of what you're smoking?

Former Member
0 Kudos

hai Mike Pokraka

sorry i didn't notice that .that line is...

The value of the specified attribute is established. If it is a virtual attribute, this is done dynamically.

regards

rose

tony_bramhill2
Participant
0 Kudos

Hi Rose

Thanks for your response.

I understand how to retrieve attribute values, but that is not really my question. I was wondering if there is a direct way to access the <b>attribute</b> of an <i>object attribute</i>.

Anyhow, Mike's answer suggests that there isn't.

thanks

former_member184112
Active Contributor
0 Kudos

Hi Tony,

Please confirm, First of all did you copy as Subtype of BUS2032. Don't copy directly.

define virtual attribute for Quantity, then you can use multiline container element.

Check this Link for more details:

http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4acd5453d11d189430000e829fbbd/frameset.htm

Thanks and Regards,

Prabhakar Dharmala