Documentación Costos de Importación PDF
Documentación Costos de Importación PDF
Documentación Costos de Importación PDF
PRECONDICIONES
1 En el formulario de gestión de proyectos existe un campo para aplicar los costos de importación
cuando se tiene la información de los costos.
PROCESO
2 Al aplicar costos de importación el sistema valida que los conceptos obligatorios estén diligenciados
mediante las siguientes sentencias SQL en el Transaction Notification de SAP Business One.
3 Una vez se cumplen las condiciones satisfactoriamente, el sistema crea un evento en el visor de
eventos de Windows con el fin de iniciar una tarea para ejecutar a través de Data transfer workbench
la creación de los costos de importación a aplicar.
Para Prosigna:
Para Signa:
4 Para calcular los datos a ingresar en los costos de importación se utilizan las siguientes 3 vistas.
VOIPF
SELECT T1.DocEntry AS ParentKey, T1.LineNum AS LineNumber, 'asPurchaseInvoice' AS
BaseDocumentType, T1.DocEntry AS BaseEntry, T1.LineNum AS BaseLine, T1.ItemCode AS
Number, REPLACE(T1.Quantity, ',', '.')
AS Quantity, REPLACE(T1.Quantity /
(SELECT SUM(T1.Quantity) AS Expr1
FROM dbo.PCH1 AS T1 INNER JOIN
dbo.OPCH AS T10 ON T10.DocEntry = T1.DocEntry INNER
JOIN
dbo.OITM AS T2 ON T2.ItemCode = T1.ItemCode AND
T2.InvntItem = 'Y'
WHERE (T10.CANCELED = 'N') AND (T1.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
FROM dbo.RPC1
WHERE (BaseCard = T1.BaseCard))) AND
(T1.DocEntry NOT IN
(SELECT BaseEntry
FROM dbo.IPF1)) AND (ISNULL(T1.Project,
T10.Project) IN
(SELECT FIPROJECT
FROM dbo.OPMG
WHERE (U_SG_CostI = 'Y')))) * ISNULL
((SELECT SUM(ISNULL(P2.LineTotal, P1.LineTotal)) AS Expr1
FROM dbo.POR1 AS P1 INNER JOIN
dbo.OPOR AS P0 ON P0.DocEntry = P1.DocEntry LEFT
OUTER JOIN
dbo.PCH1 AS P2 ON P2.BaseEntry = P1.DocEntry AND
P2.BaseLine = P1.LineNum AND P2.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
Consultores SAP BO Página 3 of 10 Documentación Costos de
importación.docx
Desarrollo – Costeo de
Documentación del Requerimiento
importaciones
Proyecto: Signa Grain S.A. Fecha: 09/07/2017
Presentado por: Eder Esteban Ceballos - César Augusto López Astaiza
FROM dbo.RPC1
WHERE (BaseType = 18))
WHERE (P1.ItemCode LIKE '4%') AND (P1.Project = ISNULL(T1.Project,
T10.Project)) AND (P0.CANCELED = 'N')), 0), ',', '.') AS AllocatedCostsLineTotal
FROM dbo.PCH1 AS T1 INNER JOIN
dbo.OPCH AS T10 ON T10.DocEntry = T1.DocEntry INNER JOIN
dbo.OITM AS T2 ON T2.ItemCode = T1.ItemCode AND T2.InvntItem = 'Y'
WHERE (T10.CANCELED = 'N') AND (T1.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
FROM dbo.RPC1 AS RPC1_1
WHERE (BaseCard = T1.BaseCard))) AND (T1.DocEntry NOT IN
(SELECT BaseEntry
FROM dbo.IPF1 AS IPF1_1)) AND (ISNULL(T1.Project, T10.Project)
IN
(SELECT FIPROJECT
FROM dbo.OPMG AS OPMG_1
WHERE (U_SG_CostI = 'Y')))
VOIPFD
SELECT DISTINCT T1.DocEntry AS ParentKey, T3.AlcCode AS LandedCostCode,
REPLACE(ISNULL
((SELECT SUM(ISNULL(P2.LineTotal, P1.LineTotal)) AS Expr1
FROM dbo.POR1 AS P1 INNER JOIN
dbo.OPOR AS P0 ON P0.DocEntry = P1.DocEntry LEFT
OUTER JOIN
dbo.PCH1 AS P2 ON P2.BaseEntry = P1.DocEntry AND
P2.BaseLine = P1.LineNum AND P2.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
FROM dbo.RPC1
WHERE (BaseType = 18))
WHERE (P1.ItemCode = T3.U_COSTO_IMPORT) AND (P1.Project =
ISNULL(T1.Project, T10.Project)) AND (P0.CANCELED = 'N')), 0), ',', '.') AS Amount, 'tNO' AS
IncludeForCustoms
FROM dbo.PCH1 AS T1 INNER JOIN
dbo.OPCH AS T10 ON T10.DocEntry = T1.DocEntry INNER JOIN
dbo.OITM AS T2 ON T2.ItemCode = T1.ItemCode AND T2.InvntItem = 'Y' CROSS
JOIN
dbo.OALC AS T3
WHERE (T10.CANCELED = 'N') AND (T1.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
FROM dbo.RPC1
WHERE (BaseCard = T1.BaseCard))) AND (T1.DocEntry NOT IN
(SELECT BaseEntry
FROM dbo.IPF1)) AND (ISNULL(T1.Project, T10.Project) IN
(SELECT FIPROJECT
FROM dbo.OPMG
WHERE (U_SG_CostI = 'Y')))
VOIPFM
SELECT DISTINCT T1.DocEntry AS LandedCostNumber, T1.BaseCard AS VendorCode, 'COP'
AS DocumentCurrency
FROM dbo.PCH1 AS T1 INNER JOIN
dbo.OPCH AS T10 ON T10.DocEntry = T1.DocEntry INNER JOIN
dbo.OITM AS T2 ON T2.ItemCode = T1.ItemCode AND T2.InvntItem = 'Y'
WHERE (T10.CANCELED = 'N') AND (T1.DocEntry NOT IN
(SELECT DISTINCT BaseEntry
FROM dbo.RPC1
WHERE (BaseCard = T1.BaseCard))) AND (T1.DocEntry NOT IN
(SELECT BaseEntry
FROM dbo.IPF1)) AND (ISNULL(T1.Project, T10.Project) IN
(SELECT FIPROJECT
FROM dbo.OPMG
WHERE (U_SG_CostI = 'Y')))
5 Para ingresar los costos de importación se utilizan los siguientes archivos que contienen la
información que usa data transfer workbench para cargar los datos en SAP Business One.
Para Prosigna:
CI1.XML
<Transfer>
<Logon>
<UserName>manager</UserName>
<Password>CKrECJcIhMjKlL</Password>
<Company>PROSIGNA</Company>
<Server>SAPBO-SERVER\SIGNA</Server>
<UserAuthentication>False</UserAuthentication>
<Language />
<LicenseServer>
</LicenseServer>
<ChooseDB>True</ChooseDB>
<DBType>7</DBType>
<DBUser>sa</DBUser>
<SybasePort />
<DBPassword>RLrLfLqKpJ9KpNhJaJvLdLfDpC</DBPassword>
</Logon>
<ObjectCode>LandedCostsService</ObjectCode>
<FileExtractor>
<Extorlogin>
<ExID>sa</ExID>
<ExPW>LNpJdJsMqK8LpNiK8LoMeIeCoD</ExPW>
<ExDSN>EDIPROSIGNA</ExDSN>
</Extorlogin>
<FilesTypes>3</FilesTypes>
<Files>
<LandedCost>SELECT [LandedCostNumber],[VendorCode],[DocumentCurrency] FROM
[VOIPFM]</LandedCost>
<LandedCost_ItemLines>SELECT
[ParentKey],[LineNumber],[BaseDocumentType],[BaseEntry],[Number],[Quantity],[AllocatedCost
sLineTotal],[BaseLine] FROM [VOIPF]</LandedCost_ItemLines>
<LandedCost_CostLines>SELECT
[ParentKey],[LandedCostCode],[Amount],[IncludeForCustoms] FROM
[VOIPFD]</LandedCost_CostLines>
</Files>
</FileExtractor>
<Map>
<Fields>
<LandedCost>
<SourceFields>
<RecordKey />
<LandedCostNumber />
<VendorCode />
<DocumentCurrency />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LandedCostNumber>LandedCostNumber</LandedCostNumber>
<VendorCode>VendorCode</VendorCode>
<DocumentCurrency>DocumentCurrency</DocumentCurrency>
</TargetFields>
</LandedCost>
<LandedCost_ItemLines>
<SourceFields>
<RecordKey />
<ParentKey />
<LineNumber />
<BaseDocumentType />
<BaseEntry />
<Number />
<Quantity />
<AllocatedCostsLineTotal />
<BaseLine />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LineNumber>LineNumber</LineNumber>
<BaseDocumentType>BaseDocumentType</BaseDocumentType>
<BaseEntry>BaseEntry</BaseEntry>
<Number>Number</Number>
<Quantity>Quantity</Quantity>
<AllocatedCostsLineTotal>AllocatedCostsLineTotal</AllocatedCostsLineTotal>
<BaseLine>BaseLine</BaseLine>
</TargetFields>
</LandedCost_ItemLines>
<LandedCost_CostLines>
<SourceFields>
<RecordKey />
<ParentKey />
<LandedCostCode />
<Amount />
<IncludeForCustoms />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LandedCostCode>LandedCostCode</LandedCostCode>
<Amount>Amount</Amount>
<IncludeForCustoms>IncludeForCustoms</IncludeForCustoms>
</TargetFields>
</LandedCost_CostLines>
</Fields>
</Map>
<Run>
<Import>1</Import>
<Rollback>True</Rollback>
<MaxError>10</MaxError>
<Update>0</Update>
<TestRun>0</TestRun>
<AddAllItems>Checked</AddAllItems>
<LineData>0</LineData>
<DataType>2</DataType>
<MultiThread>False</MultiThread>
<ThreadNum>4</ThreadNum>
</Run>
</Transfer>
Para Signa:
CI2.XML
<Transfer>
<Logon>
<UserName>manager</UserName>
<Password>CKpCHMdJmLgJiM</Password>
<Company>SIGNA</Company>
<Server>SAPBO-SERVER\SIGNA</Server>
<UserAuthentication>False</UserAuthentication>
<Language />
<LicenseServer>
</LicenseServer>
<ChooseDB>True</ChooseDB>
<DBType>7</DBType>
<DBUser>sa</DBUser>
<SybasePort />
<DBPassword>OIrLcIpJpJ8LtJjL9KvLdLfDrE</DBPassword>
</Logon>
<ObjectCode>LandedCostsService</ObjectCode>
<FileExtractor>
<Extorlogin>
<ExID>sa</ExID>
<ExPW>PJqKfLrLsMaJtJjLfMuKcKkEqF</ExPW>
<ExDSN>EDISIGNA</ExDSN>
</Extorlogin>
<FilesTypes>3</FilesTypes>
<Files>
<LandedCost>SELECT [LandedCostNumber],[VendorCode],[DocumentCurrency] FROM
[VOIPFM]</LandedCost>
<LandedCost_ItemLines>SELECT
[ParentKey],[LineNumber],[BaseDocumentType],[BaseEntry],[Number],[Quantity],[AllocatedCost
sLineTotal],[BaseLine] FROM [VOIPF]</LandedCost_ItemLines>
<LandedCost_CostLines>SELECT
[ParentKey],[LandedCostCode],[Amount],[IncludeForCustoms] FROM
[VOIPFD]</LandedCost_CostLines>
</Files>
</FileExtractor>
<Map>
<Fields>
<LandedCost>
<SourceFields>
<RecordKey />
<LandedCostNumber />
<VendorCode />
<DocumentCurrency />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LandedCostNumber>LandedCostNumber</LandedCostNumber>
<VendorCode>VendorCode</VendorCode>
<DocumentCurrency>DocumentCurrency</DocumentCurrency>
</TargetFields>
</LandedCost>
<LandedCost_ItemLines>
<SourceFields>
<RecordKey />
<ParentKey />
<LineNumber />
<BaseDocumentType />
<BaseEntry />
<Number />
<Quantity />
<AllocatedCostsLineTotal />
<BaseLine />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LineNumber>LineNumber</LineNumber>
<BaseDocumentType>BaseDocumentType</BaseDocumentType>
<BaseEntry>BaseEntry</BaseEntry>
<Number>Number</Number>
<Quantity>Quantity</Quantity>
<AllocatedCostsLineTotal>AllocatedCostsLineTotal</AllocatedCostsLineTotal>
<BaseLine>BaseLine</BaseLine>
</TargetFields>
</LandedCost_ItemLines>
<LandedCost_CostLines>
<SourceFields>
<RecordKey />
<ParentKey />
<LandedCostCode />
<Amount />
<IncludeForCustoms />
</SourceFields>
<TargetFields>
<RecordKey>RecordKey</RecordKey>
<LandedCostCode>LandedCostCode</LandedCostCode>
<Amount>Amount</Amount>
<IncludeForCustoms>IncludeForCustoms</IncludeForCustoms>
</TargetFields>
</LandedCost_CostLines>
</Fields>
</Map>
<Run>
<Import>1</Import>
<Rollback>True</Rollback>
<MaxError>10</MaxError>
<Update>0</Update>
<TestRun>0</TestRun>
<AddAllItems>Checked</AddAllItems>
<LineData>0</LineData>
<DataType>2</DataType>
<MultiThread>False</MultiThread>
<ThreadNum>4</ThreadNum>
</Run>
</Transfer>
POSCONDICIONES