com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.DefaultCostCenterCreateMultipleFunctionResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bapi-api Show documentation
Show all versions of bapi-api Show documentation
Generated classes of the SAP S/4HANA Virtual Data Model (VDM) for BAPIs.
/*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.s4hana.datamodel.bapi.functions;
import java.util.List;
import com.google.common.collect.Lists;
import com.sap.cloud.sdk.result.ResultElement;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.BapiQueryResult;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.CostCenterCreateInput;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.RefStructureForParameterExtensioninExtensionout;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.ReturnParameter;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@RequiredArgsConstructor
@EqualsAndHashCode
@ToString
public class DefaultCostCenterCreateMultipleFunctionResult
implements CostCenterCreateMultipleFunctionResult
{
private final BapiQueryResult result;
/**
* See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getCostCenters() interface}
*
* @return
* Cost Centers
*/
@Override
public List getCostCenters() {
final List list = Lists.newArrayList();
for (ResultElement row: result.get("COSTCENTERLIST").getAsCollection()) {
list.add(row.getAsObject().as(CostCenterCreateInput.class));
}
return list;
}
/**
* See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getAdditionalOutput() interface}
*
* @return
* Additional Output
*/
@Override
public List getAdditionalOutput() {
final List list = Lists.newArrayList();
for (ResultElement row: result.get("EXTENSIONOUT").getAsCollection()) {
list.add(row.getAsObject().as(RefStructureForParameterExtensioninExtensionout.class));
}
return list;
}
/**
* See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getMessages() interface}
*
* @return
* Return Values
*/
@Override
public List getMessages() {
final List list = Lists.newArrayList();
for (ResultElement row: result.get("RETURN").getAsCollection()) {
list.add(row.getAsObject().as(ReturnParameter.class));
}
return list;
}
}