Application Development and Automation 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: 
Read only

Error in OO

Former Member
0 Likes
544

Moderator message: please use more descriptive subject lines from now on.

Hi Guys

In the code below occurs this error : "gs_MEPOHEADER" is not a reference variable.

I inserted the code between the coments " *** FSF "

I need to change the value of the field LIFNR on gw_MEPOHEADER and to pass by Set_data.

Somenone can help me, please.

============================================================================

METHOD if_ex_me_process_po_cust~process_header .

DATA : lt_items TYPE purchase_order_items.

DATA : ls_items LIKE LINE OF lt_items.

DATA : ls_data TYPE mepoitem .

DATA : ls_data_aux TYPE mepoitem.

DATA : v_end TYPE c.

      • FSF

data: gw_MEPOHEADER type MEPOHEADER.

data: gs_MEPOHEADER like gw_MEPOHEADER.

data: wa_ekpo type ekpo.

      • FSF

lt_items = im_header->get_items( ) .

LOOP AT lt_items INTO ls_items.

ls_data_aux = ls_items-item->get_data( ) .

IF ls_data_aux-loekz IS INITIAL.

EXIT.

ENDIF.

ENDLOOP.

LOOP AT lt_items INTO ls_items.

ls_data = ls_items-item->get_data( ) .

IF ls_data_aux-adrn2 NE ls_data-adrn2.

MOVE ls_data_aux-adrn2 TO ls_data-adrn2.

ls_items-item->set_data( ls_data ) .

ENDIF.

IF NOT ls_data-banfn IS INITIAL.

v_end = 'X'.

EXPORT zz FROM v_end TO MEMORY ID 'ZEND'.

EXIT.

ENDIF.

ENDLOOP.

      • FSF

gw_MEPOHEADER = IM_HEADER->get_data( ).

move: gw_MEPOHEADER to gs_MEPOHEADER.

select single zzlifnr

from ekpo

into wa_ekpo-zzlifnr

where ebeln = gw_MEPOHEADER-konnr.

if wa_ekpo-zzlifnr ne gw_MEPOHEADER-lifnr.

gs_MEPOHEADER->set_data( gw_MEPOHEADER ) . <<<< The error occurs in this line

endif.

      • FSF

ENDMETHOD.

Edited by: Thomas Zloch on Nov 30, 2010 12:31 PM

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
501

Hello,

gs_MEPOHEADER->set_data( gw_MEPOHEADER ) . <<<< The error occurs in this line

If you want to use Object reference variables you should use TYPE REF TO & not TYPE.

BR,

Suhas

1 REPLY 1
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
502

Hello,

gs_MEPOHEADER->set_data( gw_MEPOHEADER ) . <<<< The error occurs in this line

If you want to use Object reference variables you should use TYPE REF TO & not TYPE.

BR,

Suhas