rnsap 0.1.8 → 0.2.0
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/rnsap.rb +16 -10
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab248c85bb93de20f3192e57601fa6de355fc1ec20f7dac9011f5aa4b0999d05
|
4
|
+
data.tar.gz: ec124a2b318e25b16287f0770822567f040325aca99ccd4a1ba07c93413429f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c8928f4101c0a25dd69871f2d9880107d7739a2f22ccf4f3ff1b25726602c738419079098c93fa5f2ef54df74c4ab6fbd67612fa8908fc66b7ce0746e154dc6
|
7
|
+
data.tar.gz: 0c0a2f737370e382c2b9d6e883f697a29f85d14eeee3fdc059d111ae933d304f8fdb6b0bf11699f8d6873c610c0a54a8216da1fcdc5d7b8c1b7971a13f1402de
|
data/lib/rnsap.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'nwrfc'
|
4
|
-
require 'json'
|
5
|
-
require 'yaml'
|
6
4
|
|
7
5
|
include NWRFC
|
8
6
|
|
@@ -10,13 +8,19 @@ module RnSap
|
|
10
8
|
class Sap
|
11
9
|
attr_reader :conn
|
12
10
|
|
11
|
+
# Constructor requires to receive connection parameters,
|
12
|
+
# a hash containint necessary information to logon to SAP
|
13
13
|
def initialize(_conn_parms)
|
14
|
-
puts 'initialized'
|
15
14
|
@conn = Connection.new(_conn_parms)
|
16
|
-
dump_instance_variables(:conn)
|
17
15
|
end
|
18
16
|
|
19
|
-
|
17
|
+
# Closes SAP connection
|
18
|
+
def close
|
19
|
+
conn.disconnect
|
20
|
+
end
|
21
|
+
|
22
|
+
# Calls Function Module RFC_READ_TABLE
|
23
|
+
def read_table(name, fields, clauses)
|
20
24
|
klass_name = name.capitalize
|
21
25
|
fields_up = []
|
22
26
|
fields_down = []
|
@@ -24,6 +28,7 @@ module RnSap
|
|
24
28
|
fields_up << field.upcase
|
25
29
|
fields_down << field.downcase
|
26
30
|
end
|
31
|
+
|
27
32
|
base_obj = get_class_instance(klass_name, fields_down)
|
28
33
|
|
29
34
|
#-- Read Table
|
@@ -32,11 +37,17 @@ module RnSap
|
|
32
37
|
fc_read_table = fn_read_table.get_function_call
|
33
38
|
|
34
39
|
fc_read_table[:QUERY_TABLE] = name.upcase
|
40
|
+
fc_read_table[:DELIMITER] = '|'
|
35
41
|
fields_up.each do |field|
|
36
42
|
row = fc_read_table[:FIELDS].new_row
|
37
43
|
row[:FIELDNAME] = field
|
38
44
|
end
|
39
45
|
|
46
|
+
clauses.each do |clause|
|
47
|
+
row = fc_read_table[:OPTIONS].new_row
|
48
|
+
row[:TEXT] = clause
|
49
|
+
end
|
50
|
+
|
40
51
|
fc_read_table.invoke
|
41
52
|
|
42
53
|
columns_hash = {}
|
@@ -65,11 +76,6 @@ module RnSap
|
|
65
76
|
list
|
66
77
|
end
|
67
78
|
|
68
|
-
# Close connection
|
69
|
-
def close
|
70
|
-
conn.disconnect
|
71
|
-
end
|
72
|
-
|
73
79
|
private
|
74
80
|
|
75
81
|
attr_writer :conn
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rnsap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rogerio Nascimento
|
@@ -24,7 +24,8 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.9
|
27
|
-
description:
|
27
|
+
description: By encapsulating SAPs NW RFC library calls, Ruby routines can access
|
28
|
+
SAP power in a simpler manner
|
28
29
|
email:
|
29
30
|
executables: []
|
30
31
|
extensions: []
|