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

if_ex_me_process_req_cust Error while compling code

Former Member
0 Likes
532

I am getting Error in the Following Code which is marked as Bold, pls Help << Removed >>.

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

METHOD if_ex_me_process_req_cust~check.

DATA : t_item TYPE mmpur_requisition_items,

w_item TYPE mmpur_requisition_item,

ref_account TYPE REF TO if_acct_container_mm,

t_acc_objs TYPE mmpur_accounting_list,

w_acc_obj TYPE mmpur_accounting_type,

ref_model TYPE REF TO if_accounting_model_mm,

w_exkn TYPE exkn,

t_exkn TYPE STANDARD TABLE OF exkn,

ref TYPE REF TO if_purchase_requisition_item,

i_act_items TYPE mereq_item,

t_itemdata TYPE STANDARD TABLE OF mereq_item,

w_itemdata TYPE mereq_item,

ref_acc TYPE REF TO if_accounting_model_mm.

*=============================Acc

DATA: w_ekkn TYPE mepoaccounting_datax,

w_ekkn1 TYPE exkn,

w_ekkn3 TYPE exkn.

*=============================Acc

CONSTANTS : c_f TYPE c VALUE 'F'.

break mm_sd.

IF sy-tcode = 'ME51N' OR sy-tcode = 'ME52N' OR sy-tcode = 'ME53N'.

  • Retreving Item details

CALL METHOD im_header->get_items

RECEIVING

re_items = t_item.

LOOP AT t_item INTO w_item.

ref = w_item-item.

CALL METHOD ref->get_data

RECEIVING

re_data = i_act_items.

APPEND i_act_items TO t_itemdata.

  • Retreving Account details

ref_account = ref.

CALL METHOD ref_account->get_items

RECEIVING

re_items = t_acc_objs.

break mm_sd.

LOOP AT t_acc_objs INTO w_acc_obj.

ref_model = w_acc_obj-model.

*=========================================== Acc Details

CALL METHOD ref_model->get_exknx

RECEIVING

re_exknx = w_ekkn.

CALL METHOD ref_model->get_exkn

RECEIVING

re_exkn = w_ekkn1.

*=========================================== for Saving Data Error

w_ekkn1-aufnr = '123456789'. "Wanted set Defalt Order No in PR

CALL METHOD ref_model->set_datax

EXPORTING

re_exknx = w_ekkn.

CALL METHOD ref_model->set_data

EXPORTING

re_exkn = w_ekkn1.

*==============================================

ENDLOOP.

ENDLOOP.

ENDIF.

ENDMETHOD.

Edited by: Rob Burbank on Apr 19, 2009 10:06 PM

1 ACCEPTED SOLUTION
Read only

mvoros
Active Contributor
0 Likes
467

Hi,

ref_model does not have methods set_datax and set_data. Probably you want to call methods SET_EXKN and SET_EXKNX. You have also problem with variable type. Method GET_EXKNX returns variable with different type than GET_EXKNX. One more thing. You will have to set change flag in X structure for your modified field AUFNR as well. It look like you don't understand how to use that object to modify some field.

General approach:

1) Get current structure plus structure with modification flags using methods GET_EXKN and GET_EXKNX.

2) Change fields and set change flags for these fields in the X structure

3) Update object using methods SET_EXKN and SET_EXKNX.

Cheers

2 REPLIES 2
Read only

mvoros
Active Contributor
0 Likes
468

Hi,

ref_model does not have methods set_datax and set_data. Probably you want to call methods SET_EXKN and SET_EXKNX. You have also problem with variable type. Method GET_EXKNX returns variable with different type than GET_EXKNX. One more thing. You will have to set change flag in X structure for your modified field AUFNR as well. It look like you don't understand how to use that object to modify some field.

General approach:

1) Get current structure plus structure with modification flags using methods GET_EXKN and GET_EXKNX.

2) Change fields and set change flags for these fields in the X structure

3) Update object using methods SET_EXKN and SET_EXKNX.

Cheers

Read only

Former Member
0 Likes
467

Thanks a Lot. problem is Solved