Sage: find an article with physical criteria(FindByPhysicalCriterionArticle)
Sage: find an article with physical criteria(FindByPhysicalCriterionArticle)
Read the data for one or more articles by searching for physical criteria. A combination of article information and criteria for the search can be used. Two parameter groups are used as input. Multiple parameters can be filled with the appropriate search criteria in the first input parameter group. If the parameters contain the character %, a search is made with like, otherwise with =. The individual search criteria are connected with AND. All fields in the table g000 can be entered. By filling the parameter lang_ext, you can control which language is to be read. The parameters BasePricemenge_ab and BasePricedatum have a special meaning. With these two arrays, you can enter the desired quantity or date for the purchase prices. In the second parameter group, the search criteria for the variant criteria are entered. This parameter group must be of the type: tdv:variantensuche. The parameters Name, Operator and Value exist in this indexed parameter group. For each condition, the name of the criterion has to be written on the parameter Name, the type of comparison on the parameter Operator and the value to be compared on the parameter Value. The following comparisons are possible as operator:
= | equal to |
> | greater than |
>= | greater or equal to |
< | smaller than |
<= | smaller or greater than |
!= | unequal to |
If the search for articles is to also deliver values of individual criteria, a list of the criteria to be read is to also be given in a third parameter group. This parameter group must be of the type tdv:sage_merkmal_zuordnen. In this indexed parameter group, the following parameters are filled:
Name | Name of the criterion. (this name must also be contained in the result parameter group otherwise the criterion cannot be written) |
Designation (Bezeichnung) | The name of the parameter in the result parameter group on which the the designation of the characteristic is written. These details are optional |
The function returns all the articles found in an indexed parameter group. The indexation of the parameter group is adjusted if necessary. If unknown search criteria are used, the service delivers a corresponding error message. This is entered via the parameter Message. Before evaluating the output parameter group, the parameter Message should be verified.
To increase the speed of this function, you can also limit the data to be read internally in the service. With the parameter select in the search parameter group, you can control the list of fields to be read. e.g.
art_such.select = ’identnr,ben,werkstoff,PhysicalCriterion/*’
or
art_such.select = ’identnr,ben,werkstoff,BasePrice/ekpreis,PhysicalCriterion/fldname, PhysicalCriterion/fldtyp, PhysicalCriterion/ausprint, PhysicalCriterion/ausprtxt, PhysicalCriterion/ausprfloat, PhysicalCriterion/ausprdatuhr, PhysicalCriterion/txt’
The following groups of fields can be specified:
Article fields | <Name> |
Article caption fields | ArticleName/<Name> |
Base price | BasePrice/<Name> |
Criterion | PhysicalCriterion/<Name> |
Criterion designation | PhysicalCriterion/CriterionRangeDesignation/txt |
The following parameters in the parameter group are filled:
abmessung, aendnr, agr, altern, aplidentnr, aplvar, ben, ben1, bestell, bild, bild_inet, bonuskz, breite, bs, cadkz, cadnr, ch, dataen, datneu, doku, dpreis, ekpreism, epreis, ekpreis, gewicht, hoehe, identnr, kalkpreis, klasse, kn_sebl, kn_variant, kn_vsperre, kontovb, kontovr, kontowe, kontowv, kostst, kurz_ben, laenge, lang_ext, lgnr, mc_var, me, me_abmessung, meb, mep, mev, mevk, menge_ab, norm, normnr, objektid, orpreis, pe, peek, pevk, preisgrp, preisgrp_e, prodgr, rabattkz, staffel, stlidentnr, stlvar, ts_m, ts_w, txt_nr, umrech, umrechb, umrechp, umrechvk, updatenr, useraen, userneu, var, var_akt, volumen, vpreis, waehrung, werkstoff, wgr, zeichnr, zu_ab, zuab_wert und die angegebenen Merkmale.
Syntax: | Status = f$SageService ( Service , 'FindByPhysicalCriterionArticle' , 'PGINPUTList' , 'PGOUTPUT' ) | |||
| Argument | Type | Meaning | |
| Service | String | URL of the web service | |
| 'FindByPhysicalCriterionArticle' | String | Command constant | |
| 'PGINPUTList' | String | Name of the two ePOS parameter groups with the search criteria, separated by a comma. | |
| 'PGOUTPUT' | String | Name of the ePOS parameter group with the result data. | |
Result: | Integer | Status of the function: 1 : the service function was successfully called -1 : the component eposvbcomexe could not be found -2 : function URL not entered -4 : general error | ||
Example 1: | B7Service = 'http://b7demo.sagebaeurer.de/br71/callin/epos_soap' Variantsearch[1].Name = 'VOLTAGE' Variantsearch[1].Operator = '=' Variantsearch[1].Value = '12 volts' Status = f$SageService ( B7Service , 'FindByPhysicalCriterionArticle', 'art_such,Variantsearch' , 'art_erg' ) | |||
Example 2: | B7Service = 'http://b7demo.sagebaeurer.de/br71/callin/epos_soap' art_such.BasePricemenge_ab = 2 Variantsearch[1].Name = 'VOLTAGE' Variantsearch[1].Operator = '=' Variantsearch[1].Value = '12 volts' Articlecriteria[1].Name = 'VOLTAGE' Articlecriteria[2].Name = 'WIDTH' Articlecriteria[3].Name = 'CHECK_ELEC' Articlecriteria[3].Designation = 'CHECK_ELEC_TEXT' Status = f$SageService ( B7Service , 'FindByPhysicalCriterionArticle', 'art_such,Variantsearch,Articlecriteria' , 'art_erg' ) | |||