Purpose of the document

This document is for WIP Module business function and interface analysis and research , To adopt concurrent request mode and call API Methods are introduced respectively

Content

WIP Introduction to the common standard tables of modules

WIP Things are made up of

WIP Related business processes

WIP relevant API Research case

( Ten ) Reference documents ( 7、 ... and ) Some knowledge about purchasing

( One )WIP Introduction to the common standard tables of modules

1.1    Common standard tables

Listed in the table below are the relationships with WIP Import related tables and instructions :

Table name

explain

Other information

BOM_STRUCTURES_B

BOM Header information

BOM_COMPONENTS_B

BOM Component information

BOM_OPERATIONAL_ROUTINGS

BOM Route header information

BOM_OPERATION_SEQUENCES

BOM Route production information

WIP_ENTITIES

Work order information sheet

WIP_DISCRETE_JOBS

Discrete work order information table

WIP_REQUIREMENT_OPERATIONS

Task requisition demand release form

WIP_OPERATIONS

Discrete operations ( operation ) surface

WIP_OPERATION_RESOURCES

Production resource list

MTL_MATERIAL_TRANSACTIONS

Things to do list

WIP_TRANSACTIONS

WIP Things to do list

1.2  General introduction of interface table

Listed in the table below are the relationships with WIP Import the relevant interface table and description :

Table name

explain

Other information

mtl_transactions_interface

Transaction processing interface table

mtl_serial_numbers_interface

The sequence of things

mtl_transaction_lots_interface

Transaction batch table

cst_comp_snap_interface

wip_move_txn_interface

Mobile transaction interface table

1.3    explain

Only... Is listed here WIP Most of the related common tables . There are also some less frequently used ones that are not involved , For details, please refer to oracle On the website

( Two )WIP Things are made up of

WIP Things processing mainly includes : Work order generation , Work order change , Feeding and returning , Work order mobile , Work order complete

2.1  WIP Things are made up of

Job creation : Generate work order

Work order change : Change job information

Feeding and returning : Material input and return of work order

Work order mobile : Forward and reverse movement of work order

Feeding and returning : Work order completion processing

( 3、 ... and )WIP Related business processes

3.1   establish BOM

route :Bill Of Materials > Bills > Bills

Background data

SELECT *
FROM bom_structures_b l
WHERE l.assembly_item_id =
;

SELECT *

FROM bom_components_b

WHERE bill_sequence_id IN

(SELECT bill_sequence_id

FROM bom_structures_b

WHERE assembly_item_id =
);

Issuing method

Push Push delivery , You have to manually issue materials through the interface It is necessary to strictly control the quantity or materials with large fluctuation

Assembly Pull Pull delivery , When the assembly is finished or scrapped, it will be triggered automatically according to the standard consumption Consumption of relatively stable materials

Operation Pull Pull delivery , The process moves to To Move It is automatically triggered according to the standard consumption Consumption of relatively stable materials

BOM_COMPONENTS_B.WIP_SUPPLY_TYPE Storage and issue mode

Value

Meaning

1

Push

2

Assembly Pull

3

Operation Pull

4

Bulk

5

Supplier

6

Phantom

7

Based on Bill

3.2   Definition ROUTING

route :Bill Of Materials > Routings> Routings

Routings( Process route ) The final solution is the processing sequence in the production process 、 Standardization of resources and usage .Routing It's the product / Production step diagram of semi-finished products , It defines the process of producing a specific material 、 Processing Department ( Work center )、 Lead time 、 The resources consumed and their rated quantity .

Routing The header information is stored in the table BOM_OPERATIONAL_ROUTINGS in ,Routing Of Operations Information stored in BOM_OPERATION_SEQUENCES In the table , Two tables pass fields ROUTING_SEQUENCE_ID Field Association

SELECT *
FROM BOM_OPERATIONAL_ROUTINGS
WHERE ASSEMBLY_ITEM_ID = 
;

SELECT *

FROM bom_operation_sequences

WHERE routing_sequence_id
IN

(SELECT routing_sequence_id

FROM bom_operational_routings

WHERE assembly_item_id =
);

3.2   Define discrete jobs

route :WIP > Discrete > DiscreteJobs

Discrete, Discrete form , A manufacturing method , Used for group or batch manufacturing of assembly parts . Develop standard discrete tasks , Enter the core content : The name of the task ( Work order No )、 Production type 、 Assembly parts 、 Job type 、 Production quantity 、 Start time or finish time .

Here it is Discrete Job It defines job, preservation , and release This job.

working procedure

Components

It involves several tables WIP_ENTITIES,WIP_DISCRETE_JOBS,WIP_REQUIREMENT_OPERATIONS and , These tables are all through WIP_ENTITY_ID Relate to each other .

<<WIP_ENTITIES>>

WIP_ENTITIES stores information about jobs,repetitive assemblies, and flow schedules. Each row includes a unique entityname, the entity type, and the assembly being built.
Oracle Work in Process uses this information to controlproduction activities and to ensure that entities with duplicate names are notcreated.

Key Fields:

WIP_ENTITY_ID:Job or schedule Identifier

ORGANIZATION_ID:Organization Identifier

WIP_ENTITY_NAME:WIP job or repetitiveassembly name or flow schedule reference code

ENTITY_TYPE:WIP entity type code

1

Discrete job

2

Repetitive assembly

3

Closed discrete job

4

Flow schedule

PRIMARY_ITEM_ID:Assembly Item Item

<<WIP_DISCRETE_JOBS>>

WIP_DISCRETE_JOBS stores discrete jobinformation. Each row represents a discrete job, and contains information aboutthe assembly being built, the revision of the assembly, the job quantity, thestatus of the job, the material control method, accounting information,
and jobschedule dates. Oracle Work in Process uses this information to controldiscrete production.

Key Fields:

WIP_ENTITY_ID:Job or schedule Identifier

ORGANIZATION_ID:Organization Identifier

PRIMARY_ITEM_ID:Assembly Item Item

STATUS_TYPE :Status of job

You can go through the following SQL Find out code The meaning of

SELECT lookup_code,meaning FROMFND_LOOKUP_VALUES

where LANGUAGE = 'US' AND Upper(lookup_type) LIKE Upper('WIP_JOB_STATUS')

Value

Meaning

7

Cancelled

8

Pending Bill Load

9

Failed Bill Load

10

Pending Routing Load

11

Failed Routing Load

12

Closed

13

Pending - Mass Loaded

14

Pending Close

15

Failed Close

1

Unreleased

3

Released

4

Complete

5

Complete - No Charges

6

On Hold

JOB_TYPE :Type of discrete job

Value

Meaning

1

Standard

3

Non-standard

WIP_SUPPLY_TYPE :Method of material consumption within WIP

Value

Meaning

1

Push

2

Assembly Pull

3

Operation Pull

4

Bulk

5

Supplier

6

Phantom

7

Based on Bill

START_QUANTITY:Job start quantity

QUANTITY_COMPLETED:Current job quantity completed

COMMON_BOM_SEQUENCE_ID:-->BOM_COMPONENTS_B.BILL_SEQUENCE_ID

COMMON_ROUTING_SEQUENCE_ID:-->BOM_OPERATIONAL_ROUTINGS.ROUTING_SEQUENCE_ID

