cancel
Showing results for 
Search instead for 
Did you mean: 

planned order conversion to production order check

Former Member
0 Kudos

Hi,

I have one requirement that while planne order conversion to production order. we need a check that system should not convert the planned order to production order if the Document type-ZAO is not with in the sale order range (1050 to 1090).

For this i will explain the process.

My scenario is Make to order. we are running MRP in MD50 by giving sale order. This sale order effectivity we are giving in Document type-ZAO. This Document type is assigning to material.

if i am running the MRP for 1091 sale order. Then planned orders will generate. Now my Document assigned to material is having sale order range 1050 to 1090 only. So my Document is not extended to 1091 sale order. Then in that case the planned order of that material should not convert to production order. Because the Document type is not extended to 1091.

For this Our SCN guys have given the BADI is

Use the BADI : BADI - WORKORDER_UPDATE, method AT_SAVE, here you can prevent saving the order ifDocuments are not released in created stage with error message.


For this how to give the table logic to ABAPer for using this BADI. Please help me.

Regards,

Mastan.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can go to table TVAK (Sales Document Types) and pass Sales Document Type ZAO (Field: AUART) then you will get the No. Range Int. assign. (Field: NUMKI). Now copy the value from field NUMKI and pass it to the table NRIV then you will get the number range (From to TO).

You can tell above logic to the ABAPer.

Regards,

Narresh

Former Member
0 Kudos

Hi Naresh,

Thank You.

Sorry if the requirement is not clear.

ZAO is not the sales Document. It is the routing document.

My scenario is while zao document creation we are giving the sale order effectivity to the document.

Suppose i having the ZAO Document no= 10000002. To this document i will asign the sale order range from 1050 to 1090. suppose mrp run for 1091 sale order. Then planned orders will generate.

if i am converting the x-part material planned order of 1091 to production order.it should not convert to production order. Because my x-part attching zao document sale order is 1091. 1091 is not with in the range of 1050 to 1090.

Regards,

Mastan.

Former Member
0 Kudos

Hi,

For your case, you need to use logic which will check while converting planned order to production order that for the header material routing, routing document number assigned sale order range and if sale order number for which planned order is created, exceeds the range then terminate/stop the conversion by giving the error message.

Error message should clearly indicate the reason of termination of conversion because it will guide the user for the right action to complete the business process.

Regards,

Narresh

Former Member
0 Kudos

Hi Naresh,

Thank You.

Yes, Now your are in correct understanding. For this how to write the logic. Where i have to use the above BADI. please guide me.

I have given below logic. This logic is correct or not.please guide me.

In AFPO table, the sale order no (KDAUF) is not with in the range of ZZSSFROM (Shipset from) to ZZSSTO (shipsetto) for the field DOKAR (Document type= ZAO) of DRAW table Then the field PLNUM (Planned order) should not convert to field AUFNR (Order). And should display the message as  shipset not extended to ZAO Document. Use the BADI : BADI - WORKORDER_UPDATE, method AT_SAVE, here you can prevent saving the order ifDocuments are not released in created stage with error message.


Regards,

Mastan.

former_member184666
Active Contributor
0 Kudos

Hi Mastan,

If you want to restrict the order creation itself from planned order to production order then you cannot use AFPO table.

You need to use PLAF table. Planned order what ever you are converting should be passed to table PLAF and fetch the KDAUF and KDPOS and accordingly to be further drilled down to the doucment type etc.

Regards,

Ramagiri

Former Member
0 Kudos

Hi,

As per suggestion by expert Mr. Ramagiri, AFPO table is not useful because you have still not entered into production execution and you want to restrict while converting planned order to production order hence you need to check in planned order table (PLAF) to write your logic.

AFPO table is updated after you convert planned order to production order which you want to restrict hence this table should not come into picture.

Regards,

Narresh

Former Member
0 Kudos

Hi Ramagiri Srinivas,

Thank You very Much.

Where i have to pass the KDAUF and KDPOS to get the Document type and where i have to use the above BADI. How the logic  will restrict the conversion of planned order to production order. Please guide me.

Regards,

Mastan.

Former Member
0 Kudos

Hi Naresh,

Thank You very Much.

Where i have to pass the KDAUF and KDPOS to get the Document type and where i have to use the above BADI. How the logic  will restrict the conversion of planned order to production order. Please guide me.

Regards,

Mastan.

Former Member
0 Kudos

Hi,

Check the below SCN thread for your query,

Regards,

Narresh

Former Member
0 Kudos

Hi Ramagiri Srinivas,

we have given the logic that

Pass PLNUM (Planned order) in PLAF table get KDAUF (Sale order no),KDPOS (Sale order item) and MATNR.

pass the MATNR in to OBJKY field in DRAD table and get the Document type (DOKAR) = ZAO, DOKNR,DOKVR,DOKTL.

Pass Document type (DOKAR) = ZAO, DOKNR,DOKVR,DOKTL in to DRAW table get ZZSSFROM (Shipset from) to ZZSSTO (shipsetto). After that use the badi

Use BADI If the sale order no (KDAUF) of PLAF Table is not with in the range of ZZSSFROM (Shipset from) to ZZSSTO (shipsetto) for the field DOKAR (Document type= ZAO) of DRAW table Then the field PLNUM (Planned order) should not convert to field AUFNR (Order). And should display the message as  shipset not extended to ZAO Document. Use the below BADI.

Please guide me the Logic is correct or not. Because with that logic ABAPer is not getting the check. Some times he is getting the check and some times if the sale order no is with in the range of ZZSSFROM (Shipset from) to ZZSSTO (shipsetto). Then planned order is not converting to production order.

Regards,

Mastan.

Former Member
0 Kudos

Hi Naresh,

Iam not getting the idea on given link. please find the below logic we have and guide me any change is required.

we have given the logic that

Pass PLNUM (Planned order) in PLAF table get KDAUF (Sale order no),KDPOS (Sale order item) and MATNR.

pass the MATNR in to OBJKY field in DRAD table and get the Document type (DOKAR) = ZAO, DOKNR,DOKVR,DOKTL.

Pass Document type (DOKAR) = ZAO, DOKNR,DOKVR,DOKTL in to DRAW table get ZZSSFROM (Shipset from) to ZZSSTO (shipsetto). After that use the badi

Use BADI If the sale order no (KDAUF) of PLAF Table is not with in the range of ZZSSFROM (Shipset from) to ZZSSTO (shipsetto) for the field DOKAR (Document type= ZAO) of DRAW table Then the field PLNUM (Planned order) should not convert to field AUFNR (Order). And should display the message as  shipset not extended to ZAO Document. Use the below BADI.

Please guide me the Logic is correct or not. Because with that logic ABAPer is not getting the check. Some times he is getting the check and some times if the sale order no is with in the range of ZZSSFROM (Shipset from) to ZZSSTO (shipsetto). Then planned order is not converting to production order.

Regards,

Mastan.