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

Problem in geting po type in ME_PROCESS_PO_CUST

Hi..

i have done validation for Po item i.e. if PO doc type is zsp1/zsp3... i have to make PR num is mandatory at line item level.

It is working fine for ME22N and ME23N.. bcoz i m getting doc type from EKKO using po num.

But when they are creating PO using ME21N obviously there is no PO exit in ekko table bcoz it is not at saved...

then how would i check it FOR tcode me21n....

Pls help me in this regard.

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 Mar 01, 2013 at 12:01 PM

    HI.. i got resolved it by putting the below snippet

    Thnaks to Raymond and Prasanth Patil.

    data : ls_header type ref to if_purchase_order_mm,

    ls_mepoheader type mepoheader.

    ls_header = im_item->get_header( ).

    ls_mepoheader = ls_header->get_data( ).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 28, 2013 at 08:35 AM

    Hi

    It would work for tcode ME59N if you want a PR id when you are creating the PO. Please, ask to a MM consultant. So, check it for ME59N and set the proper filter in your BADI for avoiding this check in ME21N without PR.

    Regards

    Eduardo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 28, 2013 at 08:56 AM

    Hi,

    Use method GET_DATA to read the heade data, you will get the PO type in header data.

    Regards,

    Prashant Patil

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi i tried with the below code snipped but it thours an error

      "IM_HEADER" is not a reference variable

      data : im_header type mepoheader,

      ls_header type mepoheader.

      * ls_item = im_item->get_data( ).

      * im_header = im_item->get_header( ).

      * im_header->get_data( ).

      CALL METHOD im_header->get_data

      EXPORTING

      im_data = ls_header.


  • Posted on Feb 28, 2013 at 11:10 AM

    Use method

      im_header->get_data( )

    or from item

      ls_item = im_item->get_data( ).  im_header = im_item->get_header( ).  ls_header = im_header->get_data( ).

    And don't use SELECT to get data from database, but methods get_persistent_data( ).

    Regards,

    Raymond

    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.