Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
gabriel_kunz
Advisor
Advisor
5,547
With the upgrade to the S/4HANA the New Output Management (OM) with the usage of BRF+ was introduced to the Inventory Management area in Procurement (Materials Management). This means that if the output is not triggered after a goods movement post, new types of check and troubleshooting need to be made in order to fix the issue. The purpose of this blog post is to assist on how to check if the new OM configuration is correct and how you can debug an output request further in case you are facing any issues.

 

#1 - Check if the New OM is active and configured in SPRO and SFP transactions


In SPRO transaction in the SAP Reference IMG, access the following path: Cross-Application Components’ -> ‘Output Control’. Under that path we have the highlighted activities where we will check the new output management configuration:





  • In the ‘Manage Application Object Type Activation’ activity we can check if the Application Object Type GOODS_MOVEMENT has the status ‘Application Active’:




  • In the ‘Define Output Types’ activity, we can check if the Output Types are assigned to the Application Object Type GOODS_MOVEMENT:




  • In the ‘Assign Output Channels' activity, we can check if the Output Channel is assigned to the Output Type linked to the Application Object Type:



  • The last check in SPRO transaction is in the ‘Assign Form Templates’ where we can check if the Form Template ID is assigned to the Output Type:


In SFP transaction, we can check if a certain Form Template, for example MMIM_GR4PO_IND_SLIP, is matched to a print program (FDP - Form Data Provider):


 

#2 - Check if the New OM is active for 'Transaction/Event Type' (MKPF-VGART)


A check for the output determination is made based on the 'Transaction/Event Type' field (MKPF-VGART) during the material document posting which determines if the new output management will be used, WE for Goods Receipt for example. The customizing for this check is maintained in table T159OM and we can use the view V_159OM in SE16 transaction to maintain it:


 

#3 - How to confirm if the New OM is being called during the material document creation:


Sometimes, the output for the goods movement is not generated because the old NAST/NACE Output Management is being used insted of the New OM with BRF+ and may not be properly configured. If all the checks mentioned before were made, then the New OM is the one being used. But we can confirm this in real time with a breakpoint placed using SE24 transaction in Class CL_MM_IM_OUTPUT_UTILITY, method GET_ACTIVE_OUTPUT_CONTROL:
        IF lv_active = 'X'.
gv_oc_type = 'B'. "new BOPF OM
ELSE.
gv_oc_type = 'C'. "old NAST
ENDIF.

With a breakpoint at the start of the IF statement on the method, we can then check if the variable gv_oc_type is set to 'B' during the material document posting in MIGO transaction, if so, the New OM is going to be used for the rest of the process.

 

#4 - Check OPD Transaction for the Output Parameter Determination:


Since now the BRF+ is used as output management for Inventory Management area, we can use the simplified OPD transaction that will allow us to check and configure the rules for each determination step for the Business Rule 'Goods Movement':


 

The default configuration both on SAP GUI and OPD can be found in the SAP Notes below:

  • 2274936 - Output Management in S/4 HANA for Goods Movement Default Customization

  • 2461075 - Output Management in S/4 HANA Cloud 1708 and On Premise 1709 for Goods Movement Default Customization


 

#5 - Debugging the output creation during the goods movement posting:


During the goods movement posting MIGO, the event sequence for the output determination and creation runs as follows:

  1. Method GET_ACTIVE_OUTPUT_CONTROL (CL_MM_IM_OUTPUT_UTILITY)

  2. Form MM07MFB9_BUCHEN_NUMMERNVERGABE

  3. Form MM07MFB9_BUCHEN_AUSFUEHREN

  4. Function Module MB_TRIGGER_OUTPUT

  5. Function Module MB_POST_OUTPUT (Update Mode)

  6. Method TRIGGER_OUTPUT_DETERMINATION (CL_MM_IM_TRIGGER_OUTPUT) (Update Mode)

  7. Method _PARAMETER_DETERMINATION (CL_APOC_OR_A_ROOT_DET_ITEMS) (Update Mode)


