EXPORT
Description
This action is called for each record in the tables to be processed. By "table to be processed" means a table declared in the "identifiers" grid for the Import/Export template record. Conversely, the "Export" action will not be executed, for the tables that are only declared in the tab for the fields in the Import/Export template. In this case, the supervisor attempts to resolve the link between the table with that defined for the group by using the links described in the dictionary.
The action EXPORT is therefore executed after the read of each record n the table to be processed (the [F] class is therefore loaded) and before the write to the record to be exported.
Export OBJect
Single, Grid, Combined and without OBJect
Use
It can be used, for example :
to avoid the export of a record set the variable [L]OK=0
to update the record. The update sequence is to be written entirely in these action.
to load the variables GIMP(n) ( n being a number 1 to 99 ). These variables are to be entered when the import/export template fields are named *n ( n being a number 1 to 99 ).
to export the texts stored in X3, in the form of a clob. These texts must be in complete text to be exported. (if it is a rich text, the text will be exported with all its attributes).
The available variables are as follows :
EXPFIC : Abbreviation for the table to be processed, value over 3 characters.
Example
In the export of the sales or purchase price lists, the field [F:SPL]PLICRI contains the different information separated by the character "~" is split over five fields
$EXPORT
# criteria explosion
Local Integer JK, RG
Local Char MANIP (250)
MANIP=[F:SPL]PLICRI
For RG=1 To 5
JK=instr(1,MANIP,"~")
If JK
Assign "GIMP("+num$(RG)+")" With left$(MANIP,JK-1)
MANIP=(right$(MANIP,JK+1))
Endif
Next RG
Return
Case EXPFIC
When "SOH"
If G_ENT
Gosub EXP_RAZ_T1 From TRTX3IMP
If dim([F:SOH]SOHTEX1)>0 & [F:SOH]SOHTEX1<>""
G_CLE_CLOB=[F:SOH]SOHTEX1 : Gosub EXP_TEXTE From TRTX3IMP : Gosub EXP_T1 From TRTX3IMP
Endif
EndifIf G_PIE
Gosub EXP_RAZ_T2 From TRTX3IMP
If dim([F:SOH]SOHTEX2)>0 & [F:SOH]SOHTEX2<>""
G_CLE_CLOB=[F:SOH]SOHTEX2 : Gosub EXP_TEXTE From TRTX3IMP : Gosub EXP_T2 From TRTX3IMP
Endif
EndifWhen "SOQ"
If G_DET
Gosub EXP_RAZ_T3 From TRTX3IMP
If dim([F:SOQ]SOQTEX)>0 & [F:SOQ]SOQTEX<>""
G_CLE_CLOB=[F:SOQ]SOQTEX : Gosub EXP_TEXTE From TRTX3IMP : Gosub EXP_T3 From TRTX3IMP
Endif
Endif
Endcase
In the export of the sales or purchase orders there is the possibility to export the clob texts. The sub-programme EXP_TEXTE splits the clob into 8 fields of 250 characters, then the process EXP_T1 ( or EXP_T2, or EXP_T3 ) ; loads the variables GIMP(n).