DeleteSalesHeaderAndDetail

DeleteSalesHeaderAndDetail

Major Business Rule

Object Name: B4200580

Parent DLL: CDIST

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will remove records from either the Sales Order Header (F4201) table or the Sales Order 
Detail (F4211) table based on the Mode passed in.


1.2Setup Notes and Prerequisites

• Records to be purged must first be successfully saved to the Sales Header Ledger (F42019) and Sales 
Detail Ledger (F42119) files.  Use business functions B4200570 and B4200260 to do this

• 
1.3Special Logic


None.


2.2Related Tables 

Table Table Description
F4201Sales Order Header

F4211Sales Order Detail



2.3Related Business Functions

Source NameFunction Name


2.4Processing 

1.If DeleteHeaderOrDetail equals 1
If the Document Number, Document Type and Key Company is not passed in exit the function without

doing anything

delete all records in the Sales Header (F4201) table with the key equal to the Document Number, 

Document Type and Key Company passed in.

2.If DeleteHeaderOrDetail equals 2

If the Document Number, Document Type, Key Company and Line Number are not passed in exit the

function without doing anything

Delete all records in the Sales Detail (F4211) table with the key equal to the Document Number,

Document Type, Key Company and Line Number passed in.

3.If an error occurs with the delete function return ErrorID '9999' if suppress error message is 

not a '1'


Data Structure

D4200580 - DeleteSalesHeaderAndDetail


Special Input Expected

DOCODocument Number

DCTODocument Type

KCOOKey Company

LNIDLine Number

MODEDeleteHeaderOrDetail1 = Delete Header 2 = Delete Detail

EV01SuppressErrorMessage



Special Output Returned

DTAIErrorID


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnDocumentNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szDocumentTypeDCTOcharNONENONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szKeyCompanyKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

mnLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

cDeleteHeaderOrDetailMODEcharNONENONE


Special Input Expected

MODEab DeleteHeaderOrDetail


Significant Data Values

1 = Delete Header

2 = Delete Detail

^

szErrorMessageDTAIcharNONENONE


Special Output Returned

DTAIab ErrorID

^

cSuppressErrorMessageEV01charNONENONE


Special Input Expected

EV01ab SuppressErrorMessage

^

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

cPurgeTextOrNotEV01charOPTNONE

An option that specifies the type of processing for an event.

Related Functions

None

Related Tables

F4201 Sales Order Header File
F4211 Sales Order Detail File