
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultMaterialPriceService Maven / Gradle / Ivy
/*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.s4hana.datamodel.odata.services;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.annotation.Nonnull;
import javax.inject.Named;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.materialprice.InventoryPriceChangeFluentHelper;
/**
*
* This service enables you to change the prices of your materials. If stock exists for the material, a revaluation
* posting is generated.
*
*
*
* Reference: SAP
* API Business Hub
*
* Details:
*
*
* OData Service:
* API_MATERIAL_VALUATION_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Material Price Changes and Inventory Values Integration (SAP_COM_0147)
*
*
* Scope Items:
* Managing Material Price Changes and Inventory Values
* (1ZT)
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultMaterialPriceService" )
public class DefaultMaterialPriceService implements MaterialPriceService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link MaterialPriceService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultMaterialPriceService()
{
servicePath = MaterialPriceService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultMaterialPriceService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultMaterialPriceService withServicePath( @Nonnull final String servicePath )
{
return new DefaultMaterialPriceService(servicePath);
}
@Override
@Nonnull
public InventoryPriceChangeFluentHelper inventoryPriceChange(
final String inventoryValuationType,
final String valuationArea,
final BigDecimal materialPriceUnitQty,
final LocalDateTime postingDate,
final BigDecimal inventoryPrice,
final String material,
final String currencyRole,
final String currency )
{
return new InventoryPriceChangeFluentHelper(
servicePath,
inventoryValuationType,
valuationArea,
materialPriceUnitQty,
postingDate,
inventoryPrice,
material,
currencyRole,
currency);
}
}