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

Use two conditons for Same table

Former Member
0 Likes
515

I need to do the following :-

Pass machine serial no and inv date in table BSISZUONR and BSISBUDAT

to get BSISDMBTR (Sum up the values of BSISDMBTR)

i am stuck up after this :-

SELECT BUKRS

HKONT

ZUONR

BUDAT

GSBER

DMBTR

FROM BSIS INTO TABLE IT_BSIS

FOR ALL ENTRIES IN IT_OBJK

WHERE ZUONR EQ IT_OBJK-SERNR.

i need to get value of DMBTR for this condn also BUDAT = VBRK-FKDAT along wid above where condn ZUONR EQ IT_OBJK-SERNR.

Pls assist.

3 REPLIES 3
Read only

Former Member
0 Likes
485

Use a join on both the tables!!

Read only

Former Member
0 Likes
485

hi

Try this

select VBRK table data

loop at it_bsis ,read vbrk and remove the budat <> vbrk-fkdat

i think with in single for all entries not possible(may be try to use outer join and loop it)

Read only

Former Member
0 Likes
485

>

> I need to do the following :-

>

> Pass machine serial no and inv date in table BSISZUONR and BSISBUDAT

> to get BSISDMBTR (Sum up the values of BSISDMBTR)

>

> i am stuck up after this :-

> SELECT BUKRS

> HKONT

> ZUONR

> BUDAT

> GSBER

> DMBTR

> FROM BSIS INTO TABLE IT_BSIS

> FOR ALL ENTRIES IN IT_OBJK

> WHERE ZUONR EQ IT_OBJK-SERNR.

>

> i need to get value of DMBTR for this condn also BUDAT = VBRK-FKDAT along wid above where condn ZUONR EQ IT_OBJK-SERNR.

>

> Pls assist.

Try something like this:

SELECT BSIS~BUKRS
            BSIS~HKONT
            BSIS~ZUONR
            BSIS~BUDAT
            BSIS~GSBER
            BSIS~DMBTR
   FROM BSIS 
   JOIN VBRK ON BSIS~BUDAT = VBRK~FKDAT
   INTO TABLE IT_BSIS
   FOR ALL ENTRIES IN IT_OBJK
   WHERE ZUONR EQ IT_OBJK-SERNR.