Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

get_data method of class cl_po_item_handle_mm is returning blank data

Former Member
0 Kudos

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'.

4 REPLIES 4

Former Member
0 Kudos

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

Ankur B

0 Kudos

ex_data_L structure is blank in the last method call

Former Member
0 Kudos

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.

pavel_parshenkov2
Participant
0 Kudos

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.