Professional Documents
Culture Documents
How-To Guide
PUBLIC
Applicable Releases:
and
All Countries
English
December 2010
Table of Contents
Purpose ........................................................................................................................................... 3
Creating a Format to Export Business Partners from SAP Business One .............................. 4
Mapping between the source format tree and the target format tree ..................................... 10
© SAP AG 2010 2
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Purpose
This how-to guide provides an example of using the Electronic File Manager: Format Definition add-on
to design a GEP (Generic Electronic File Format Project) format to export business partners from SAP
Business One.
You can use the source file (BPList.rpt) and the target file (BPList.xsd or BPList.xml) that are
attached to the how-to guide to complete the example. SAP also provides you with the completed
format (BPList.gep).
The how-to guide describes in detail each of the following steps used to create the format:
1. Create a format project.
2. Add a source file. You can use the attached source file (BPList.rpt).
3. Add a target file. You can use the attached target file (BPList.xsd or BPList.xml).
4. Set up property.
5. Map the format between source tree and target tree.
6. Add the validation rules.
7. Verify the format.
8. Conduct a test run of the format.
For other formats, such as BPP (Bank Payment File Format Project) and SSP (Special-Purpose File
Format Project), you can use the example as a reference.
For more information about the Electronic File Manager: Format Definition add-on, see the online help
for Electronic File Manager: Format Definition.
© SAP AG 2010 3
How to Design an Electronic File Format in Electronic File Manager: Format Definition
ii. To specify the path, choose the ellipsis button and choose the path.
iii. Specify the format name and choose the OK button.
A default mapping is created.
3. To add the source file for the GEP format, do the following:
a. Right-click the Source folder and choose Source → Add → RPT.
b. In the Open window, select the BPList.rpt file, and choose the Open button.
The source file is added in the Source folder and its format structure appears in a tree structure
on the mapping tab.
© SAP AG 2010 4
How to Design an Electronic File Format in Electronic File Manager: Format Definition
4. In the Format Explorer area, select the root node of the format.
5. In the Properties area, under the Deployment property, do the following:
a. In the Module field, select Business Partner. After the format is imported, it appears
under the business partner module.
b. In the Menu Name field, specify BP List. “BP List” appears as a menu name in the menu
of SAP Business One.
The Menu Path field displays the full menu path of the format in SAP Business One:
\Business Partner\Business Partner Reports\Electronic Report\BP List.
c. Specify the other fields.
© SAP AG 2010 5
How to Design an Electronic File Format in Electronic File Manager: Format Definition
6. To add a target file for the GEP format, right-click the Target folder, choose Add, and select
XML.
The imported XML schema file is added to the Target folder and its format structure
appears in a tree structure as read only on the mapping tab.
In the opened window, select BPList as the root node for the XML structure and choose
the OK button.
Select Import the structure from an XML document and choose the OK button,
In the Open… window, select the BPList.xml and choose the Open button.
© SAP AG 2010 6
How to Design an Electronic File Format in Electronic File Manager: Format Definition
The imported XML file is added to the Target folder and its format structure appears in a
tree structure on the mapping tab.
8. To view the target format tree in different views, do one of the following:
Full view or compact view: Right-click the format tree head and choose the view to which
you want to switch.
Customized compact view: do the following:
i. Display the XML format tree in full view.
ii. To hide a non technical node, click the non technical node until the node is greyed
out, for example, .
To display the non technical node, click the (Eye) icon attached to the node
until the node is enabled, for example, .
Note
All, Choice, and Sequence are technical nodes.
iii. Display the XML format tree in compact view.
9. Map between the source format tree and the target format tree by mapping the following target
nodes to the relevant source nodes and configure the relevant mapping settings:
Source Node Target Node
GroupNameCountry1 Name
Details BP
CardType1 IsSupplier
CardName1 Name
Balance1 Balance
© SAP AG 2010 7
How to Design an Electronic File Format in Electronic File Manager: Format Definition
For more information, see Mapping Between the Source Format Tree and the Target Format
Tree.
10. Create runtime validation rules for all the target nodes except for the target node BPList.
For more information, see Creating Runtime Validation Rules for Target Nodes.
11. To verify the format for the mapping settings or the validation rules of the target tree, do one of
the following:
Click (Verify).
Choose Project → Verify.
Press F6.
The verification checks the mapping settings of only the nodes required by the imported XML
schema and the validation settings of all the nodes.
After the verification is finished, a message listing errors, warnings, or information appears on
the Message tab.
To display different types of messages, choose the Error(s), Warning(s), or Information button.
By default, all types of messages are displayed on the Message tab.
To export messages, right-click any space on the Message tab and choose Export All. In the
Save As window, specify the file name, and choose the Save button.
12. To start a test run, do one of the following:
© SAP AG 2010 8
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Press F5.
You test run the format with the embedded value in the source .rpt file.
If the test run succeeds, the Output tab automatically displays the simulated XML content. To
save the test run results, right-click any space on the Output tab and choose Export All. In the
Save As window, specify the file name, and choose the Save button.
If the test run fails, the messages are displayed on the Message tab. For runtime data validation
failure, the messages you specify on the Validation tab appear.
You can test run the format with external data. For more information, see the Test Running
Formats in the online help of the Electronic File Manager: Format Definition add-on.
13. To save the formats, do one of the following:
Choose File → Save.
Click (Save).
Choose File → Save As… and specify the new format name.
Result
You can import the format into SAP Business One.
© SAP AG 2010 9
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Note
The No Value option is automatically selected for the target nodes that are element
containers. The element container node cannot be filled with any value.
© SAP AG 2010 10
How to Design an Electronic File Format in Electronic File Manager: Format Definition
3. For the target node: Name (under the Country node), select Copy Value From Source Node for
Value.
© SAP AG 2010 11
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Note
You use %CardType as the reference no. for the source node CardType1. Reference no.
is the reference code or alias of the node. You can use the reference code or alias to
refer to the node in the function or the condition of another node.
substring(string, number, number?)
Description: Returns the substring of the first argument starting at the position specified
in the second argument and having the length specified in the third argument.
The index begins at 1.
Sample: substring(“12345”,2,3) returns “234”.
© SAP AG 2010 12
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Select the Constant Value radio button and specify True. If the condition is met at
runtime, no value will be outputted.
e. Select the Else Condition checkbox.
f. Select the Constant Value radio button and specify False.
If the condition is not met at runtime, the output value is the constant value: False.
6. For the target node: Name (under the Sequence node), select Copy Value From Source Node
for Value.
© SAP AG 2010 13
How to Design an Electronic File Format in Electronic File Manager: Format Definition
© SAP AG 2010 14
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Note
If you import the XML schema file BPList.xsd as the target file in step 6, the validation
rules are already included in the file.
2. To add validation rules for the target node: Sequence, select Number of Occurrence and specify
1 in the From field and 1 in the To field.
© SAP AG 2010 15
How to Design an Electronic File Format in Electronic File Manager: Format Definition
3. To add a validation rule for the target node: Country, select Number of Occurrence and specify
1 in the From field.
© SAP AG 2010 16
How to Design an Electronic File Format in Electronic File Manager: Format Definition
4. To add validation rules for the target node: Name, do the following:
© SAP AG 2010 17
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Valid Values: Add DE, GB, and US to the valid value list.
The error message is automatically changed to “format( “Name” - “{0}” is not a valid
value in list “DE, GB, US”’,.)”.
Only the value covered in the valid value list is allowed at runtime. If the validation rule is
broken, the error message appears.
© SAP AG 2010 18
How to Design an Electronic File Format in Electronic File Manager: Format Definition
5. To add a validation rule for the target node: Sequence, select Number of Occurrence and
specify 1 in the From field and 1 in the To field.
© SAP AG 2010 19
How to Design an Electronic File Format in Electronic File Manager: Format Definition
6. To add a validation rule for the target node: BP, select Number of Occurrence and specify 1 in
the From field.
7. To add validation rules for the target node: IsSupplier, do the following:
© SAP AG 2010 20
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Valid Values: Add False and True to the valid values list.
The error message is automatically changed to “format( ‘“IsSupplier” - “{0}” is not a valid
value in list “False, True”’,.)”.
Only the value covered in the valid values list is allowed. If the validation rule is broken,
the error message appears.
© SAP AG 2010 21
How to Design an Electronic File Format in Electronic File Manager: Format Definition
8. To add a validation rule for the target node: Sequence, select Number of Occurrence and
specify 1 in the From field and 1 in the To field.
© SAP AG 2010 22
How to Design an Electronic File Format in Electronic File Manager: Format Definition
9. To add validation rules for the target node: Name, select Number of Occurrence and specify 1 in
the From field and 1 in the To field.
The error message is automatically changed to “format(‘{0} - Number of occurrence is outside
range “1” to “1”,’Name’)”.
The name is allowed to appear only once at runtime. If the validation rule is broken, the error
message appears.
© SAP AG 2010 23
How to Design an Electronic File Format in Electronic File Manager: Format Definition
10. To add validation rules for the target node: Balance, do the following:
Data Range: Specify 0 in the From field and select the Inclusive checkbox. Leave the To
field empty and select the Inclusive checkbox.
The error message is automatically changed to “format(‘Balance – Value “{0}” is outside
range “0” to “infinity”,.).
The allowed balance range is from zero to infinity. If the validation rule is broken, the
error message appears.
© SAP AG 2010 24
How to Design an Electronic File Format in Electronic File Manager: Format Definition
Note
You can create validation rule of data range for the only target fields with the type as
Number or Date. The target field type is determined in the XML schema. If you manually
create a target field, you cannot set the field type in the Electronic File Manager: Format
Definition add-on. You can only create validation rule of data range for the target fields
with the type as Number or Date that are imported from an XML schema.
© SAP AG 2010 25
How to Design an Electronic File Format in Electronic File Manager: Format Definition
The Electronic File Manager: Format Definition add-on for SAP Business One 2007 A SP01 and 8.8
provides the following formats:
• Special-Purpose File Format Project (SPP): A generic format used for various special business
purposes with predefined structure
• BFP: Bank statement file format used for parsing and importing bank statement data into SAP
Business One
BFP is the same format you edit in the Format Definition add-on of SAP Business One 2007
and 8.8.
For more information, see the online help for Electronic File Manager: Format Definition and SAP
Note 1531223.
© SAP AG 2010 26
How to Design an Electronic File Format in Electronic File Manager: Format Definition
© SAP AG 2010 27