rnsap 0.3.2 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/helper/rfc_helper.rb +21 -0
- data/lib/preq_detail/preq_acct_assignment.rb +109 -0
- data/lib/preq_detail/preq_contract_limits.rb +27 -0
- data/lib/preq_detail/preq_item.rb +259 -0
- data/lib/preq_detail/preq_limits.rb +59 -0
- data/lib/preq_detail/preq_services.rb +153 -0
- data/lib/preq_detail/preq_services_texts.rb +13 -0
- data/lib/preq_detail/preq_srv_accass_values.rb +23 -0
- data/lib/preq_detail/preq_text.rb +13 -0
- data/lib/preq_release_info/preq_gen_release_info.rb +23 -0
- data/lib/preq_release_info/preq_release_final.rb +55 -0
- data/lib/preq_release_info/preq_release_posted.rb +55 -0
- data/lib/preq_release_info/preq_release_prerequisites.rb +55 -0
- data/lib/read_table/table_column.rb +14 -0
- data/lib/return.rb +21 -0
- data/lib/rnsap.rb +202 -8
- data/lib/rnsap_spec.rb +93 -0
- metadata +22 -6
@@ -0,0 +1,153 @@
|
|
1
|
+
# class used to represent REQUISITION_SERVICES. Used internally
|
2
|
+
class PreqServices
|
3
|
+
# @return [Integer] Purchase Order: Entered Quantity
|
4
|
+
attr_accessor :actual_qty
|
5
|
+
# @return [Integer] Purchase order: Entered value
|
6
|
+
attr_accessor :actual_val
|
7
|
+
# @return [String] Alternative Line
|
8
|
+
attr_accessor :alternat
|
9
|
+
# @return [String] Base Unit of Measure
|
10
|
+
attr_accessor :base_uom
|
11
|
+
# @return [String] Basic Line
|
12
|
+
attr_accessor :basic_line
|
13
|
+
# @return [String] Alternatives: Reference to basic item
|
14
|
+
attr_accessor :basline_no
|
15
|
+
# @return [String] Start Time
|
16
|
+
attr_accessor :begintime
|
17
|
+
# @return [String] Bidder's Line
|
18
|
+
attr_accessor :bidder
|
19
|
+
# @return [String] Blanket Line
|
20
|
+
attr_accessor :blanket
|
21
|
+
# @return [String] Entry: Unplanned from contract
|
22
|
+
attr_accessor :con_line
|
23
|
+
# @return [String] Entry: Unplanned from contract
|
24
|
+
attr_accessor :con_pckg
|
25
|
+
# @return [Integer] Contract: Quantity Released (by Issue of Release Orders)
|
26
|
+
attr_accessor :con_qty
|
27
|
+
# @return [Integer] Contract: Value released (via release orders)
|
28
|
+
attr_accessor :con_value
|
29
|
+
# @return [Date] Date
|
30
|
+
attr_accessor :date
|
31
|
+
# @return [String] Deletion Indicator
|
32
|
+
attr_accessor :delete_ind
|
33
|
+
# @return [String] Distribution indicator for multiple account assignment
|
34
|
+
attr_accessor :distrib
|
35
|
+
# @return [String] Edition of Service Type
|
36
|
+
attr_accessor :edition
|
37
|
+
# @return [String] End Time
|
38
|
+
attr_accessor :endtime
|
39
|
+
# @return [String] Contingency Line
|
40
|
+
attr_accessor :eventual
|
41
|
+
# @return [String] External Personnel Number
|
42
|
+
attr_accessor :extpers_no
|
43
|
+
# @return [String] External Reference Key for Service
|
44
|
+
attr_accessor :extrefkey
|
45
|
+
# @return [String] Line Number
|
46
|
+
attr_accessor :ext_line
|
47
|
+
# @return [String] Vendor's Service Number
|
48
|
+
attr_accessor :ext_serv
|
49
|
+
# @return [String] Formula Number
|
50
|
+
attr_accessor :formula
|
51
|
+
# @return [Integer] Formula Value
|
52
|
+
attr_accessor :form_val1
|
53
|
+
# @return [Integer] Formula value
|
54
|
+
attr_accessor :form_val2
|
55
|
+
# @return [Integer] Formula value
|
56
|
+
attr_accessor :form_val3
|
57
|
+
# @return [Integer] Formula value
|
58
|
+
attr_accessor :form_val4
|
59
|
+
# @return [Integer] Formula value
|
60
|
+
attr_accessor :form_val5
|
61
|
+
# @return [String] Lower Limit
|
62
|
+
attr_accessor :from_line
|
63
|
+
# @return [Integer] Gross value
|
64
|
+
attr_accessor :gross_val
|
65
|
+
# @return [Integer] Gross price
|
66
|
+
attr_accessor :gr_price
|
67
|
+
# @return [String] Hierarchically superior line number
|
68
|
+
attr_accessor :hi_line_no
|
69
|
+
# @return [String] Informatory Line
|
70
|
+
attr_accessor :inform
|
71
|
+
# @return [String] Entry: Unplanned, limit line
|
72
|
+
attr_accessor :limit_line
|
73
|
+
# @return [String] Internal line number
|
74
|
+
attr_accessor :line_no
|
75
|
+
# @return [String] Material Group
|
76
|
+
attr_accessor :matl_group
|
77
|
+
# @return [Integer] Net value
|
78
|
+
attr_accessor :net_value
|
79
|
+
# @return [Integer] Non-deductible input tax
|
80
|
+
attr_accessor :nond_itax
|
81
|
+
# @return [String] Line with Open Quantity
|
82
|
+
attr_accessor :open_qty
|
83
|
+
# @return [String] Indicator: Outline line
|
84
|
+
attr_accessor :outl_ind
|
85
|
+
# @return [I] Hierarchy level of group
|
86
|
+
attr_accessor :outl_level
|
87
|
+
# @return [String] Outline Level
|
88
|
+
attr_accessor :outl_no
|
89
|
+
# @return [Integer] Overfulfillment Tolerance
|
90
|
+
attr_accessor :ovf_tol
|
91
|
+
# @return [String] Unlimited Overfulfillment
|
92
|
+
attr_accessor :ovf_unlim
|
93
|
+
# @return [String] Package number
|
94
|
+
attr_accessor :pckg_no
|
95
|
+
# @return [String] Personnel Number
|
96
|
+
attr_accessor :pers_no
|
97
|
+
# @return [Date] Period of Performance End Date
|
98
|
+
attr_accessor :per_edate
|
99
|
+
# @return [Date] Period of Performance Start Date
|
100
|
+
attr_accessor :per_sdate
|
101
|
+
# @return [String] Entry: Planned package line
|
102
|
+
attr_accessor :pln_line
|
103
|
+
# @return [String] Source package number
|
104
|
+
attr_accessor :pln_pckg
|
105
|
+
# @return [String] Price Change in Entry Sheet
|
106
|
+
attr_accessor :price_chg
|
107
|
+
# @return [Integer] Price unit
|
108
|
+
attr_accessor :price_unit
|
109
|
+
# @return [Integer] Quantity with Sign
|
110
|
+
attr_accessor :quantity
|
111
|
+
# @return [String] Activity Number
|
112
|
+
attr_accessor :service
|
113
|
+
# @return [String] Short Description of Service Type
|
114
|
+
attr_accessor :serv_type
|
115
|
+
# @return [String] Short Text
|
116
|
+
attr_accessor :short_text
|
117
|
+
# @return [String] Standard Service Catalog Item
|
118
|
+
attr_accessor :ssc_item
|
119
|
+
# @return [String] Service line refers to standard service catalog limits
|
120
|
+
attr_accessor :ssc_lim
|
121
|
+
# @return [String] Subpackage number
|
122
|
+
attr_accessor :subpckg_no
|
123
|
+
# @return [String] Supplementary Line
|
124
|
+
attr_accessor :supp_line
|
125
|
+
# @return [Integer] Target Value
|
126
|
+
attr_accessor :target_val
|
127
|
+
# @return [String] Tax Jurisdiction
|
128
|
+
attr_accessor :taxjurcode
|
129
|
+
# @return [String] Tax on Sales/Purchases Code
|
130
|
+
attr_accessor :tax_code
|
131
|
+
# @return [String] Entry: Unplanned service from model specifications
|
132
|
+
attr_accessor :tmp_line
|
133
|
+
# @return [String] Entry: Unplanned service from model specifications
|
134
|
+
attr_accessor :tmp_pckg
|
135
|
+
# @return [String] Upper Limit
|
136
|
+
attr_accessor :to_line
|
137
|
+
# @return [Integer] Contract: Unplanned Released Quantity
|
138
|
+
attr_accessor :unpl_qty
|
139
|
+
# @return [Integer] Contract: Unplanned released value
|
140
|
+
attr_accessor :unpl_val
|
141
|
+
# @return [String] ISO code for unit of measurement
|
142
|
+
attr_accessor :uom_iso
|
143
|
+
# @return [String] User-Defined Field
|
144
|
+
attr_accessor :userf1_num
|
145
|
+
# @return [String] User-Defined Field
|
146
|
+
attr_accessor :userf1_txt
|
147
|
+
# @return [Integer] User-Defined Field
|
148
|
+
attr_accessor :userf2_num
|
149
|
+
# @return [String] User-Defined Field
|
150
|
+
attr_accessor :userf2_txt
|
151
|
+
# @return [String] Wage Type
|
152
|
+
attr_accessor :wagetype
|
153
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# class used to represent REQUISITION_SERVICES_TEXTS. Used internally
|
2
|
+
class PreqServicesText
|
3
|
+
# @return [String] Tag column
|
4
|
+
attr_accessor :format_col
|
5
|
+
# @return [String] Internal line number
|
6
|
+
attr_accessor :line_no
|
7
|
+
# @return [String] Package number
|
8
|
+
attr_accessor :pckg_no
|
9
|
+
# @return [String] Text ID
|
10
|
+
attr_accessor :text_id
|
11
|
+
# @return [String] Text Line
|
12
|
+
attr_accessor :text_line
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# class used to represent REQUISITION_SRV_ACCASS_VALUES. Used internally
|
2
|
+
class PreqServicesAccassValues
|
3
|
+
# @return [String] Deletion Indicator
|
4
|
+
attr_accessor :delete_ind
|
5
|
+
# @return [String] Highest package number
|
6
|
+
attr_accessor :hpackno
|
7
|
+
# @return [String] Inactive account assignment specification
|
8
|
+
attr_accessor :inactive
|
9
|
+
# @return [String] Line Number
|
10
|
+
attr_accessor :line_no
|
11
|
+
# @return [Integer] Net value
|
12
|
+
attr_accessor :net_value
|
13
|
+
# @return [String] Package number
|
14
|
+
attr_accessor :pckg_no
|
15
|
+
# @return [Integer] Percentage for Account Assignment Value Distribution
|
16
|
+
attr_accessor :percentage
|
17
|
+
# @return [Integer] Quantity
|
18
|
+
attr_accessor :quantity
|
19
|
+
# @return [String] Sequential Number of Account Assignment
|
20
|
+
attr_accessor :serial_no
|
21
|
+
# @return [String] Seq. Number of Acc. Assignment Specification: Service Line
|
22
|
+
attr_accessor :serno_line
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# class used to represent REQUISITION_TEXT STRUCTURE. Used internally
|
2
|
+
class PreqText
|
3
|
+
# @return [String] Item number of purchase requisition
|
4
|
+
attr_accessor :preq_item
|
5
|
+
# @return [String] Purchase Requisition Number
|
6
|
+
attr_accessor :preq_no
|
7
|
+
# @return [String] Tag column
|
8
|
+
attr_accessor :text_form
|
9
|
+
# @return [String] Text ID
|
10
|
+
attr_accessor :text_id
|
11
|
+
# @return [String] Text Line
|
12
|
+
attr_accessor :text_line
|
13
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# class used to represent GENERAL_RELEASE_INFO. Used internally
|
2
|
+
class PreqGenReleaseInfo
|
3
|
+
# @return [String] Item number of purchase requisition
|
4
|
+
attr_accessor :preq_item
|
5
|
+
# @return [String] Purchase Requisition Number
|
6
|
+
attr_accessor :preq_no
|
7
|
+
# @return [String] Release code
|
8
|
+
attr_accessor :rel_code
|
9
|
+
# @return [String] Description of release code
|
10
|
+
attr_accessor :rel_cod_tx
|
11
|
+
# @return [String] Release group
|
12
|
+
attr_accessor :rel_group
|
13
|
+
# @return [String] Description of release group
|
14
|
+
attr_accessor :rel_grp_tx
|
15
|
+
# @return [String] Release indicator
|
16
|
+
attr_accessor :rel_ind
|
17
|
+
# @return [String] Description of Release Indicator
|
18
|
+
attr_accessor :rel_ind_tx
|
19
|
+
# @return [String] Release Strategy
|
20
|
+
attr_accessor :rel_strat
|
21
|
+
# @return [String] Description of release strategy
|
22
|
+
attr_accessor :rel_str_tx
|
23
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# class used to represent RELEASE_FINAL. Used internally
|
2
|
+
class PreqReleaseFinal
|
3
|
+
# @return [String] Item number of purchase requisition
|
4
|
+
attr_accessor :preq_item
|
5
|
+
# @return [String] Purchase Requisition Number
|
6
|
+
attr_accessor :preq_no
|
7
|
+
# @return [String] Description of release code 1
|
8
|
+
attr_accessor :rel_cd_tx1
|
9
|
+
# @return [String] Description of release code 2
|
10
|
+
attr_accessor :rel_cd_tx2
|
11
|
+
# @return [String] Description of release code 3
|
12
|
+
attr_accessor :rel_cd_tx3
|
13
|
+
# @return [String] Description of release code 4
|
14
|
+
attr_accessor :rel_cd_tx4
|
15
|
+
# @return [String] Description of release code 5
|
16
|
+
attr_accessor :rel_cd_tx5
|
17
|
+
# @return [String] Description of release code 6
|
18
|
+
attr_accessor :rel_cd_tx6
|
19
|
+
# @return [String] Description of release code 7
|
20
|
+
attr_accessor :rel_cd_tx7
|
21
|
+
# @return [String] Description of release code
|
22
|
+
attr_accessor :rel_cd_tx8
|
23
|
+
# @return [String] Release code 1
|
24
|
+
attr_accessor :rel_code1
|
25
|
+
# @return [String] Release code 2
|
26
|
+
attr_accessor :rel_code2
|
27
|
+
# @return [String] Release code 3
|
28
|
+
attr_accessor :rel_code3
|
29
|
+
# @return [String] Release code 4
|
30
|
+
attr_accessor :rel_code4
|
31
|
+
# @return [String] Release code 5
|
32
|
+
attr_accessor :rel_code5
|
33
|
+
# @return [String] Release code 6
|
34
|
+
attr_accessor :rel_code6
|
35
|
+
# @return [String] Release code 7
|
36
|
+
attr_accessor :rel_code7
|
37
|
+
# @return [String] Release code 8
|
38
|
+
attr_accessor :rel_code8
|
39
|
+
# @return [String] Role resolution for workflow for release code 1
|
40
|
+
attr_accessor :rel_wf1
|
41
|
+
# @return [String] Role resolution for workflow for release code 2
|
42
|
+
attr_accessor :rel_wf2
|
43
|
+
# @return [String] Role resolution for workflow for release code 3
|
44
|
+
attr_accessor :rel_wf3
|
45
|
+
# @return [String] Role resolution for workflow for release code 4
|
46
|
+
attr_accessor :rel_wf4
|
47
|
+
# @return [String] Role resolution for workflow for release code 5
|
48
|
+
attr_accessor :rel_wf5
|
49
|
+
# @return [String] Role resolution for workflow for release code 6
|
50
|
+
attr_accessor :rel_wf6
|
51
|
+
# @return [String] Role resolution for workflow for release code 7
|
52
|
+
attr_accessor :rel_wf7
|
53
|
+
# @return [String] Role resolution for workflow for release code 8
|
54
|
+
attr_accessor :rel_wf8
|
55
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# class used to represent RELEASE_ALREADY_POSTED. Used internally
|
2
|
+
class PreqReleasePosted
|
3
|
+
# @return [String] Item number of purchase requisition
|
4
|
+
attr_accessor :preq_item
|
5
|
+
# @return [String] Purchase Requisition Number
|
6
|
+
attr_accessor :preq_no
|
7
|
+
# @return [String] Description of release code 1
|
8
|
+
attr_accessor :rel_cd_tx1
|
9
|
+
# @return [String] Description of release code 2
|
10
|
+
attr_accessor :rel_cd_tx2
|
11
|
+
# @return [String] Description of release code 3
|
12
|
+
attr_accessor :rel_cd_tx3
|
13
|
+
# @return [String] Description of release code 4
|
14
|
+
attr_accessor :rel_cd_tx4
|
15
|
+
# @return [String] Description of release code 5
|
16
|
+
attr_accessor :rel_cd_tx5
|
17
|
+
# @return [String] Description of release code 6
|
18
|
+
attr_accessor :rel_cd_tx6
|
19
|
+
# @return [String] Description of release code 7
|
20
|
+
attr_accessor :rel_cd_tx7
|
21
|
+
# @return [String] Description of release code
|
22
|
+
attr_accessor :rel_cd_tx8
|
23
|
+
# @return [String] Release code 1
|
24
|
+
attr_accessor :rel_code1
|
25
|
+
# @return [String] Release code 2
|
26
|
+
attr_accessor :rel_code2
|
27
|
+
# @return [String] Release code 3
|
28
|
+
attr_accessor :rel_code3
|
29
|
+
# @return [String] Release code 4
|
30
|
+
attr_accessor :rel_code4
|
31
|
+
# @return [String] Release code 5
|
32
|
+
attr_accessor :rel_code5
|
33
|
+
# @return [String] Release code 6
|
34
|
+
attr_accessor :rel_code6
|
35
|
+
# @return [String] Release code 7
|
36
|
+
attr_accessor :rel_code7
|
37
|
+
# @return [String] Release code 8
|
38
|
+
attr_accessor :rel_code8
|
39
|
+
# @return [String] Role resolution for workflow for release code 1
|
40
|
+
attr_accessor :rel_wf1
|
41
|
+
# @return [String] Role resolution for workflow for release code 2
|
42
|
+
attr_accessor :rel_wf2
|
43
|
+
# @return [String] Role resolution for workflow for release code 3
|
44
|
+
attr_accessor :rel_wf3
|
45
|
+
# @return [String] Role resolution for workflow for release code 4
|
46
|
+
attr_accessor :rel_wf4
|
47
|
+
# @return [String] Role resolution for workflow for release code 5
|
48
|
+
attr_accessor :rel_wf5
|
49
|
+
# @return [String] Role resolution for workflow for release code 6
|
50
|
+
attr_accessor :rel_wf6
|
51
|
+
# @return [String] Role resolution for workflow for release code 7
|
52
|
+
attr_accessor :rel_wf7
|
53
|
+
# @return [String] Role resolution for workflow for release code 8
|
54
|
+
attr_accessor :rel_wf8
|
55
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# class used to represent RELEASE_PREREQUISITES. Used internally
|
2
|
+
class PreqReleasePrerequisites
|
3
|
+
# @return [String] Item number of purchase requisition
|
4
|
+
attr_accessor :preq_item
|
5
|
+
# @return [String] Purchase Requisition Number
|
6
|
+
attr_accessor :preq_no
|
7
|
+
# @return [String] Description of release code 1
|
8
|
+
attr_accessor :rel_cd_tx1
|
9
|
+
# @return [String] Description of release code 2
|
10
|
+
attr_accessor :rel_cd_tx2
|
11
|
+
# @return [String] Description of release code 3
|
12
|
+
attr_accessor :rel_cd_tx3
|
13
|
+
# @return [String] Description of release code 4
|
14
|
+
attr_accessor :rel_cd_tx4
|
15
|
+
# @return [String] Description of release code 5
|
16
|
+
attr_accessor :rel_cd_tx5
|
17
|
+
# @return [String] Description of release code 6
|
18
|
+
attr_accessor :rel_cd_tx6
|
19
|
+
# @return [String] Description of release code 7
|
20
|
+
attr_accessor :rel_cd_tx7
|
21
|
+
# @return [String] Description of release code
|
22
|
+
attr_accessor :rel_cd_tx8
|
23
|
+
# @return [String] Release code 1
|
24
|
+
attr_accessor :rel_code1
|
25
|
+
# @return [String] Release code 2
|
26
|
+
attr_accessor :rel_code2
|
27
|
+
# @return [String] Release code 3
|
28
|
+
attr_accessor :rel_code3
|
29
|
+
# @return [String] Release code 4
|
30
|
+
attr_accessor :rel_code4
|
31
|
+
# @return [String] Release code 5
|
32
|
+
attr_accessor :rel_code5
|
33
|
+
# @return [String] Release code 6
|
34
|
+
attr_accessor :rel_code6
|
35
|
+
# @return [String] Release code 7
|
36
|
+
attr_accessor :rel_code7
|
37
|
+
# @return [String] Release code 8
|
38
|
+
attr_accessor :rel_code8
|
39
|
+
# @return [String] Role resolution for workflow for release code 1
|
40
|
+
attr_accessor :rel_wf1
|
41
|
+
# @return [String] Role resolution for workflow for release code 2
|
42
|
+
attr_accessor :rel_wf2
|
43
|
+
# @return [String] Role resolution for workflow for release code 3
|
44
|
+
attr_accessor :rel_wf3
|
45
|
+
# @return [String] Role resolution for workflow for release code 4
|
46
|
+
attr_accessor :rel_wf4
|
47
|
+
# @return [String] Role resolution for workflow for release code 5
|
48
|
+
attr_accessor :rel_wf5
|
49
|
+
# @return [String] Role resolution for workflow for release code 6
|
50
|
+
attr_accessor :rel_wf6
|
51
|
+
# @return [String] Role resolution for workflow for release code 7
|
52
|
+
attr_accessor :rel_wf7
|
53
|
+
# @return [String] Role resolution for workflow for release code 8
|
54
|
+
attr_accessor :rel_wf8
|
55
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# class used to represent a Table Column. Used internally
|
2
|
+
# to map SAP's returned working area (WA) into class instances
|
3
|
+
class TableColumn
|
4
|
+
# @return [String] Name of the table field
|
5
|
+
attr_accessor :field_name
|
6
|
+
# @return [Integer] Number of characters to offset when looking for the field in the Working Area (WA)
|
7
|
+
attr_accessor :offset
|
8
|
+
# @return [Integer] Length of the field returned in the Working Area (WA)
|
9
|
+
attr_accessor :length
|
10
|
+
# @return [String] Data Type (ex: Character, Decimal, Number)
|
11
|
+
attr_accessor :type
|
12
|
+
# @return [String] Field Description returned by the SAP dictionary
|
13
|
+
attr_accessor :description
|
14
|
+
end
|
data/lib/return.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# class used to represent RETURN. Used internally
|
2
|
+
class Return
|
3
|
+
# @return [String] Message code
|
4
|
+
attr_accessor :code
|
5
|
+
# @return [String] Application log: Internal message serial number
|
6
|
+
attr_accessor :log_msg_no
|
7
|
+
# @return [String] Application log: log number
|
8
|
+
attr_accessor :log_no
|
9
|
+
# @return [String] Message Text
|
10
|
+
attr_accessor :message
|
11
|
+
# @return [String] Message Variable
|
12
|
+
attr_accessor :message_v1
|
13
|
+
# @return [String] Message Variable
|
14
|
+
attr_accessor :message_v2
|
15
|
+
# @return [String] Message Variable
|
16
|
+
attr_accessor :message_v3
|
17
|
+
# @return [String] Message Variable
|
18
|
+
attr_accessor :message_v4
|
19
|
+
# @return [String] Message type: S Success, E Error, W Warning, I Info, A Abort
|
20
|
+
attr_accessor :type
|
21
|
+
end
|
data/lib/rnsap.rb
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'nwrfc'
|
4
|
+
require 'read_table/table_column'
|
5
|
+
require 'preq_detail/preq_item'
|
6
|
+
require 'preq_detail/preq_acct_assignment'
|
7
|
+
require 'preq_detail/preq_text'
|
8
|
+
require 'preq_detail/preq_limits'
|
9
|
+
require 'preq_detail/preq_contract_limits'
|
10
|
+
require 'preq_detail/preq_services'
|
11
|
+
require 'preq_detail/preq_services_texts'
|
12
|
+
require 'preq_detail/preq_srv_accass_values'
|
13
|
+
require 'preq_release_info/preq_gen_release_info'
|
14
|
+
require 'preq_release_info/preq_release_prerequisites'
|
15
|
+
require 'preq_release_info/preq_release_posted'
|
16
|
+
require 'preq_release_info/preq_release_final'
|
17
|
+
require 'return'
|
18
|
+
require 'helper/rfc_helper'
|
4
19
|
|
5
20
|
include NWRFC
|
6
21
|
|
@@ -18,6 +33,9 @@ module RnSap
|
|
18
33
|
# keeps the SAP connection alive during the Sap instance lifecycle
|
19
34
|
attr_reader :conn
|
20
35
|
|
36
|
+
INT_TYPES ||= ['b','N']
|
37
|
+
FLOAT_TYPES ||= ['P']
|
38
|
+
DATE_TYPES ||=['D']
|
21
39
|
# Constructor requires to receive connection parameters,
|
22
40
|
# a hash containint necessary information to logon to SAP
|
23
41
|
# @param conn_parms [Hash] SAP Connection Parameters
|
@@ -30,6 +48,32 @@ module RnSap
|
|
30
48
|
conn.disconnect
|
31
49
|
end
|
32
50
|
|
51
|
+
def commit(conn)
|
52
|
+
|
53
|
+
#-- Execute BAPI_TRANSACTION_COMMIT
|
54
|
+
fn_commit = conn.get_function('BAPI_TRANSACTION_COMMIT')
|
55
|
+
fn_commit = fn_commit.get_function_call
|
56
|
+
fn_commit[:WAIT] = 'X'
|
57
|
+
|
58
|
+
fn_commit.invoke
|
59
|
+
|
60
|
+
{
|
61
|
+
tb_return: fn_commit[:RETURN],
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
def rollback(conn)
|
66
|
+
#-- Execute BAPI_TRANSACTION_ROLLBACK
|
67
|
+
fn_rollback = conn.get_function('BAPI_TRANSACTION_ROLLBACK')
|
68
|
+
fn_rollback = fn_rollback.get_function_call
|
69
|
+
|
70
|
+
fn_rollback.invoke
|
71
|
+
|
72
|
+
{
|
73
|
+
tb_return: fn_rollback[:RETURN],
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
33
77
|
# Invokes SAP RFC_READ_TABLE function module remotely, passing
|
34
78
|
# the table to be read and receiving back a list of objects of that
|
35
79
|
# table.
|
@@ -107,13 +151,38 @@ module RnSap
|
|
107
151
|
end
|
108
152
|
|
109
153
|
list = []
|
154
|
+
|
110
155
|
fc_read_table[:DATA].each do |row|
|
111
156
|
obj = base_obj.class.new
|
112
|
-
wa = row[:WA]
|
157
|
+
wa = row[:WA].split('|')
|
158
|
+
pos = -1
|
113
159
|
fields_down.each do |field|
|
160
|
+
pos = pos + 1
|
114
161
|
column = columns_hash[field.upcase]
|
115
|
-
value = wa[column.offset.to_i, column.length.to_i]
|
116
|
-
|
162
|
+
# value = wa[column.offset.to_i, column.length.to_i]
|
163
|
+
if INT_TYPES.include?(column.type)
|
164
|
+
value = wa[pos].to_i
|
165
|
+
eval("obj.#{field} = #{value}")
|
166
|
+
elsif FLOAT_TYPES.include?(column.type)
|
167
|
+
value = wa[pos].to_f
|
168
|
+
eval("obj.#{field} = #{value}")
|
169
|
+
elsif DATE_TYPES.include?(column.type)
|
170
|
+
value = wa[pos].strip
|
171
|
+
if value == '00000000'
|
172
|
+
eval("obj.#{field} = nil")
|
173
|
+
else
|
174
|
+
value = Date.new(
|
175
|
+
value[0..3],
|
176
|
+
value[4..5],
|
177
|
+
value[6..7]
|
178
|
+
)
|
179
|
+
eval("obj.#{field} = #{value}")
|
180
|
+
end
|
181
|
+
else
|
182
|
+
value = wa[pos].strip
|
183
|
+
eval("obj.#{field} = '#{value}'")
|
184
|
+
end
|
185
|
+
|
117
186
|
end
|
118
187
|
list << obj
|
119
188
|
end
|
@@ -121,6 +190,136 @@ module RnSap
|
|
121
190
|
list
|
122
191
|
end
|
123
192
|
|
193
|
+
def preq_detail(preq = 0, acc_assignment = 'X', item_text = 'X', services = 'X', services_texts = 'X')
|
194
|
+
#-- Execute BAPI_REQUISITION_GETDETAIL
|
195
|
+
fn_preq_detail = @conn.get_function('BAPI_REQUISITION_GETDETAIL')
|
196
|
+
fc_preq_detail = fn_preq_detail.get_function_call
|
197
|
+
|
198
|
+
fc_preq_detail[:NUMBER] = preq
|
199
|
+
fc_preq_detail[:ACCOUNT_ASSIGNMENT] = acc_assignment
|
200
|
+
fc_preq_detail[:ITEM_TEXTS] = item_text
|
201
|
+
fc_preq_detail[:SERVICES] = services
|
202
|
+
fc_preq_detail[:SERVICE_TEXTS] = services_texts
|
203
|
+
|
204
|
+
fc_preq_detail.invoke
|
205
|
+
|
206
|
+
#-- Execute conversions for returned tables to a designated list (array)
|
207
|
+
preq_items = get_object_list(fc_preq_detail[:REQUISITION_ITEMS], PreqItem.to_s)
|
208
|
+
preq_acct_assignment = get_object_list(fc_preq_detail[:REQUISITION_ACCOUNT_ASSIGNMENT], PreqAcctAssignment.to_s)
|
209
|
+
preq_text = get_object_list(fc_preq_detail[:REQUISITION_TEXT], PreqText.to_s)
|
210
|
+
preq_limits = get_object_list(fc_preq_detail[:REQUISITION_LIMITS], PreqLimits.to_s)
|
211
|
+
preq_contract_limits = get_object_list(fc_preq_detail[:REQUISITION_CONTRACT_LIMITS], PreqContractLimits.to_s)
|
212
|
+
preq_services = get_object_list(fc_preq_detail[:REQUISITION_SERVICES], PreqItem.to_s)
|
213
|
+
preq_services_texts = get_object_list(fc_preq_detail[:REQUISITION_SERVICES_TEXTS], PreqServicesText.to_s)
|
214
|
+
preq_srv_accass_values = get_object_list(fc_preq_detail[:REQUISITION_SRV_ACCASS_VALUES], PreqServicesAccassValues.to_s)
|
215
|
+
tb_return = get_object_list(fc_preq_detail[:RETURN], Return.to_s)
|
216
|
+
|
217
|
+
{
|
218
|
+
preq_items: preq_items,
|
219
|
+
preq_acct_assignment: preq_acct_assignment,
|
220
|
+
preq_text: preq_text,
|
221
|
+
preq_limits: preq_limits,
|
222
|
+
preq_contract_limits: preq_contract_limits,
|
223
|
+
preq_services: preq_services,
|
224
|
+
preq_services_texts: preq_services_texts,
|
225
|
+
preq_srv_accass_values: preq_srv_accass_values,
|
226
|
+
tb_return: tb_return,
|
227
|
+
}
|
228
|
+
end
|
229
|
+
|
230
|
+
def preq_release_strategy_info(preq = 0, item = "00000", rel_code = "")
|
231
|
+
#-- Execute BAPI_REQUISITION_GETRELINFO
|
232
|
+
fn_preq_rel_strat_info = @conn.get_function('BAPI_REQUISITION_GETRELINFO')
|
233
|
+
fn_preq_rel_strat_info = fn_preq_rel_strat_info.get_function_call
|
234
|
+
|
235
|
+
fn_preq_rel_strat_info[:NUMBER] = preq
|
236
|
+
fn_preq_rel_strat_info[:ITEM] = item
|
237
|
+
fn_preq_rel_strat_info[:REL_CODE] = rel_code
|
238
|
+
|
239
|
+
fn_preq_rel_strat_info.invoke
|
240
|
+
|
241
|
+
#-- Execute conversions for returned tables to a designated list (array)
|
242
|
+
preq_gen_release_info = get_object_list(fn_preq_rel_strat_info[:GENERAL_RELEASE_INFO], PreqGenReleaseInfo.to_s)
|
243
|
+
preq_release_prerequisites = get_object_list(fn_preq_rel_strat_info[:RELEASE_PREREQUISITES], PreqReleasePrerequisites.to_s)
|
244
|
+
preq_release_posted = get_object_list(fn_preq_rel_strat_info[:RELEASE_ALREADY_POSTED], PreqReleasePosted.to_s)
|
245
|
+
preq_release_final = get_object_list(fn_preq_rel_strat_info[:RELEASE_FINAL], PreqReleaseFinal.to_s)
|
246
|
+
tb_return = get_object_list(fn_preq_rel_strat_info[:RETURN], Return.to_s)
|
247
|
+
|
248
|
+
{
|
249
|
+
preq_gen_release_info: preq_gen_release_info,
|
250
|
+
preq_release_prerequisites: preq_release_prerequisites,
|
251
|
+
preq_release_posted: preq_release_posted,
|
252
|
+
preq_release_final: preq_release_final,
|
253
|
+
tb_return: tb_return,
|
254
|
+
}
|
255
|
+
|
256
|
+
end
|
257
|
+
|
258
|
+
def preq_release(preq = 0, rel_code = "", no_commit="", item="00000", use_exceptions="")
|
259
|
+
#Validate if will release by item ou general
|
260
|
+
if item == "00000" or item == nil or item.empty?
|
261
|
+
#-- Execute BAPI_REQUISITION_RELEASE_GEN
|
262
|
+
fn_preq_exec_release = @conn.get_function('BAPI_REQUISITION_RELEASE_GEN')
|
263
|
+
fn_preq_exec_release = fn_preq_exec_release.get_function_call
|
264
|
+
else
|
265
|
+
#-- Execute BAPI_REQUISITION_RELEASE
|
266
|
+
fn_preq_exec_release = @conn.get_function('BAPI_REQUISITION_RELEASE')
|
267
|
+
fn_preq_exec_release = fn_preq_exec_release.get_function_call
|
268
|
+
fn_preq_exec_release[:ITEM] = item
|
269
|
+
fn_preq_exec_release[:USE_EXCEPTIONS] = use_exceptions
|
270
|
+
end
|
271
|
+
|
272
|
+
fn_preq_exec_release[:NUMBER] = preq
|
273
|
+
fn_preq_exec_release[:REL_CODE] = rel_code
|
274
|
+
fn_preq_exec_release[:NO_COMMIT_WORK] = no_commit
|
275
|
+
|
276
|
+
fn_preq_exec_release.invoke
|
277
|
+
|
278
|
+
tb_return = get_object_list(fn_preq_exec_release[:RETURN], Return.to_s)
|
279
|
+
{
|
280
|
+
status_new: fn_preq_exec_release[:REL_STATUS_NEW],
|
281
|
+
indicator_new: fn_preq_exec_release[:REL_INDICATOR_NEW],
|
282
|
+
tb_return: tb_return,
|
283
|
+
}
|
284
|
+
end
|
285
|
+
|
286
|
+
def po_detail(po = 0)
|
287
|
+
[]
|
288
|
+
end
|
289
|
+
|
290
|
+
def po_release_strategy_info(po = 1)
|
291
|
+
[]
|
292
|
+
end
|
293
|
+
|
294
|
+
def authority_check(user, auth_object, field, value)
|
295
|
+
#-- Execute AUTHORITY_CHECK
|
296
|
+
function = @conn.get_function('AUTHORITY_CHECK')
|
297
|
+
fun_call = function.get_function_call
|
298
|
+
|
299
|
+
fun_call[:USER] = user
|
300
|
+
fun_call[:OBJECT] = auth_object
|
301
|
+
fun_call[:FIELD1] = field
|
302
|
+
fun_call[:VALUE1] = value
|
303
|
+
|
304
|
+
begin
|
305
|
+
fun_call.invoke
|
306
|
+
rescue Exception => ex
|
307
|
+
if ex.to_s.include?('USER_IS_AUTHORIZED')
|
308
|
+
{
|
309
|
+
rc: 0,
|
310
|
+
message: 'Authorized.'
|
311
|
+
}
|
312
|
+
else
|
313
|
+
{
|
314
|
+
rc: 10,
|
315
|
+
message: 'User is not authorized.',
|
316
|
+
exception: ex
|
317
|
+
}
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
322
|
+
|
124
323
|
private
|
125
324
|
|
126
325
|
attr_writer :conn
|
@@ -148,9 +347,4 @@ module RnSap
|
|
148
347
|
end
|
149
348
|
end
|
150
349
|
|
151
|
-
# class used to represent a Table Column. Used internally
|
152
|
-
# to map SAP's returned working area (WA) into class instances
|
153
|
-
class TableColumn
|
154
|
-
attr_accessor :field_name, :offset, :length, :type, :description
|
155
|
-
end
|
156
350
|
end
|