<<WIP_REQUIREMENT_OPERATIONS>>

WIP_REQUIREMENT_OPERATIONS storesinformation about the material requirements of jobs and schedules. Each rowrepresents a material requirement and contains information about the componentitem, its usage quantities, the using department, requirement date,
and thematerial control method. Oracle Work in Process uses this information to trackthe material usage of jobs and schedules.

Key Fields:

WIP_ENTITY_ID:Job or schedule Identifier

ORGANIZATION_ID:Organization Identifier

INVENTORY_ITEM_ID:Component Item Id

COMPONENT_SEQUENCE_ID:-->BOM_COMPONENTS_B.COMPONENT_SEQUENCE_ID

WIP_SUPPLY_TYPE :Method of material consumption within WIP

Value

Meaning

1

Push

2

Assembly Pull

3

Operation Pull

4

Bulk

5

Supplier

6

Phantom

7

Based on Bill

REQUIRED_QUANTITY:Component quantityrequired

QUANTITY_ISSUED:Component quantity issued

SUPPLY_SUBINVENTORY:Subinventory used tosupply component to WIP

SUPPLY_LOCATOR_ID:Locator used to supplycomponent to WIP

SEGMENT1:Component Item segment

QUANTITY_ALLOCATED:Quantity allocated

QUANTITY_BACKORDERED:Quantity backordered

SELECT *
FROM WIP_ENTITIES
WHERE WIP_ENTITY_NAME =
'J2010113';

WIP_ENTITIES.PRIMARY_ITEM_ID= 24815 And BOM relation

     

SELECT *

FROM wip_discrete_jobs

WHERE wip_entity_id =

(SELECT wip_entity_id

FROM wip_entities

WHERE wip_entity_name =
'J2010113');

SELECT *

FROM wip_requirement_operations

WHERE wip_entity_id =

(SELECT wip_entity_id

FROM wip_entities

WHERE wip_entity_name =
'J2010113');

3.2   Send out materials

Next we need to ship the work order from the inventory , There are two ways to issue materials to the work order

Method 1:WIP > Material Transactions > WIP Material Transactions

This is the easy way , Direct inventory and issue

Method 2:WIP > Discrete > Component Pick Release > Component Pick Releas(Form) / (SRS)

When BOM There are many components of , How to use it? If you issue materials , It's a lot of trouble to specify inventory one by one ,Oracle EBS Provides Pick Release The way to issue materials , In this way, the user only needs to specify the appropriate Picking Rule, Then the system will automatically help you select the library .

The system will produce a Move Order(Move Order Type:Manufacturing Pick), This step is actually very similar to that of the order Pick Release.

Next go Transact Move Order Interface ,Transact This Move Order It's time to finish the distribution .

Pay attention to the usage of the first material , Backstage is not going to produce Move Order Of , Only way two can have Move Order produce .

3.2   To deal with

You can go to Material Transaction form Check it out , Components have been deducted from inventory ,Transaction Type=WIP Issue(Transaction_Type_id:35,WIPcomponent issue)

This is the time MTL_MATERIAL_TRANSACTIONS A few of them in the table JOB Related fields

MMT.Transaction_Type_id:35

MMT.TRANSACTION_ACTION_ID:1

MMT.TRANSACTION_SOURCE_TYPE_ID:5

MMT.TRANSACTION_SOURCE_ID-->WIP_DISCRETE_JOBS.WIP_ENTITY_ID

MMT.TRX_SOURCE_LINE_ID-->WIP_REQUIREMENT_OPERATIONS.OPERATION_SEQ_NUM

MMT.SOURCE_LINE_ID -->MTL_TXN_REQUEST_LINES.LINE_ID

MMT.Move_Order_line_ID-->MTL_TXN_REQUEST_LINES.LINE_ID

3.2   Material return

After the material is sent to the work order , It is possible to return the materials to the warehouse for various reasons , have access to WIP Return

route :WIP > Material Transactions > WIPMaterial Transactions,Type choice WIP Return

see Material Transaction, You can see a WIP Return Of Transaction It happened. , And the inventory quantity of components is restored to the quantity before issuing .

Transaction_TYPE_ID:43(WIP Component Return)

ps: Whatever it says above WIP Issue still WIP Return, stay WIP_TRANSACTIONS There is no data in the table .

WIP_TRANSACTIONS stores information aboutWIP resource transactions.Each row represents a single resource transaction andincludes a uniquetransaction Identifier, a transaction date, the job orrepetitiveschedule charged, the WIP operation and resource charges,
andthenumber of units of measure applied. Oracle Work in Process uses thisinformation to track resourcecharges and to calculate the values stored in WIP_TRANSACTION_ACCOUNTS.

( Four )WIP relevant API Research case

For the description of the related interface fields, please refer to the description in the reference example

3.1  Job creation

PROCEDUREnew_work_order(p_wip_entity_id NUMBER,

p_organization_idNUMBER,

x_error_status OUTVARCHAR2,

x_error_message OUTVARCHAR2) IS

l_iface_rec wip.wip_job_schedule_interface%ROWTYPE; -- Work order task interface table

CURSOR c_wdj IS

SELECT *

FROM cux_wip_discrete_jobs_temp cwdj

WHERE cwdj.wip_entity_id =p_wip_entity_id

AND cwdj.organization_id =p_organization_id;

BEGIN

--

l_iface_rec.last_update_date := SYSDATE;

l_iface_rec.last_updated_by := fnd_global.user_id;

l_iface_rec.creation_date := SYSDATE;

l_iface_rec.created_by := fnd_global.user_id;

--

l_iface_rec.group_id := wip.wip_job_schedule_interface_s.nextval;

/*================================================

WIP_LOAD_TYPE MFG_LOOKUPS

------------ --------------

1 Create Standard Job

2 Create Repetitive Schedule

3 Update Discrete Job

4 Create Non–standard Job

================================================*/

FOR rec_wdj IN c_wdj LOOP

g_status_type := rec_wdj.status_type;

-- Judge standard non-standard work order according to business logic

IF rec_wdj.job_type = 1 THEN

l_iface_rec.load_type := 1; --1 standard

ELSE

l_iface_rec.load_type := 4; -- Nonstandard

END IF;

l_iface_rec.allow_explosion := 'Y';

l_iface_rec.process_phase := '2';

l_iface_rec.process_status := '1';

l_iface_rec.status_type := '3'/*rec_wdj.status_type*/

; -- Issued

l_iface_rec.job_name := rec_wdj.job_num;

l_iface_rec.organization_id := rec_wdj.organization_id;

l_iface_rec.class_code :=rec_wdj.class_code;

l_iface_rec.primary_item_id :=rec_wdj.primary_item_id;

l_iface_rec.start_quantity :=rec_wdj.plan_quantity;

l_iface_rec.scheduling_method := '1';

l_iface_rec.first_unit_start_date :=rec_wdj.scheduled_start_date;

l_iface_rec.first_unit_completion_date :=rec_wdj.scheduled_completion_date;

l_iface_rec.attribute_category :=rec_wdj.temp_attribute_category;

l_iface_rec.attribute1 :=rec_wdj.temp_attribute1;

l_iface_rec.attribute2 :=rec_wdj.temp_attribute2;

