Skip to Content

issue with select for EKPO and LIPS tables

Hi experts,

I am fetching data from EKPO table based on entries in LIPS table, where I am getting an error as EBELP and I_LIPS-VGPOS must be of same type and length

SELECT ebeln ebelp cuobj

FROM ekpo

INTO TABLE i_cuobj

FOR ALL ENTRIES IN i_lips

WHERE ebeln = i_lips-vgbel

AND ebelp = i_lips-vgpos.

I know we can move the contents into a temporary internal table I_LIPS_TEMP, which is a copy of I_LIPS table , and use the temporary internal table I_LIPS_TEMP when fetching data from EKPO.

I also know that VGPOS is of type NUMC 6 and EKPO EBELP is of type NUMC 5 . Please suggest any good solution for this.

Thanks,

RG

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Sep 18, 2016 at 09:47 AM
    SELECT ebeln ebelp cuobj
           FROM ekpo
           INTO TABLE i_cuobj
           FOR ALL ENTRIES IN i_lips
           WHERE ebeln  = i_lips-vgbel
           AND   ebelp  = i_lips-vgpos(5).
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2016 at 07:39 AM

    Usually I use EKBE, joining EKPO and EKBE with EBELN, EBELP and filtering with EKBE-VGABE = '8' for delivery. Then select from LIPS with EKBE-BELNR = LIPS-VBELN and concatenate EKBE-GJAHR+2(2) + EKBE-BUZEI = POSNR 😎...

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2016 at 06:34 AM

    Hi,

    Try,

    LOOP AT i_lips INTO w_LIPS.

    SELECT ebeln ebelp cuobj

    FROM ekpo

    APPENDING TABLE i_cuobj

    WHERE ebeln = w_LIPS-vgbel

    AND ebelp = w_LIPS-vgpos.

    ENDLOOP.

    Hope it helpful,

    Regards,

    Venkat.

    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.