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, FOR ALL ENTRIES?

Former Member
0 Likes
1,197

Hi,

I can't use this code because EBELP and VGPOS are not the same...

EBELP --> EBELP NUMC 5 0 Item Number of Purchasing Document

VGPOS --> VGPOS NUMC 6 0 Item number of the reference item


DATA: ls_likp TYPE likpvb,
      it_lips TYPE tab_lipsvb,
      ls_lips TYPE lipsvb.

DATA: gt_ekpo TYPE STANDARD TABLE OF ekpo,
      gs_ekpo TYPE ekpo.

SELECT     *
FROM       ekpo
INTO TABLE gt_ekpo    
FOR ALL ENTRIES IN it_lips
WHERE      ebeln EQ it_lips-vgbel
AND        ebelp EQ it_lips-vgpos. -------------->> HERE IS THE PROBLEM

How to solve this?

regards,

Adibo.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
976

Declare another internal table with

it_lips1.

vgbel LIKE lips-vgbel,

vgpos LIKE ekpo-ebelp.

itlips1.

LOOP AT itlips.

vgbel = itlips-vgbel.

vgpos = itlips-vgpos.

APPEND itlips1.

ENDLOOP.

Rest use the same code.

6 REPLIES 6
Read only

Former Member
0 Likes
976

Hi,

In the internal table it_lips declare vgpos referring to ebelp.

This will solve ur problem.

Reward if helpful.

Read only

0 Likes
976

Can't do that,



it_lips TYPE tab_lipsvb,

Table Type         TAB_LIPSVB
Table Type for SD Document: Ref. Structure for XLIPS/YLIPS
line type --> LIPSVB

LIPSVB--> Reference structure for XLIPS/YLIPS

Read only

0 Likes
976

Hi

If you want to use FOR ALL ENTRIES option, don't use the item for the selection, but the document number only:

SELECT     * FROM ekpo INTO TABLE gt_ekpo    
                          FOR ALL ENTRIES IN it_lips
                                   WHERE      ebeln EQ it_lips-vgbel.
*AND        ebelp EQ it_lips-vgpos. -------------->> HERE IS THE PROBLEM

Max

Read only

Former Member
0 Likes
976

yes you can not use it ...because the domain is not same .

only the fieds having same domain shoudl be used .

SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
         dmbtr mwart hwbas aufnr projk shkzg kokrs
    FROM bseg
    INTO TABLE it_bseg
    FOR ALL ENTRIES IN it_bkpf
    WHERE bukrs EQ it_bkpf-bukrs AND
          belnr EQ it_bkpf-belnr AND
          gjahr EQ it_bkpf-gjahr.

reward points if it is usefull ...

Girish

Read only

Former Member
0 Likes
977

Declare another internal table with

it_lips1.

vgbel LIKE lips-vgbel,

vgpos LIKE ekpo-ebelp.

itlips1.

LOOP AT itlips.

vgbel = itlips-vgbel.

vgpos = itlips-vgpos.

APPEND itlips1.

ENDLOOP.

Rest use the same code.

Read only

S0025444845
Active Participant
0 Likes
976

Hi,

this because ebelp is type char 10

and vgpos is type numc 6 so the error is because of type mismatch.

To avoid this in it_lips declare

vgpos type ekpo-ebelp.

regards,

sudha