How-To Guide For Customization
How-To Guide For Customization
TABLE OF CONTENTS
1
PREREQUISITES .............................................................................................................................. 3
4
4.1
4.2
4.3
APPENDIX......................................................................................................................................... 8
WSDL File: ........................................................................................................................................ 8
Links.................................................................................................................................................. 8
Structure Dump ................................................................................................................................ 8
PREREQUISITES
To modify an existing template you will need the following (or similar) tools:
-
First, you will need to download the Excel sheet which you want to modify from the system. To understand
how the Excel works, please start by opening the sheet in Excel. Then, switch to the Developer tab and click
Source:
If you dont have the developer tab in your Excel, please go to File -> Options -> Customize Ribbon and
enable the checkbox for developer:
Now you should be able to see the underlying data structure on the right side. Please choose the XML Map
SAP_BYD_MAIN to see the correct structure:
To adjust the data structure and the template, the data structure needs to be enhanced first. To do this, find
the Excel sheet on your hard drive and change its extension to .zip. Then, open it with your preferred ZipTool and change to the folder xl:
Please extract the file xmlMaps.xml and open it with your preferred XML-editor (Notepad++ in this case).
This file is very long as it contains many type definitions. The part which is interesting for this guide is the
definition of the complex type AccountingEntryFlatType, around line 1350:
As you can see, this structure represents the tree in the Excel sheet, for example:
In this context, new fields can now be added. As an example the field DraftIndicator should be added,
which controls if the created Journal Entry Voucher is created in draft mode or posted directly (the default is
posted directly). This field is of the type Indicator, which is already defined in the schema, therefore we can
use it without further customization. If you want to use a field whose data type is not present in the schema,
you need to add it manually or use another compatible data type (eg. Note for string types).
To add this indicator, you add the following line (e.g. after ExternalID):
<xs:element maxOccurs="1" minOccurs="0" name="DraftIndicator"
type="tns:Indicator"/>
This adds a new field to the data structure, which will be transferred as is to the underlying web service. If
you want to add more complex logic behind a field, you can also use XML transformations before the upload
to the service is done. In this case please search for the element <Transformation direction="in"> in the
xmlMaps.xml.
As this is a simple boolean field, you are now finished. Save the xml-File and re-add it to the zip-File (which
was the Excel sheet before) make sure you replace the existing file. If this is successful, rename the file
ending to xlsx again and open it in Excel. As you can see, the DraftIndicator now appears in the tree listing.
The last step which is now necessary to make this field functional, is to add it to the sheet map it to a
cell.To do this, simply drag the field to a desired cell on header level. The field is now bound and after
specifying a proper heading ready to use.
Please note: This field is of type Indicator, so you will need to supply a bool value (true, false).
To add extension fields to the Excel sheet is a little bit more complicated, but possible. First, youll need to
create an extension field in the adaptation mode for the Journal Entry Voucher. Please read the system
documentation for details on this topic. If you created the field, use the Further Usage functionality to add
the extension field to the service and write down or copy the information shown in the screenshot:
and name with the values you wrote down in the first step (Note: The namespace will most likely be the
same). Now you can save the XML file and integrate it back into the Excel sheet.
In the last step you need to bind the field to an Excel cell, please see the second chapter for an explanation
of this process.
4
4.1
APPENDIX
WSDL File:
Links
https://wiki.wdf.sap.corp/wiki/display/APArchOffSec/Development+Guideline+for+Office+Integration
https://wiki.wdf.sap.corp/wiki/display/APArchOffSec/How+to+create+OVS+for+Excel+Write-Back+templates
4.3
Structure Dump
<AccountingEntry>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<ChangeStateID>?</ChangeStateID>
<ExternalID>?</ExternalID>
<PartnerObjectReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</PartnerObjectReference>
<CompanyID>?</CompanyID>
<Note languageCode="?">?</Note>
<AccountingDocumentTypeCode>?</AccountingDocumentTypeCode>
<EntryDate>?</EntryDate>
<PostingDate>?</PostingDate>
<CurrencyConversionDate>?</CurrencyConversionDate>
<AccountingClosingStepCode>?</AccountingClosingStepCode>
<BusinessTransactionTypeCode>?</BusinessTransactionTypeCode>
<TransactionCurrencyCode>?</TransactionCurrencyCode>
<LocalCurrencyAmountExchangeRate>
<UnitCurrency>?</UnitCurrency>
<QuotedCurrency>?</QuotedCurrency>
<Rate>?</Rate>
<QuotationDateTime>?</QuotationDateTime>
</LocalCurrencyAmountExchangeRate>
<HardCurrencyAmountExchangeRate>
<UnitCurrency>?</UnitCurrency>
<QuotedCurrency>?</QuotedCurrency>
<Rate>?</Rate>
<QuotationDateTime>?</QuotationDateTime>
</HardCurrencyAmountExchangeRate>
<IndexCurrencyAmountExchangeRate>
<UnitCurrency>?</UnitCurrency>
<QuotedCurrency>?</QuotedCurrency>
<Rate>?</Rate>
<QuotationDateTime>?</QuotationDateTime>
</IndexCurrencyAmountExchangeRate>
<SetOfBooksCurrencyAmountExchangeRate>
<UnitCurrency>?</UnitCurrency>
<QuotedCurrency>?</QuotedCurrency>
<Rate>?</Rate>
<QuotationDateTime>?</QuotationDateTime>
</SetOfBooksCurrencyAmountExchangeRate>
<DraftIndicator>?</DraftIndicator>
<!--1 or more repetitions:-->
<Item>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<ItemGroupID>?</ItemGroupID>
<DebitCreditCode>?</DebitCreditCode>
<ChartOfAccountsItemCode>?</ChartOfAccountsItemCode>
<Note languageCode="?">?</Note>
<SubledgerAccountLineItemTypeCode>?</SubledgerAccountLineItemTypeCode>
<SubledgerAccountTypeCode>?</SubledgerAccountTypeCode>
<GeneralLedgerMovementTypeCode>?</GeneralLedgerMovementTypeCode>
<SegmentID>?</SegmentID>
<ProfitCentreID>?</ProfitCentreID>
<FinancialAccountingViewOfProjectReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</FinancialAccountingViewOfProjectReference>
<FinancialAccountingViewOfProjectTaskReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</FinancialAccountingViewOfProjectTaskReference>
<FinancialAccountingViewOfCostObjectKey>
<CostObjectTypeCode>?</CostObjectTypeCode>
<CostObjectID>?</CostObjectID>
</FinancialAccountingViewOfCostObjectKey>
<FinancialsViewOfContractReference>
<TypeCode>?</TypeCode>
<ID>?</ID>
</FinancialsViewOfContractReference>
<ExpenseClassificationFunctionalAreaCode>?</ExpenseClassificationFunctionalAreaC
ode>
<PartnerCompanyID>?</PartnerCompanyID>
<PartnerSegmentID>?</PartnerSegmentID>
<PartnerProfitCentreID>?</PartnerProfitCentreID>
<AssignmentDerivationDisabledIndicator>?</AssignmentDerivationDisabledIndicator>
<TransactionCurrencyAmount currencyCode="?">?</TransactionCurrencyAmount>
<LocalCurrencyAmount currencyCode="?">?</LocalCurrencyAmount>
<SetOfBooksCurrencyAmount currencyCode="?">?</SetOfBooksCurrencyAmount>
<HardCurrencyAmount currencyCode="?">?</HardCurrencyAmount>
<IndexBasedCurrencyAmount currencyCode="?">?</IndexBasedCurrencyAmount>
<LineItemCurrencyAmount currencyCode="?">?</LineItemCurrencyAmount>
<Quantity unitCode="?">?</Quantity>
<QuantityTypeCode>?</QuantityTypeCode>
<!--Zero or more repetitions:-->
<AccountsReceivablePayableLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<BusinessPartnerID>?</BusinessPartnerID>
<DueItemOrderReference>
<UUID>?</UUID>
SAP Information Classification: Customer
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</DueItemOrderReference>
<PartyRoleCategoryCode>?</PartyRoleCategoryCode>
<BusinessTransactionDocumentReference>
<ID>?</ID>
<UUID>?</UUID>
<TypeCode>?</TypeCode>
<ItemID>?</ItemID>
<ItemUUID>?</ItemUUID>
<ItemTypeCode>?</ItemTypeCode>
</BusinessTransactionDocumentReference>
<AccountsReceivableDueItemTypeCode>?</AccountsReceivableDueItemTypeCode>
<AccountsPayableDueItemTypeCode>?</AccountsPayableDueItemTypeCode>
</AccountsReceivablePayableLedgerAccountItem>
<!--Zero or more repetitions:-->
<CashLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<HouseBankID>?</HouseBankID>
<CashLocationID>?</CashLocationID>
<CashLocationTypeCode>?</CashLocationTypeCode>
</CashLedgerAccountItem>
<!--Zero or more repetitions:-->
<FixedAssetItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<IndividualMaterialTypeCode>?</IndividualMaterialTypeCode>
<IndividualMaterialIdentifierTypeCode>?</IndividualMaterialIdentifierTypeCode>
<IndividualMaterialID>?</IndividualMaterialID>
<PartnerIndividualMaterialTypeCode>?</PartnerIndividualMaterialTypeCode>
<PartnerIndividualMaterialIdentifierTypeCode>?</PartnerIndividualMaterialIdentif
ierTypeCode>
<PartnerIndividualMaterialID>?</PartnerIndividualMaterialID>
<FixedAssetMasterFixedAssetID>?</FixedAssetMasterFixedAssetID>
<FixedAssetID>?</FixedAssetID>
<PartnerFixedAssetMasterFixedAssetID>?</PartnerFixedAssetMasterFixedAssetID>
<PartnerFixedAssetID>?</PartnerFixedAssetID>
<FixedAssetValuationViewID>?</FixedAssetValuationViewID>
<OriginalValueCalculationReferenceDate>?</OriginalValueCalculationReferenceDate>
<ValueCalculationReferenceDate>?</ValueCalculationReferenceDate>
<FixedAssetMovementCategoryCode>?</FixedAssetMovementCategoryCode>
</FixedAssetItem>
<!--Zero or more repetitions:-->
<MaterialLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<MaterialTypeCode>?</MaterialTypeCode>
<MaterialIdentifierTypeCode>?</MaterialIdentifierTypeCode>
<MaterialProductID>?</MaterialProductID>
<PermanentEstablishmentID>?</PermanentEstablishmentID>
<ValuationQuantity unitCode="?">?</ValuationQuantity>
<ValuationQuantityTypeCode>?</ValuationQuantityTypeCode>
<ReferenceQuantity unitCode="?">?</ReferenceQuantity>
SAP Information Classification: Customer
10
<ReferenceQuantityTypeCode>?</ReferenceQuantityTypeCode>
</MaterialLedgerAccountItem>
<!--Zero or more repetitions:-->
<OverheadCostsLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<CostCentreID>?</CostCentreID>
<TransactionQuantity unitCode="?">?</TransactionQuantity>
<TransactionQuantityTypeCode>?</TransactionQuantityTypeCode>
</OverheadCostsLedgerAccountItem>
<!--Zero or more repetitions:-->
<ProductionLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<OperationalDocumentReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</OperationalDocumentReference>
<CostRevenueElementCode>?</CostRevenueElementCode>
<CostRevenueElementChartCode>?</CostRevenueElementChartCode>
</ProductionLedgerAccountItem>
<!--Zero or more repetitions:-->
<PurchaseLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<OperationalDocumentReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</OperationalDocumentReference>
<ValuationQuantity unitCode="?">?</ValuationQuantity>
<ValuationQuantityTypeCode>?</ValuationQuantityTypeCode>
<ReferenceValuationQuantity
unitCode="?">?</ReferenceValuationQuantity>
<ReferenceValuationQuantityTypeCode>?</ReferenceValuationQuantityTypeCode>
<ClearingQuantity unitCode="?">?</ClearingQuantity>
<ClearingQuantityTypeCode>?</ClearingQuantityTypeCode>
</PurchaseLedgerAccountItem>
<!--Zero or more repetitions:-->
<SalesLedgerAccountItem>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<OperationalDocumentReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</OperationalDocumentReference>
<OperationalDocumentItemReference>
<UUID>?</UUID>
<ObjectID>?</ObjectID>
<FormattedID>?</FormattedID>
<ObjectTypeCode>?</ObjectTypeCode>
<ObjectNodeTypeCode>?</ObjectNodeTypeCode>
</OperationalDocumentItemReference>
11
<AccountDeterminationPriceSpecificationElementPurposeGroupCode>?</AccountDetermi
nationPriceSpecificationElementPurposeGroupCode>
<CostRevenueElementCode>?</CostRevenueElementCode>
<CostRevenueElementChartCode>?</CostRevenueElementChartCode>
<ValuationQuantity unitCode="?">?</ValuationQuantity>
<ValuationQuantityTypeCode>?</ValuationQuantityTypeCode>
<OrderQuantity unitCode="?">?</OrderQuantity>
<OrderQuantityTypeCode>?</OrderQuantityTypeCode>
<ReferenceQuantity unitCode="?">?</ReferenceQuantity>
<ReferenceQuantityTypeCode>?</ReferenceQuantityTypeCode>
</SalesLedgerAccountItem>
</Item>
<!--Zero or more repetitions:-->
<SetOfBooks>
<ObjectNodeSenderTechnicalID>?</ObjectNodeSenderTechnicalID>
<SetOfBooksID>?</SetOfBooksID>
</SetOfBooks>
</AccountingEntry>
12
www.sap.com