Skip to Content
0

Reset PR Release Strategy at ME_PROCESS_REQ_CUST

Jan 31, 2017 at 12:39 PM

210

avatar image

I'm trying to Reset the Release Strategy using the method ME_PROCESS_REQ_CUST~PROCESS_ITEM.

Using the following code:

 CALL METHOD im_item->if_releasable_mm~get_data
    IMPORTING
      ex_strategy = o_strategy
      ex_state    = o_state.

  CALL METHOD o_state->reset_release
    EXPORTING
      im_code = <rel_code> " There's a big logic to found this guy
    EXCEPTIONS
      no_authority      = 1
      not_released      = 2
      not_responsible   = 3
      illegal_call      = 4
      illegal_indicator = 5
      rfq_exists        = 6
      po_exists         = 7
      OTHERS            = 8.

I achieve sucess cleanning the strategy steps:

This method set the values:

EBAN-FRGRL = ‘X’ .

EBAN-FRGZU = ‘ '

EBAN-FRGKZ = ‘X’

And that is perfect!

The problem is the field EBAN-BANPR keep the old value "05"... And I need to reset this to "03".

I tried the methods im_item->set_data and im_item->set_datax to change this value, but that call starts a infinite loop calling the badi again.

I have the possibility of use the FM BAPI_REQUISITION_RESET_RELEASE wich works fine. But this way isn't online and worst, could create a Enquee problem.

release.jpg (12.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Raphael Maia Feb 03, 2017 at 10:47 AM
1

Problem solved!

I keep the PROCESS_ITEM code and at CHECK method I use IF_PURCHASE_REQUISITION_ITEM~set_data and IF_PURCHASE_REQUISITION_ITEM~set_datx to change: EBAN-FRGRL, EBAN-FRGZU, EBAN-FRGKZ and finaly EBAN-BANPR.

Beside that i change the same values at the items-MY_STATE->ITEM, to access the Item I use the method im_header->get_items.

Share
10 |10000 characters needed characters left characters exceeded