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

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

The newest version!
/*
 * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
 */

package com.sap.cloud.sdk.s4hana.datamodel.bapi.functions;

import javax.annotation.Nonnull;

import com.google.common.collect.Lists;
import com.sap.cloud.sdk.s4hana.connectivity.ErpConfigContext;
import com.sap.cloud.sdk.s4hana.connectivity.exception.QueryExecutionException;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.BapiQuery;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.BapiQueryResult;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.ParameterFields;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.Table;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.TableRow;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.AccountingDocumentCheckPostingInAccountingCoPaAcctAssignmentCharacteristic;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.AddContractAccountsRecAndPayableDocumentLineItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.AddContractAccountsRecievableAndPayableHeaderLine;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.ContainerForCustomerExitParameter;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.CurrencyItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.CustomerItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.GlAccountItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.Header;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.PaymentCardInformation;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.PostingInAccountingCoPaAcctAssignmentValueField;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.PostingInAccountingPartnerBillingDoc;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.RealEstateAccountAssignmentData;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.RefStructureForParameterExtensioninExtensionout;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.TaxItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.VendorItem;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.WithholdingTaxInformation;

import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import lombok.experimental.Tolerate;

/**
 * {@inheritDoc}
 * 
 */
@ToString
@EqualsAndHashCode
@Accessors(fluent = true)
@RequiredArgsConstructor(access = AccessLevel.PUBLIC)
public class DefaultAcctngDocumentPostFunction
    implements AcctngDocumentPostFunction
{

    /**
     * Header
     * 
     */
    private final Header documentHeader;
    /**
     * (Optional) One-time customer
     * 
     */
    @Setter
    private PostingInAccountingPartnerBillingDoc customerCpd = null;
    /**
     * (Optional) Additional contract accounts recievable and payable header line
     * 
     */
    @Setter
    private AddContractAccountsRecievableAndPayableHeaderLine contractHeader = null;
    /**
     * (Optional) G/L account item
     * 
     */
    @Setter
    @Nonnull
    private Iterable accountGl = Lists.newArrayList();
    /**
     * (Optional) Customer item
     * 
     */
    @Setter
    @Nonnull
    private Iterable accountReceivable = Lists.newArrayList();
    /**
     * (Optional) Vendor item
     * 
     */
    @Setter
    @Nonnull
    private Iterable accountPayable = Lists.newArrayList();
    /**
     * (Optional) Tax item
     * 
     */
    @Setter
    @Nonnull
    private Iterable accountTax = Lists.newArrayList();
    /**
     * Currency items
     * 
     */
    @Nonnull
    private final Iterable currencyAmount;
    /**
     * (Optional) CO-PA Account assignment characteristics
     * 
     */
    @Setter
    @Nonnull
    private Iterable criteria = Lists.newArrayList();
    /**
     * (Optional) CO-PA Account Assignment Value Fields
     * 
     */
    @Setter
    @Nonnull
    private Iterable valuefield = Lists.newArrayList();
    /**
     * (Optional) Account Assignments for Real Estate
     * 
     */
    @Setter
    @Nonnull
    private Iterable realEstate = Lists.newArrayList();
    /**
     * (Optional) Enhancement for COMD Implementation
     * 
     */
    @Setter
    @Nonnull
    private Iterable extension1 = Lists.newArrayList();
    /**
     * (Optional) Enhancement for BAdI Implementation
     * 
     */
    @Setter
    @Nonnull
    private Iterable extension2 = Lists.newArrayList();
    /**
     * (Optional) Payment card information
     * 
     */
    @Setter
    @Nonnull
    private Iterable paymentCard = Lists.newArrayList();
    /**
     * (Optional) Additional contract accounts recieviable and payable document line item
     * 
     */
    @Setter
    @Nonnull
    private Iterable contractItem = Lists.newArrayList();
    /**
     * (Optional) Withholding Tax
     * 
     */
    @Setter
    @Nonnull
    private Iterable withholdingTax = Lists.newArrayList();

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    public AcctngDocumentPostFunctionResult execute(final ErpConfigContext erpConfigContext)
        throws QueryExecutionException
    {
        final BapiQuery query = toQuery();
        final BapiQueryResult queryResult = query.execute(erpConfigContext);
        return new DefaultAcctngDocumentPostFunctionResult(queryResult);
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    public AcctngDocumentPostFunctionResult execute()
        throws QueryExecutionException
    {
        return execute(new ErpConfigContext());
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    public BapiQuery toQuery() {
        documentHeader.validate();
        if (customerCpd!= null) {
            customerCpd.validate();
        }
        if (contractHeader!= null) {
            contractHeader.validate();
        }
        if (accountGl!= null) {
            for (GlAccountItem item: accountGl) {
                item.validate();
            }
        }
        if (accountReceivable!= null) {
            for (CustomerItem item: accountReceivable) {
                item.validate();
            }
        }
        if (accountPayable!= null) {
            for (VendorItem item: accountPayable) {
                item.validate();
            }
        }
        if (accountTax!= null) {
            for (TaxItem item: accountTax) {
                item.validate();
            }
        }
        for (CurrencyItem item: currencyAmount) {
            item.validate();
        }
        if (criteria!= null) {
            for (AccountingDocumentCheckPostingInAccountingCoPaAcctAssignmentCharacteristic item: criteria) {
                item.validate();
            }
        }
        if (valuefield!= null) {
            for (PostingInAccountingCoPaAcctAssignmentValueField item: valuefield) {
                item.validate();
            }
        }
        if (realEstate!= null) {
            for (RealEstateAccountAssignmentData item: realEstate) {
                item.validate();
            }
        }
        if (extension1 != null) {
            for (ContainerForCustomerExitParameter item: extension1) {
                item.validate();
            }
        }
        if (extension2 != null) {
            for (RefStructureForParameterExtensioninExtensionout item: extension2) {
                item.validate();
            }
        }
        if (paymentCard!= null) {
            for (PaymentCardInformation item: paymentCard) {
                item.validate();
            }
        }
        if (contractItem!= null) {
            for (AddContractAccountsRecAndPayableDocumentLineItem item: contractItem) {
                item.validate();
            }
        }
        if (withholdingTax!= null) {
            for (WithholdingTaxInformation item: withholdingTax) {
                item.validate();
            }
        }
        final BapiQuery query = new BapiQuery("BAPI_ACC_DOCUMENT_POST");
        {
            final ParameterFields row = query.withExportingFields("DOCUMENTHEADER", "BAPIACHE09");
            if (documentHeader.getAccPrinciple()!= null) {
                row.field("ACC_PRINCIPLE", "ACCOUNTING_PRINCIPLE", documentHeader.getAccPrinciple());
            }
            if (documentHeader.getAcDocNo()!= null) {
                row.field("AC_DOC_NO", "BELNR_D", documentHeader.getAcDocNo());
            }
            if (documentHeader.getBillCategory()!= null) {
                row.field("BILL_CATEGORY", "FKTYP", documentHeader.getBillCategory());
            }
            if (documentHeader.getBusAct()!= null) {
                row.field("BUS_ACT", "GLVOR", documentHeader.getBusAct());
            }
            if (documentHeader.getCompoAcc()!= null) {
                row.field("COMPO_ACC", "COMPO", documentHeader.getCompoAcc());
            }
            if (documentHeader.getCompCode()!= null) {
                row.field("COMP_CODE", "BUKRS", documentHeader.getCompCode());
            }
            if (documentHeader.getDocDate()!= null) {
                row.field("DOC_DATE", "BLDAT", documentHeader.getDocDate());
            }
            if (documentHeader.getDocStatus()!= null) {
                row.field("DOC_STATUS", "BAPI_ACC_DOC_STATUS", documentHeader.getDocStatus());
            }
            if (documentHeader.getDocType()!= null) {
                row.field("DOC_TYPE", "BLART", documentHeader.getDocType());
            }
            if (documentHeader.getEcsEnv()!= null) {
                row.field("ECS_ENV", "ACC_DTE_ECS_IF_TYPE", documentHeader.getEcsEnv());
            }
            if (documentHeader.getFiscYear()!= null) {
                row.field("FISC_YEAR", "GJAHR", documentHeader.getFiscYear());
            }
            if (documentHeader.getFisPeriod()!= null) {
                row.field("FIS_PERIOD", "MONAT", documentHeader.getFisPeriod());
            }
            if (documentHeader.getHeaderTxt()!= null) {
                row.field("HEADER_TXT", "BKTXT", documentHeader.getHeaderTxt());
            }
            if (documentHeader.getInvoiceRecDate()!= null) {
                row.field("INVOICE_REC_DATE", "REINDAT", documentHeader.getInvoiceRecDate());
            }
            if (documentHeader.getNegPostng()!= null) {
                row.field("NEG_POSTNG", "XNEGP", documentHeader.getNegPostng());
            }
            if (documentHeader.getObjKey()!= null) {
                row.field("OBJ_KEY", "AWKEY", documentHeader.getObjKey());
            }
            if (documentHeader.getObjKeyInv()!= null) {
                row.field("OBJ_KEY_INV", "AWKEY_REB", documentHeader.getObjKeyInv());
            }
            if (documentHeader.getObjKeyR()!= null) {
                row.field("OBJ_KEY_R", "AWKEY_REV", documentHeader.getObjKeyR());
            }
            if (documentHeader.getObjSys()!= null) {
                row.field("OBJ_SYS", "AWSYS", documentHeader.getObjSys());
            }
            if (documentHeader.getObjType()!= null) {
                row.field("OBJ_TYPE", "AWTYP", documentHeader.getObjType());
            }
            if (documentHeader.getPartialRev()!= null) {
                row.field("PARTIAL_REV", "BAPI_PART_REV", documentHeader.getPartialRev());
            }
            if (documentHeader.getPstngDate()!= null) {
                row.field("PSTNG_DATE", "BUDAT", documentHeader.getPstngDate());
            }
            if (documentHeader.getReasonRev()!= null) {
                row.field("REASON_REV", "ACPI_STGRD", documentHeader.getReasonRev());
            }
            if (documentHeader.getRefDocNo()!= null) {
                row.field("REF_DOC_NO", "XBLNR", documentHeader.getRefDocNo());
            }
            if (documentHeader.getRefDocNoLong()!= null) {
                row.field("REF_DOC_NO_LONG", "XBLNR_LONG", documentHeader.getRefDocNoLong());
            }
            if (documentHeader.getTaxCalcDate()!= null) {
                row.field("TAX_CALC_DATE", "TXDAT", documentHeader.getTaxCalcDate());
            }
            if (documentHeader.getTransDate()!= null) {
                row.field("TRANS_DATE", "WWERT_D", documentHeader.getTransDate());
            }
            if (documentHeader.getUsername()!= null) {
                row.field("USERNAME", "USNAM", documentHeader.getUsername());
            }
            if (documentHeader.getVatdate()!= null) {
                row.field("VATDATE", "VATDATE", documentHeader.getVatdate());
            }
            row.end();
        }
        if (customerCpd!= null) {
            final ParameterFields row = query.withExportingFields("CUSTOMERCPD", "BAPIACPA09");
            if (customerCpd.getBankAcct()!= null) {
                row.field("BANK_ACCT", "BANKN", customerCpd.getBankAcct());
            }
            if (customerCpd.getBankCtry()!= null) {
                row.field("BANK_CTRY", "BANKS", customerCpd.getBankCtry());
            }
            if (customerCpd.getBankCtryIso()!= null) {
                row.field("BANK_CTRY_ISO", "BANKS_ISO", customerCpd.getBankCtryIso());
            }
            if (customerCpd.getBankNo()!= null) {
                row.field("BANK_NO", "BANKL", customerCpd.getBankNo());
            }
            if (customerCpd.getCity()!= null) {
                row.field("CITY", "ORT01_GP", customerCpd.getCity());
            }
            if (customerCpd.getCountry()!= null) {
                row.field("COUNTRY", "LAND1_GP", customerCpd.getCountry());
            }
            if (customerCpd.getCountryIso()!= null) {
                row.field("COUNTRY_ISO", "LAND1_ISO", customerCpd.getCountryIso());
            }
            if (customerCpd.getCtrlKey()!= null) {
                row.field("CTRL_KEY", "BKONT", customerCpd.getCtrlKey());
            }
            if (customerCpd.getDmeInd()!= null) {
                row.field("DME_IND", "DTAMS", customerCpd.getDmeInd());
            }
            if (customerCpd.getEqualTax()!= null) {
                row.field("EQUAL_TAX", "ACPI_STKZA", customerCpd.getEqualTax());
            }
            if (customerCpd.getIban()!= null) {
                row.field("IBAN", "IBAN", customerCpd.getIban());
            }
            if (customerCpd.getInstrKey()!= null) {
                row.field("INSTR_KEY", "DTAWS", customerCpd.getInstrKey());
            }
            if (customerCpd.getLanguIso()!= null) {
                row.field("LANGU_ISO", "LAISO", customerCpd.getLanguIso());
            }
            if (customerCpd.getName()!= null) {
                row.field("NAME", "NAME1_GP", customerCpd.getName());
            }
            if (customerCpd.getName2()!= null) {
                row.field("NAME_2", "NAME2_GP", customerCpd.getName2());
            }
            if (customerCpd.getName3()!= null) {
                row.field("NAME_3", "NAME3_GP", customerCpd.getName3());
            }
            if (customerCpd.getName4()!= null) {
                row.field("NAME_4", "NAME4_GP", customerCpd.getName4());
            }
            if (customerCpd.getPobkCurac()!= null) {
                row.field("POBK_CURAC", "PSKTO", customerCpd.getPobkCurac());
            }
            if (customerCpd.getPobxPcd()!= null) {
                row.field("POBX_PCD", "PSTL2", customerCpd.getPobxPcd());
            }
            if (customerCpd.getPostlCode()!= null) {
                row.field("POSTL_CODE", "PSTLZ", customerCpd.getPostlCode());
            }
            if (customerCpd.getPoBox()!= null) {
                row.field("PO_BOX", "PFACH", customerCpd.getPoBox());
            }
            if (customerCpd.getRegion()!= null) {
                row.field("REGION", "REGIO", customerCpd.getRegion());
            }
            if (customerCpd.getStreet()!= null) {
                row.field("STREET", "STRAS_GP", customerCpd.getStreet());
            }
            if (customerCpd.getSwiftCode()!= null) {
                row.field("SWIFT_CODE", "SWIFT", customerCpd.getSwiftCode());
            }
            if (customerCpd.getTax()!= null) {
                row.field("TAX", "STKZU", customerCpd.getTax());
            }
            if (customerCpd.getTaxNo1()!= null) {
                row.field("TAX_NO_1", "STCD1", customerCpd.getTaxNo1());
            }
            if (customerCpd.getTaxNo2()!= null) {
                row.field("TAX_NO_2", "STCD2", customerCpd.getTaxNo2());
            }
            if (customerCpd.getTaxNo3()!= null) {
                row.field("TAX_NO_3", "STCD3", customerCpd.getTaxNo3());
            }
            if (customerCpd.getTaxNo4()!= null) {
                row.field("TAX_NO_4", "STCD4", customerCpd.getTaxNo4());
            }
            if (customerCpd.getTaxNo5()!= null) {
                row.field("TAX_NO_5", "STCD5", customerCpd.getTaxNo5());
            }
            if (customerCpd.getTitle()!= null) {
                row.field("TITLE", "ANRED", customerCpd.getTitle());
            }
            row.end();
        }
        if (contractHeader!= null) {
            final ParameterFields row = query.withExportingFields("CONTRACTHEADER", "BAPIACCAHD");
            if (contractHeader.getDocNo()!= null) {
                row.field("DOC_NO", "ACPI_DOC_NO", contractHeader.getDocNo());
            }
            if (contractHeader.getDocTypeCa()!= null) {
                row.field("DOC_TYPE_CA", "ACPI_DOC_TYPE_CA", contractHeader.getDocTypeCa());
            }
            if (contractHeader.getFikey()!= null) {
                row.field("FIKEY", "ACPI_FIKEY", contractHeader.getFikey());
            }
            if (contractHeader.getPaymentFormRef()!= null) {
                row.field("PAYMENT_FORM_REF", "ACPI_PMNT_FORM_REF", contractHeader.getPaymentFormRef());
            }
            if (contractHeader.getResKey()!= null) {
                row.field("RES_KEY", "ACPI_RES_KEY", contractHeader.getResKey());
            }
            row.end();
        }
        if ((accountGl!= null)&&accountGl.iterator().hasNext()) {
            final Table table = query.withTable("ACCOUNTGL", "BAPIACGL09");
            for (GlAccountItem item: accountGl) {
                final TableRow row = table.row();
                if (item.getAcctKey()!= null) {
                    row.field("ACCT_KEY", "KTOSL", item.getAcctKey());
                }
                if (item.getAcctType()!= null) {
                    row.field("ACCT_TYPE", "KOART", item.getAcctType());
                }
                if (item.getAcritemType()!= null) {
                    row.field("ACRITEM_TYPE", "ACR_ITEM_TYPE", item.getAcritemType());
                }
                if (item.getAcrobjId()!= null) {
                    row.field("ACROBJ_ID", "ACR_OBJ_ID", item.getAcrobjId());
                }
                if (item.getAcrobjType()!= null) {
                    row.field("ACROBJ_TYPE", "ACR_OBJ_TYPE", item.getAcrobjType());
                }
                if (item.getAcrsubobjId()!= null) {
                    row.field("ACRSUBOBJ_ID", "ACR_SUBOBJ_ID", item.getAcrsubobjId());
                }
                if (item.getActivity()!= null) {
                    row.field("ACTIVITY", "VORNR", item.getActivity());
                }
                if (item.getActtype()!= null) {
                    row.field("ACTTYPE", "LSTAR", item.getActtype());
                }
                if (item.getAcDocNo()!= null) {
                    row.field("AC_DOC_NO", "BELNR_D", item.getAcDocNo());
                }
                if (item.getAllocNmbr()!= null) {
                    row.field("ALLOC_NMBR", "ACPI_ZUONR", item.getAllocNmbr());
                }
                if (item.getAssetNo()!= null) {
                    row.field("ASSET_NO", "ANLN1", item.getAssetNo());
                }
                if (item.getAsvalDate()!= null) {
                    row.field("ASVAL_DATE", "BF_BZDAT", item.getAsvalDate());
                }
                if (item.getBaseUom()!= null) {
                    row.field("BASE_UOM", "MEINS", item.getBaseUom());
                }
                if (item.getBaseUomIso()!= null) {
                    row.field("BASE_UOM_ISO", "MEINS_ISO", item.getBaseUomIso());
                }
                if (item.getBillingPeriodEndDate()!= null) {
                    row.field("BILLING_PERIOD_END_DATE", "FM_PEROP_FI_HIGH", item.getBillingPeriodEndDate());
                }
                if (item.getBillingPeriodStartDate()!= null) {
                    row.field("BILLING_PERIOD_START_DATE", "FM_PEROP_FI_LOW", item.getBillingPeriodStartDate());
                }
                if (item.getBillType()!= null) {
                    row.field("BILL_TYPE", "FKART", item.getBillType());
                }
                if (item.getBudgetPeriod()!= null) {
                    row.field("BUDGET_PERIOD", "FM_BUDGET_PERIOD", item.getBudgetPeriod());
                }
                if (item.getBusArea()!= null) {
                    row.field("BUS_AREA", "GSBER", item.getBusArea());
                }
                if (item.getBusScenario()!= null) {
                    row.field("BUS_SCENARIO", "ACPI_IAOM_BS_ID", item.getBusScenario());
                }
                if (item.getCmmtItem()!= null) {
                    row.field("CMMT_ITEM", "FIPOS", item.getCmmtItem());
                }
                if (item.getCmmtItemLong()!= null) {
                    row.field("CMMT_ITEM_LONG", "FM_FIPEX", item.getCmmtItemLong());
                }
                if (item.getCompCode()!= null) {
                    row.field("COMP_CODE", "BUKRS", item.getCompCode());
                }
                if (item.getCondCategory()!= null) {
                    row.field("COND_CATEGORY", "ACPI_KNTYP", item.getCondCategory());
                }
                if (item.getCondCount()!= null) {
                    row.field("COND_COUNT", "ACPI_DZAEHK", item.getCondCount());
                }
                if (item.getCondStNo()!= null) {
                    row.field("COND_ST_NO", "ACPI_STUNR", item.getCondStNo());
                }
                if (item.getCondType()!= null) {
                    row.field("COND_TYPE", "KSCHA", item.getCondType());
                }
                if (item.getCostcenter()!= null) {
                    row.field("COSTCENTER", "KOSTL", item.getCostcenter());
                }
                if (item.getCostobject()!= null) {
                    row.field("COSTOBJECT", "KSTRG", item.getCostobject());
                }
                if (item.getCoBusproc()!= null) {
                    row.field("CO_BUSPROC", "CO_PRZNR", item.getCoBusproc());
                }
                if (item.getCshdisInd()!= null) {
                    row.field("CSHDIS_IND", "XSKRL", item.getCshdisInd());
                }
                if (item.getCsTransT()!= null) {
                    row.field("CS_TRANS_T", "RMVCT", item.getCsTransT());
                }
                if (item.getCustomer()!= null) {
                    row.field("CUSTOMER", "KUNNR", item.getCustomer());
                }
                if (item.getDeCreInd()!= null) {
                    row.field("DE_CRE_IND", "ACPI_TBTKZ", item.getDeCreInd());
                }
                if (item.getDistrChan()!= null) {
                    row.field("DISTR_CHAN", "VTWEG", item.getDistrChan());
                }
                if (item.getDivision()!= null) {
                    row.field("DIVISION", "SPART", item.getDivision());
                }
                if (item.getDocType()!= null) {
                    row.field("DOC_TYPE", "BLART", item.getDocType());
                }
                if (item.getEntryQnt()!= null) {
                    row.field("ENTRY_QNT", "ERFMG", item.getEntryQnt());
                }
                if (item.getEntryUom()!= null) {
                    row.field("ENTRY_UOM", "ERFME", item.getEntryUom());
                }
                if (item.getEntryUomIso()!= null) {
                    row.field("ENTRY_UOM_ISO", "ERFME_ISO", item.getEntryUomIso());
                }
                if (item.getExpenseType()!= null) {
                    row.field("EXPENSE_TYPE", "GTR_CRM_EXPENSE_CAT", item.getExpenseType());
                }
                if (item.getExtObjectId()!= null) {
                    row.field("EXT_OBJECT_ID", "ACPI_IAOM_EO_ID", item.getExtObjectId());
                }
                if (item.getFastpay()!= null) {
                    row.field("FASTPAY", "FMFG_FASTPAY_FLG", item.getFastpay());
                }
                if (item.getFiscYear()!= null) {
                    row.field("FISC_YEAR", "GJAHR", item.getFiscYear());
                }
                if (item.getFisPeriod()!= null) {
                    row.field("FIS_PERIOD", "MONAT", item.getFisPeriod());
                }
                if (item.getFmArea()!= null) {
                    row.field("FM_AREA", "FIKRS", item.getFmArea());
                }
                if (item.getFuncArea()!= null) {
                    row.field("FUNC_AREA", "FKBER_SHORT", item.getFuncArea());
                }
                if (item.getFuncAreaLong()!= null) {
                    row.field("FUNC_AREA_LONG", "FKBER", item.getFuncAreaLong());
                }
                if (item.getFund()!= null) {
                    row.field("FUND", "BP_GEBER", item.getFund());
                }
                if (item.getFundsCtr()!= null) {
                    row.field("FUNDS_CTR", "FISTL", item.getFundsCtr());
                }
                if (item.getGlAccount()!= null) {
                    row.field("GL_ACCOUNT", "HKONT", item.getGlAccount());
                }
                if (item.getGrantNbr()!= null) {
                    row.field("GRANT_NBR", "GM_GRANT_NBR", item.getGrantNbr());
                }
                if (item.getGrossWt()!= null) {
                    row.field("GROSS_WT", "ACPI_BRGEW_15", item.getGrossWt());
                }
                if (item.getHousebankacctid()!= null) {
                    row.field("HOUSEBANKACCTID", "HKTID", item.getHousebankacctid());
                }
                if (item.getHousebankid()!= null) {
                    row.field("HOUSEBANKID", "HBKID", item.getHousebankid());
                }
                if (item.getInvQty()!= null) {
                    row.field("INV_QTY", "ACPI_FKIMG", item.getInvQty());
                }
                if (item.getInvQtySu()!= null) {
                    row.field("INV_QTY_SU", "ACPI_FKLMG", item.getInvQtySu());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getItemnoTax()!= null) {
                    row.field("ITEMNO_TAX", "TAXPS", item.getItemnoTax());
                }
                if (item.getItemCat()!= null) {
                    row.field("ITEM_CAT", "ACPI_PSTYP", item.getItemCat());
                }
                if (item.getItemText()!= null) {
                    row.field("ITEM_TEXT", "SGTXT", item.getItemText());
                }
                if (item.getItmNumber()!= null) {
                    row.field("ITM_NUMBER", "POSNR", item.getItmNumber());
                }
                if (item.getLogProc()!= null) {
                    row.field("LOG_PROC", "LOGVO", item.getLogProc());
                }
                if (item.getMaterial()!= null) {
                    row.field("MATERIAL", "MATNR18", item.getMaterial());
                }
                if (item.getMaterialLong()!= null) {
                    row.field("MATERIAL_LONG", "MATNR40", item.getMaterialLong());
                }
                if (item.getMatlType()!= null) {
                    row.field("MATL_TYPE", "ACPI_MTART", item.getMatlType());
                }
                if (item.getMeasure()!= null) {
                    row.field("MEASURE", "FM_MEASURE", item.getMeasure());
                }
                if (item.getMvtInd()!= null) {
                    row.field("MVT_IND", "KZBEW", item.getMvtInd());
                }
                if (item.getNetwork()!= null) {
                    row.field("NETWORK", "NPLNR", item.getNetwork());
                }
                if (item.getNetWeight()!= null) {
                    row.field("NET_WEIGHT", "ACPI_NTGEW_15", item.getNetWeight());
                }
                if (item.getOrderid()!= null) {
                    row.field("ORDERID", "AUFNR", item.getOrderid());
                }
                if (item.getOrderItno()!= null) {
                    row.field("ORDER_ITNO", "CO_POSNR", item.getOrderItno());
                }
                if (item.getOrigGroup()!= null) {
                    row.field("ORIG_GROUP", "HRKFT", item.getOrigGroup());
                }
                if (item.getOrigMat()!= null) {
                    row.field("ORIG_MAT", "HKMAT", item.getOrigMat());
                }
                if (item.getPartnerBudgetPeriod()!= null) {
                    row.field("PARTNER_BUDGET_PERIOD", "FM_PBUDGET_PERIOD", item.getPartnerBudgetPeriod());
                }
                if (item.getPartnerFund()!= null) {
                    row.field("PARTNER_FUND", "FM_PFUND", item.getPartnerFund());
                }
                if (item.getPartnerGrantNbr()!= null) {
                    row.field("PARTNER_GRANT_NBR", "GM_PGRANT_NBR", item.getPartnerGrantNbr());
                }
                if (item.getPartnerSegment()!= null) {
                    row.field("PARTNER_SEGMENT", "FB_PSEGMENT", item.getPartnerSegment());
                }
                if (item.getPartAcct()!= null) {
                    row.field("PART_ACCT", "JV_PART", item.getPartAcct());
                }
                if (item.getPartPrctr()!= null) {
                    row.field("PART_PRCTR", "PPRCTR", item.getPartPrctr());
                }
                if (item.getPaymentType()!= null) {
                    row.field("PAYMENT_TYPE", "GTR_CRM_PAYMENT_TYPE", item.getPaymentType());
                }
                if (item.getPersonNo()!= null) {
                    row.field("PERSON_NO", "PERNR_D", item.getPersonNo());
                }
                if (item.getPlant()!= null) {
                    row.field("PLANT", "WERKS_D", item.getPlant());
                }
                if (item.getPoItem()!= null) {
                    row.field("PO_ITEM", "EBELP", item.getPoItem());
                }
                if (item.getPoNumber()!= null) {
                    row.field("PO_NUMBER", "EBELN", item.getPoNumber());
                }
                if (item.getPoPrQnt()!= null) {
                    row.field("PO_PR_QNT", "ACPI_BPMNG", item.getPoPrQnt());
                }
                if (item.getPoPrUom()!= null) {
                    row.field("PO_PR_UOM", "ACPI_BPRME", item.getPoPrUom());
                }
                if (item.getPoPrUomIso()!= null) {
                    row.field("PO_PR_UOM_ISO", "BPRME_ISO", item.getPoPrUomIso());
                }
                if (item.getPpaExInd()!= null) {
                    row.field("PPA_EX_IND", "EXCLUDE_FLG", item.getPpaExInd());
                }
                if (item.getProfitCtr()!= null) {
                    row.field("PROFIT_CTR", "PRCTR", item.getProfitCtr());
                }
                if (item.getProgramProfile()!= null) {
                    row.field("PROGRAM_PROFILE", "GTR_CRM_PROG_PROFILE", item.getProgramProfile());
                }
                if (item.getPstngDate()!= null) {
                    row.field("PSTNG_DATE", "BUDAT", item.getPstngDate());
                }
                if (item.getPElPrctr()!= null) {
                    row.field("P_EL_PRCTR", "ACPI_EPRCTR", item.getPElPrctr());
                }
                if (item.getQuantity()!= null) {
                    row.field("QUANTITY", "MENGE_D", item.getQuantity());
                }
                if (item.getRefKey1()!= null) {
                    row.field("REF_KEY_1", "XREF1", item.getRefKey1());
                }
                if (item.getRefKey2()!= null) {
                    row.field("REF_KEY_2", "XREF2", item.getRefKey2());
                }
                if (item.getRefKey3()!= null) {
                    row.field("REF_KEY_3", "XREF3", item.getRefKey3());
                }
                if (item.getResDoc()!= null) {
                    row.field("RES_DOC", "KBLNR", item.getResDoc());
                }
                if (item.getResItem()!= null) {
                    row.field("RES_ITEM", "KBLPOS", item.getResItem());
                }
                if (item.getRevalInd()!= null) {
                    row.field("REVAL_IND", "ACPI_XUMBW", item.getRevalInd());
                }
                if (item.getRoutingNo()!= null) {
                    row.field("ROUTING_NO", "CO_AUFPL", item.getRoutingNo());
                }
                if (item.getSalesorg()!= null) {
                    row.field("SALESORG", "VKORG", item.getSalesorg());
                }
                if (item.getSalesGrp()!= null) {
                    row.field("SALES_GRP", "VKGRP", item.getSalesGrp());
                }
                if (item.getSalesOff()!= null) {
                    row.field("SALES_OFF", "VKBUR", item.getSalesOff());
                }
                if (item.getSalesOrd()!= null) {
                    row.field("SALES_ORD", "KDAUF", item.getSalesOrd());
                }
                if (item.getSalesUnit()!= null) {
                    row.field("SALES_UNIT", "VRKME", item.getSalesUnit());
                }
                if (item.getSalesUnitIso()!= null) {
                    row.field("SALES_UNIT_ISO", "ACPI_VRKME_ISO", item.getSalesUnitIso());
                }
                if (item.getSegment()!= null) {
                    row.field("SEGMENT", "FB_SEGMENT", item.getSegment());
                }
                if (item.getSerialNo()!= null) {
                    row.field("SERIAL_NO", "ACPI_DZEKKN", item.getSerialNo());
                }
                if (item.getSoldTo()!= null) {
                    row.field("SOLD_TO", "KUNAG", item.getSoldTo());
                }
                if (item.getStatCon()!= null) {
                    row.field("STAT_CON", "ACPI_KSTAZ", item.getStatCon());
                }
                if (item.getSubNumber()!= null) {
                    row.field("SUB_NUMBER", "ANLN2", item.getSubNumber());
                }
                if (item.getSOrdItem()!= null) {
                    row.field("S_ORD_ITEM", "KDPOS", item.getSOrdItem());
                }
                if (item.getTaxjurcode()!= null) {
                    row.field("TAXJURCODE", "TXJCD", item.getTaxjurcode());
                }
                if (item.getTaxCalcDate()!= null) {
                    row.field("TAX_CALC_DATE", "TXDAT", item.getTaxCalcDate());
                }
                if (item.getTaxCalcDtFrom()!= null) {
                    row.field("TAX_CALC_DT_FROM", "FOT_TXDAT_FROM", item.getTaxCalcDtFrom());
                }
                if (item.getTaxCode()!= null) {
                    row.field("TAX_CODE", "MWSKZ", item.getTaxCode());
                }
                if (item.getTradeId()!= null) {
                    row.field("TRADE_ID", "RASSC", item.getTradeId());
                }
                if (item.getTrPartBa()!= null) {
                    row.field("TR_PART_BA", "PARGB", item.getTrPartBa());
                }
                if (item.getUnitOfWt()!= null) {
                    row.field("UNIT_OF_WT", "ACPI_GEWEI", item.getUnitOfWt());
                }
                if (item.getUnitOfWtIso()!= null) {
                    row.field("UNIT_OF_WT_ISO", "ACPI_GEWEI_ISO", item.getUnitOfWtIso());
                }
                if (item.getValobjtype()!= null) {
                    row.field("VALOBJTYPE", "VAL_OBJ_TYPE", item.getValobjtype());
                }
                if (item.getValobjId()!= null) {
                    row.field("VALOBJ_ID", "VAL_OBJ_ID", item.getValobjId());
                }
                if (item.getValsubobjId()!= null) {
                    row.field("VALSUBOBJ_ID", "VAL_SUBOBJ_ID", item.getValsubobjId());
                }
                if (item.getValueDate()!= null) {
                    row.field("VALUE_DATE", "VALUT", item.getValueDate());
                }
                if (item.getValArea()!= null) {
                    row.field("VAL_AREA", "BWKEY", item.getValArea());
                }
                if (item.getValType()!= null) {
                    row.field("VAL_TYPE", "BWTAR_D", item.getValType());
                }
                if (item.getVendorNo()!= null) {
                    row.field("VENDOR_NO", "LIFNR", item.getVendorNo());
                }
                if (item.getVolume()!= null) {
                    row.field("VOLUME", "ACPI_VOLUM_15", item.getVolume());
                }
                if (item.getVolumeunit()!= null) {
                    row.field("VOLUMEUNIT", "ACPI_VOLEH", item.getVolumeunit());
                }
                if (item.getVolumeunitIso()!= null) {
                    row.field("VOLUMEUNIT_ISO", "ACPI_VOLEH_ISO", item.getVolumeunitIso());
                }
                if (item.getWbsElement()!= null) {
                    row.field("WBS_ELEMENT", "PS_POSID", item.getWbsElement());
                }
                if (item.getXmfrw()!= null) {
                    row.field("XMFRW", "ACPI_XMFRW", item.getXmfrw());
                }
            }
            table.end();
        }
        if ((accountReceivable!= null)&&accountReceivable.iterator().hasNext()) {
            final Table table = query.withTable("ACCOUNTRECEIVABLE", "BAPIACAR09");
            for (CustomerItem item: accountReceivable) {
                final TableRow row = table.row();
                if (item.getAllocNmbr()!= null) {
                    row.field("ALLOC_NMBR", "ACPI_ZUONR", item.getAllocNmbr());
                }
                if (item.getAltPayee()!= null) {
                    row.field("ALT_PAYEE", "VVABWZE", item.getAltPayee());
                }
                if (item.getAltPayeeBank()!= null) {
                    row.field("ALT_PAYEE_BANK", "VVBVTYPABW", item.getAltPayeeBank());
                }
                if (item.getBankId()!= null) {
                    row.field("BANK_ID", "HBKID", item.getBankId());
                }
                if (item.getBlineDate()!= null) {
                    row.field("BLINE_DATE", "ACPI_ZFBDT", item.getBlineDate());
                }
                if (item.getBranch()!= null) {
                    row.field("BRANCH", "ACPI_FILKD", item.getBranch());
                }
                if (item.getBudgetPeriod()!= null) {
                    row.field("BUDGET_PERIOD", "FM_BUDGET_PERIOD", item.getBudgetPeriod());
                }
                if (item.getBusinessplace()!= null) {
                    row.field("BUSINESSPLACE", "ACPI_BRANCH", item.getBusinessplace());
                }
                if (item.getBusArea()!= null) {
                    row.field("BUS_AREA", "GSBER", item.getBusArea());
                }
                if (item.getCaseGuid()!= null) {
                    row.field("CASE_GUID", "SCMG_CASE_GUID", item.getCaseGuid());
                }
                if (item.getCompCode()!= null) {
                    row.field("COMP_CODE", "BUKRS", item.getCompCode());
                }
                if (item.getCustomer()!= null) {
                    row.field("CUSTOMER", "KUNNR", item.getCustomer());
                }
                if (item.getCCtrArea()!= null) {
                    row.field("C_CTR_AREA", "ACPI_KKBER", item.getCCtrArea());
                }
                if (item.getDisputeIfType()!= null) {
                    row.field("DISPUTE_IF_TYPE", "DISPUTE_IF_TYPE", item.getDisputeIfType());
                }
                if (item.getDsctDays1()!= null) {
                    row.field("DSCT_DAYS1", "ACPI_ZBD1T", item.getDsctDays1());
                }
                if (item.getDsctDays2()!= null) {
                    row.field("DSCT_DAYS2", "ACPI_ZBD2T", item.getDsctDays2());
                }
                if (item.getDsctPct1()!= null) {
                    row.field("DSCT_PCT1", "ACPI_ZBD1P", item.getDsctPct1());
                }
                if (item.getDsctPct2()!= null) {
                    row.field("DSCT_PCT2", "ACPI_ZBD2P", item.getDsctPct2());
                }
                if (item.getDunnArea()!= null) {
                    row.field("DUNN_AREA", "ACPI_MABER", item.getDunnArea());
                }
                if (item.getDunnBlock()!= null) {
                    row.field("DUNN_BLOCK", "ACPI_MANSP", item.getDunnBlock());
                }
                if (item.getDunnKey()!= null) {
                    row.field("DUNN_KEY", "ACPI_MSCHL", item.getDunnKey());
                }
                if (item.getFund()!= null) {
                    row.field("FUND", "BP_GEBER", item.getFund());
                }
                if (item.getFundLong()!= null) {
                    row.field("FUND_LONG", "FM_FUND_LONG", item.getFundLong());
                }
                if (item.getGlAccount()!= null) {
                    row.field("GL_ACCOUNT", "HKONT", item.getGlAccount());
                }
                if (item.getGrantNbr()!= null) {
                    row.field("GRANT_NBR", "GM_GRANT_NBR", item.getGrantNbr());
                }
                if (item.getHousebankacctid()!= null) {
                    row.field("HOUSEBANKACCTID", "HKTID", item.getHousebankacctid());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getItemText()!= null) {
                    row.field("ITEM_TEXT", "SGTXT", item.getItemText());
                }
                if (item.getMeasure()!= null) {
                    row.field("MEASURE", "FM_MEASURE", item.getMeasure());
                }
                if (item.getNetterms()!= null) {
                    row.field("NETTERMS", "ACPI_ZBD3T", item.getNetterms());
                }
                if (item.getPartnerBk()!= null) {
                    row.field("PARTNER_BK", "BVTYP", item.getPartnerBk());
                }
                if (item.getPartnerGuid()!= null) {
                    row.field("PARTNER_GUID", "ACPI_GC_PARTNEG", item.getPartnerGuid());
                }
                if (item.getPartBusinessplace()!= null) {
                    row.field("PART_BUSINESSPLACE", "BCODE", item.getPartBusinessplace());
                }
                if (item.getPaymtRef()!= null) {
                    row.field("PAYMT_REF", "ACPI_KIDNO", item.getPaymtRef());
                }
                if (item.getPaysProv()!= null) {
                    row.field("PAYS_PROV", "COM_WEC_PAYMENT_SRV_PROVIDER", item.getPaysProv());
                }
                if (item.getPaysTran()!= null) {
                    row.field("PAYS_TRAN", "FPS_TRANSACTION", item.getPaysTran());
                }
                if (item.getPmnttrms()!= null) {
                    row.field("PMNTTRMS", "ACPI_ZTERM", item.getPmnttrms());
                }
                if (item.getPmntBlock()!= null) {
                    row.field("PMNT_BLOCK", "ACPI_ZLSPR", item.getPmntBlock());
                }
                if (item.getPmtmthsupl()!= null) {
                    row.field("PMTMTHSUPL", "UZAWE", item.getPmtmthsupl());
                }
                if (item.getProfitCtr()!= null) {
                    row.field("PROFIT_CTR", "PRCTR", item.getProfitCtr());
                }
                if (item.getPymtAmt()!= null) {
                    row.field("PYMT_AMT", "ACPI_PYAMT", item.getPymtAmt());
                }
                if (item.getPymtAmtLong()!= null) {
                    row.field("PYMT_AMT_LONG", "ACPI_PYAMT_31", item.getPymtAmtLong());
                }
                if (item.getPymtCur()!= null) {
                    row.field("PYMT_CUR", "ACPI_PYCUR", item.getPymtCur());
                }
                if (item.getPymtCurIso()!= null) {
                    row.field("PYMT_CUR_ISO", "WAERS_ISO", item.getPymtCurIso());
                }
                if (item.getPymtMeth()!= null) {
                    row.field("PYMT_METH", "ACPI_ZLSCH", item.getPymtMeth());
                }
                if (item.getRefKey1()!= null) {
                    row.field("REF_KEY_1", "XREF1", item.getRefKey1());
                }
                if (item.getRefKey2()!= null) {
                    row.field("REF_KEY_2", "XREF2", item.getRefKey2());
                }
                if (item.getRefKey3()!= null) {
                    row.field("REF_KEY_3", "XREF3", item.getRefKey3());
                }
                if (item.getRepCountryEu()!= null) {
                    row.field("REP_COUNTRY_EU", "EGMLD_BSEZ", item.getRepCountryEu());
                }
                if (item.getResDoc()!= null) {
                    row.field("RES_DOC", "KBLNR", item.getResDoc());
                }
                if (item.getResItem()!= null) {
                    row.field("RES_ITEM", "KBLPOS", item.getResItem());
                }
                if (item.getSalesOrd()!= null) {
                    row.field("SALES_ORD", "KDAUF", item.getSalesOrd());
                }
                if (item.getScbankInd()!= null) {
                    row.field("SCBANK_IND", "LZBKZ", item.getScbankInd());
                }
                if (item.getSectioncode()!= null) {
                    row.field("SECTIONCODE", "ACPI_SECCO1", item.getSectioncode());
                }
                if (item.getSepaMandateId()!= null) {
                    row.field("SEPA_MANDATE_ID", "SEPA_MNDID", item.getSepaMandateId());
                }
                if (item.getSpGlInd()!= null) {
                    row.field("SP_GL_IND", "ACPI_UMSKZ", item.getSpGlInd());
                }
                if (item.getSupcountry()!= null) {
                    row.field("SUPCOUNTRY", "LANDL", item.getSupcountry());
                }
                if (item.getSupcountryIso()!= null) {
                    row.field("SUPCOUNTRY_ISO", "LANDL_ISO", item.getSupcountryIso());
                }
                if (item.getSOrdItem()!= null) {
                    row.field("S_ORD_ITEM", "KDPOS", item.getSOrdItem());
                }
                if (item.getTaxjurcode()!= null) {
                    row.field("TAXJURCODE", "TXJCD", item.getTaxjurcode());
                }
                if (item.getTaxCode()!= null) {
                    row.field("TAX_CODE", "MWSKZ", item.getTaxCode());
                }
                if (item.getTaxDate()!= null) {
                    row.field("TAX_DATE", "ACPI_TXDAT", item.getTaxDate());
                }
                if (item.getVatRegNo()!= null) {
                    row.field("VAT_REG_NO", "STCEG", item.getVatRegNo());
                }
            }
            table.end();
        }
        if ((accountPayable!= null)&&accountPayable.iterator().hasNext()) {
            final Table table = query.withTable("ACCOUNTPAYABLE", "BAPIACAP09");
            for (VendorItem item: accountPayable) {
                final TableRow row = table.row();
                if (item.getAllocNmbr()!= null) {
                    row.field("ALLOC_NMBR", "ACPI_ZUONR", item.getAllocNmbr());
                }
                if (item.getAltPayee()!= null) {
                    row.field("ALT_PAYEE", "VVABWZE", item.getAltPayee());
                }
                if (item.getAltPayeeBank()!= null) {
                    row.field("ALT_PAYEE_BANK", "VVBVTYPABW", item.getAltPayeeBank());
                }
                if (item.getBankId()!= null) {
                    row.field("BANK_ID", "HBKID", item.getBankId());
                }
                if (item.getBlineDate()!= null) {
                    row.field("BLINE_DATE", "ACPI_ZFBDT", item.getBlineDate());
                }
                if (item.getBllsrvInd()!= null) {
                    row.field("BLLSRV_IND", "DIEKZ", item.getBllsrvInd());
                }
                if (item.getBranch()!= null) {
                    row.field("BRANCH", "ACPI_FILKD", item.getBranch());
                }
                if (item.getBudgetPeriod()!= null) {
                    row.field("BUDGET_PERIOD", "FM_BUDGET_PERIOD", item.getBudgetPeriod());
                }
                if (item.getBusinessplace()!= null) {
                    row.field("BUSINESSPLACE", "ACPI_BRANCH", item.getBusinessplace());
                }
                if (item.getBusArea()!= null) {
                    row.field("BUS_AREA", "GSBER", item.getBusArea());
                }
                if (item.getCompCode()!= null) {
                    row.field("COMP_CODE", "BUKRS", item.getCompCode());
                }
                if (item.getDsctDays1()!= null) {
                    row.field("DSCT_DAYS1", "ACPI_ZBD1T", item.getDsctDays1());
                }
                if (item.getDsctDays2()!= null) {
                    row.field("DSCT_DAYS2", "ACPI_ZBD2T", item.getDsctDays2());
                }
                if (item.getDsctPct1()!= null) {
                    row.field("DSCT_PCT1", "ACPI_ZBD1P", item.getDsctPct1());
                }
                if (item.getDsctPct2()!= null) {
                    row.field("DSCT_PCT2", "ACPI_ZBD2P", item.getDsctPct2());
                }
                if (item.getFund()!= null) {
                    row.field("FUND", "BP_GEBER", item.getFund());
                }
                if (item.getGlAccount()!= null) {
                    row.field("GL_ACCOUNT", "HKONT", item.getGlAccount());
                }
                if (item.getGrantNbr()!= null) {
                    row.field("GRANT_NBR", "GM_GRANT_NBR", item.getGrantNbr());
                }
                if (item.getHousebankacctid()!= null) {
                    row.field("HOUSEBANKACCTID", "HKTID", item.getHousebankacctid());
                }
                if (item.getInstr1()!= null) {
                    row.field("INSTR1", "DTAT16", item.getInstr1());
                }
                if (item.getInstr2()!= null) {
                    row.field("INSTR2", "DTAT17", item.getInstr2());
                }
                if (item.getInstr3()!= null) {
                    row.field("INSTR3", "DTAT18", item.getInstr3());
                }
                if (item.getInstr4()!= null) {
                    row.field("INSTR4", "DTAT19", item.getInstr4());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getItemText()!= null) {
                    row.field("ITEM_TEXT", "SGTXT", item.getItemText());
                }
                if (item.getMeasure()!= null) {
                    row.field("MEASURE", "FM_MEASURE", item.getMeasure());
                }
                if (item.getNetterms()!= null) {
                    row.field("NETTERMS", "ACPI_ZBD3T", item.getNetterms());
                }
                if (item.getPartnerBk()!= null) {
                    row.field("PARTNER_BK", "BVTYP", item.getPartnerBk());
                }
                if (item.getPartnerGuid()!= null) {
                    row.field("PARTNER_GUID", "ACPI_GC_PARTNEG", item.getPartnerGuid());
                }
                if (item.getPartBusinessplace()!= null) {
                    row.field("PART_BUSINESSPLACE", "BCODE", item.getPartBusinessplace());
                }
                if (item.getPaymtRef()!= null) {
                    row.field("PAYMT_REF", "ACPI_KIDNO", item.getPaymtRef());
                }
                if (item.getPmnttrms()!= null) {
                    row.field("PMNTTRMS", "ACPI_ZTERM", item.getPmnttrms());
                }
                if (item.getPmntBlock()!= null) {
                    row.field("PMNT_BLOCK", "ACPI_ZLSPR", item.getPmntBlock());
                }
                if (item.getPmtmthsupl()!= null) {
                    row.field("PMTMTHSUPL", "UZAWE", item.getPmtmthsupl());
                }
                if (item.getPoCheckdg()!= null) {
                    row.field("PO_CHECKDG", "ESRPZ", item.getPoCheckdg());
                }
                if (item.getPoRefNo()!= null) {
                    row.field("PO_REF_NO", "ESRRE", item.getPoRefNo());
                }
                if (item.getPoSubNo()!= null) {
                    row.field("PO_SUB_NO", "ESRNR", item.getPoSubNo());
                }
                if (item.getPpaExInd()!= null) {
                    row.field("PPA_EX_IND", "EXCLUDE_FLG", item.getPpaExInd());
                }
                if (item.getProfitCtr()!= null) {
                    row.field("PROFIT_CTR", "PRCTR", item.getProfitCtr());
                }
                if (item.getPymtAmt()!= null) {
                    row.field("PYMT_AMT", "ACPI_PYAMT", item.getPymtAmt());
                }
                if (item.getPymtAmtLong()!= null) {
                    row.field("PYMT_AMT_LONG", "ACPI_PYAMT_31", item.getPymtAmtLong());
                }
                if (item.getPymtCur()!= null) {
                    row.field("PYMT_CUR", "ACPI_PYCUR", item.getPymtCur());
                }
                if (item.getPymtCurIso()!= null) {
                    row.field("PYMT_CUR_ISO", "WAERS_ISO", item.getPymtCurIso());
                }
                if (item.getPymtMeth()!= null) {
                    row.field("PYMT_METH", "ACPI_ZLSCH", item.getPymtMeth());
                }
                if (item.getRefKey1()!= null) {
                    row.field("REF_KEY_1", "XREF1", item.getRefKey1());
                }
                if (item.getRefKey2()!= null) {
                    row.field("REF_KEY_2", "XREF2", item.getRefKey2());
                }
                if (item.getRefKey3()!= null) {
                    row.field("REF_KEY_3", "XREF3", item.getRefKey3());
                }
                if (item.getScbankInd()!= null) {
                    row.field("SCBANK_IND", "LZBKZ", item.getScbankInd());
                }
                if (item.getSectioncode()!= null) {
                    row.field("SECTIONCODE", "ACPI_SECCO1", item.getSectioncode());
                }
                if (item.getSpGlInd()!= null) {
                    row.field("SP_GL_IND", "ACPI_UMSKZ", item.getSpGlInd());
                }
                if (item.getSupcountry()!= null) {
                    row.field("SUPCOUNTRY", "LANDL", item.getSupcountry());
                }
                if (item.getSupcountryIso()!= null) {
                    row.field("SUPCOUNTRY_ISO", "LANDL_ISO", item.getSupcountryIso());
                }
                if (item.getTaxjurcode()!= null) {
                    row.field("TAXJURCODE", "TXJCD", item.getTaxjurcode());
                }
                if (item.getTaxCode()!= null) {
                    row.field("TAX_CODE", "MWSKZ", item.getTaxCode());
                }
                if (item.getTaxDate()!= null) {
                    row.field("TAX_DATE", "ACPI_TXDAT", item.getTaxDate());
                }
                if (item.getVendorNo()!= null) {
                    row.field("VENDOR_NO", "LIFNR", item.getVendorNo());
                }
                if (item.getWTaxCode()!= null) {
                    row.field("W_TAX_CODE", "ACPI_QSSKZ", item.getWTaxCode());
                }
            }
            table.end();
        }
        if ((accountTax!= null)&&accountTax.iterator().hasNext()) {
            final Table table = query.withTable("ACCOUNTTAX", "BAPIACTX09");
            for (TaxItem item: accountTax) {
                final TableRow row = table.row();
                if (item.getAcctKey()!= null) {
                    row.field("ACCT_KEY", "KTOSL", item.getAcctKey());
                }
                if (item.getCondKey()!= null) {
                    row.field("COND_KEY", "KSCHL", item.getCondKey());
                }
                if (item.getDirectTax()!= null) {
                    row.field("DIRECT_TAX", "BAPI_FLG_DIR", item.getDirectTax());
                }
                if (item.getGlAccount()!= null) {
                    row.field("GL_ACCOUNT", "HKONT", item.getGlAccount());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getItemnoTax()!= null) {
                    row.field("ITEMNO_TAX", "TAXPS", item.getItemnoTax());
                }
                if (item.getTaxjurcode()!= null) {
                    row.field("TAXJURCODE", "TXJCD", item.getTaxjurcode());
                }
                if (item.getTaxjurcodeDeep()!= null) {
                    row.field("TAXJURCODE_DEEP", "ACPI_TXJCD_DEEP", item.getTaxjurcodeDeep());
                }
                if (item.getTaxjurcodeLevel()!= null) {
                    row.field("TAXJURCODE_LEVEL", "ACPI_TXJCD_LEVEL", item.getTaxjurcodeLevel());
                }
                if (item.getTaxCalcDtFrom()!= null) {
                    row.field("TAX_CALC_DT_FROM", "FOT_TXDAT_FROM", item.getTaxCalcDtFrom());
                }
                if (item.getTaxCode()!= null) {
                    row.field("TAX_CODE", "MWSKZ", item.getTaxCode());
                }
                if (item.getTaxDate()!= null) {
                    row.field("TAX_DATE", "ACPI_TXDAT", item.getTaxDate());
                }
                if (item.getTaxRate()!= null) {
                    row.field("TAX_RATE", "MSATZ_F05L", item.getTaxRate());
                }
            }
            table.end();
        }
        if (currencyAmount.iterator().hasNext()) {
            final Table table = query.withTable("CURRENCYAMOUNT", "BAPIACCR09");
            for (CurrencyItem item: currencyAmount) {
                final TableRow row = table.row();
                if (item.getAmtBase()!= null) {
                    row.field("AMT_BASE", "BAPIAMTBASE", item.getAmtBase());
                }
                if (item.getAmtBaseLong()!= null) {
                    row.field("AMT_BASE_LONG", "BAPIAMTBASE_31", item.getAmtBaseLong());
                }
                if (item.getAmtDoccur()!= null) {
                    row.field("AMT_DOCCUR", "BAPIDOCCUR", item.getAmtDoccur());
                }
                if (item.getAmtDoccurLong()!= null) {
                    row.field("AMT_DOCCUR_LONG", "BAPIDOCCUR_31", item.getAmtDoccurLong());
                }
                if (item.getCurrency()!= null) {
                    row.field("CURRENCY", "WAERS", item.getCurrency());
                }
                if (item.getCurrencyIso()!= null) {
                    row.field("CURRENCY_ISO", "WAERS_ISO", item.getCurrencyIso());
                }
                if (item.getCurrType()!= null) {
                    row.field("CURR_TYPE", "CURTP", item.getCurrType());
                }
                if (item.getDiscAmt()!= null) {
                    row.field("DISC_AMT", "ACPI_ACSKT", item.getDiscAmt());
                }
                if (item.getDiscAmtLong()!= null) {
                    row.field("DISC_AMT_LONG", "ACPI_ACSKT_31", item.getDiscAmtLong());
                }
                if (item.getDiscBase()!= null) {
                    row.field("DISC_BASE", "ACPI_SKFBT", item.getDiscBase());
                }
                if (item.getDiscBaseLong()!= null) {
                    row.field("DISC_BASE_LONG", "ACPI_SKFBT_31", item.getDiscBaseLong());
                }
                if (item.getExchRate()!= null) {
                    row.field("EXCH_RATE", "KURSF", item.getExchRate());
                }
                if (item.getExchRateV()!= null) {
                    row.field("EXCH_RATE_V", "ACPI_UKURSM", item.getExchRateV());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getTaxAmt()!= null) {
                    row.field("TAX_AMT", "BAPITAXAMT", item.getTaxAmt());
                }
                if (item.getTaxAmtLong()!= null) {
                    row.field("TAX_AMT_LONG", "BAPITAXAMT_31", item.getTaxAmtLong());
                }
            }
            table.end();
        }
        if ((criteria!= null)&&criteria.iterator().hasNext()) {
            final Table table = query.withTable("CRITERIA", "BAPIACKEC9");
            for (AccountingDocumentCheckPostingInAccountingCoPaAcctAssignmentCharacteristic item: criteria) {
                final TableRow row = table.row();
                if (item.getCharacter()!= null) {
                    row.field("CHARACTER", "ACPI_RKE_CRIGEN", item.getCharacter());
                }
                if (item.getFieldname()!= null) {
                    row.field("FIELDNAME", "FIELDNAME", item.getFieldname());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getProdNoLong()!= null) {
                    row.field("PROD_NO_LONG", "BAPI_PROD_NO", item.getProdNoLong());
                }
            }
            table.end();
        }
        if ((valuefield!= null)&&valuefield.iterator().hasNext()) {
            final Table table = query.withTable("VALUEFIELD", "BAPIACKEV9");
            for (PostingInAccountingCoPaAcctAssignmentValueField item: valuefield) {
                final TableRow row = table.row();
                if (item.getAmtValcom()!= null) {
                    row.field("AMT_VALCOM", "BAPIRKEVAL", item.getAmtValcom());
                }
                if (item.getAmtValcomLong()!= null) {
                    row.field("AMT_VALCOM_LONG", "BAPIRKEVAL_31", item.getAmtValcomLong());
                }
                if (item.getBaseUom()!= null) {
                    row.field("BASE_UOM", "MEINS", item.getBaseUom());
                }
                if (item.getBaseUomIso()!= null) {
                    row.field("BASE_UOM_ISO", "MEINS_ISO", item.getBaseUomIso());
                }
                if (item.getCurrency()!= null) {
                    row.field("CURRENCY", "WAERS", item.getCurrency());
                }
                if (item.getCurrencyIso()!= null) {
                    row.field("CURRENCY_ISO", "WAERS_ISO", item.getCurrencyIso());
                }
                if (item.getCurrType()!= null) {
                    row.field("CURR_TYPE", "CURTP", item.getCurrType());
                }
                if (item.getFieldname()!= null) {
                    row.field("FIELDNAME", "FIELDNAME", item.getFieldname());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getQuaValcom()!= null) {
                    row.field("QUA_VALCOM", "QUA_VALCOM", item.getQuaValcom());
                }
            }
            table.end();
        }
        if ((realEstate!= null)&&realEstate.iterator().hasNext()) {
            final Table table = query.withTable("REALESTATE", "BAPIACRE09");
            for (RealEstateAccountAssignmentData item: realEstate) {
                final TableRow row = table.row();
                if (item.getBuilding()!= null) {
                    row.field("BUILDING", "SGENR", item.getBuilding());
                }
                if (item.getBusinessEntity()!= null) {
                    row.field("BUSINESS_ENTITY", "SWENR", item.getBusinessEntity());
                }
                if (item.getContractNo()!= null) {
                    row.field("CONTRACT_NO", "RANL", item.getContractNo());
                }
                if (item.getCorrItem()!= null) {
                    row.field("CORR_ITEM", "SBERI", item.getCorrItem());
                }
                if (item.getFlowType()!= null) {
                    row.field("FLOW_TYPE", "SBEWART", item.getFlowType());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getOptionRate()!= null) {
                    row.field("OPTION_RATE", "POPTSATZ", item.getOptionRate());
                }
                if (item.getProperty()!= null) {
                    row.field("PROPERTY", "SGRNR", item.getProperty());
                }
                if (item.getRefDate()!= null) {
                    row.field("REF_DATE", "DABRBEZ", item.getRefDate());
                }
                if (item.getRentalObject()!= null) {
                    row.field("RENTAL_OBJECT", "REBDRONRBAPI", item.getRentalObject());
                }
                if (item.getServChargeKey()!= null) {
                    row.field("SERV_CHARGE_KEY", "SNKSL", item.getServChargeKey());
                }
                if (item.getSettlementUnit()!= null) {
                    row.field("SETTLEMENT_UNIT", "SEMPSL", item.getSettlementUnit());
                }
            }
            table.end();
        }
        if ((extension1 != null)&&extension1 .iterator().hasNext()) {
            final Table table = query.withTable("EXTENSION1", "BAPIACEXTC");
            for (ContainerForCustomerExitParameter item: extension1) {
                final TableRow row = table.row();
                if (item.getField1()!= null) {
                    row.field("FIELD1", "STRNG250", item.getField1());
                }
                if (item.getField2()!= null) {
                    row.field("FIELD2", "STRNG250", item.getField2());
                }
                if (item.getField3()!= null) {
                    row.field("FIELD3", "STRNG250", item.getField3());
                }
                if (item.getField4()!= null) {
                    row.field("FIELD4", "STRNG250", item.getField4());
                }
            }
            table.end();
        }
        if ((extension2 != null)&&extension2 .iterator().hasNext()) {
            final Table table = query.withTable("EXTENSION2", "BAPIPAREX");
            for (RefStructureForParameterExtensioninExtensionout item: extension2) {
                final TableRow row = table.row();
                if (item.getStructure()!= null) {
                    row.field("STRUCTURE", "TE_STRUC", item.getStructure());
                }
                if (item.getValuepart1()!= null) {
                    row.field("VALUEPART1", "VALUEPART", item.getValuepart1());
                }
                if (item.getValuepart2()!= null) {
                    row.field("VALUEPART2", "VALUEPART", item.getValuepart2());
                }
                if (item.getValuepart3()!= null) {
                    row.field("VALUEPART3", "VALUEPART", item.getValuepart3());
                }
                if (item.getValuepart4()!= null) {
                    row.field("VALUEPART4", "VALUEPART", item.getValuepart4());
                }
            }
            table.end();
        }
        if ((paymentCard!= null)&&paymentCard.iterator().hasNext()) {
            final Table table = query.withTable("PAYMENTCARD", "BAPIACPC09");
            for (PaymentCardInformation item: paymentCard) {
                final TableRow row = table.row();
                if (item.getAuthamount()!= null) {
                    row.field("AUTHAMOUNT", "ACPI_CAUTW", item.getAuthamount());
                }
                if (item.getAuthamountLong()!= null) {
                    row.field("AUTHAMOUNT_LONG", "ACPI_CAUTW_31", item.getAuthamountLong());
                }
                if (item.getAuthDate()!= null) {
                    row.field("AUTH_DATE", "AUDAT_CC", item.getAuthDate());
                }
                if (item.getAuthRefno()!= null) {
                    row.field("AUTH_REFNO", "AUTRA", item.getAuthRefno());
                }
                if (item.getAuthTime()!= null) {
                    row.field("AUTH_TIME", "AUTIM", item.getAuthTime());
                }
                if (item.getCctyp()!= null) {
                    row.field("CCTYP", "ACPI_CCTYP", item.getCctyp());
                }
                if (item.getCcAutthNo()!= null) {
                    row.field("CC_AUTTH_NO", "AUNUM", item.getCcAutthNo());
                }
                if (item.getCcGlaccount()!= null) {
                    row.field("CC_GLACCOUNT", "ACPI_CCACT", item.getCcGlaccount());
                }
                if (item.getCcName()!= null) {
                    row.field("CC_NAME", "CCNAME", item.getCcName());
                }
                if (item.getCcNumber()!= null) {
                    row.field("CC_NUMBER", "CCNUM", item.getCcNumber());
                }
                if (item.getCcSeqNo()!= null) {
                    row.field("CC_SEQ_NO", "CCFOL", item.getCcSeqNo());
                }
                if (item.getCcType()!= null) {
                    row.field("CC_TYPE", "CCINS", item.getCcType());
                }
                if (item.getCcValidF()!= null) {
                    row.field("CC_VALID_F", "DATAB_CC", item.getCcValidF());
                }
                if (item.getCcValidT()!= null) {
                    row.field("CC_VALID_T", "DATBI_CC", item.getCcValidT());
                }
                if (item.getCurrency()!= null) {
                    row.field("CURRENCY", "WAERS", item.getCurrency());
                }
                if (item.getCurrencyIso()!= null) {
                    row.field("CURRENCY_ISO", "WAERS_ISO", item.getCurrencyIso());
                }
                if (item.getDataorigin()!= null) {
                    row.field("DATAORIGIN", "CSOUR", item.getDataorigin());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getMerchidcl()!= null) {
                    row.field("MERCHIDCL", "MERCH", item.getMerchidcl());
                }
                if (item.getPointOfReceipt()!= null) {
                    row.field("POINT_OF_RECEIPT", "LOCID_CC", item.getPointOfReceipt());
                }
                if (item.getTerminal()!= null) {
                    row.field("TERMINAL", "TRMID", item.getTerminal());
                }
            }
            table.end();
        }
        if ((contractItem!= null)&&contractItem.iterator().hasNext()) {
            final Table table = query.withTable("CONTRACTITEM", "BAPIACCAIT");
            for (AddContractAccountsRecAndPayableDocumentLineItem item: contractItem) {
                final TableRow row = table.row();
                if (item.getAgreementGuid()!= null) {
                    row.field("AGREEMENT_GUID", "SYSUUID_X", item.getAgreementGuid());
                }
                if (item.getBudgetPeriod()!= null) {
                    row.field("BUDGET_PERIOD", "FM_BUDGET_PERIOD", item.getBudgetPeriod());
                }
                if (item.getBusScenario()!= null) {
                    row.field("BUS_SCENARIO", "ACPI_IAOM_BS_ID", item.getBusScenario());
                }
                if (item.getCmmtItem()!= null) {
                    row.field("CMMT_ITEM", "FIPOS", item.getCmmtItem());
                }
                if (item.getCmmtItemLong()!= null) {
                    row.field("CMMT_ITEM_LONG", "FM_FIPEX", item.getCmmtItemLong());
                }
                if (item.getContAcct()!= null) {
                    row.field("CONT_ACCT", "ACPI_CONT_ACCT", item.getContAcct());
                }
                if (item.getExtObjectId()!= null) {
                    row.field("EXT_OBJECT_ID", "ACPI_IAOM_EO_ID", item.getExtObjectId());
                }
                if (item.getFmArea()!= null) {
                    row.field("FM_AREA", "FIKRS", item.getFmArea());
                }
                if (item.getFuncArea()!= null) {
                    row.field("FUNC_AREA", "FKBER_SHORT", item.getFuncArea());
                }
                if (item.getFuncAreaLong()!= null) {
                    row.field("FUNC_AREA_LONG", "FKBER", item.getFuncAreaLong());
                }
                if (item.getFund()!= null) {
                    row.field("FUND", "BP_GEBER", item.getFund());
                }
                if (item.getFundsCtr()!= null) {
                    row.field("FUNDS_CTR", "FISTL", item.getFundsCtr());
                }
                if (item.getGrantNbr()!= null) {
                    row.field("GRANT_NBR", "GM_GRANT_NBR", item.getGrantNbr());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getMainTrans()!= null) {
                    row.field("MAIN_TRANS", "ACPI_MAIN_TRANS", item.getMainTrans());
                }
                if (item.getReferenceNo()!= null) {
                    row.field("REFERENCE_NO", "ACPI_CA_DOC_REF", item.getReferenceNo());
                }
                if (item.getSubTrans()!= null) {
                    row.field("SUB_TRANS", "ACPI_SUB_TRANS", item.getSubTrans());
                }
                if (item.getVtref()!= null) {
                    row.field("VTREF", "ACPI_CONT_REF", item.getVtref());
                }
                if (item.getVtrefGuid()!= null) {
                    row.field("VTREF_GUID", "SYSUUID_X", item.getVtrefGuid());
                }
            }
            table.end();
        }
        if ((withholdingTax!= null)&&withholdingTax.iterator().hasNext()) {
            final Table table = query.withTable("ACCOUNTWT", "BAPIACWT09");
            for (WithholdingTaxInformation item: withholdingTax) {
                final TableRow row = table.row();
                if (item.getAwhAmtL2()!= null) {
                    row.field("AWH_AMT_L2", "BAPIWT_AWT2", item.getAwhAmtL2());
                }
                if (item.getAwhAmtL2Long()!= null) {
                    row.field("AWH_AMT_L2_LONG", "BAPIWT_AWT2_31", item.getAwhAmtL2Long());
                }
                if (item.getAwhAmtL3()!= null) {
                    row.field("AWH_AMT_L3", "BAPIWT_AWT3", item.getAwhAmtL3());
                }
                if (item.getAwhAmtL3Long()!= null) {
                    row.field("AWH_AMT_L3_LONG", "BAPIWT_AWT3_31", item.getAwhAmtL3Long());
                }
                if (item.getAwhAmtLc()!= null) {
                    row.field("AWH_AMT_LC", "BAPIWT_AWT", item.getAwhAmtLc());
                }
                if (item.getAwhAmtLcLong()!= null) {
                    row.field("AWH_AMT_LC_LONG", "BAPIWT_AWT_31", item.getAwhAmtLcLong());
                }
                if (item.getAwhAmtTc()!= null) {
                    row.field("AWH_AMT_TC", "BAPIWT_AWT1", item.getAwhAmtTc());
                }
                if (item.getAwhAmtTcLong()!= null) {
                    row.field("AWH_AMT_TC_LONG", "BAPIWT_AWT1_31", item.getAwhAmtTcLong());
                }
                if (item.getBasAmtInd()!= null) {
                    row.field("BAS_AMT_IND", "WT_BASMAN", item.getBasAmtInd());
                }
                if (item.getBasAmtL2()!= null) {
                    row.field("BAS_AMT_L2", "BAPIWT_BS2", item.getBasAmtL2());
                }
                if (item.getBasAmtL2Long()!= null) {
                    row.field("BAS_AMT_L2_LONG", "BAPIWT_BS2_31", item.getBasAmtL2Long());
                }
                if (item.getBasAmtL3()!= null) {
                    row.field("BAS_AMT_L3", "BAPIWT_BS3", item.getBasAmtL3());
                }
                if (item.getBasAmtL3Long()!= null) {
                    row.field("BAS_AMT_L3_LONG", "BAPIWT_BS3_31", item.getBasAmtL3Long());
                }
                if (item.getBasAmtLc()!= null) {
                    row.field("BAS_AMT_LC", "BAPIWT_BS", item.getBasAmtLc());
                }
                if (item.getBasAmtLcLong()!= null) {
                    row.field("BAS_AMT_LC_LONG", "BAPIWT_BS_31", item.getBasAmtLcLong());
                }
                if (item.getBasAmtTc()!= null) {
                    row.field("BAS_AMT_TC", "BAPIWT_BS1", item.getBasAmtTc());
                }
                if (item.getBasAmtTcLong()!= null) {
                    row.field("BAS_AMT_TC_LONG", "BAPIWT_BS1_31", item.getBasAmtTcLong());
                }
                if (item.getItemnoAcc()!= null) {
                    row.field("ITEMNO_ACC", "POSNR_ACC", item.getItemnoAcc());
                }
                if (item.getManAmtInd()!= null) {
                    row.field("MAN_AMT_IND", "WT_AMNMAN", item.getManAmtInd());
                }
                if (item.getManAmtL2()!= null) {
                    row.field("MAN_AMT_L2", "BAPIWT_QBUIH2", item.getManAmtL2());
                }
                if (item.getManAmtL2Long()!= null) {
                    row.field("MAN_AMT_L2_LONG", "BAPIWT_QBUIH2_31", item.getManAmtL2Long());
                }
                if (item.getManAmtL3()!= null) {
                    row.field("MAN_AMT_L3", "BAPIWT_QBUIH3", item.getManAmtL3());
                }
                if (item.getManAmtL3Long()!= null) {
                    row.field("MAN_AMT_L3_LONG", "BAPIWT_QBUIH3_31", item.getManAmtL3Long());
                }
                if (item.getManAmtLc()!= null) {
                    row.field("MAN_AMT_LC", "BAPIWT_QBUIHH", item.getManAmtLc());
                }
                if (item.getManAmtLcLong()!= null) {
                    row.field("MAN_AMT_LC_LONG", "BAPIWT_QBUIHH_31", item.getManAmtLcLong());
                }
                if (item.getManAmtTc()!= null) {
                    row.field("MAN_AMT_TC", "BAPIWT_QBUIHB", item.getManAmtTc());
                }
                if (item.getManAmtTcLong()!= null) {
                    row.field("MAN_AMT_TC_LONG", "BAPIWT_QBUIHB_31", item.getManAmtTcLong());
                }
                if (item.getWtCode()!= null) {
                    row.field("WT_CODE", "WT_WITHCD", item.getWtCode());
                }
                if (item.getWtType()!= null) {
                    row.field("WT_TYPE", "WITHT", item.getWtType());
                }
            }
            table.end();
        }
        query.withImportingAsReturn("OBJ_TYPE", "BAPIACHE09");
        query.withImportingAsReturn("OBJ_KEY", "BAPIACHE09");
        query.withImportingAsReturn("OBJ_SYS", "BAPIACHE09");
        query.withTableAsReturn("RETURN", "BAPIRET2");
        return query;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction accountGl(GlAccountItem... items) {
        accountGl = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction accountReceivable(CustomerItem... items) {
        accountReceivable = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction accountPayable(VendorItem... items) {
        accountPayable = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction accountTax(TaxItem... items) {
        accountTax = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction criteria(AccountingDocumentCheckPostingInAccountingCoPaAcctAssignmentCharacteristic... items) {
        criteria = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction valuefield(PostingInAccountingCoPaAcctAssignmentValueField... items) {
        valuefield = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction realEstate(RealEstateAccountAssignmentData... items) {
        realEstate = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction extension1(ContainerForCustomerExitParameter... items) {
        extension1 = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction extension2(RefStructureForParameterExtensioninExtensionout... items) {
        extension2 = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction paymentCard(PaymentCardInformation... items) {
        paymentCard = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction contractItem(AddContractAccountsRecAndPayableDocumentLineItem... items) {
        contractItem = Lists.newArrayList(items);
        return this;
    }

    /**
     * {@inheritDoc}
     * 
     */
    @Override
    @Nonnull
    @Tolerate
    public AcctngDocumentPostFunction withholdingTax(WithholdingTaxInformation... items) {
        withholdingTax = Lists.newArrayList(items);
        return this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy