Application Development 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: 

problem with data type

Former Member
0 Kudos

Hi friends

I have requirement where i need to relate

ekpo-bednr and

ekpo-afnam

with vbrp- AUBEL and

vbrp-aupos

i wanted to do

for all entries select with these two tables; meaning for all entries of ekpo-afnam and ekpo-bednr need to select vbrp-aubel and vbrp-aupos..

but the difficuty is the data type of afnam and aupos is diffrent , it says this cannot be used FOR all ENTRIES in purpose...

could any of you please let me know , for anyother way to get this query?

Thanks in advance

RInky.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this example..

DATA: BEGIN OF ITAB_EKPO OCCURS 0,

BEDNR LIKE EKPO-BEDNR,

AFNAM LIKE EKPO-AFNAM,

END OF ITAB_EKPO.

DATA: BEGIN OF ITAB_VBRK OCCURS 0,

AUBEL LIKE VBRP-AUBEL,

AUPOS LIKE VBRP-AUPOS,

END OF ITAB_VBRK.

  • Lets say if you have the po detail in the internal table...You cannot directly use the internal table for the vbrk as the data type will not match..Instead populate the values from the PO internal table to the ITAB_VBRK internal table and then use the FOR ALL ENTRIES...

LOOP AT ITAB_EKPO.

ITAB_VBRK-AUBEL = ITAB_EKPO-BEDNR.

ITAB_VBRK-AUPOS = ITAB_EKPO-AFNAM.

APPEND ITAB_VBRK.

ENDLOOP.

  • SELECT THE DATA.

SELECT * FROM VBRP

INTO TABLE T_VBRP

FOR ALL ENTRIES IN ITAB_VBRK

WHERE AUBEL = ITAB_VBRK-AUBEL

AND AUPOS = ITAB_VBRK-AUPOS.

Hope this is what you want..

THanks,

Naren

1 REPLY 1

Former Member
0 Kudos

Hi,

Check this example..

DATA: BEGIN OF ITAB_EKPO OCCURS 0,

BEDNR LIKE EKPO-BEDNR,

AFNAM LIKE EKPO-AFNAM,

END OF ITAB_EKPO.

DATA: BEGIN OF ITAB_VBRK OCCURS 0,

AUBEL LIKE VBRP-AUBEL,

AUPOS LIKE VBRP-AUPOS,

END OF ITAB_VBRK.

  • Lets say if you have the po detail in the internal table...You cannot directly use the internal table for the vbrk as the data type will not match..Instead populate the values from the PO internal table to the ITAB_VBRK internal table and then use the FOR ALL ENTRIES...

LOOP AT ITAB_EKPO.

ITAB_VBRK-AUBEL = ITAB_EKPO-BEDNR.

ITAB_VBRK-AUPOS = ITAB_EKPO-AFNAM.

APPEND ITAB_VBRK.

ENDLOOP.

  • SELECT THE DATA.

SELECT * FROM VBRP

INTO TABLE T_VBRP

FOR ALL ENTRIES IN ITAB_VBRK

WHERE AUBEL = ITAB_VBRK-AUBEL

AND AUPOS = ITAB_VBRK-AUPOS.

Hope this is what you want..

THanks,

Naren