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: 

ME51N / BADI ME_PROCESS_REQ_CUST

Washington
Explorer
0 Kudos

Hi guys,

i need to validate the entry made in the field BEDNR in ME51N and ME52N. I created an implementation of the badi ME_PROCESS_REQ_CUST in SE19, that was activated.

Now, i'm trying to use the PROCESS_ITEM method to validate the value of BEDNR field, to do this i need the value of this field.

The parameter IM_ITEM must provide it, this is a reference type of IF_PURCHASE_REQUISITION_ITEM, that is an interface that contains the GET_DATA method, that i'm tying to use w/o success.

Could somebody help me, please ?

1 ACCEPTED SOLUTION

former_member214131
Active Contributor
0 Kudos

Hello,

Check this link:

Please let me know if you need further help.

Regds, Murugesh AS

3 REPLIES 3

former_member214131
Active Contributor
0 Kudos

Hello,

Check this link:

Please let me know if you need further help.

Regds, Murugesh AS

0 Kudos

Hi Murugesh,

thanks for your answer.

I saw the thread that you sent, tried to implement, but i'm still having problems with this.

I changed the code to:

method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM .

data: l_mereq_item type mereq_item,

l_ztmm0003 type ztmm0003.

l_mereq_item = im_req_item->get_data( ).

check not l_mereq_item-bednr is initial.

select single *

into l_ztmm0003

from ztmm0003

where bednr eq l_mereq_item-bednr.

check not sy-subrc is initial.

message e001(zmm01).

endmethod.

And, when i try to actvate, i got the messages:

"Classe ZCL_IM_ME_PROCESS_REQ_CUST,Method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM"

"The field "IM_REQ_ITEM" is unknown, but there is a field with the similar name "IM_REF_ITEM"."

I changed "IM_REQ_ITEM" by "IM_REF_ITEM" and the activation was ok, i ran the ME52N, changed the value of the BEDNR and got a DUMP, with:

Runtime error <u>OBJECTS_OBJREF_NOT_ASSIGNED_NO</u>

Exception <u>CX_SY_REF_IS_INITIAL</u>

<u>Error analysis</u>

An exception occurred. This exception is dealt with in more detail below

. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL', was neither caught nor passed along using a RAISING clause, in the procedure "IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM" "(METHOD)"

......

0 Kudos

Hi Murugesh,

i found de problem.

Just changed the line

l_mereq_item = <b>im_req_item</b>->get_data( ) (e.g)

by

l_mereq_item = <b>im_item</b>->get_data( ).

Now works fine.

Thanks !!!