l_iface_rec.attribute3 :=rec_wdj.temp_attribute3;

l_iface_rec.attribute4 :=rec_wdj.temp_attribute4;

l_iface_rec.attribute5 :=rec_wdj.temp_attribute5;

l_iface_rec.attribute6 :=rec_wdj.temp_attribute6;

l_iface_rec.attribute7 :=rec_wdj.temp_attribute7;

l_iface_rec.attribute8 :=rec_wdj.temp_attribute8;

l_iface_rec.attribute9 := rec_wdj.temp_attribute9;

l_iface_rec.attribute10 :=rec_wdj.temp_attribute10;

l_iface_rec.attribute11 :=rec_wdj.temp_attribute11;

l_iface_rec.attribute12 :=rec_wdj.temp_attribute12;

l_iface_rec.attribute13 := rec_wdj.temp_attribute13;

l_iface_rec.attribute14 :=rec_wdj.temp_attribute14;

l_iface_rec.attribute15 :=rec_wdj.temp_attribute15;

l_iface_rec.source_code := 'wip test';

l_iface_rec.source_line_id :=rec_wdj.job_id;

INSERT INTO wip.wip_job_schedule_interfaceVALUES l_iface_rec;

END LOOP;

--API

wip_massload_pub.massloadjobs(p_groupid => l_iface_rec.group_id, --Group ID

p_validationlevel => 2, -- Validation Level

p_commitflag=> 0, -- Commit 1 =Yes , 0 =' no '

x_returnstatus=> x_error_status,

x_errormsg=> x_error_message);

END;

3.2   Work order change

PROCEDUREchange_work_order_status(p_wip_entity_id NUMBER,

p_organization_id NUMBER,

p_status_type NUMBER,

p_group_idNUMBER := wip.wip_job_schedule_interface_s.nextval,

x_error_status OUT VARCHAR2,

x_error_message OUT VARCHAR2) IS

l_schedule_iface_rec wip.wip_job_schedule_interface%ROWTYPE; -- Work order task interface table

--l_group_id NUMBER;

/*l_returnstatus VARCHAR2(40);

l_errormsg VARCHAR2(2000);*/

l_temp VARCHAR2(3);

BEGIN

BEGIN

SELECT 1

INTO l_temp

FROM wip_discrete_jobs wdj

WHERE wdj.wip_entity_id =p_wip_entity_id

AND wdj.organization_id =p_organization_id

AND wdj.status_type = p_status_type;

x_error_status := 'S';

RETURN;

EXCEPTION

WHEN no_data_found THEN

NULL;

END;

l_schedule_iface_rec.group_id := p_group_id;

--

l_schedule_iface_rec.last_update_date := SYSDATE;

l_schedule_iface_rec.last_updated_by := fnd_global.user_id;

l_schedule_iface_rec.creation_date := SYSDATE;

l_schedule_iface_rec.created_by := fnd_global.user_id;

--

-- l_schedule_iface_rec.group_id := l_group_id;

/*================================================

WIP_LOAD_TYPE MFG_LOOKUPS

------------ --------------

1 Create Standard Job

2 Create Repetitive Schedule

3 Update Discrete Job

4 Create Non–standard Job

================================================*/

l_schedule_iface_rec.load_type := 3; --Update standard or non-standardDiscrete Job

l_schedule_iface_rec.process_phase := 2; --Validation

l_schedule_iface_rec.process_status := 1; --Pending

--

l_schedule_iface_rec.wip_entity_id := p_wip_entity_id;

l_schedule_iface_rec.organization_id := p_organization_id;

l_schedule_iface_rec.status_type := p_status_type; -- Target state

INSERT INTO wip.wip_job_schedule_interface VALUES l_schedule_iface_rec;

wip_massload_pub.massloadjobs(p_groupid => p_group_id, -- Group ID

p_validationlevel => 2, -- Validation Level

p_commitflag=> 0, -- Commit 1 =Yes , 0 ='No'

x_returnstatus=> x_error_status,

x_errormsg=> x_error_message);

END;

3.3  Work order mobile

After the work order is created , Without mobile transactions , The completion transaction cannot be processed . The moving quantity needs to be moved according to the finished quantity . There is the concept of over completion in completion transaction , therefore , Mobile transactions also have excessive mobility .

Need one function obtain Mobile number

 

 

 

 

 

 

/*=============================================

   *  FUNCTION / PROCEDURE

   *      get_available_to_move_qty

   *  DESCRIPTION:

   *      
Get the mobile number

   *  ARGUMENT:

         

   *  RETURN:

   *      

   *  HISTORY:

   *       1.00 2014-7-11 cxy

*=============================================*/

FUNCTIONget_available_to_move_qty(p_wip_entity_id  IN NUMBER,

p_opr_seq_num     IN NUMBER,

p_organization_id IN NUMBER,

p_intraopr_step   IN NUMBER)

RETURN NUMBER IS

l_available_to_move_qty NUMBER;

CURSOR csr_wip_operations IS

SELECT decode(p_intraopr_step,

1,

wo.quantity_in_queue,

2,

wo.quantity_running,

3,

wo.quantity_waiting_to_move,

4,

wo.quantity_rejected,

5,

wo.quantity_scrapped,

wo.quantity_completed)

FROM wip_operations wo

WHERE wo.wip_entity_id = p_wip_entity_id

AND wo.operation_seq_num =p_opr_seq_num

AND wo.organization_id =p_organization_id

AND wo.repetitive_schedule_id ISNULL;

BEGIN

OPEN csr_wip_operations;

FETCH csr_wip_operations

INTO l_available_to_move_qty;

CLOSE csr_wip_operations;

RETURN l_available_to_move_qty;

END get_available_to_move_qty;

--Call API Process WIP Move Transaction

--Fixed:

--TRANSACTION_ID/GROUP_ID/PROCESS_PHASE/PROCESS_STATUS not valid. Please re-enter

--SELECT group_id

--   
FROM wip_move_txn_interface

--  
WHERE transaction_id = p_txn_id

--    
AND process_phase = WIP_CONSTANTS.MOVE_VAL

--    
AND process_status = WIP_CONSTANTS.RUNNING

--    
AND group_id IS NOT NULL;

--Doc ID: 
363753.1

--

PROCEDUREprocess_wip_move_txn(p_transaction_id IN NUMBER,

p_commit         IN VARCHAR2 := fnd_api.g_false,

x_return_status  IN OUT VARCHAR2,

x_error_message  IN OUT VARCHAR2)IS

--PRAGMA AUTONOMOUS_TRANSACTION;

l_groupid NUMBER;

l_errbuf VARCHAR2(1000);

l_retcode NUMBER;

BEGIN

-- Call the procedure

