Skip to Content
author's profile photo Former Member
Former Member

SELECT, FOR ALL ENTRIES?

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 09:11 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 09:17 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 09:07 AM

    Hi,

    In the internal table it_lips declare vgpos referring to ebelp.

    This will solve ur problem.

    Reward if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2007 at 09:08 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.