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: 

Reset PR Release Strategy at ME_PROCESS_REQ_CUST

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member

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.

1 REPLY 1

Former Member

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.