/***************************************************************************

* This procedure will be used to do move,easy-return, easy-completion, and

* scrap transaction for Discrete, OSFMjobs, and Repetitive Schedule. The

* caller need to insert the record intoWIP_MOVE_TXN_INTERFACE before calling

* this routine. Caller can generatewmti.transaction_id and wmti.group_id

* from the sequence wip_transactions_s.Caller need to insert both group_id

* and transaction_id before calling theprocedure below. These 2 columns

* should have to same value. Callershould always insert wmti.process_phase =

* 1(Validation) to make sure that thedata inserted is valid, and insert

* wmti.process_status = 2(Running) toprevent Move Manager from picking up

* this record.

*

* PARAMETER:

*

* p_txn_id             transaction_id inWIP_MOVE_TXN_INTERFACE

* p_do_backflush       this parameter determine whether moveprocesor has to

*                      backflush pull componentor not. Some customers use

*                      third party software toinsert backflush components, so

*                      they do not want moveprocessor to backflush them

*                     again. The defaultvalue is null. If the callers do not

*                      pass this parameter orpass fnd_api.g_true, we will

*                      backflush pull component.Otherwise, we will not

*                      backflush them. pass fnd_api.g_true orfnd_api.g_false.

* p_commmit            commit the change to the databaseif succesfully

*                      processing ? pass

*                      fnd_api.g_true orfnd_api.g_false

* x_returnStatus       There are 2 possible values

*                     *fnd_api.g_ret_sts_success*

*                      means the movetransaction succesfully processed

*                     *fnd_api.g_ret_sts_unexp_error*

*                     means anexception occurred

*                      The size of this variableshould be VARCHAR2(1)

* x_errorMsg           contains the error message onfailure. null on success.

*                      The size of this variableshould be VARCHAR2(1000)

*                      because there may beerrors in several columns.

*

* NOTE:

* 1. This procedure should be called ifcaller want to process one record at

*   a time such as Online transaction.

* 2. This procedure will returnfnd_api.g_ret_sts_unexp_error if this records

*   failed. The caller can check the error message from x_errorMsg.

* 3. The caller does not have to insertchild record for overmove/

*   overcompletion. This API will take care everything. The caller does not

*   have to call QA API either.

***************************************************************************/

cux_conc_utl.log_msg(p_msg => '   Begin Call Wip_movproc_pub.processinterface()');

l_groupid := p_transaction_id;

/*SELECT group_id

INTO l_groupid

FROM wip_move_txn_interface

WHERE transaction_id = p_transaction_id

AND process_phase =wip_constants.move_val

AND process_status =wip_constants.running

AND group_id IS NOT NULL;*/

--wip_move_validator.validate(p_group_id=> l_groupid, p_initmsglist => fnd_api.g_true);

/*--Wip_Movproc_Priv.move_worker()

wip_movproc_priv.move_worker(errbuf       => l_errbuf,

retcode      => l_retcode,

p_group_id   => l_groupid,

p_proc_phase=> wip_constants.move_proc,

p_time_out   => 30,

p_seq_move   =>wip_constants.yes);*/

-- This procedure should be called if caller want to do batch processing formultiple records in WMTI.

/*wip_movproc_pub.processinterface(p_group_id     => l_groupid,

p_do_backflush => fnd_api.g_false,

p_commit       => fnd_api.g_false,

x_returnstatus => x_return_status);*/

-- This procedure should be called if caller want to process one record at atime.

wip_movproc_pub.processinterface(p_txn_id       => p_transaction_id,

p_do_backflush => fnd_api.g_false,

p_commit       =>fnd_api.g_false,

x_returnstatus => x_return_status,

x_errormsg     =>x_error_message);

IF x_return_status =fnd_api.g_ret_sts_success THEN

NULL;

cux_conc_utl.log_msg(p_msg =>'   The Transaction_ID : ' ||

p_transaction_id ||

'Succesfully Processed');

--COMMIT;

ELSE

cux_conc_utl.log_msg(p_msg =>'   The Transaction_ID : ' ||

p_transaction_id ||

' WIP APIError : ' ||

x_error_message);

cux_conc_utl.out_msg(p_msg =>'   The Transaction_ID : ' ||

p_transaction_id ||

' WIP API Error : '||

x_error_message);

--RAISE fnd_api.g_exc_error;

--ROLLBACK;

END IF;

cux_conc_utl.log_msg(p_msg => '   End Call Wip_movproc_pub.processinterface()');

END process_wip_move_txn;

/*=============================================

   *  FUNCTION / PROCEDURE

   *      process_wip_move

   *  DESCRIPTION:

   *       Work order mobile transaction processing

   *  ARGUMENT:

         

   *  RETURN:

   *      

   *  HISTORY:

   *       1.00 2014-7-18 cxy

 *=============================================*/

FUNCTIONprocess_wip_move(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,

p_commit        IN VARCHAR2 DEFAULT fnd_api.g_false,

x_return_status OUT NOCOPYVARCHAR2,

x_msg_count     OUT NOCOPY NUMBER,

x_msg_data      OUT NOCOPY VARCHAR2,

p_parameter1    IN VARCHAR2) RETURN VARCHAR2 IS

l_api_name       CONSTANT VARCHAR2(30) :='process_wip_move';

l_savepoint_name CONSTANT VARCHAR2(30) :='sp_process_wip_move';

l_return_status VARCHAR2(1);

l_msg_data      VARCHAR2(2000);

l_rec_move_txn  wip_move_txn_interface%ROWTYPE;

l_group_id  NUMBER;

l_txn_id    NUMBER;

l_available NUMBER;

l_trn_intermtl_transactions_interface%ROWTYPE;

v_transaction_header_id NUMBER DEFAULTNULL;

v_transaction_action_id NUMBER DEFAULTNULL;

v_quantity_flag         NUMBER DEFAULT 1;

v_return_status  VARCHAR2(3) DEFAULT NULL;

v_return_message VARCHAR2(6000) DEFAULTNULL;

v_on_hand_enough VARCHAR2(1) DEFAULT 'N';

x_over_qty       NUMBER;

l_wip_entity_id        NUMBER := 265057;

l_organization_id      NUMBER := 353;

l_transaction_quantity NUMBER := 3;

-- v_lot_number              VARCHAR2(15) := 'zhw007';*\

BEGIN

-- start activity to create savepoint,check compatibility

-- and initialize message list, includedebug message hint to enter api

x_return_status :=cux_api.start_activity(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name=> l_savepoint_name,

p_init_msg_list  =>p_init_msg_list);

IF (x_return_status =fnd_api.g_ret_sts_unexp_error) THEN

RAISE fnd_api.g_exc_unexpected_error;

ELSIF (x_return_status =fnd_api.g_ret_sts_error) THEN

RAISE fnd_api.g_exc_error;

END IF;

-- API body

-- logging parameters

IF l_debug = 'Y' THEN

cux_log.debug('p_parameter1 : ' ||p_parameter1);

END IF;

-- todo

SELECT wip_transactions_s.nextval INTOl_group_id FROM dual;

--loop

l_txn_id       := NULL;

l_rec_move_txn := NULL;

SELECT wip_transactions_s.nextval INTOl_txn_id FROM dual;

l_rec_move_txn.transaction_id :=l_txn_id;

l_rec_move_txn.group_id       := l_group_id;

l_rec_move_txn.process_phase  := 1;

l_rec_move_txn.process_status := 2;--runing

l_rec_move_txn.created_by        := fnd_global.user_id;

l_rec_move_txn.creation_date     := SYSDATE;

l_rec_move_txn.last_updated_by   := fnd_global.user_id;

l_rec_move_txn.last_update_date  := SYSDATE;

l_rec_move_txn.last_update_login :=fnd_global.login_id;

