FS for Background Job and frontend transaction for Technically Completing the Production Orders after certain time has passed since order creation.

 Logic for development

1. Create a transaction, say ZORDTECO and give a field for entry/selection of multiple “Production order” and "Order Types" as shown below. 

“Hours” field shows duration of the time that should be passed before Technically completing the Production Order. Our client had in-house Production time of one day for all the FG materials. They wanted Production order to be automatically technically completed after 24 Hrs. from the order creation. Here, we had given selection option of 24 Hrs. / 48 Hrs. / 72 hrs. as per our Client's requirement. They will select one of these (24 Hrs. / 48 Hrs. / 72 Hrs.).

User can select the order types and Hours as per their requirement.

User will save variant with order types and Hours for background job execution of this program.



2. Go to AUFK table, AUKF-AUART = pass the same order types entered on the selection screen of ZORDTECO transaction. 

3. AUFK- IDAT2 = “Blank”. AUFK-IDAT2 is a field in which "Tech. completion" date is inserted by the system when Production order receives the status TECO.

By putting this condition, we will make sure that only production orders which are not Technically Completed are fetched in our program for further processing.

 

4. In AUFK table, we must check order's “Created on” and “Time created” that is AUFK-ERDAT and AUFK-ERFZEIT fields.

Fetch the time entered by the user on the selection screen of ZORDTECO transaction. Let’s assume that this time is 24 Hrs. 

Carry out following calculation.

if the AUFK-ERDAT and AUFK-ERFZEIT + 48 Hrs. < Current date and time, select the order for Technical completion. 

If the above condition is not satisfied, that means Production order does not fulfill the time criteria and should not be technically completed.


5. If all the above given conditions are fulfilled, fetch AUFK-AUFNR and pass it to the below given BAPI.

Pass the AUFK-AUFNR to the BAPI “BAPI_PRODORD_COMPLETE_TECH”.

Using the above given BAPI, we can technically complete the Production Order.



6. You can also provide successful and unsuccessful messages as an output of front-end transaction as shown below.  ZORDTECO”




Comments