• Perdeu a senha?
  • Cadastre-se
  • Notificações
Skip to content

Orabr

Base e troca de conhecimentos, divulgação de oportunidades e projetos
  • Início
  • Doação
  • LOGIN
  • ORABR
    • SOBRE ORABR
      • ORABR-MAIS-CMS
  • ARQUIVOS
  • BUSCAR NO SITE
  • POSTAR
    • ORACLE DÚVIDAS E RESPOSTAS
    • OPORTUNIDADE
    • EDITAR SEUS POSTS
Orabr
Base e troca de conhecimentos, divulgação de oportunidades e projetos
  • Início
  • Doação
  • LOGIN
  • ORABR
    • SOBRE ORABR
      • ORABR-MAIS-CMS
  • ARQUIVOS
  • BUSCAR NO SITE
  • POSTAR
    • ORACLE DÚVIDAS E RESPOSTAS
    • OPORTUNIDADE
    • EDITAR SEUS POSTS
 
 

Oracle EBS/APP – CRIAR PO VIA OPEN INTERFACE

Oracle PL/SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
 
 
 
/*Purchase Order Interface
Purchase Order Interface -- PO_HEADERS_INTERFACE
Interface Tables Used
 
1)PO_HEADERS_INTERFACE
2)PO_LINES_INTERFACE
3)PO_DISTRIBUTIONS_INTERFACE
*/
INSERT INTO po_headers_interface
  (interface_header_id
  ,batch_id
  ,action
  ,org_id
  ,document_type_code
  ,vendor_id
  ,vendor_site_code
  ,vendor_site_id
  ,vendor_doc_num
  ,currency_code
  ,agent_id
  ,terms_id
  ,approval_status
  ,ship_to_location_id
  ,effective_date
  ,creation_date
  ,created_by
  ,last_update_date
  ,last_updated_by
  ,attribute_category
  ,attribute9 --xtra information
  ,comments)
VALUES
  (po_headers_interface_s.nextval
  ,po_headers_interface_s.currval
  ,'ORIGINAL'
  ,g_org_id
  ,'STANDARD'
  ,rec_get_header_info.vendor_id
  ,rec_get_header_info.vendor_site_code
  ,rec_get_header_info.vendor_site_id
  ,po_headers_interface_s.currval
  ,'USD'
  ,l_agent_id
  ,rec_get_header_info.terms_id
  ,'APPROVED'
  ,rec_get_header_info.deliver_to_location_id
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID')
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID')
  ,'DS Fields'
  ,rec_get_header_info.attribute9 --xtra information
  ,l_comments) INSERT INTO po_lines_interface
  (interface_header_id
  ,interface_line_id
  ,requisition_line_id
  ,line_num
  ,shipment_num
  ,line_type_id
  ,item
  ,item_description
  ,category_id
  ,unit_of_measure
  ,quantity
  ,unit_price
  ,ship_to_organization_id
  ,line_location_id
  ,effective_date
  ,need_by_date
  ,creation_date
  ,created_by
  ,last_update_date
  ,last_updated_by
  ,taxable_flag)
VALUES
  (po.po_headers_interface_s.currval
  ,po.po_lines_interface_s.nextval
  ,rec_get_line_info.requisition_line_id
  ,l_line_num
  ,1
  ,rec_get_line_info.line_type_id
  ,rec_get_line_info.segment1
  ,rec_get_line_info.item_description
  ,rec_get_line_info.category_id
  ,rec_get_line_info.primary_unit_of_measure
  ,rec_get_line_info.quantity
  ,rec_get_line_info.unit_price
  ,rec_get_line_info.destination_organization_id
  ,po_line_locations_s.nextval
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,to_date(rec_get_line_info.need_by_date, 'DD-MON-RRRR')
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID')
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID')
  ,'Y');
INSERT INTO po.po_distributions_interface
  (interface_header_id
  ,interface_line_id
  ,interface_distribution_id
  ,req_distribution_id
  ,org_id
  ,distribution_num
  ,quantity_ordered
  ,destination_organization_id
  ,destination_type_code
  ,destination_subinventory
  ,deliver_to_location_id
  ,set_of_books_id
  ,charge_account_id
  ,budget_account_id
  ,accrual_account_id
  ,variance_account_id
  ,deliver_to_person_id
  ,creation_date
  ,created_by
  ,last_update_date
  ,last_updated_by)
VALUES
  (po.po_headers_interface_s.currval
  ,po.po_lines_interface_s.currval
  ,po.po_distributions_interface_s.nextval
  ,rec_get_distrib_info.distribution_id
  ,g_org_id
  ,rec_get_distrib_info.distribution_num
  ,rec_get_distrib_info.req_line_quantity
  ,rec_get_distrib_info.destination_organization_id
  ,rec_get_distrib_info.destination_type_code
  ,l_destination_subinventory
  ,rec_get_line_info.deliver_to_location_id
  ,rec_get_distrib_info.set_of_books_id
  ,rec_get_distrib_info.code_combination_id
  ,rec_get_distrib_info.budget_account_id
  ,l_new_accrual_account_id
  ,rec_get_distrib_info.variance_account_id
  ,rec_get_line_info.to_person_id
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID')
  ,to_date(SYSDATE, 'DD-MON-RRRR')
  ,fnd_profile.value('USER_ID'));
--
--
--Após ter populado AS interface rodar o concurrent abaixo concurrent program :
--
--
         apps.fnd_request.submit_request(application => 'PO' --Application,
                                        program =>
                                        'POXPOPDOI' --Program,
                                        argument1 => '' --Buyer ID,
                                        argument2 =>
                                        'STANDARD' --Document Type,
                                        argument3 => '' --Document Subtype,
                                        argument4 => 'N' --Process Items Flag,
                                        argument5 => 'N' --Create Sourcing rule,
                                        argument6 => '' --Approval Status,
                                        argument7 => '' --Release Generation Method,
                                        argument8 => '' --NULL,
                                        argument9 =>
                                        g_org_id --Operating Unit ID,
                                        argument10 => '' --Global Agreement
                         );
--CALLING po approval workflow TO approve pos
  SELECT to_char(po_wf_itemkey_s.nextval)
    INTO v_wf_seq
    FROM sys.dual;
v_itemkey := to_char(l_header.po_header_id) || '-' || v_wf_seq;
po_reqapproval_init1.start_wf_process(itemtype              => 'POAPPRV',
                                      itemkey               => v_itemkey,
                                      workflowprocess       => 'POAPPRV_TOP',
                                      actionoriginatedfrom  => 'PO_FORM',
                                      documentid            => l_header.po_header_id,
                                      documentnumber        => l_header.segment1,
                                      preparerid            => l_header.agent_id,
                                      documenttypecode      => 'PO',
                                      documentsubtype       => 'STANDARD',
                                      submitteraction       => 'APPROVE',
                                      forwardtoid           => NULL,
                                      forwardfromid         => l_header.agent_id,
                                      defaultapprovalpathid => 10,
                                      note                  => NULL,
                                      printflag             => 'N',
                                      faxflag               => NULL,
                                      faxnumber             => NULL);
 

Relacionado

Você precisa fazer log in para comentar.

Navegação de Post

Previous Previous post: Oracle EBS/APPS – CRIAR NOTA NO AP VIA OPEN INTERFACE
Next Next post: Oracle Integration Cloud Consultant – São Paulo – Brasil
 
Orabr | Orabr | Orabr | © Copyright All right reserved