l_rec_move_txn.wip_entity_id :=l_wip_entity_id;

--l_rec_move_txn.wip_entity_name :=rec_grp.wo_no;

l_rec_move_txn.organization_id      := l_organization_id;

l_rec_move_txn.transaction_date     := SYSDATE;

l_rec_move_txn.transaction_quantity := abs(l_transaction_quantity);-- No matter what , The number of transactions is always positive

l_rec_move_txn.transaction_uom      := ' individual ';

IF l_transaction_quantity > 0 THEN

when , Moving forward , From queuing to moving, operation number goes from minimum to maximum

l_rec_move_txn.transaction_type := 1;--1.normal move;2.combination move or completion/return transaction

SELECT MIN(wo.operation_seq_num),MAX(wo.operation_seq_num)

INTOl_rec_move_txn.fm_operation_seq_num,

l_rec_move_txn.to_operation_seq_num

FROM wip_operations wo

WHERE wo.wip_entity_id =l_wip_entity_id

AND wo.organization_id =l_organization_id;

l_rec_move_txn.fm_intraoperation_step_type := 1; -- line up

l_rec_move_txn.to_intraoperation_step_type := 3; -- Move

l_available                                :=get_available_to_move_qty(p_wip_entity_id  => l_wip_entity_id,

p_opr_seq_num     => l_rec_move_txn.fm_operation_seq_num,

p_organization_id => l_organization_id,

p_intraopr_step   => 1);

IF l_available <l_transaction_quantity THEN

-- If the movable quantity is less than the movable quantity , Enable excessive movement

l_rec_move_txn.overcompletion_transaction_qty := l_transaction_quantity-

l_available;

l_rec_move_txn.overcompletion_primary_qty     := l_transaction_quantity -

l_available;

x_over_qty :=l_transaction_quantity - l_available;

END IF; --IF l_available <p_move_qty THEN

ELSE

when , Move in the opposite direction , From moving to queuing, the operation number goes from maximum to minimum

l_rec_move_txn.transaction_type := 1;--1.normal move;2.combination move or completion/return transaction

SELECT MAX(wo.operation_seq_num),MIN(wo.operation_seq_num)

INTO l_rec_move_txn.fm_operation_seq_num,

l_rec_move_txn.to_operation_seq_num

FROM wip_operations wo

WHERE wo.wip_entity_id =l_wip_entity_id

AND wo.organization_id =l_organization_id;

l_rec_move_txn.fm_intraoperation_step_type:= 3; -- Move

l_rec_move_txn.to_intraoperation_step_type := 1; -- line up

END IF; -- IF p_move_qty > 0 THEN

l_rec_move_txn.last_updated_by_name :=fnd_global.user_name;

l_rec_move_txn.created_by_name      := fnd_global.user_name;

-- The following two fields are accessed according to the business logic

l_rec_move_txn.source_code    := 'CXY_MES_WIP_MOVE_TEST';

l_rec_move_txn.source_line_id := 265057;

BEGIN

INSERT INTO wip_move_txn_interfaceVALUES l_rec_move_txn;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intowip_move_txn_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;

wip_movproc_pub.processinterface(p_txn_id       => l_txn_id,

p_commit       => 'F',

x_returnstatus => l_return_status,

x_errormsg     => l_msg_data);

--END IF;

-- API end body

-- end activity, include debug messagehint to exit api

x_return_status :=cux_api.end_activity(p_pkg_name  =>g_pkg_name,

p_api_name  => l_api_name,

p_commit    => p_commit,

x_msg_count => x_msg_count,

x_msg_data  => x_msg_data);

RETURN l_return_status || l_msg_data;

EXCEPTION

WHEN fnd_api.g_exc_error THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_error,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

WHEN fnd_api.g_exc_unexpected_error THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name=> l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_unexp,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

WHEN OTHERS THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_others,

x_msg_count      => x_msg_count,

x_msg_data       =>x_msg_data);

END process_wip_move;

3.4   Work order feeding and returning

/*=============================================

   *  FUNCTION / PROCEDURE

   *      process_wip_issues_returns

   *  DESCRIPTION:

   *       Work order feeding & Return material handling

   *  ARGUMENT:

         

   *  RETURN:

   *      

   *  HISTORY:

   *       1.00 2014-7-18 cxy

   *=============================================*/

FUNCTIONprocess_wip_issues_returns(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,

p_commit        IN VARCHAR2DEFAULT fnd_api.g_false,

x_return_status OUT NOCOPY VARCHAR2,

x_msg_count     OUT NOCOPY NUMBER,

x_msg_data      OUT NOCOPYVARCHAR2,

p_parameter1    IN VARCHAR2)

RETURN VARCHAR2 IS

l_api_name       CONSTANT VARCHAR2(30) :='process_wip_issues_returns';

l_savepoint_name CONSTANT VARCHAR2(30) :='sp_process_wip_issues_returns';

l_iface_recinv.mtl_transactions_interface%ROWTYPE;

l_trn_serial    mtl_serial_numbers_interface%ROWTYPE;

x_error_message VARCHAR2(2000);

l_request_id    NUMBER;

l_return_status VARCHAR2(2);

x_error_status  VARCHAR(2);

l_msg_count   NUMBER;

l_msg_data    VARCHAR2(2000);

l_trans_count VARCHAR2(20000);

l_transaction_source_id NUMBER := 265056;--WIP_DISCRETE_JOBS.WIP_ENTITY_ID

l_inventory_item_id     NUMBER := 325265; -- It's a lot of stuff

l_organization_id       NUMBER := 353;

l_subinventory_code     VARCHAR2(30) := 'YC01';

l_transaction_quantity  NUMBER := -4;

BEGIN

-- start activity to create savepoint,check compatibility

-- and initialize message list, includedebug message hint to enter api

x_return_status :=cux_api.start_activity(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_init_msg_list  =>p_init_msg_list);

IF (x_return_status =fnd_api.g_ret_sts_unexp_error) THEN

RAISE fnd_api.g_exc_unexpected_error;

ELSIF (x_return_status =fnd_api.g_ret_sts_error) THEN

RAISE fnd_api.g_exc_error;

END IF;

-- API body

-- logging parameters

IF l_debug = 'Y' THEN

cux_log.debug('p_parameter1 : ' ||p_parameter1);

END IF;

-- todo

--cux_debug.test_log('1', '1', 'beginprocess');

SELECTmtl_material_transactions_s.nextval

INTO l_iface_rec.transaction_interface_id

FROM dual;

/* l_trn_serial                          := NULL;

l_trn_serial.transaction_interface_id :=l_iface_rec.transaction_interface_id;

l_trn_serial.source_code              := v_source_code;

l_trn_serial.source_line_id           := v_source_line_id;

l_trn_serial.creation_date            := SYSDATE;

l_trn_serial.created_by               := g_user_id;

l_trn_serial.last_update_date         := SYSDATE;

l_trn_serial.last_updated_by          := g_user_id;

l_trn_serial.last_update_login        := g_login_id;

l_trn_serial.program_application_id   := g_prog_appl_id;

l_trn_serial.program_id               := g_conc_program_id;

l_trn_serial.program_update_date      := SYSDATE;

l_trn_serial.request_id               := g_request_id;

l_trn_serial.fm_serial_number         := NULL; --redo

l_trn_serial.to_serial_number         := NULL; -- redo

l_trn_serial.process_flag             := 1;

BEGIN

INSERT INTOmtl_serial_numbers_interface VALUES l_trn_serial;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intomtl_serial_numbers_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;*/

