Skip to Content
Technical Articles
Author's profile photo Freddy Valderrama

No workflow in requisitions created with MRP

Hello community SAP.

Purpose of this blog

As you may know, the SAP transactions are not perfect and sometime it has a bug, in this moment we need apply a sap note for fix it.

This blog show us how to fix when no workflow is created for this purchase requisition created in materials planning when we use transaction MD01N – MRP Live in S/4HANA.

 

My system

My System: S4HANA ON PREMISE 1709 02 (05/2018)

 

SAP Note relevant

sap note 1976456 – No workflow in requisitions created with MRP

 

Solutions

If I following the next steps the system working, try in your system.

1.Option

MD03 MRP-Individual Planning-Single Level
MD12 Change Planned Order for mark  the check

and run the last transaction.

MD14 Individual Conversion of Plnned Ord.


2.Option

In this process the Workflow is created, but if we want to use the MD01N – MRP Live ?  the BADI MD_PURREQ_POST is the solution as said the note.

 

You can implement it the BADI, paste the folowing code and test it.

===============================================

 

METHOD if_ex_md_purreq_post~post_after_save.
*    * Container Set Element
DEFINE swc_set_element.
CALL FUNCTION ‘SWC_ELEMENT_SET’ ##FM_SUBRC_OK
EXPORTING
element       &2
field         &3
TABLES
container     &1
EXCEPTIONS OTHERS 1.
END-OF-DEFINITION.

*you can use a break-point here….

IF syxprog EQ ‘SAPLPPH_MRP_RUN’. “MD01N – MRP Live

DATABEGIN OF st_objkey,
number TYPE ebanbanfn,
item   TYPE ebanbnfpo,
END OF   st_objkey.

DATAls_key    LIKE st_objkey,
lv_key    TYPE sweinstcouobjkey,
container TYPE TABLE OF swcont.

DATAlt_rel_final TYPE TABLE OF  bapirlcorq.

CALL FUNCTION ‘ME_REL_INFO’
EXPORTING
i_frgkz     im_ebanfrgkz
i_frggr     im_ebanfrggr
i_frgst     im_ebanfrgst
i_frgot     ‘1’
i_no_dialog ‘X’
TABLES
rel_final   lt_rel_final
EXCEPTIONS
not_active  1
OTHERS      2.
IF sysubrc <> 0.
* Implement suitable error handling here
ELSE.
READ TABLE lt_rel_final INTO DATA(ls_rel_finalINDEX 1.
IF ls_rel_finalrel_code1 IS NOT INITIAL.

ls_keynumber      im_ebanbanfn.
ls_keyitem        im_ebanbnfpo.

lv_key ls_key.

swc_set_element container ‘ReleaseCode’  ls_rel_finalrel_code1.

DATA lv_creator TYPE swhactor.
CONCATENATE ‘US’ syuname INTO lv_creator.
CALL FUNCTION ‘SWE_EVENT_CREATE_IN_UPD_TASK’ IN UPDATE TASK
EXPORTING
objtype           ‘BUS2009’
objkey            lv_key
event             ‘RELEASESTEPCREATED’
creator           lv_creator
TABLES
event_container   container[]
EXCEPTIONS
objtype_not_found 1
OTHERS            2.
IF sysubrc <> 0.
ELSE.
ENDIF.
ENDIF.
ENDIF.
ENDIF.

ENDMETHOD.

===============================================

 

Conclusion

We have 2 options to fix the bug in the transaction MD01N – MRP Live.

 

 

Thanks for reading.

 

Freddy Valderrama

SAP ABAP/WF/PI/MDG Consultant

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo jessica berman
      jessica berman

      Well for the MRP , i used to do it earlier but i am not able to get the myapron code you defined here , it would be good if that well explained to use. Well Cheers

      Author's profile photo Esteban Colina
      Esteban Colina

      Excellent. thank you so much