cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Work Order when Receiving a Material at Goods Receipt

former_member626955
Participant
0 Kudos

Can anyone tell me if it is possible using standard SAP to create a Work Order when receiving a Material during a Goods Receipt?  We have some motors that we order that need to be prepared prior to use so I need to create a work order when receiving them to schedule the work to be performed.  Is there a BAPI, Function Module or Follow-up action that needs to be use to perform this process?  I am thinking that there has to be a link between the Material and Equipment ID # to initiate this process.  If so, how do you set this up in SAP?  Thanks in advance for any help you can provide me.

Accepted Solutions (0)

Answers (2)

Answers (2)

peter_atkin
Active Contributor
0 Kudos

Darrin,

Do you intend having the material/equipment linked directly via serial numbers,, or have them linked indirectly - possibly via the construction type field?

Can the orders be created overnight via batch program, or do they need to be created real-time?

PeteA

former_member626955
Participant
0 Kudos

No I wasn't going to link them by serial number.  Also, I've never used the Const Type field in the Equipment record.  So are you saying if I create a Const Type I could use this to link to the Material?  I'm not sure how to do this. Is their a field in the Material Master to add the Const Type that will trigger the work order to get created when completing the Goods Receipt?  I'm still a little confused.  I am fairly new to the PM module so I apologies for all the questions.

peter_atkin
Active Contributor
0 Kudos

Darrin,

You can use the Construction Type field to link to a material - but this is usually used for linking a general BOM. IT does not create an order, but does link an equipment/material together. You could use other options like classification, or a customer defined field (via user-exit ITOB0001).

There are several examples on the web of using BAPI_ALM_ORDER_MAINTAIN, here is one of them:

BAPI_ALM_ORDER_MAINTAIN create sap work order - SAP Function Module - ABAP

There is no standard way to create a work order off the back of a goods receipt - so you will need to develop a solution (which I think you already know..). The options are:

  1. Use the goods receipt document to trigger the work order creation via user-exit/BADI.
  2. Create a batch program which runs periodically (say overnight) to search for GR created in a given time frame, and then create the work orders.

Option 1 will create work orders real-time, but if there are issues the work order cannot be re-created via the GR (without cancelling the GR).

Option 2 means that the work orders are created at a later date/time. However, if the process fails, you can manually run the batch program to create the work order. This option is also easier to debug and does not extend the time for the GRs to be created (unlike option 1).

PeteA

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Darrin,

This is my assessment for your requirement

Prior to search for an fm, you need a suitable user-exit to trigger at GR. When it triggers the code in the exit first will create an Equipment (with fm like BAPI_EQUI_CREATE) using an fm suitable for this or with the help of BDC programming. Then the code will use another fm (BAPI_ALM_ORDER_MAINTAIN) to create a work order.

For the user-exit info, you need to search net or post a query in MM space. It won't be difficult to arrive at right one.

Good luck

KJogeswaraRao

former_member626955
Participant
0 Kudos

Can you help me with what Import Parameters need to be field in to Create the Equipment? Do I use the DATA_GENERAL to do this?

I am also having problems trying to figure out what Tables (32 of them) I need to populate with what data to Create the Work Order in FM BAPI_ALM_ORDER_MAINTAIN.

Thanks

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Darrin,

It is YES for the 1st fm. You need to use structure DATA_GENERAL for the export details of equipment . It is a simple fm to be used. but the later one is a bit difficult one. You will find several CREATE examples for this fm on net. Search through google with string 'Create Order through BAPI_ALM_ORDER_MAINTAIN'. You will certainly be tired for sometime with this fm, but I'm sure you'll come out. The key structures are the 1st two IT_METHODS and IT_HEADER, You take clues from net about these two. The rest of the tables are self explanatory, i.e., wherever you want to give the information. Also you may have to to use fm BAPI_TRANSACTION_COMMIT after this fm.

My suggestion is you should conquer this fm (BAPI_ALM_ORDER_MAINTAIN) for CREATE, CHANGE applications irrespective of the present requirement.

Regards & Good luck

KJogeswaraRao