Traslado de stock usando SAP service layer

Hola Victor Gaspar un gran saludo desde Venezuela, amigo estoy muy interesado en una programación que vi en el foro, la cual es estoy intentando hacer un traslado de stock usando SAP service layer… y tengo casi todo listo pero no veo por ningún lado donde se asigna una ubicación especifica del almacén y vi que lo lograste, me podrías ayudar por favor???

Hola Juan,
No recuerdo ese tema, posiblemente sería algo con DI API, ya que el SL apenas estamos empezando a usarlo pero no para cosas de inventarios. Si pudieras preguntar en el tema especifico donde viste que yo dije que lo logré sería mejor para tratar de recordar.
Saludos.

Este sería el tema donde está la programación. Transferencia de stock con Ubicación DI API - SAP Business One - Ayuda SAP (consultoria-sap.com) y tengo la misma interrogante que está en tu pregunta como puede saber cual es la variable que afecta la ubicación del almacen ya que entiendo perfectamente el “De almacén” a “Almacén destino” pero por ningún lado veo como sacar la información de “a ubicación” y me gustaria saber si tienes algo de información. Saludos y gracias por responder.

esta es un transferencia de prueba.

{
    "odata.metadata": "https://xxxxxxx/b1s/v1/$metadata#StockTransfers",
    "value": [
        {
            "DocEntry": 90,
            "Series": 27,
            "Printed": "tNO",
            "DocDate": "2024-06-25T00:00:00Z",
            "DueDate": "2024-06-25T00:00:00Z",
            "CardCode": null,
            "CardName": null,
            "Address": null,
            "Reference1": "22",
            "Reference2": null,
            "Comments": null,
            "JournalMemo": "Traslados -",
            "PriceList": -1,
            "SalesPersonCode": -1,
            **"FromWarehouse": "003"**,
            **"ToWarehouse": "003"**,
            "CreationDate": "2024-06-25T00:00:00Z",
            "UpdateDate": "2024-06-25T00:00:00Z",
            "FinancialPeriod": 19,
            "TransNum": null,
            "DocNum": 22,
            "TaxDate": "2024-06-25T00:00:00Z",
            "ContactPerson": 0,
            "FolioPrefixString": null,
            "FolioNumber": null,
            "DocObjectCode": "67",
            "AuthorizationStatus": "sasWithout",
            "BPLID": null,
            "BPLName": null,
            "VATRegNum": null,
            "AuthorizationCode": null,
            "StartDeliveryDate": null,
            "StartDeliveryTime": null,
            "EndDeliveryDate": null,
            "EndDeliveryTime": null,
            "VehiclePlate": null,
            "ATDocumentType": null,
            "EDocExportFormat": null,
            "ElecCommStatus": null,
            "ElecCommMessage": null,
            "PointOfIssueCode": "8888",
            "Letter": "fLetterR",
            "FolioNumberFrom": 21,
            "FolioNumberTo": 21,
            "AttachmentEntry": null,
            "DocumentStatus": "bost_Open",
            "ShipToCode": null,
            "SAPPassport": null,
            "LastPageFolioNumber": null,
            "DutyStatus": "tYES",
            "U_B1SYS_CAI": null,
            "U_B1SYS_CAI_DATE": null,
            "U_B1SYS_ECM2_LINK": null,
            "U_NroCompEsp": null,
            "U_ProvEvent": null,
            "U_FechaFce": null,
            "U_MotivoNCE": "N",
            "U_RefComFCE": null,
            "U_TipoFCE": "ADC",
            "U_NIF": null,
            "U_PG_Monto": 0.0,
            "U_PG_FechaVto": null,
            "U_PG_DiasVto": null,
            "U_PG_Yacimiento": null,
            "U_PG_PAD": null,
            "U_PG_OC": null,
            "U_PG_NIC": null,
            "U_PG_NP": null,
            "U_PG_PC": null,
            "U_PG_HES": null,
            "U_PG_HE": null,
            "U_PG_NroDoc": null,
            "U_PG_IR": null,
            "U_PG_OV": null,
            "U_PG_PorcMonto": 0.0,
            "U_PG_Vale": null,
            "U_PG_DocMat": null,
            "U_PG_DocRecep": null,
            "U_PG_RecepMerca": null,
            "U_PG_NroServicio": null,
            "U_PG_DescServicio": null,
            "U_PG_NroCertificado": null,
            "U_PG_PeriodoCertif": null,
            "StockTransfer_ApprovalRequests": [],
            "ElectronicProtocols": [],
            "StockTransferLines": [
                {
                    "LineNum": 0,
                    **"DocEntry": 90,**
                    **"ItemCode": "CABEZAL 10\"",**
                    **"ItemDescription": "CABEZAL CON RACOR 10\"",**
                    **"Quantity": 1.0,**
                    "Price": 100.0,
                    "Currency": "ARS",
                    "Rate": 0.0,
                    "DiscountPercent": 0.0,
                    "VendorNum": "",
                    "SerialNumber": null,
                    **"WarehouseCode": "003"**,
                    **"FromWarehouseCode": "003",**
                    "ProjectCode": "",
                    "Factor": 1.0,
                    "Factor2": 1.0,
                    "Factor3": 1.0,
                    "Factor4": 1.0,
                    "DistributionRule": null,
                    "DistributionRule2": null,
                    "DistributionRule3": null,
                    "DistributionRule4": null,
                    "DistributionRule5": null,
                    "UseBaseUnits": "tYES",
                    "MeasureUnit": "Unidad",
                    "UnitsOfMeasurment": 1.0,
                    "BaseType": "Default",
                    "BaseLine": null,
                    "BaseEntry": null,
                    "UnitPrice": 100.0,
                    "UoMEntry": 1,
                    "UoMCode": "UNI",
                    "InventoryQuantity": 1.0,
                    "RemainingOpenQuantity": 1.0,
                    "RemainingOpenInventoryQuantity": 1.0,
                    "LineStatus": "bost_Open",
                    "WeightOfRecycledPlastic": null,
                    "PlasticPackageExemptionReason": null,
                    "SerialNumbers": [],
                    "BatchNumbers": [],
                    "CCDNumbers": [],
                    "StockTransferLinesBinAllocations": []
                }
            ],
            "StockTransferTaxExtension": {
                "SupportVAT": "tNO",
                "FormNumber": null,
                "TransactionCategory": null,
                "U_B1SYS_TrailerId": null,
                "U_B1SYS_IncotermsTxt": null
            },
            "DocumentReferences": []
        }
    ]
}

