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: 

BADI/Exit for PO(ME21N) Service item Check

Former Member
0 Kudos

Hi,

I need to validate PO Service Items,

I have got a BADI - ME_PROCESS_PO_CUST,

However I am not able to get Service Data(ESLL) in it.

I have also gone through Exit - SRVESLL  - EXIT_SAPLMLSP_031

In this I am not able to EKKO and EKPO data,

Please Suggest,

Regards,

Pavan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You Can Read the Global data using field symbol for (SAPLMEPO)EKPO. or (SAPLME02)GT_EKPO[].

Use this in EXIT_SAPLMLSP_031.

The second one might not contain the data at the time initially.

Hope this helps.

8 REPLIES 8

former_member182915
Active Contributor
0 Kudos

hi,

YOU may not get every thing in every where at the time of Enhancement.

So first trace sequence of exit,badi,badi-method for your process. then take the help of ABAP memory that is export import parameter which will help you to get required data in one session .

I will try to give some more appropriate solution in this subject.

Hope this will help you

Former Member
0 Kudos

You Can Read the Global data using field symbol for (SAPLMEPO)EKPO. or (SAPLME02)GT_EKPO[].

Use this in EXIT_SAPLMLSP_031.

The second one might not contain the data at the time initially.

Hope this helps.

0 Kudos

Hi,

Thanks for the reply,

Can you help out with syntax.

Regards,

Pavan.

0 Kudos

Hi ,

The syntax would be as below:

field-symbols : <fs_ekpo>   type any table, "ekpo,

FFIELD-SYMBOLS: <FS_ekpo> TYPE ekpo.

data: wa_ekpo type ekpo,

      lt_ekpo   type standard table of ekpo,

assign ('(SAPLMEPO)EKPO') to <fs_ekpo>.

if <fs_ekpo> is assigned .

       wa_ekpo = <fs_ekpo1>.

     endif.


For table it would be:

assign ('(SAPLME02)GT_EKPO[]') to <fs_ekpo>.

     if <fs_ekpo> is assigned .

       lt_ekpo[] = <fs_ekpo>.

     endif.


Hope this helps.

0 Kudos

Hi,

Can you please tell me how could I get EKKO data..

Regards,

Pavan.

0 Kudos

The same way you got EKPO.

FFIELD-SYMBOLS: <FS_ekpo> TYPE ekpo.

data: wa_ekko type ekko.

assign ('(SAPLMEPO)EKKO') to <fs_ekko>.


if <fs_ekko> is assigned .

       wa_ekko = <fs_ekko>.

     endif.


Hope this helps.

raymond_giuseppi
Active Contributor
0 Kudos

During your search did you find my answer in MM me21n service part user field.Please helppp?

Regards,

Raymond

Former Member
0 Kudos

Hi Pavan,

Using the ABAP stack '(SAPLMEPO)EKKO' you can achieve your requirement, as suggest by Gaurav.

But as suggested by Raymond Giuseppi, using the standard class methods provided by SAP is the recommended way.

* Check the working code below for the ESLL data (also see the sceenshot for run time sample data).

DATA: ls_poheader TYPE mepoheader,

           lt_poitem   TYPE purchase_order_items,

           ls_items      TYPE purchase_order_item,

           lt_esll       TYPE mmsrv_esll,

           ls_item_data  TYPE mepoitem,

           lr_item       TYPE REF TO cl_po_item_handle_mm.

     ls_poheader = im_header->get_data( ).

     lt_poitem = im_header->get_items( ).

     LOOP AT lt_poitem INTO ls_items.

       ls_item_data = ls_items-item->get_data( ).

       mmpur_dynamic_cast lr_item ls_items-item.

* Then use methods of IF_SERVICES_MM interface to get service information

    CALL METHOD lr_item->if_services_mm~get_srv_data

      EXPORTING

        im_packno = ls_item_data-packno

      IMPORTING

        ex_esll   = lt_esll.

ENDLOOP.

Regards,

Raju.