All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.DefaultAcctngActivityAllocPostFunctionResult Maven / Gradle / Ivy

There is a newer version: 2.28.0
Show newest version
/*
 * 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.ReturnParameter;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.types.DocumentNumber;

import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@RequiredArgsConstructor
@EqualsAndHashCode
@ToString
public class DefaultAcctngActivityAllocPostFunctionResult
    implements AcctngActivityAllocPostFunctionResult
{

    private final BapiQueryResult result;

    /**
     * See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.AcctngActivityAllocPostFunctionResult#getDocumentNumber() interface}
     * 
     * @return
     *     Document Number
     */
    @Override
    public DocumentNumber getDocumentNumber() {
        return result.get("DOC_NO").getAsObject().as(DocumentNumber.class);
    }

    /**
     * See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.AcctngActivityAllocPostFunctionResult#getMessages() interface}
     * 
     * @return
     *     Error Message Table
     */
    @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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy