Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3180

ME22N - get line data from Purchase Order

$
0
0

Hello ,

 

I am creating my own Search Help for Batch and I am trying to get some data (e.g. MATNR) from specific line item in ME22N.

Usually it works when we use ASSIGN for getting a table and then GET CURSOR for getting specific line number.

But in ME22N it does not work like this.

When I call GET CURSOR  in my Search Help I get nothing.

I have found some code to get line items, it looks like this:

 

 

DATA: cl_item  TYPE mmpur_model_type,

           cl_item2 TYPE REF TO if_purchase_order_item_mm,

           cl_item3 TYPE REF TO cl_po_item_handle_mm,

           ls_data  TYPE mepoitem,

           lit_komv TYPE TABLE OF komv.

 

     FIELD-SYMBOLS: <lfs_dyn1211_items> TYPE mmpur_models,

                    <lfs_2>             TYPE any.

 

      ASSIGN ('(SAPLMEGUI)DYN_1211ITEMS[]') TO <lfs_dyn1211_items>.

 

     IF <lfs_dyn1211_items> IS   ASSIGNED.

       LOOP AT <lfs_dyn1211_items> INTO cl_item.

*      CLEAR: v_sakto, v_aufnr, v_bukrs, v_autyp, v_konty.

         " Get item data to ls_data structure

         cl_item3 ?= cl_item-model.

         cl_item3->get_data( IMPORTING ex_data = ls_data ).

       ENDLOOP.

     ENDIF.


But anyway even if I am able to get data table, I am not able to get item number - e.g. it should be like 5 when I call Search Help from this place.

Does anyone know how to solve that issue ?

2015-12-24_154615.jpg


Regards,

Rafal

 


Viewing all articles
Browse latest Browse all 3180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>