pero en ese ejemplo se hizo a una ubicación llamada **"MANGRULLO"** que si la busco en la entidad WarehouseSublevelCodesService la información es  
{
            "AbsEntry": 4,
            "WarehouseSublevel": 1,
            "Code": "MANGRULLO"
        } y ese es el problema no veo como conseguir en la transferencia de stock la ubicación **MANGRULLO**

Gracias por cualquier tipo de ayuda.

Para asignar una ubicación específica dentro de un almacén al realizar una transferencia de stock en SAP Business One utilizando el Service Layer, necesitas utilizar la propiedad StockTransferLinesBinAllocations en el objeto StockTransferLines. Aquí es donde puedes especificar los detalles de la ubicación (bin location) dentro del almacén.

A continuación te presento un ejemplo de cómo estructurar tu JSON para incluir una ubicación específica (MANGRULLO) en la transferencia de stock:

{
    "odata.metadata": "https://xxxxxxx/b1s/v1/$metadata#StockTransfers",
    "DocEntry": 90,
    "Series": 27,
    "Printed": "tNO",
    "DocDate": "2024-06-25T00:00:00Z",
    "DueDate": "2024-06-25T00:00:00Z",
    "Reference1": "22",
    "JournalMemo": "Traslados -",
    "PriceList": -1,
    "SalesPersonCode": -1,
    "FromWarehouse": "003",
    "ToWarehouse": "003",
    "CreationDate": "2024-06-25T00:00:00Z",
    "UpdateDate": "2024-06-25T00:00:00Z",
    "FinancialPeriod": 19,
    "TaxDate": "2024-06-25T00:00:00Z",
    "PointOfIssueCode": "8888",
    "Letter": "fLetterR",
    "FolioNumberFrom": 21,
    "FolioNumberTo": 21,
    "DocumentStatus": "bost_Open",
    "DutyStatus": "tYES",
    "StockTransferLines": [
        {
            "LineNum": 0,
            "DocEntry": 90,
            "ItemCode": "CABEZAL 10\"",
            "ItemDescription": "CABEZAL CON RACOR 10\"",
            "Quantity": 1.0,
            "Price": 100.0,
            "Currency": "ARS",
            "Rate": 0.0,
            "DiscountPercent": 0.0,
            "WarehouseCode": "003",
            "FromWarehouseCode": "003",
            "ProjectCode": "",
            "Factor": 1.0,
            "UseBaseUnits": "tYES",
            "MeasureUnit": "Unidad",
            "UnitsOfMeasurment": 1.0,
            "BaseType": "Default",
            "BaseLine": null,
            "BaseEntry": null,
            "UnitPrice": 100.0,
            "UoMEntry": 1,
            "UoMCode": "UNI",
            "InventoryQuantity": 1.0,
            "RemainingOpenQuantity": 1.0,
            "RemainingOpenInventoryQuantity": 1.0,
            "LineStatus": "bost_Open",
            "StockTransferLinesBinAllocations": [
                {
                    "BinAbsEntry": 4, 
                    "Quantity": 1.0,
                    "AllowNegativeQuantity": "tNO",
                    "SerialAndBatchNumbersBaseLine": -1
                }
            ]
        }
    ],
    "StockTransferTaxExtension": {
        "SupportVAT": "tNO"
    }
}

Explicación de las Claves Importantes:

  • "StockTransferLinesBinAllocations": Esta clave se utiliza para definir las ubicaciones dentro del almacén.
  • "BinAbsEntry": 4: Este es el identificador absoluto de la ubicación “MANGRULLO” que obtuviste de la entidad WarehouseSublevelCodesService.
  • "Quantity": 1.0: La cantidad que se transfiere a esta ubicación específica.

Pasos Adicionales:

  1. Obtener BinAbsEntry:

    • Asegúrate de obtener el BinAbsEntry correcto para la ubicación deseada utilizando WarehouseSublevelCodesService.
  2. Verificar Configuración de Almacén:

    • Asegúrate de que el almacén tiene habilitadas las ubicaciones (bin locations) y que estas están correctamente configuradas en SAP Business One.

Resumen Consultoria-SAP:

Para asignar una ubicación específica en un traslado de stock utilizando SAP Service Layer, necesitas utilizar la propiedad StockTransferLinesBinAllocations en tu JSON. Asegúrate de incluir el BinAbsEntry de la ubicación específica y la cantidad correspondiente. Esto permitirá realizar transferencias precisas a ubicaciones dentro del almacén.

¡Estamos aquí para ayudarte!

1 me gusta

Este tema se cerró automáticamente 7 días después de la última publicación. No se permiten nuevas respuestas.