l_iface_rec.last_update_date      := SYSDATE;

l_iface_rec.last_updated_by       := fnd_global.user_id;

l_iface_rec.creation_date         := SYSDATE;

l_iface_rec.created_by            := fnd_global.user_id;

l_iface_rec.last_update_login     := fnd_global.user_id;

l_iface_rec.transaction_header_id :=l_iface_rec.transaction_interface_id;

/************transaction_mode*********************

* transaction_mode

*2 Concurrent, Process transactioninterface Don't deal with ,

*
Need a program call Inventory transaction worker Handle

*3 Background,
from Process transaction interface Handle

***************************************************/

l_iface_rec.transaction_mode := 3;

/************process_flag*********************

* process_flag

*1 Yes

*2 No

*3 Error

***************************************************/

l_iface_rec.process_flag := 1;

IF l_transaction_quantity >= 0 THEN

l_iface_rec.transaction_type_id := 35;--mtl_transaction_types--WIP Issue-- feeding

ELSE

l_iface_rec.transaction_type_id := 43;--wip return
Material return

END IF;

l_iface_rec.transaction_source_type_id :=5; --mtl_txn_source_types-- Production management

/*************************************************

* Account alias miscellaneous , Use alias ID namely disposition_id

* Account miscellaneous , Use an account ID namely code_combination_id

*WIP Material Affairs , With mission ID namely wip_entity_id

*SO Material Affairs , use mtl_sales_orders.sales_order_id

* Subpopulation transfer or interorganizational transfer , It's empty

************************************************/

/*SELECT wdj.wip_entity_id

INTO l_iface_rec.transaction_source_id

FROM wip_discrete_jobs wdj, wip_entitieswe

WHERE (wdj.source_line_id =rec_issue.job_id OR

(wdj.wip_entity_id,wdj.organization_id) IN

(SELECTcwdj.wip_entity_id, cwdj.organization_id

FROM cux_wip_discrete_jobs_vcwdj

WHERE cwdj.job_id =rec_issue.job_id

AND cwdj.order_wip_entity_idIS NULL))

AND we.wip_entity_id = wdj.wip_entity_id

AND we.organization_id =wdj.organization_id;*/

l_iface_rec.transaction_source_id :=l_transaction_source_id;

l_iface_rec.inventory_item_id     := l_inventory_item_id;

l_iface_rec.organization_id       := l_organization_id;

l_iface_rec.subinventory_code     := l_subinventory_code;

l_iface_rec.locator_id            := NULL;

l_iface_rec.transaction_quantity  := -l_transaction_quantity;

l_iface_rec.transaction_uom       := ' individual ';

l_iface_rec.reason_id             := NULL;

l_iface_rec.transaction_date      := SYSDATE;

l_iface_rec.source_code           := 'CXY_MES_WIP_TEST_CODE';

l_iface_rec.source_header_id      := 4;

l_iface_rec.source_line_id        := 4;

l_iface_rec.final_completion_flag := 'N';

--cux_debug.test_log('1', '1', 'begininsert mtl');

BEGIN

INSERT INTOinv.mtl_transactions_interface VALUES l_iface_rec;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intomtl_transactions_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;

--cux_debug.test_log('1', '1', 'endinsert mtl');

l_request_id   := inv_txn_manager_pub.process_transactions(p_api_version      => 1,

p_init_msg_list    =>fnd_api.g_false,

p_commit           => fnd_api.g_true,

p_validation_level => fnd_api.g_valid_level_full,

x_return_status    =>l_return_status,

x_msg_count        => l_msg_count,

x_msg_data         =>l_msg_data,

x_trans_count      =>l_trans_count,

p_table            => 1,

p_header_id        =>l_iface_rec.transaction_header_id);

x_error_status := l_return_status;

BEGIN

SELECT mti.error_code || ',' ||mti.error_explanation || ',' ||

mli.error_code

INTO x_error_message

FROM mtl_transactions_interface     mti,

mtl_transaction_lots_interfacemli

WHERE mti.transaction_interface_id =

l_iface_rec.transaction_interface_id

AND mli.transaction_interface_id(+)=

mti.transaction_interface_id;

EXCEPTION

WHEN no_data_found THEN

NULL;

END;

IF x_error_status != 'S' THEN

/*DELETEmtl_transaction_lots_interface t

WHERE t.source_code ='cux_wip_issue_txn'

AND t.source_line_id =rec_issue.wip_issue_txn_id;*/

/*DELETE mtl_transactions_interface t

WHERE t.source_code ='CXY_MES_WIP_TEST_CODE'

AND t.source_line_id = 4

AND t.source_header_id = 4;*/

NULL;

END IF;

--END IF;

RETURN x_error_status || x_error_message;

-- API end body

-- end activity, include debug messagehint to exit api

x_return_status :=cux_api.end_activity(p_pkg_name  =>g_pkg_name,

p_api_name  => l_api_name,

p_commit    => p_commit,

x_msg_count => x_msg_count,

x_msg_data  => x_msg_data);

EXCEPTION

WHEN fnd_api.g_exc_error THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_error,

x_msg_count      =>x_msg_count,

x_msg_data       => x_msg_data);

WHEN fnd_api.g_exc_unexpected_error THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_unexp,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

WHEN OTHERS THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       => cux_api.g_exc_name_others,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

END process_wip_issues_returns;

3.4   Work order complete

/*=============================================

   *  FUNCTION / PROCEDURE

   *      process_wip_completions

   *  DESCRIPTION:

   *       The work order completes the transaction

   *  ARGUMENT:

         

   *  RETURN:

   *      

   *  HISTORY:

   *       1.00 2014-7-18 cxy

   *=============================================*/

FUNCTIONprocess_wip_completions(p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,

p_commit        IN VARCHAR2DEFAULT fnd_api.g_false,

x_return_status OUT NOCOPYVARCHAR2,

x_msg_count     OUT NOCOPY NUMBER,

x_msg_data      OUT NOCOPYVARCHAR2,

p_parameter1    IN VARCHAR2)

RETURN VARCHAR2 IS

l_api_name       CONSTANT VARCHAR2(30) :='process_wip_completions';

l_savepoint_name CONSTANT VARCHAR2(30) :='sp_process_wip_completions';

l_iface_rec  inv.mtl_transactions_interface%ROWTYPE;

l_cst_rec    cst_comp_snap_interface%ROWTYPE;

l_trn_serialmtl_serial_numbers_interface%ROWTYPE;

l_return_status VARCHAR2(1);

l_msg_count     NUMBER;

l_msg_data      VARCHAR2(2000);

l_trans_count   NUMBER;

x_error_message VARCHAR2(2000);

l_transaction_quantity  NUMBER := 3;

l_transaction_source_id NUMBER := 265057;--wip_entity_id

l_inventory_item_id     NUMBER := 325264; --CXY_ Manufactured parts

l_organization_id       NUMBER := 353;

