02-20-2019 7:01 AM
Hey,
I am having trouble to get field data from structure.
select single * into @data(wa_vbap2)
from vbap as v
left outer join vbfa as x
on v~vbeln = x~vbelv
left outer join vbfa as y
on x~vbeln = y~vbelv and x~vbtyp_v = 'G'
where y~vbeln = @vbeln and y~vbtyp_v = 'C'.
this is my query and in debugging mode i have this.
i want to fetch fields from V. how can i do this?
like
zproj_name = wa_vbap2-zproj_name. (giving error)
thanks.
02-20-2019 8:48 AM
because you dont specific field name ( select * from a join ) then fields of each table will save in corresponding nested structure of return structure. you can access field like below:
zproj_name = wa_vbap2-v-zproj_name.(i suppose zproj_name is under vbap which you define alias as V in query, if not you have to change it)
02-20-2019 7:46 AM
You can try specifying only fields from V like below
select single v~* into @data(wa_vbap2)
from vbap as v
left outer join vbfa as x
on v~vbeln = x~vbelv
left outer join vbfa as y
on x~vbeln = y~vbelv and x~vbtyp_v = 'G'
where y~vbeln = @vbeln and y~vbtyp_v = 'C'.
02-20-2019 8:48 AM
because you dont specific field name ( select * from a join ) then fields of each table will save in corresponding nested structure of return structure. you can access field like below:
zproj_name = wa_vbap2-v-zproj_name.(i suppose zproj_name is under vbap which you define alias as V in query, if not you have to change it)
02-20-2019 9:14 AM
i am using @data(wa_vbap2) it will create itselft.
after executing query i am getting the data but don't know how to display or pass that data into another field.
anyway Thank you all, I resolve my issue. i checked that structure filed in debugging and got my answer.
now i am using like this.
zproj_name = wa_vbap2-v-zproj_name