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

!!!Urgent!!! purchase order

when i am checking po is existing its getting correct value then i need to check if the po exists and its item doesnt exit it should show me an error as an list how cani do it

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 09:14 AM

    Hello,

    Do like this.

    Select * from ekko into table IT_EKKO where EBELN IN S_EBELN.

    If not IT_EKKO[] is initial.

    SELECT * from EKPO into table IT_EKPO for all entries in IT_EKKO where EBELN = IT_EKKO-EBELN.

    endif.

    Loop at IT_EKKO.

    READ atble it_ekpo with key EBELN = IT_EKKO-EBELN.

    if sy-subrc NE 0.

    Error Meesage.

    endif.

    ENDLOOP

    If useful reward.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 09:30 AM

    SELECT ebeln

    ebelp

    FROM ekpo

    INTO TABLE t_ekpo

    FOR ALL ENTRIES IN t_ekko

    WHERE ebeln EQ t_ekko-ebeln

    AND loekz EQ ' '.

    loop at t_ekko.

    read table t_ekpo with key ebeln = t_ekko-eblen.

    if sy-subrc =0 .

    • item exists

    else.

    • item not exists.

    endif.

    -Anu.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 09:35 AM

    U can directly check the table EKPO for the purchase order and item data. Because, item cannot exists without header data. Unless you want to read EKKO for some other data or in different section of the code.

    SELECT SINGLE EBELN POSNR into lbelnr lposnr

    FROM EKPO

    WHERE ebeln = <yourdata> and

    posnr = <youritem>.

    If sy-subrc = 0.

    it exists

    else.

    does not exist.

    endif.

    U can do the same for EKKO for po header data.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 09:14 AM

    Check EKKO table for the PO header data data and EKPO table for item data and accordingly throw a error.

    Regards,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 17, 2006 at 09:14 AM

    hi,

    check table ekko for PO and ekpo for items

    A.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 09:18 AM

    Hi ,

    u mean to say the po is existing fine and now the items under that po is existing or not ???

    am i missing something here or

    are u looking for the items which are deleted under that po number in ekko ..

    if so in ekpo(item level) u have po with items

    check the field loekz --Deletion indicator in purchasing document

    or in the entries put loekz = x ,

    this will fetch u the items deleted under that po ..

    hope this helps ,

    regards,

    VIjay

    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.