Skip to main content

Hi

I'm just beginning to use struct

moving full occurrences ok

but I want to move to a struct  some fields of each occurence

entity : order line and included delivery line (one to one relation)

so I want to take for all occurrences of order line,

order line label + delivery line quantity

so I build struct

 l_line->$newstruct

l_line→libelle=$newstruct

l_line->quantity=$newstruct

componenttostruct l_line, "orderline"   → gave me all fields

How can I do this


Dominique





Hi

I'm just beginning to use struct

moving full occurrences ok

but I want to move to a struct  some fields of each occurence

entity : order line and included delivery line (one to one relation)

so I want to take for all occurrences of order line,

order line label + delivery line quantity

so I build struct

 l_line->$newstruct

l_line→libelle=$newstruct

l_line->quantity=$newstruct

componenttostruct l_line, "orderline"   → gave me all fields

How can I do this


Dominique





To put those two fields in, it's :-



l_line = $newstruct
l_line→libelle = libelle.orderline
l_line→quantity = quantity.orderline



so a full order might look like

l_order = $newstruct
forentity "orderline"
  l_order->Line{$curocc("orderline")} = $newstruct
  call add_line(l_order->Line{$curocc("orderline")})
endfor

.
.
.
.
entry add_line
params
 struct l_line : INOUT
endparams

l_line→libelle = libelle.orderline 
l_line→quantity = quantity.orderline
etc.

end

Hi

I'm just beginning to use struct

moving full occurrences ok

but I want to move to a struct  some fields of each occurence

entity : order line and included delivery line (one to one relation)

so I want to take for all occurrences of order line,

order line label + delivery line quantity

so I build struct

 l_line->$newstruct

l_line→libelle=$newstruct

l_line->quantity=$newstruct

componenttostruct l_line, "orderline"   → gave me all fields

How can I do this


Dominique





Thanks Iain

hard to find all these in the documentation


Thanks Iain

hard to find all these in the documentation

Hi Dominique,

It could be helpful this nice page into official documentation; it is including many struct code samples.

Gianni


Thanks Iain

hard to find all these in the documentation

Thanks Gianni

nice page