Skip to main content
Skip table of contents

Sage: create a BOM position (CreateBomLineItem)


Sage: create a BOM position (CreateBomLineItem)

Create a line (position) in a BOM. Multiple parameters can be filled with their corresponding values in the input parameter group. The following parameters can be used: agpos,aufbr, beregelung, cadpos, chargen_rein, datvon, ersatz, gewicht, gewicht_br, herstellernr, identnr, kn_ausliefteil, kn_matdruck, kn_vdispo, kostst, kzmat, lgber, lgfach, lgnr, meg, menge_bezug, mes, staltern, stlnr, stlvar, stmenge, stpos, umrech, var, vorlzeit, werk. The arrays identnr, stlnr, and stmenge are required. If necessary, information on customization can also be delivered to the BOM position. The array names of the customization from B7 have been given the prefix z_ so that they can be identified. The following parameters can be entered: z_bez, z_bildnr, z_breite, z_hoehe, z_laenge, z_mezu, z_rbreite, z_rhoehe, z_rlaenge, z_useraen, z_userneu, z_vzuschl, z_winka, z_winkb, z_zumenge. The function returns the data for the BOM position in a parameter group after its creation. The same parameter group can be used for input and output. If an indexed parameter group is present, the index must also be entered. If the BOM position cannot be created, 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 from the BOM positions parameter group are read: aendnr, agpos, beregelung, cadpos, dataen, datneu, datvon, ersatz, gewicht, gewicht_br, herstellernr, identnr, kostst, lfdnr, meg, menge_bezug, mes, staltern, stid, stlidentnr, stlnr, stlvar, stmenge, stpos, txt_bst, txt_nr, umrech, useraen, userneu, var, vorlzeit.

If the BOM position is customized, the following parameters are also read: z_aendnr, z_bez, z_bildnr, z_breite, z_dataen, z_datneu, z_hoehe, z_laenge, z_mezu, z_rbreite, z_rhoehe, z_rlaenge, z_stid, z_useraen, z_userneu, z_vzuschl, z_winka, z_winkb, z_zumenge

Syntax:

Status = f$SageService ( Service , 'CreateBomLineItem' , 'PGINPUT' , 'PGOUTPUT' )

 

Argument

Type

Meaning

 

Service

String

URL of the web service

 

'CreateBomLineItem'

String

Command constant

 

'PGINPUT'

String

Name of the ePOS parameter group with the data for the BOM position.

 

'PGOUTPUT'

String

Name of the ePOS parameter group with the result data for the BOM position.

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:

CODE
proc void create_bom(  )
{
   int i;
   int Quantity;
   string PGName;

   // Enter service name
   B7Service = 'http://b7demo.sagebaeurer.de/br71/callin/epos_soap';

   // Enter BOM header data
   stueli_kopf.stlidentnr = 'BNUESSLE-T03';
   stueli_kopf.art = 1;
   stueli_kopf.userneu ='prodgen';

   f$PGLeer( 'stueli_pos[]' );

   // Enter BOM item data   
   stueli_pos[1].identnr = '110.100';
   stueli_pos[1].stmenge = 1;
   stueli_pos[1].mes = 'STK';
   
   stueli_pos[2].identnr = 'BTL';
   stueli_pos[2].stmenge = 1;
   stueli_pos[2].mes = 'STK';

   stueli_pos[3].identnr = 'BODEN';
   stueli_pos[3].var = '0001';
   stueli_pos[3].stmenge = 1;
   stueli_pos[3].mes = 'STK';

   stueli_pos[4].identnr = '11000111';
   stueli_pos[4].stmenge = 2;
   // Customization information
   
   stueli_pos[4].z_bez = 'Schutzblech';
   stueli_pos[4].z_breite = 150;
   stueli_pos[4].z_hoehe = 200;
   stueli_pos[4].z_mezu = 'MM';
   stueli_pos[4].z_zumenge = 1;
   
   // Create BOM header
   Status = f$SageService ( B7Service , 'CreateBOM' , 'stueli_kopf' , 'stueli_kopf' );
   if (f$IsNullString('stueli_kopf.stlnr') == '')
   {
      f$Message ('Sage Message', Message);
      return ();
   }

   // Create BOM items
   Quantity = 4;
   for ( i=1;i<=Quantity;i=i+1)
   {
      stueli_pos[i].stlnr = stueli_kopf.stlnr;
      PGName = 'stueli_pos[' + f$FtoS(i) + ']';
      Status = f$SageService ( B7Service , 'CreateBOMLineItem' , PGName , PGName );
   }
   if (Message != '')
   {
     f$Message ('Sage Message', Message);
     return(); 
   }
   p$anzeige_ergebnis('stueli_kopf' );
   p$anzeige_ergebnis('stueli_pos' );

}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.