Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select Query

Former Member
0 Likes
856

Hi

Can anybody help me to correct the query.

it is giving me a short dump.

DATA : BEGIN OF t_vbsegk OCCURS 0,

ausbk TYPE ausbk,

belnr TYPE belnr_d,

gjahr TYPE gjahr,

bzkey TYPE buzei,

lifnr TYPE lifnr,

sgtxt TYPE sgtxt,

ebeln TYPE ebeln,

ebelp TYPE ebelp,

buzei TYPE mblpo,

werks TYPE werks_d,

END OF t_vbsegk.

SELECT vbsegk~ausbk

vbsegk~belnr

vbsegk~gjahr

vbsegk~bzkey

vbsegk~lifnr

vbsegk~sgtxt

ekbe~ebeln

ekbe~ebelp

ekbe~buzei

ekbe~werks

FROM vbsegk

JOIN ekbe

ON vbsegkgjahr = ekbegjahr

AND vbsegkbelnr = ekbebelnr

INTO CORRESPONDING FIELDS OF TABLE t_vbsegk

WHERE vbsegk~ausbk IN s_ausbk

AND vbsegk~belnr IN s_belnr

AND vbsegk~gjahr IN s_gjahr

AND vbsegk~lifnr IN s_lifnr

and ekbe~VGABE = ‘P’.

Basicallly i want to extract the data fom the above two tables based on user input in selection screen.

Thanks

Any help will not go unmarked.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
731

hi

you can just check whether the value table in the domain VGABE contains the value 'P'.

and you can also make the second trial by declaring the 'P' as a local variable or a constanst and try passing that...

example:


constants: vgabe value 'P'.


-- 
SELECT vbsegk~ausbk
- 
-- 
- 
AND ekbe~vgabe = VGABE.

thanks

pavan

4 REPLIES 4
Read only

Former Member
0 Likes
732

hi

you can just check whether the value table in the domain VGABE contains the value 'P'.

and you can also make the second trial by declaring the 'P' as a local variable or a constanst and try passing that...

example:


constants: vgabe value 'P'.


-- 
SELECT vbsegk~ausbk
- 
-- 
- 
AND ekbe~vgabe = VGABE.

thanks

pavan

Read only

Former Member
0 Likes
731

Hi,

It working fine for the following code.

constants: c_vgabe type vgabe value 'P'.

DATA : BEGIN OF t_vbsegk OCCURS 0,
ausbk TYPE ausbk,
belnr TYPE belnr_d,
gjahr TYPE gjahr,
bzkey TYPE buzei,
lifnr TYPE lifnr,
sgtxt TYPE sgtxt,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
buzei TYPE mblpo,
werks TYPE werks_d,
END OF t_vbsegk.



SELECT vbsegk~ausbk
vbsegk~belnr
vbsegk~gjahr
vbsegk~bzkey
vbsegk~lifnr
vbsegk~sgtxt
ekbe~ebeln
ekbe~ebelp
ekbe~buzei
ekbe~werks
FROM vbsegk
JOIN ekbe
ON vbsegk~gjahr = ekbe~gjahr
AND vbsegk~belnr = ekbe~belnr
INTO  TABLE t_vbsegk
WHERE vbsegk~ausbk IN s_ausbk
AND vbsegk~belnr IN s_belnr
AND vbsegk~gjahr IN s_gjahr
AND vbsegk~lifnr IN s_lifnr
and ekbe~VGABE = c_vgabe.

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
731

hi,

Once check all the data elements in data declaration.

Read only

Former Member
0 Likes
731

Hi Syed, What exactly does the dump states.....the query seems to be correct Some times if u try to access to many records with out proper primary key then the system might give a dump. But in your context all the primary keys are fine but want to check whether r u passing as data in the select options if not then that might be one reason...

Also once check all the data declarations..

Regards,

Swaroop