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~PROCESS_ITEM modify field value

Former Member
0 Likes
6,117

Hi All

In badi ME_PROCESS_REQ_CUST.

I want in check or process_item method to change one of the field values (EBAN structure)

if im_count = 1.

DATA: l_preq TYPE mereq_item.

CALL METHOD IM_ITEM->get_data

RECEIVING

re_data = l_preq.

If l_preq-MATNR IS INITIAL.

MOVE 'YES' TO l_preq-REVNO.

ELSE.

MOVE 'NO' TO l_preq-REVNO.

ENDIF.

DATA: ls_datax type MEREQ_ITEMX.

MOVE 'X' to ls_datax-revno.

CALL METHOD im_item->set_datax

EXPORTING

im_datax = ls_datax

.

CALL METHOD IM_ITEM->set_data

EXPORTING

im_data = l_preq.

endif.

This is my code in process item.

However the set_data method does not store the new value set.

I marked the field for update with set_datax. And tried without this method.

Anny1 got a clue on this?

And the code is actually being fully executed.

I can't see what i'm doing wrong and i've been trying this for houres now...

Anny help would be welcome.

Regards,

Tim

Edited by: LeysTim on Aug 3, 2010 3:07 PM

13 REPLIES 13
Read only

Former Member
0 Likes
3,345

Hi Tim,

I am not so sure, but in one of the thread it is saying

You can only use this BADI for customer defined fields. It will not allow you to change standard fields.

for your reference I am attaching the same below.

regards,

Antony Thomas

Read only

Former Member
0 Likes
3,345

Thank you for your feedback.

But if I can not modify standard fields there, can you tell me where i should place this piece of code?

Thanks in advandce

Read only

0 Likes
3,345

Hi Tym,

Could you please let me know the transaction code where you want to insert this code

Regards,

Antony Thomas

Read only

0 Likes
3,345

I need this for transactions

ME51N

ME52N

ME53N

ME54N

ME55

ME57

Kind regards,

Tim

Read only

0 Likes
3,345

Hi Tym,

Go to transaction SE24, class name CL_EXITHANDLER, go to methods, double click on method GET_INSTANCE.

Set a break point at

CALL METHOD cl_exithandler=>get_class_name_by_interface

EXPORTING

instance = instance

IMPORTING

class_name = class_name

CHANGING

exit_name = exit_name

EXCEPTIONS

no_reference = 1

no_interface_reference = 2

no_exit_interface = 3

data_incons_in_exit_managem = 4

class_not_implement_interface = 5

OTHERS = 6.

CASE sy-subrc.

Now run trasactions ME51N,ME52N,ME53N,ME54N,ME55,ME57

,your control will break at each BADI(If any), exit name and instance will give you the BADI details.

I think this is one of the simplest way.

Thanks and Regards,

Antony Thomas

Read only

0 Likes
3,345

Thank you for your reply,

I know how to find BADI's.

But I can not find one other then IF_EX_ME_PROCESS_REQ_CUST where I could put my code.

Best i Found is ME_PROCESS_REQ and I'll try to use that one now.

I'll keep you updated.

Update: I can not put my code there because it is standard SAP...

I can not add an implementing class there.

Anny further help would be welcome

Edited by: LeysTim on Aug 4, 2010 9:37 AM

Edited by: LeysTim on Aug 4, 2010 10:19 AM

Read only

0 Likes
3,345

I still couldn't find a way to solve this issue, i tried with custom field now but it is also not working...

Anny help / ideas?

Read only

0 Likes
3,345

Hi Tym,

I am Really sorry for this delayed reply, as I was bit nusy with some work..

I had done an analysys on this issue, and I am feeling like can you give a trial and error in imlementaion of BADI ME_PROCESS_REQ_CUST in method POST. In my last thread me only told you not to use it, but while going through the documentaion of this BADi I am feeling like this is the better one, but method should be POST. I think that particular thread wad misleading us.

Please check whether your required fields are available here in this method, as method CHECK and PROCESS_ITEM is not updating anythiing.

Another way is keep the curren code in PROCESS_ITEM, then chek the interface of POST.

Regards,

Keep me updated, will help you if Ican, dont have ME51n athourisation, so couldnt replicate the issue.

Regards,

Antony Thomas

Read only

0 Likes
3,345

Hi Tym,

I am Really sorry for this delayed reply, as I was bit busy with some work..

I had done an analysys on this issue, and I am feeling like can you give a trial and error in the implementaion of BADI ME_PROCESS_REQ_CUST in method POST. In my last thread me only told you not to use it, but while going through the documentaion of this BADi I am feeling like this is the better one, but method should be POST. I think that particular thread was misleading us.

Please check whether your required fields are available here in this method, as method CHECK and PROCESS_ITEM is not updating anythiing.

Another way is to keep the current code in PROCESS_ITEM, then chek the interface of POST, whether update indiacator is there or not!

Regards,

Keep me updated, will help you if I can, don't have ME51n authourisation, so couldn't replicate the issue.

Regards,

Antony Thomas

Read only

Former Member
0 Likes
3,345

Problem is solved.

Could not be done from inside BADI in a proper way, used userexit instead.

Read only

deepak_dhamat
Active Contributor
0 Likes
3,345

Hi Leystim ,

Can you tell me in user exit where you have updated field value of EBAN .

regards

deepak

Read only

Former Member
0 Likes
3,345

Used the SMOD components MEREQ*

Regards,

Tim

Read only

Dominik_Meier
Participant
3,345

This thread is >10 years old but I stumbled across it on Google and thought I'd share that using the BAdI worked just fine for me in ECC EhP8.

  method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM.

  DATA(ls_item) = im_item->get_data( ).
  ls_item-EKGRP = '105'.
  im_item->set_data( ls_item ).
  im_item->set_datax( VALUE MEREQ_ITEMX( EKGRP = 'X' ) ).

  endmethod.