F4801Z1WriteWOPLOrRtgTrans

F4801Z1, Write WO Parts List or Routings Transactions

Minor Business Rule

Object Name: B3101430

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
The business function may be called by the Work Order Routings Master Business Function (B3101250) to 

write add, update and delete transactions to the Outbound Work Order tables F4801Z1and mainly 

F3112Z1. 


The business function may also be called by the Work Order Parts List Master Business Function 

(B3101260) to write add, update and delete transactions to the Outbound Work Order tables F4801Z1and mainly 

F3111Z1.


The business function determines where it is being called from through the Input Parameter 

CallSource. If CallSource is '2' then it is B3101250 that is calling it. Else If CallSource is '1' then it is 

B3101260 that is calling it.


When all transactions(i.e. all routings or all part lists) are written to the master tables and the 

ENDDOC function of the calling MBF is about to start cleaning up, the calling MBF must make another 

call to this function using ActionCode = 'D' to tell this function to clean up and invoke the Outbound 

Processor UBE in the Subsystem which processes work order exports. 


1.2Setup Notes and Prerequisites

This function will only be used by B3101250 or B3101260 to write transactions for Interoperability.

1.3Special Logic

None.

2.Technical Specifications

2.4Processing 

1. Open F4801Z1.
2. If Input CallSource = '1' then

3.  Open F3112Z1

4. Else

5.  If Input CallSource = '2'

6.  Open F3111Z1

7.  End If

8. End If

9. Wk DB IO Failure = '0'

10. Output Error Code = '0'

11. Output Error Message ID =  " "

12. 

13. // Call B0000176 when All Transactions Are Completed and destroy memory allocated.

14. If Input Action Code = 'D'

15.  Destroy Data Ptr for Input IdControlData and retrieve Control DS.

16.  If szEDIAddTransactionID <> "0" then

17.  Call B0000176 to invoke subsystem UBE to process this transaction.

18.  "R4801Z1O"'e0 OBNM

19.  "ZJDE0002" 'e0 VERS

20.  SzEDUSForAdd'e0 EDUS

21.  0 'e0 EDBT

22.  szEDIAddTransactionID'e0 EDTN

23.  '1' 'e0 SUPPS

24.  End If

25.  If szEDIUpdTransactionID <> "0" then

26.  Call B0000176 to invoke subsystem UBE to process this transaction.

27.  "R4801Z1O"'e0 OBNM

28.  "ZJDE0002" 'e0 VERS

29.  SzEDUSForUpd'e0 EDUS

30.  0 'e0 EDBT

31.  szEDIUpdTransactionID'e0 EDTN

32.  '1' 'e0 SUPPS

33.  End If

34.  If szEDIDelTransactionID <> "0" then

35.  Call B0000176 to invoke subsystem UBE to process this transaction.

36.  "R4801Z1O"'e0 OBNM

37.  "ZJDE0002" 'e0 VERS

38.  SzEDUSForDel'e0 EDUS

39.  0 'e0 EDBT

40.  szEDIDelTransactionID'e0 EDTN

41.  '1' 'e0 SUPPS

42.  End If

43. End If

44. 

45. // Process Transactions for Add, Update or Delete.

46. If Input Action Code = '1' Or = '2' Or = '3' 

47.  If Input IdF4801Record <> 0 And Input IdNewRecord <> 0

48.  If (Input Action Code = '2' And Input IdOldRecord <> 0) OR Input Action Code <> '2'

49.  // Set up Control DS if this business function was called the first time

50.  If Input IdControlData = 0

51.  Allocate Memory for Control DS

52.  Initialize szEDIAddTransactionID, szEDIUpdTransactionID, szEDIDelTransactionID to 

"0"

53.  Store Pointer to Control DS in Input IdControlData.

54.  End If

55.  Retrieve Control DS from Pointer Input IdControlData.

56.  Get Audit Info (B9800100)to retrieve Audit Info.

57.  // Get Transaction Numbers for Each Action Code.

58.  If ControlDS.szEDIAddTransactionID = "0" And Input Action Code = '1'

59.  Get EDI Transaction Number(B0000175) and save in ControlDS.szEDIAddTransactionID

60.  SzEDUSForAdd = Wk User ID

61.  // Next write a WO Header transaction record into F4801Z1.

62.  Retrieve F4801 Data Structure from Input IdF4801Record.

63.  Copy Data into the F4801Z1 Data Structure:

64.  Copy F4801 Fields into the F4801Z1 DS

65.  In Addition Copy the Following Fields from F4801 to F4801Z1:

66. 