As the New OM completely runs in "perform on commit" within "in update task", it is possible to debug with external breakpoints if we set them in Form TRIGGER_OUTPUT (LMBOMF01) and Function Module MB_POST_OUTPUT if we activate the update debugging when reaching TRIGGER_OUTPUT.

  1. Method GET_ACTIVE_OUTPUT_CONTROL (CL_MM_IM_OUTPUT_UTILITY):
    As mentioned on topic #3, this method is used to check and select the output management that will be used in the process via Application Object activation and Transaction/Event Type of the material document being posted.

  2. Form MM07MFB9_BUCHEN_NUMMERNVERGABE:
    FORM BUCHEN_NUMMERNVERGABE

    [...]
    xmseg-xprint = rm07m-xnapr. "store xnapr for new OM
    [...]
    * BOPF based output management
    PERFORM new_nast_key.
    lv_omor_key = msg_objky_new.
    APPEND lv_omor_key TO xomor
    [...]

    Here, the old OM is suppressed and the object key per MATDOC item is concatenated and added into the global table XOMOR (OM Output Requests).The Material Document item keys in XOMOR will be later passed to the update function for request creation.

    XNAPR is now saved in MATDOC-XPRINT (Print Active Indicator) for later usage in BRF+. (RM07M-XNAPR corresponds to the header flag right next the slip drop down menu. Below the ‘Posting Date’ field.)

    The OM will run always and independent of the MATDOC-XPRINT flag. This flag will influence the creation of the print output only.

  3. Form MM07MFB9_BUCHEN_AUSFUEHREN:
    FORM BUCHEN_AUSFUEHREN 
    [...]
    IF xomor[] IS NOT INITIAL.
    CALL FUNCTION 'MB_TRIGGER_OUTPUT'
    EXPORTING
    t_omor = xomor.
    [...]

    In this form, the call to the new OM function MB_TRIGGER_OUTPUT is made which loads the function group OMOR to store the table XOMOR globally for PERFORM TRIGGER_OUTPUT ON COMMIT.

  4. Function Module MB_TRIGGER_OUTPUT:
    FUNCTION mb_trigger_output.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *" IMPORTING
    *" VALUE(T_OMOR) TYPE TT_MATDOCKEY
    *"----------------------------------------------------------------------

    GT_OMOR[] = T_OMOR[].
    PERFORM trigger_output ON COMMIT.

    ENDFUNCTION.

    The TRIGGER_OUTPUT triggers the final update task via Function MB_POST_OUTPUT. Here is where we can place the breakpoint in order to active the update debugging during the material document posting in order to check the rest of the process.

  5. Function Module MB_POST_OUTPUT (Update Mode😞
    FUNCTION MB_POST_OUTPUT

    [...]
    gt_omor[] = t_omor[].

    DATA: ls_omor TYPE matdockey.

    * get instance for triggering of New Output Management
    DATA(lo_inst_trigger_output) = cl_mm_im_trigger_output=>get_instance( ).

    LOOP AT gt_omor INTO ls_omor.
    IF lo_inst_trigger_output IS BOUND.
    TRY.
    * trigger output
    CALL METHOD lo_inst_trigger_output->trigger_output_determination
    EXPORTING
    iv_matdockey = ls_omor.​
    [...]

    This function executes the whole OM processing, including the output determination (BRF+) and issuing of the corresponding outputs (print, e-mail, xml,etc.).

    It loops at the key table GT_OMOR from dialog and creates an output request for each material document item (not necessarily an output for each).

  6. Method TRIGGER_OUTPUT_DETERMINATION (CL_MM_IM_TRIGGER_OUTPUT) (Update Mode😞
     METHOD TRIGGER_OUTPUT_DETERMINATION.

    [...]
    ********************************************************************************************************
    ** Determine Output items
    ********************************************************************************************************
    CLEAR lt_frw_key.
    ls_frw_key-key = lr_root_data->key .
    APPEND ls_frw_key TO lt_frw_key.

    * Fill Document ID as BRF Parameter for Function Call
    ls_brf_param-name = 'DOCUMENT_ID'.
    GET REFERENCE OF lv_matdockey INTO ls_brf_param-value.
    INSERT ls_brf_param INTO TABLE lt_brf_param_tab.
    CREATE DATA lr_det_items_ac_prm.
    lr_det_items_ac_prm->brf_context_parameter = lt_brf_param_tab.
    * in case of CHANGE mode: set indicator for BOPF action
    * IF lv_change_mode = abap_true.
    * lr_det_items_ac_prm->change_indicator = abap_true.
    * ENDIF.

    * call BOPF action DETERMINE_OUPUT_ITEMS
    * Remark: the newly created output items are NOT returned here in ET_DATA!
    go_or_srv_mgr->do_action(
    EXPORTING
    iv_act_key = if_apoc_output_request_c=>sc_action-root-determine_ouput_items
    it_key = lt_frw_key
    is_parameters = lr_det_items_ac_prm
    IMPORTING
    et_failed_action_key = DATA(lt_failed_action_key) ).

    IF lt_failed_action_key IS NOT INITIAL.
    * BRF+ Application may not be correct
    ENDIF.
    [...]​

    This method calls BRF+ for output item determination. If the output item is not created during the material document posting, here we can check if the parameters are being sent correctly.

  7. Method _PARAMETER_DETERMINATION (CL_APOC_OR_A_ROOT_DET_ITEMS) (Update Mode😞
    METHOD _PARAMETER_DETERMINATION
    [...]
    **********************************************************************
    * (3a) Application CALLBACK for role data
    **********************************************************************
    CALL METHOD lo_param_determination->get_data_for_role
    EXPORTING
    iv_appl_object_type = is_or_root-appl_object_type
    iv_appl_object_id = is_or_root-appl_object_id
    iv_root_key = is_or_root-key
    io_msg_collector = io_root_bobf_msg_collector
    is_receiver_brf = ls_receiver_brf
    io_callback = lo_callback
    IMPORTING
    et_role_data = lt_role_data.
    [...]​

    This is another method where the parameters can be verified if no output item is being created during the posting. If the OM logic has changed in this method you can use the methods GET_DATA_FOR_ROLE and GET_DATA_FOR_SENDER in callback class CL_MM_IM_OUTPUT_CALLBACK as start. From there, the call stack can be used to find the new method for parameter determination.


#6 - Further Information:

All new developments on the New Output Management are attached to package APPL_MM_IM_OUTPUT.

Important SAP Notes:

  • 2461075 - Output Management in S/4 HANA Cloud 1708 and On Premise 1709 for Goods Movement Default Customization

  • 2524991 - FAQ: Output Management in S/4 for Inventory Management

2 Comments