f$SAP_Function (f$SAP_Funktion)
f$SAP_Function (f$SAP_Funktion)
A BAPI or other function component is called in SAP with this function. The data needed for the function component is entered in a parameter group of the type tdv:SAP_BAPI. In the definition of the function component, you can see which data the function component requires. The interface reads the structure of the table used from the SAP system and processes the data to be transferred with this information. If necessary, a data type conversion is carried out. In this way, a date is automatically converted from 31.01.2005 to 20050131, for example. Only strings in SAP with leading zeros must also be with leading zeros in ePOS strings. Otherwise you can use other data types in ePOS than in SAP. It is also not absolutely necessary to define all fields in a SAP table in the allocated ePOS parameter group.
Syntax: | Status = f$SAP_Function( PGName ) | |||
| Argument | Type | Meaning | |
| PGName | String | Name of the administration parameter group containing the information about the function component and its data. When using the function p$tdv:sap:add_export etc., the name of this parameter group must be SAPDef. If the administration parameter group occurs through direct assignments, the name of the parameter group can also be different. | |
Result: | Integer | Status of the function: | ||
| -999 | Not enough memory available | ||
| -6 | The data for the allocated parameter group is not correct | ||
| -5 | The data for the administration parameter group is incomplete | ||
| -4 | The administration parameter group does not exist | ||
| -3 | The command could not be performed successfully | ||
| -2 | Cannot create the object (exterior) | ||
| -1 | Cannot be logged in | ||
| 0 | The γommand was carried out successfully. However this only concerns the part of the interface. You must evaluate the function component's return tables for the entered function component to have been successful. | ||
Example: | Example for creating a material for production resources and tools MARA_UEB[1].MANDT = '020' MARA_UEB[1].MATNR = MaterialNummer MARA_UEB[1].TCODE = 'MM01' MARA_UEB[1].TRANC = '1' MARA_UEB[1].ERSDA = '07.12.2005' MARA_UEB[1].ERNAM = 'ACBIS' MARA_UEB[1].VPSTA = 'KEF' MARA_UEB[1].PSTAT = 'KEF' MARA_UEB[1].MTART = 'FHMI' MARA_UEB[1].MBRSH = '1' MARA_UEB[1].MEINS = 'ST' MARA_UEB[1].MATKL = '01' MARA_UEB[1].COMPL = '00' MAKT_UEB[1].MANDT = MARA_UEB[1].MANDT MAKT_UEB[1].MATNR = MARA_UEB[1].MATNR MAKT_UEB[1].SPRAS = 'DE' MAKT_UEB[1].MAKTX = 'Test Material' MAKT_UEB[1].MAKTG = 'Test Material' MAKT_UEB[1].TRANC = MARA_UEB[1].TRANC MARC_UEB[1].MANDT = MARA_UEB[1].MANDT MARC_UEB[1].MATNR = MARA_UEB[1].MATNR MARC_UEB[1].WERKS = '0001' MARC_UEB[1].TRANC = MARA_UEB[1].TRANC MARC_UEB[1].DISMM = 'ND' MARC_UEB[1].MTVFP = '01' MARD_UEB[1].MANDT = MARA_UEB[1].MANDT MARD_UEB[1].MATNR = MARA_UEB[1].MATNR MARD_UEB[1].WERKS = MARC_UEB[1].WERKS MARD_UEB[1].LGORT = '0001' MARD_UEB[1].TRANC = MARA_UEB[1].TRANC MARD_UEB[1].LFGJA = '2005' MFHM_UEB[1].MATNR = MARA_UEB[1].MATNR MFHM_UEB[1].STEUF = '1' MFHM_UEB[1].PLANV = '009' MFHM_UEB[1].TRANC = MARA_UEB[1].TRANC MFHM_UEB[1].MANDT = MARA_UEB[1].MANDT MFHM_UEB[1].WERKS = MARC_UEB[1].WERKS Status = f$SAP_Login (3,'194.180.172.133','','00','020','ACBIS','ACBIS','de',0) SAPDef.FunctionName = 'Z_EPOS_CREATE_MATERIAL' p$tdv:sap:add_export( 'IV_MATNR' ,MaterialNumber , 0 , 0 ) p$tdv:sap:add_tabelle( 'GT_EPOS_SYSTEM' , 'ZEPOS_SYSTEM' ,'EPOS_System' , 0 ,0 ) p$tdv:sap:add_tabelle( 'GT_AMERRDAT' , 'MERRDAT' ,'MERRDAT' , 0 ,0 ) p$tdv:sap:add_tabelle( 'GT_AMARA_UEB' , 'MARA_UEB' ,'MARA_UEB' , 2 ,1 ) p$tdv:sap:add_tabelle( 'GT_AMAKT_UEB' ,'MAKT_UEB' ,'MAKT_UEB' , 2 , 1 ) p$tdv:sap:add_tabelle( 'GT_AMARC_UEB' ,'MARC_UEB' ,'MARC_UEB' , 2 , 1 ) p$tdv:sap:add_tabelle( 'GT_AMARD_UEB' ,'MARD_UEB' ,'MARD_UEB' , 2 , 1 ) p$tdv:sap:add_tabelle( 'GT_AMFHM_UEB' ,'MFHM_UEB' ,'MFHM_UEB' ,2 , 1 ) Status = f$SAP_Function( 'SAPDef' ) p$test_erfolg() Status = f$SAP_Logout () | |||