Skip to Content

Purchase Requisition: simultaneous item and header release strategy

Hi guys,

I found multiple archived threads asking for an answer to achieve simultaneous releases on item and header level for a single purchase requisition type.

I found the solution to e.g. differentiate between purchasing organizations - so organization 0001 can work with PR-type NB with item level releases and organization 0002 works with header level releases.

Answer in the comments.

Best regards,


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Aug 23, 2017 at 07:09 AM

    You need to enhance method PROCESS_RULES of local class LCL_RULE_INTERPRETER in include LMEREQF11. Basically you need to set, before the method runs, the following parameters:

    FIELD-SYMBOLS: <lv_t161_gsfrg>   TYPE gsfrg,
                   <lv_header_gsfrg> TYPE gsfrg.
    ASSIGN ('im_context->t161-gsfrg') TO <lv_t161_gsfrg>.
    IF sy-subrc EQ 0.
      <lv_t161_gsfrg> = 'X'.
    ASSIGN ('im_context->req_header->my_state->header-gsfrg') TO <lv_header_gsfrg>.
    IF sy-subrc EQ 0.
      <lv_header_gsfrg> = 'X'.

    Careful - a header release is only shown in ME51N/ME52N after check/save-routine. You also need to add some way to determine if the above logic should run or not - you can retrieve item level data like this:

      FIELD-SYMBOLS: <lt_oitems>       TYPE ANY TABLE,
                     <lo_item>         TYPE any,
                     <ls_item>         TYPE mereq_item.
      "get ekorg/werks from first item
      ASSIGN ('im_context->req_header->my_state->items') TO <lt_oitems>.
      IF sy-subrc EQ 0.
        LOOP AT <lt_oitems> ASSIGNING <lo_item>.
          ASSIGN ('<lo_item>->my_state->item') TO <ls_item>.

    Hope I could help someone!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.