cancel
Showing results for 
Search instead for 
Did you mean: 

Crear Reconciliaciones internas (OITR) - DI API

0 Kudos

Hola a todos

Necesito crear reconciliaciones internas.

He buscado en los objetos DI-API para usar las reconciliaciones (OITR) y no encontrado.

- SAP 9.3 PL04

¿Alguien puede ayudarme?

Nota: Si es posible un ejemplo con código, seria mejor.

former_member34
Product and Topic Expert
Product and Topic Expert

Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with our Q&A Tutorial: https://developers.sap.com/tutorials/community-qa.html, as it provides tips for preparing questions that draw responses from our members. Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM

Many thanks!

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi ismael_dt52,

Internal Reconciliation is supported in DI API From SAP Business One Version 9.3 PL02.

Note: Only Manual Reconciliation is supported, for both Business Partners and Financials (Journal Entries).

Refer to SAP Note 2586911 for more details on Internal Reconciliation.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

0 Kudos

hola buenas, No pedo acceder a la nota.

Answers (2)

Answers (2)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi ismael_dt52,

Below are the sample codes:

Directly Add

InternalReconciliationsService service = company.GetCompanyService().GetBusinessService(ServiceTypes.InternalReconciliationsService);
InternalReconciliationOpenTrans openTrans = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationOpenTrans);
InternalReconciliationParams reconParams = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationParams);


openTrans.CardOrAccount = CardOrAccountEnum.coaCard;
openTrans.InternalReconciliationOpenTransRows.Add();
openTrans.InternalReconciliationOpenTransRows.Item(0).Selected = BoYesNoEnum.tYES;
openTrans.InternalReconciliationOpenTransRows.Item(0).TransId = 41;
openTrans.InternalReconciliationOpenTransRows.Item(0).TransRowId = 1;
openTrans.InternalReconciliationOpenTransRows.Item(0).ReconcileAmount = 10;
openTrans.InternalReconciliationOpenTransRows.Add();
openTrans.InternalReconciliationOpenTransRows.Item(1).Selected = BoYesNoEnum.tYES;
openTrans.InternalReconciliationOpenTransRows.Item(1).TransId = 43;
openTrans.InternalReconciliationOpenTransRows.Item(1).TransRowId = 0;
openTrans.InternalReconciliationOpenTransRows.Item(1).ReconcileAmount = 10;


try
{
 reconParams = service.Add(openTrans);
}
catch (Exception ex)
{
 Console.WriteLine(ex.Message);
}

GetOpenTransactions and Add:

InternalReconciliationsService service = company.GetCompanyService().GetBusinessService(ServiceTypes.InternalReconciliationsService);
InternalReconciliationOpenTransParams transParams = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationOpenTransParams);
bool reconcileOnAccount = false;
int transId1 = 2;
int transRowId1 = 0;
int transId2 = 5;
int transRowId2 = 1;


// Set date selection criteria
transParams.ReconDate = DateTime.Today;
transParams.DateType = ReconSelectDateTypeEnum.rsdtPostDate;
transParams.FromDate = new DateTime(2017, 10, 11);
transParams.ToDate = new DateTime(2017, 11, 11);


// Set account or card selection criteria
if (false == reconcileOnAccount)
{
    transParams.CardOrAccount = CardOrAccountEnum.coaAccount;
    transParams.AccountNo = "100101";
}
else
{
    transParams.CardOrAccount = CardOrAccountEnum.coaCard;
    transParams.InternalReconciliationBPs.Add();
    transParams.InternalReconciliationBPs.Item(0).BPCode = "v01";
}
try
{
 InternalReconciliationOpenTrans openTrans = service.GetOpenTransactions(transParams);


 // Select transactions to reconcile and adjust amount
 foreach (InternalReconciliationOpenTransRow row in openTrans.InternalReconciliationOpenTransRows)
 {
  if (transId1 == row.TransId && transRowId1 == row.TransRowId)
  {
   row.Selected = BoYesNoEnum.tYES;
   row.ReconcileAmount = 11;
   row.CashDiscount = 1;
  }
  else if (transId2 == row.TransId && transRowId2 == row.TransRowId)
  {
   row.Selected = BoYesNoEnum.tYES;
   row.ReconcileAmount = 10;
  }
 }


 // Add reconciliation
 reconParams = service.Add(openTrans);
}
catch (Exception ex)
{
 Console.WriteLine(ex.Message);
}

Cancel:

InternalReconciliationsService service = company.GetCompanyService().GetBusinessService(ServiceTypes.InternalReconciliationsService);
InternalReconciliationParams reconParams = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationParams);


reconParams.ReconNum = 61;
try
{
 service.Cancel(reconParams);
}
catch (Exception ex)
{
 Console.WriteLine(ex.Message);
}

Get:

InternalReconciliationsService service = company.GetCompanyService().GetBusinessService(ServiceTypes.InternalReconciliationsService);
InternalReconciliationParams reconParams = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationParams);
InternalReconciliation recon = service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliation);


reconParams.ReconNum = 60;
try
{
 recon = service.Get(reconParams);
 Console.WriteLine(
  "Header" +
  ": ReconNum - " +
  recon.ReconNum +
  ", ReconDate - " +
  recon.ReconDate +
  ", CardOrAccount - " +
  recon.CardOrAccount +
  ", Total - " +
  recon.Total +
  ", ReconType - " +
  recon.ReconType +
  ", CancelAbs - " +
  recon.CancelAbs);
 InternalReconciliationRows rows = recon.InternalReconciliationRows;
 int lineNum = 0;
 foreach (InternalReconciliationRow row in rows)
 {
  Console.WriteLine(
   "Line " + lineNum +
   ": LineSeq - " + row.LineSeq +
   ", ShortName - " + row.ShortName +
   ", TransId - " + row.TransId +
   ", TransRowId - " + row.TransRowId +
   ", SrcObjTyp - " + row.SrcObjTyp +
   ", SrcObjAbs - " + row.SrcObjAbs +
   ", CreditOrDebit - " + row.CreditOrDebit +
   ", ReconcileAmount - " + row.ReconcileAmount +
   ", CashDiscount - " + row.CashDiscount);
  ++lineNum;
 }
}
catch (Exception ex)
{
 Console.WriteLine(ex.Message);
}

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi ismael_dt52,

As of SAP Business One 9.3 PL02, a new service is exposed to provide Internal Reconciliation functions through both DI API and Service Layer. InternalReconciliationsService enables you to retrieve, create and cancel internal reconciliations.

Note: Only Manual Reconciliation is supported, for both Business Partners and Financials (Journal Entries).

MUST READ: IMPORTANT WARNING about using Internal Reconciliation via DI API

The use of this new service is highly risky. Any kind of misuse or improper use can have the most serious impact, it can easily lead to data corruption and complete disruption of bookkeeping. Thus, this may result in the loss of tax benefits or estimation of the tax burden to the disadvantage of the company, and, not least, it may lead to tax criminal proceedings. In the worst case, improperly executed accounting has criminal and civil consequences.

In this respect, the Internal Reconciliation via DI API can only be carried out with very great experience and extensive knowledge in this area after very careful consideration.

In general, SAP advises against use of Internal Reconciliation via DI API, only in absolute and justified exceptional cases, this should be used.

SAP hereby expressly points out the associated risks and excludes any responsibility, claims, or support for using Internal Reconciliation via DI API.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support