67. 

68.  End If

69.  If ControlDS.szEDIUpdTransactionID = "0" And Input Action Code = '2'

70.  Get EDI Transaction Number(B0000175) and save in ControlDS.szEDIUpdTransactionID

71.  SzEDUSForUpd = Wk User ID

72.  // Next write a WO Header transaction record into F4801Z1.

73.  Retrieve F4801 Data Structure from Input IdF4801Record.

74.  Copy Data into the F4801Z1 Data Structure:

75.  Copy F4801 Fields into the F4801Z1 DS

76.  In Addition Copy the Following Fields from F4801 to F4801Z1:

77. 

78. 

79.  End If

80.  If ControlDS.szEDIDelTransactionID = "0" And Input Action Code = '3'

81.  Get EDI Transaction Number(B0000175) and save in ControlDS.szEDIDelTransactionID

82.  SzEDUSForDel = Wk User ID

83.  // Next write a WO Header transaction record into F4801Z1.

84.  Retrieve F4801 Data Structure from Input IdF4801Record.

85.  Copy Data into the F4801Z1 Data Structure:

86.  Copy F4801 Fields into the F4801Z1 DS

87.  In Addition Copy the Following Fields from F4801 to F4801Z1:

88. 

89. 

90.  End If

91. 

92.  // Write transactions to the F3112Z1 or F3111Z1 Table.

93.  Assign common fields to F311xZ1 DS:

94. 

95.  Case Input Action Code = '1'

96.  // Add

97.  Wk Action Code = "02"

98. 

99. 

100.  Case Input Action Code = '2'

101.  // Update

102.  Retrieve DS for F3112 or F3111 from Input IdOldRecord.

103.  Copy BeforeImage-related data to appropriate columns in F3112Z1 or F3111Z1.

104.  Copy the following data into F3112Z1 or F3111Z1:

105. 

106. 

107.  Perform Insert to F3112Z1 or F3111Z1.

108.  If Failed then

109.  Wk DB IO Failure = '1'

110.  End If

111.  If Wk DB IO Failure = '0'

112.  Wk Action Code = "UA"

113.  End If

114. 

115.  Case Input Action Code = '3'

116.  // Delete

117.  Wk Action Code = "03"

118. 

119. 

120.  End Case

121. 

122.  If Wk DB IO Failure = '0'

123.  Retrieve DS for F3112 or F3111 from Input IdNewRecord.

124.  Copy BeforeImage-related data to appropriate columns in F3112Z1 or F3111Z1.

125.  Copy the following also to the F3112Z1 or F3111Z1columns.

126. 

127. 

128.  //

129.  Perform Insert to F3112Z1 or F3111Z1.

130.  If Failed then

131.  Wk DB IO Failure = '1'

132.  End If

133.  End If

134.  Else

135.  Wk DB IO Failure = '1'

136.  End If

137.  Else

138.  Wk DB IO Failure = '1'

139.  End If

140. Else

141.  If Input Action Code <> 'D'

142.  Wk DB IO Failure = '1'

143.  End If

144. End If

145. If Wk DB IO Failure = '1'

146.  Output Error Code = '1'

147.  Output Error Message ID = "0002"

148. End If

149. Close all opened tables.

150. 


^

Data Structure

D3101430 - F4801Z1, Write WO Parts List or Routing Transactions

Parameter NameData ItemData TypeReq/OptI/O/Both
cCallSourceEV01charNONENONE

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

idF4801RecordGENLNGIDNONENONE

General purpose ID variable.

idNewRecordGENLN2IDNONENONE

General purpose ID variable.

idOldRecordGENLN2IDNONENONE

General purpose ID variable.

idControlDataGENLN3IDNONENONE

General purpose ID variable.

cActionCodeACTNcharNONENONE

A code that specifies the action that is performed. Valid values are: A Add C Change

szTransactionTypeTYTNcharNONENONE

The qualifier used to identify a specific type of transaction.

szProgramIDPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

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).

szErrorMessageIDDTAIcharNONENONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

idNewTagRecordGENLN2IDOPTNONE

General purpose ID variable.

idOldTagRecordGENLN2IDOPTNONE

General purpose ID variable.

Related Functions

B0000175 Get Next Transaction Number
B0000176 Add Transaction To Subsystem Queue
B9800100 Get Audit Information

Related Tables

F3111 Work Order Parts List
F3111Z1 Outbound Work Order Parts List
F3112 Work Order Routing
F3112Z1 Outbound Work Order Routings
F4801 Work Order Master File
F4801Z1 Outbound Work Order Header