l_subinventory_code     VARCHAR2(30) := 'CP01';

l_request_id            NUMBER;

BEGIN

-- start activity to create savepoint,check compatibility

-- and initialize message list, includedebug message hint to enter api

x_return_status := cux_api.start_activity(p_pkg_name       => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_init_msg_list  => p_init_msg_list);

IF (x_return_status =fnd_api.g_ret_sts_unexp_error) THEN

RAISE fnd_api.g_exc_unexpected_error;

ELSIF (x_return_status =fnd_api.g_ret_sts_error) THEN

RAISE fnd_api.g_exc_error;

END IF;

-- API body

-- logging parameters

IF l_debug = 'Y' THEN

cux_log.debug('p_parameter1 : ' ||p_parameter1);

END IF;

-- todo

SELECTmtl_material_transactions_s.nextval

INTO l_iface_rec.transaction_interface_id

FROM dual;

l_iface_rec.transaction_header_id :=l_iface_rec.transaction_interface_id;

/* l_trn_serial                          := NULL;

l_trn_serial.transaction_interface_id :=l_iface_rec.transaction_interface_id;

l_trn_serial.source_code              := v_source_code;

l_trn_serial.source_line_id           := v_source_line_id;

l_trn_serial.creation_date            := SYSDATE;

l_trn_serial.created_by               := g_user_id;

l_trn_serial.last_update_date         := SYSDATE;

l_trn_serial.last_updated_by          := g_user_id;

l_trn_serial.last_update_login        := g_login_id;

l_trn_serial.program_application_id   := g_prog_appl_id;

l_trn_serial.program_id               := g_conc_program_id;

l_trn_serial.program_update_date      := SYSDATE;

l_trn_serial.request_id               := g_request_id;

l_trn_serial.fm_serial_number         := NULL; --redo

l_trn_serial.to_serial_number         := NULL; -- redo

l_trn_serial.process_flag             := 1;

BEGIN

INSERT INTOmtl_serial_numbers_interface VALUES l_trn_serial;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intomtl_serial_numbers_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;*/

l_iface_rec.last_update_date  := SYSDATE;

l_iface_rec.last_updated_by   := fnd_global.user_id;

l_iface_rec.creation_date     := SYSDATE;

l_iface_rec.created_by        := fnd_global.user_id;

l_iface_rec.last_update_login :=fnd_global.user_id;

/************transaction_mode*********************

* transaction_mode

*2 Concurrent, Process transactioninterface Don't deal with ,

*
Need a program call Inventory transaction worker Handle

*3 Background,
from Process transaction interface Handle

***************************************************/

l_iface_rec.transaction_mode := 3;

/************process_flag*********************

* process_flag

*1 Yes

*2 No

*3 Error

***************************************************/

l_iface_rec.process_flag := 1;

IF l_transaction_quantity >= 0 THEN

l_iface_rec.transaction_type_id := 44;--mtl_transaction_types--WIP Completion
Completion transaction

ELSE

l_iface_rec.transaction_type_id := 17;-- If the quantity is negative 17 WIP Completion Return
Completion transaction returns

END IF;

l_iface_rec.transaction_source_type_id :=5; --mtl_txn_source_types-- Production management

/*************************************************

* Account alias miscellaneous , Use alias ID namely disposition_id

* Account miscellaneous , Use an account ID namely code_combination_id

*WIP Material Affairs , With mission ID namely wip_entity_id

*SO Material Affairs , use mtl_sales_orders.sales_order_id

* Subpopulation transfer or interorganizational transfer , It's empty

************************************************/

/* BEGIN

SELECT wdj.wip_entity_id,we.primary_item_id

INTOl_iface_rec.transaction_source_id,

l_iface_rec.inventory_item_id

FROM wip_discrete_jobs wdj, wip_entitieswe

WHERE (wdj.source_line_id =rec_completion.job_id AND

wdj.source_code = 'wipplatform')

AND we.wip_entity_id =wdj.wip_entity_id

AND we.organization_id =wdj.organization_id;

EXCEPTION

WHEN no_data_found THEN

NULL;

END;*/

l_iface_rec.transaction_source_id :=l_transaction_source_id;

l_iface_rec.inventory_item_id     := l_inventory_item_id;

IF l_transaction_quantity > 0 THEN

-- If the quantity is greater than zero , Mobile transactions are required first

l_msg_data :=process_wip_move(p_init_msg_list => fnd_api.g_false,

p_commit        =>fnd_api.g_false,

x_return_status => l_return_status,

x_msg_count     => l_msg_count,

x_msg_data      => l_msg_data,

p_parameter1    => NULL);

IF l_return_status != 'S' THEN

cux_debug.test_log('MOVE_COM' ||l_return_status,

l_msg_count,

l_msg_data);

NULL;

END IF; --IF x_error_status != 'S'THEN

END IF; -- IF rec_completion.quantity> 0 THEN

-- Mobile success continues

l_iface_rec.organization_id       := l_organization_id;

l_iface_rec.subinventory_code     := l_subinventory_code;

l_iface_rec.locator_id            := NULL;

l_iface_rec.transaction_quantity  := l_transaction_quantity;

l_iface_rec.transaction_uom       := ' individual ';

l_iface_rec.transaction_date      := SYSDATE;

l_iface_rec.final_completion_flag := 'N';

l_iface_rec.wip_entity_type := 1;

--l_iface_rec.transaction_header_id :=l_iface_rec.transaction_interface_id;

-- The following three fields , Depending on the business logic

l_iface_rec.source_code :='CXY_MES_WIP_COM_TEST1';

l_iface_rec.source_header_id := 265057;

l_iface_rec.source_line_id := 265057;

BEGIN

INSERT INTOinv.mtl_transactions_interface VALUES l_iface_rec;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intomtl_transactions_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;

l_cst_rec.transaction_interface_id :=l_iface_rec.transaction_header_id;

l_cst_rec.wip_entity_id            := 265057;

l_cst_rec.operation_seq_num        := 10;

l_cst_rec.last_update_date         := SYSDATE;

l_cst_rec.last_updated_by          := fnd_global.user_id;

l_cst_rec.creation_date            := SYSDATE;

l_cst_rec.created_by               := fnd_global.user_id;

l_cst_rec.quantity_completed       := l_transaction_quantity; --QuantityCompleted

l_cst_rec.primary_quantity         := l_transaction_quantity; --PriamryQuantity

BEGIN

INSERT INTO cst_comp_snap_interfaceVALUES l_cst_rec;

EXCEPTION

WHEN OTHERS THEN

cux_conc_utl.log_msg('insert intocst_comp_snap_interface error : ' ||

SQLERRM);

RAISE fnd_api.g_exc_error;

END;

l_request_id :=inv_txn_manager_pub.process_transactions(p_api_version      => 1,

p_init_msg_list    =>fnd_api.g_false,

p_commit           =>fnd_api.g_true,

p_validation_level=> fnd_api.g_valid_level_full,

x_return_status    =>l_return_status,

x_msg_count        => l_msg_count,

x_msg_data         =>l_msg_data,

x_trans_count      =>l_trans_count,

p_table            => 1,

p_header_id        =>l_iface_rec.transaction_header_id);

x_return_status := l_return_status;

BEGIN

