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: 

BADI ME_PROCESS_REQ_CUST Method POST update BLCKD field of PR ITEM

former_member184111
Active Contributor
0 Kudos
3,085

Dear Experts,

I am trying to update the fields BLCKD and BLCKT i.e. Status as blocked and some text in Block Text field for a PR Item.

Implemented BADI ME_PROCESS_REQ_CUST method POST for this but even after using the SET_DATA method when the PR is saved it does not shows status Blocked and neither the block text is there.

Should I use the method SET_DATAX before SET_DATA but in that case the structure MEREQ_ITEMX does not have fields BLCKD and BLCKT to set it to 'X'.

How to update these fields for item when PR is created?

Any pointers are appreciated...

Thanks,

Anubhav

1 ACCEPTED SOLUTION

former_member199637
Participant
0 Kudos
777

Hello Anubhav,

As the Blocked status is at PR item, you need to use method PROCESS_ITEM, as in method POST only PR header is available.

Hope this is helpful.

7 REPLIES 7

former_member199637
Participant
0 Kudos
778

Hello Anubhav,

As the Blocked status is at PR item, you need to use method PROCESS_ITEM, as in method POST only PR header is available.

Hope this is helpful.

0 Kudos
777

Hi Puneet,

I am using the below code in method PROCESS_ITEM

DATA

ls_reqitm      TYPE mereq_item.

  ls_reqitm = im_item->get_data( ).

**check some conditions and if true

ls_reqitm-blckd  = '1'.

  ls_reqitm-blckt  = lc_blck_txt.

im_item->set_data( ls_reqitm ).

But that does not set the field values as passed.


Should I use the method SET_DATAX before SET_DATA but in that case the structure MEREQ_ITEMX does not have fields BLCKD and BLCKT to set it to 'X'.

Thanks,

Anubhav

0 Kudos
777

Hello Anubhav,

Yes, method SET_DATAX is needed to be called. But method SET_DATAX needs to be called after the calling of method SET_DATA.

Regards,

Puneet Desai

Former Member
0 Kudos
777

hello , look at structure MEREQ_ITEM_S_CUST_ALLOWED

i enhance it with 2 fields:

BLCKD BLCKD

BLCKT BLCKT

and my abap code in method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM is working now !!!

  CHECK im_count = 1 .
  DATA  reqdata   TYPE mereq_item .
  reqdata = im_item->get_data( ) .
  reqdata-blckd   = '1' .
  reqdata-blckt   = 'text' .
*
  im_item->set_data( reqdata ) .
  DATA: ls_datax TYPE mereq_itemx.
  MOVE: 'X' TO ls_datax-blckd,
        'X' TO ls_datax-blckt .
  im_item->set_datax( ls_datax ) .

0 Kudos
777

Hello Anubhav,


Is your issue resolved. Could you please explain me how you have achieved this.

My requirement is almost same as your's Need to change block status .

I am checking with both the method in the implementation of BADI ME_PROCESS_REQ_CUST

method POST & PROCESS_ITEM . I passed the values through SET_DATA and then  SET_DATAX but still not working.


I even tried to add two fields in the structure MEREQ_ITEM_S_CUST_ALLOWED but being standard field this raises an error with eban table like two fields in same name.


Thanks in Advance ,


G.Gowri Sankar

0 Kudos
777

Hi Gowri,

I do not have access to that system anymore but from what I recollect I implemented the BADI ME_REQ_POSTED Method POSTED and then called a FM in update task. This FM was used to change the BLCKD field using standard BAPIs for PR.


Since the FM is called update task it is executed after the LUW for BADI is completed which means that EBAN now has data for this PR item and it can be updated.

Hope this helps.

Thanks,

Anubhav

0 Kudos
777

I am facing the same problem and I think the problem is in structure

MEREQ_ITEM_S_CUST_ALLOWED

which has the updatable fields. I am going to see if I can append it the BLCKD and BLCKT fields