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

get_data method of class cl_po_item_handle_mm is returning blank data

get_data method of class cl_po_item_handle_mm is returning blank data for Delivery Schedule.

The code I am using is following:

REPORT zt_flora_07 MESSAGE-ID v1.

DATA:
po    TYPE REF TO cl_po_item_handle_mm,
my_po_header TYPE REF TO cl_po_header_handle_mm,
im_po_number	TYPE	ekko-ebeln,
ex_data_L TYPE    mepoitem,
im_po_item_number	TYPE ekpo-ebelp "	Document Item Number
.

im_po_number = '5500000001'.
im_po_item_number = '00010'.

CREATE OBJECT my_po_header
  EXPORTING
    im_po_number = im_po_number
  EXCEPTIONS
    failure = 1
    others  = 2
    .

CREATE OBJECT po
  EXPORTING
    im_po_item_number = im_po_item_number
    im_po_header =  my_po_header
*    IM_PO_HEADER_ID =
  EXCEPTIONS
    failure = 1
    others  = 2
    .

CHECK sy-subrc = 0.

CALL METHOD po->get_data
  IMPORTING
    ex_data = ex_data_L
  EXCEPTIONS
    failure = 1
    OTHERS  = 2
    .


WRITE:/ 'Finish'.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2006 at 11:43 AM

    Only the delivery schedule data is blank or the whole internal table is blank.

    Ankur B

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2006 at 12:43 PM

    Hi flora,

    1. i also tried at my end.

    2. The first Instance, is only not getting generated /

    popuolated properly

    CREATE OBJECT my_po_header

    EXPORTING

    im_po_number = im_po_number

    EXCEPTIONS

    failure = 1

    others = 2

    3. After this put break-point and try this :

    DATA : HD LIKE MEPOHEADER.

    CALL METHOD MY_PO_HEADER->get_data

    IMPORTING

    EX_DATA = HD

    EXCEPTIONS

    FAILURE = 1

    others = 2

    .

    4. Check if HD (header) is getting any values or not ?

    regards,

    amit m.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2007 at 11:26 AM

    hello, you should call follow methods before calling GET_DAT

    1) po_initialize( ).

    and

    2) po_read( )

    :

    for example (to read order's header)

    DATA lc_po       TYPE REF TO cl_po_header_handle_mm.
    DATA l_ebeln     LIKE ekko-ebeln.
    
    DATA ls_header   TYPE mepoheader.
    
    l_ebeln  = " You Order
    
    
    CREATE OBJECT lc_po
     EXPORTING
       im_po_number = l_ebeln
     EXCEPTIONS
       failure      = 1
       OTHERS       = 9.
    
    
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    
    
    
    DATA l_result  TYPE mmpur_bool.
    
    lc_po->po_initialize( ).
    
    CALL METHOD lc_po->po_read
      EXPORTING
        im_tcode     = 'ME23N'
        im_trtyp      = 'A'
        im_aktyp     = 'A'
        im_po_number = l_ebeln
      IMPORTING
        ex_result    = l_result
      EXCEPTIONS
        OTHERS       = 9.
    
    CHECK l_result EQ 'X'.
    
    
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    
    
    
    CALL METHOD lc_po->get_data
      IMPORTING
        ex_data = ls_header
      EXCEPTIONS
        failure = 1
        OTHERS  = 2.
    
    
    

    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.