SELECT mti.error_code || ',' ||mti.error_explanation || ',' ||

mli.error_code

INTO x_error_message

FROM mtl_transactions_interface     mti,

mtl_transaction_lots_interfacemli

WHERE mti.transaction_interface_id =

l_iface_rec.transaction_interface_id

AND mli.transaction_interface_id(+)=

mti.transaction_interface_id;

EXCEPTION

WHEN no_data_found THEN

NULL;

END;

IF x_return_status != 'S' THEN

NULL;

/*DELETE mtl_transactions_interface t

WHERE t.source_code ='cux_wip_issue_txn'

AND t.source_line_id =rec_issue.wip_issue_txn_id

AND t.source_header_id =rec_issue.job_id;*/

ENDIF; --IF x_error_status != 'S' THEN

--END IF;

-- API end body

-- end activity, include debug messagehint to exit api

x_return_status :=cux_api.end_activity(p_pkg_name  =>g_pkg_name,

p_api_name  => l_api_name,

p_commit    => p_commit,

x_msg_count => x_msg_count,

x_msg_data  => x_msg_data);

RETURN l_return_status ||x_error_message;

EXCEPTION

WHEN fnd_api.g_exc_error THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_error,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

WHEN fnd_api.g_exc_unexpected_error THEN

x_return_status := cux_api.handle_exceptions(p_pkg_name       => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       => cux_api.g_exc_name_unexp,

x_msg_count      =>x_msg_count,

x_msg_data       =>x_msg_data);

WHEN OTHERS THEN

x_return_status :=cux_api.handle_exceptions(p_pkg_name      => g_pkg_name,

p_api_name       => l_api_name,

p_savepoint_name => l_savepoint_name,

p_exc_name       =>cux_api.g_exc_name_others,

x_msg_count      =>x_msg_count,

x_msg_data       => x_msg_data);

END process_wip_completions;

Detailed explanation EBS Interface development WIP More articles on module interfaces

  1. Specific explanation EBS Interface development WIP Module interface

    Overall description Purpose of the document This document is for WIP Module business function and interface analysis and research , To adopt concurrent request mode and call API Methods are introduced respectively Content WIP Modules are often introduced using standard tables WIP Things are made up of WIP Related business processes W ...

  2. Detailed explanation EBS Interface development of inventory transaction processing, purchase receiving -- Add

    Except that it can be used  Detailed explanation EBS Interface development of the inventory transaction processing purchase receiving method can also use the following methods , The difference is that with batch and sequence control, the implementation is different The script will load records into ...

  3. Detailed explanation EBS Interface development of the purchase application import

    For more information, please refer to my blog  Detailed explanation EBS Import purchase order of interface development http://blog.csdn.net/cai_xingyun/article/details/17114697 /*+++++++ ...

  4. Detailed explanation EBS Interface development of inventory transaction batch update

    Sometimes there are import errors in the inventory transaction batch, which need to be updated. You can use the secondary program to update , Batch import can refer to blog Detailed explanation EBS Interface development of inventory transactions - Material batch import http://blog.csdn.net/cai_xingyun/art ...

  5. supplier API Add ( Detailed explanation EBS Supplier import of interface development )( turn )

    Original address   Supplier imported API Add ( Detailed explanation EBS Supplier import of interface development ) -- supplier -- establish AP_VENDOR_PUB_PKG.Create_Vendor ( p_api_version IN NUM ...

  6. Asp.net Mvc Modular development of “ Turn on module development 、 A simple and enjoyable journey of debugging ”

    All over the world , Divide everything into two opposite sides . The wealth that everyone desires is divided into rich and poor , Height is divided into high and short , The body is divided into fat and thin , wait . We always sigh , I don't understand the life of the rich ; How can rich people understand that we get up early every day ...

  7. ArcGIS Engine Development tour 04---ARCGIS Interface details

    original text :ArcGIS Engine Development tour 04---ARCGIS Interface details ArcGIS Interface details ... 1 1.      IField Interface (esriGeoDatabase)... 2 2.    ...

  8. Detailed explanation EBS Interface development of accounts receivable processing

    Refer to examples : Du Chunyang R12 Accounts receivable module collection API Research ( One ) A brief introduction to the common standard list of receivables 1.1    Common standard tables The tables and descriptions related to receivables processing are listed in the following table : Table name explain Other information AR_BATCHES_ALL ...

  9. Dojo A preliminary study 2: Set up dojoConfig Detailed explanation ,dojoConfig Parameters, +Dojo Preset custom in AMD Four ways of module ( be based on dojo1.11.2)

    Dojo Want to load custom AMD modular , You need to set the path corresponding to this module first , The path of the module is the unique identifier of the module . One .dojoConfig Parameter setting details var dojoConfig = { baseUrl: ...

Random recommendation

  1. MySQL Summary of the usage of index and Optimization in

    1. What is an index in a database ? What does an index do ? The purpose of index is to speed up the query . If the amount of data is large , Large queries need to load data from the hard disk into the memory . 2.InnoDB What is the indexing principle in ? InnoDB yes Mysql Of ...

  2. metaspolit Basics

    stay kali Use in metasploit, It needs to be turned on first PostgreSQL Database services and metasploit service , And then you can make full use of msf Database query exploit And recorded . This is better than bt5 Much more convenient , So now ...

  3. About ibatis Physical cursor paging

    http://www.iteye.com/topic/136712 detailed demo: reference http://www.kusoft.net My database uses mssql2000  With paging, the amount of data is relatively large :  according to i ...

  4. digital certificate KeyTool Use ( Second articles )

    http://my.oschina.net/frankies/blog/344914 J2SDK Provides keytool Command line tools , The digital certificate can be created according to the specified parameters . The generated certificate or certificate library is saved in the command line by default ...

  5. c# .net core Network request under

    This article is based on VS2017 Under the environment of ,.net core 1.1 Above version . in the meantime , because .net core Not based on IIS, Our past network request code is in .net core Within the framework of , There may be incompatibilities , Now that I'm wrong ...

  6. How to change Myeclipse Edit area background color ( turn )

    Right click in the edit window -->Preferences-->General plus -->Editors plus --> spot Text Editors word --> In the lower right window, select Backgroud col ...

  7. SSIS Loop through the component [Foreach Loop Container]

    background Extract data to business department every month , Each branch has to extract general , Run first SQL, Paste to Excel in , Then send an email to the person concerned . laborious , It's also easy to paste and dislocate . therefore , You need a program to do these steps . The first thing I think of is through SSIS ...

  8. use mongols Make it easy websocket application

    use websocket Chat system is very suitable . mongols It's a program that runs on linux Open source on top of the system c++ library , It's easy to open a websocket The server . First ,build One websocket The server . #i ...

  9. unity Plug in is the king of all fields

    Gesture operation on mobile terminal Easy Touch obtain Slow motion iTween obtain Visual programming Playmaker1.9.0 obtain UI NGUI,UGUI obtain Shader Shader visual programming AmplifySha ...

  10. If you change the size of the form, the graphics in the view area will also change MFC

    How to realize the form zooming , The graphics in the view area also change stay CMFCView Class to add three message functions : In the class wizard, select CMFCView class , Click on the right ----> Class wizard ------> news --------> ...