FM Function scripts with more than 1 sublevel

EasyInput Frequently Asked Questions
moderator
Posty: 138
Rejestracja: śr cze 22, 2016 7:45 pm

FM Function scripts with more than 1 sublevel

Post autor: moderator » czw kwie 19, 2018 4:30 pm

Many BAPIs require more than one sublevel of data passed as import parameters. For accounting BAPIs such a need arises when passing CO-PA assignment for line item.
Example of lines sequence on data worksheet:

Kod: Zaznacz cały

Level 0 header
Level 1 line item (variuos types GL Item/ Customer/ Vendor/ Tax, etc)
Level 2a CO-PA characteristics
Level 2b CO-PA value fields
When creating such a script it is necessary to follow one golden rule:
The sequence of level/order pairs in the script worksheet should follow the sequence in which data will be given on the data sheet. If one does not obey the rule some data lines may be omitted! Please reorder the scipt lines accordingly. The sequence of a pairs on the same level is irrelevant (e.g.2a/2b in the script can be switched in order), but the sequence of sublevels vs the level above them (2a/2b should follow in the script level 1) is important!. Also script order/level pairs should be continuous (the only exception is level 0, that does not have to be contignuous). Please switch debugging on when developing the script to see whether all the data lines are taken into account.

According to the rules above scripts with following sequence are OK:

Kod: Zaznacz cały

Example 1
Line 1    -U Level 0 - Header
Line U+1 - V Level 1a - Line item
Line V+1 - W Level 2a - Line item details 1
Line W+1 - X Level 2b - Line item details 2
Line X+1 - Y Level 1b - Return messages

Example 2 (the lines on the same level can be switched in order 2a/2b, level 0 does not have to be contignuous)
Line 1    -U Level 0 - Header
Line U+1 - V Level 1a - Line item
Line V+1 - W Level 2b - Line item details 2
Line W+1 - X Level 2a - Line item details 1
Line X+1 - Y Level 1b - Return messages
Line Y+1 - Z Level 0 - Header (part 2)
According to the rules above script with following sequence is INCORRECT (since return messages level/order separates line item 1a form line item details 2a/2b):

Kod: Zaznacz cały

Example 3
Line 1    -U Level 0 - Header
Line U+1 - V Level 1a - Line item
Line V+1 - W Level 1b - Return messages
Line W+1 - X Level 2a - Line item details 1
Line X+1 - Y Level 2b - Line item details 2
See example EasyInput_FM_Example_FI_Billing_200.xlsx

ODPOWIEDZ