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 statement

Former Member
0 Likes
855

How to write select statement for 3 tables mvke vbak vbap using FOR ALL ENTRIES

Thanks & Regards

Kavitha

7 REPLIES 7
Read only

Former Member
0 Likes
794

Hi,

Forall entries is used to compare an internal table with the database table..I will give u a example..

SELECT VBRKVBELN VBRKFKDAT VBRKERDAT VBRKKUNRG VBRK~KUNAG

VBRKNETWR VBRKVKORG VBRKVTWEG VBRPSPART VBRPPOSNR VBRPMATNR

VBRPARKTX VBRPFKIMG INTO CORRESPONDING FIELDS OF TABLE ITAB FROM VBRK

AS VBRK INNER JOIN VBRP AS VBRP

ON VBRPVBELN = VBRKVBELN

WHERE VBRK~VKORG = VKORG AND

VBRK~VTWEG IN VTWEG AND

VBRK~SPART IN SPART AND

VBRP~MATNR IN MATNR AND

VBRK~FKDAT IN FKDAT AND

VBRK~KUNRG IN KUNNR AND

VBRK~ERDAT IN ERDAT.

ITAB1[] = ITAB[].

SORT ITAB BY VBELN.

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN.

SELECT VTWEG VTEXT FROM TVTWT INTO CORRESPONDING FIELDS OF TABLE DISCH

FOR ALL

ENTRIES IN ITAB WHERE vtweg = ITAB-VTWEG AND SPRAS = 'EN'.

SELECT KUNNR NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE CUST FOR

ALL ENTRIES IN ITAB WHERE KUNNR = ITAB-KUNRG.

reward if useful

Read only

0 Likes
794

Hi,

My Question is this

Get the material pricing group (field MVKE-KONDM) from the material master of the current material (MVKE where MVKE-VKORG = VBAK-VKORG and MVKE-VTWEG = VBAK-VTWEG and MVKE-MATNR = VBAP-MATNR).

Thanks & Regards

Kavitha

Read only

Former Member
0 Likes
794

hi

good

You have to write with respect to VBAK,

If not l_t_vbak[] is initial.

Select vbeln posnr .... from vbap in to l_t_vbap

for all entries in l_t_vbak

where vbeln = l_t_vbak-vbeln.

endif.

thanks

mrutyun^

Read only

0 Likes
794

Hi,

Where is mvke table.

Thanks & regards

Kavitha

Read only

0 Likes
794

Hi ,

3 tables r there vbak,vbap,mvke please help me out.I will give good points to you.

Read only

0 Likes
794

Hi kavitha,

As per ur explaination, i have written the select query.

Hope this will help u.

select xkondm y z~ into corresponding fields of table itab from mvke as x inner join vbak as y on xvkorg = yvkorg and xvtweg = yvtweg inner join vbap as z on xmatnr = zmatnr.

Regards...

Arun.

Read only

Former Member
0 Likes
794

Hi Kavitha,

try it.

"sorry, corrections"

Select HONDM

from MVKE

into table TI_TABLE

for all entries in MVKE(use a "TI_MVKE")

where

VKORG = VBAK-VKORG and

VTWEG = VBAK-VTWEG and

MATNR = VBAP-MATNR.

Regards

Allan Cristian

Message was edited by:

Allan Cristian