Sage: find article with variant criteria (FindByVariantArticle)
Sage: find article with variant criteria (FindByVariantArticle)
Read the data for one or more articles by searching for variant 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 search criteria for the variant criteria are entered in the second parameter group. This parameter group must be of the type: tdv:variantensuche. The parameters Name, Operator and Value exist in this indexed parameter group. Per search condition, the name of the criterion must be entered in Name, the type of comparison in Operator, and the value to be compared in 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.
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, 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, mep, mev, mevk, norm, normnr, objektid, orpreis, pe, peek, pevk, preisgrp, prodgr, rabattkz, staffel, stlidentnr, stlvar, ts_m, ts_w, txt_nr, umrech, umrechp, umrechvk, updatenr, useraen, userneu, var, var_akt, volumen, vpreis, werkstoff, wgr, zeichnr.
Syntax: | Status = f$SageService ( Service , 'FindByVariantArticle' , 'PGINPUTList' , 'PGOUTPUT' ) | |||
| Argument | Type | Meaning | |
| Service | String | URL of the web service | |
| 'FindByVariantArticle' | 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' art_such.ben = '%Schub%' Variantsearch[1].Name = 'COLOR1' Variantsearch[1].Operator = '=' Variantsearch[1].Value = 'red' Variantsearch[2].Name = 'VAR_WIDTH' Variantsearch[2].Operator = '>' Variantsearch[2].Value = '400' Variantsearch[3].Name = 'VAR_WIDTH' Variantsearch[3].Operator = '<=' Variantsearch[3].Value = '1100' Status = f$SageService ( B7Service , 'FindByVariantArticle' , 'art_such,Variantensuche' , 'art_erg' ) | |||
Example 2: | B7Service = 'http://b7demo.sagebaeurer.de/br71/callin/epos_soap' art_such.ben = '%Schub%' Variantsearch[1].Name = 'COLOR1' Variantsearch[1].Operator = '=' Variantsearch[1].Value = 'red' Variantsearch[2].Name = 'VAR_WIDTH' Variantsearch[2].Operator = '>' Variantsearch[2].Value = '400' Variantsearch[3].Name = 'VAR_WIDTH' Variantsearch[3].Operator = '<=' Variantsearch[3].Value = '1100' Articlecriteria[1].Name = 'VAR_WIDTH' Articlecriteria[2].Name = 'COLOR1' Status = f$SageService ( B7Service , 'FindByVariantArticle' , 'art_such,Variantsearch,Articlecriteria' , 'art_erg' ) | |||