Ansicht
Dokumentation

ERC_DOC_UPLOAD - BAdI: Upload Documents

ERC_DOC_UPLOAD - BAdI: Upload Documents

ABAP Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

The purpose of this Business Add-In (BAdI) HRRCF00_DOC_UPLOAD is to check files that are uploaded as attachments to the E-Recruiting System.

The BAdI supplies the following methods for an implementation. These methods are executed one after another in the sequential order specified below:

CHECK_ATTACH_FILE_TYPE

This method checks the file type of an attachment. You can specify what file types may be uploaded for a given HR object. If a file type is not stored, the file may not be uploaded and the user receives notification of this.

Parameter Type Reference Type Description
FILENAME Importing STRING Name of file. Using the function module SKWF_MIMETYPE_OF_ FILE_GET, the file type can be determined from the file name extension.
HROBJECT Importing HROBJECT Key of HR object with which the file is to be linked as attachment. The following object types are possible: Candidate = 'NA', Requisition = 'NB', Application = 'ND', Candidacy = 'NE'.
SUBTYPE Importing SUBTY Subtype for Attachments infotype (5134) according to control table T778U. Specifies the purpose of the attachment, for example, candidate profile, Talent Relationship Management, requisition.
ATTACHMENT_TYPE Importing RCF_ATTACHMENT_TYPE Attachment type according to the Customizing table T77RCF_ATTTYPE. Specifies the content the attachment has, for example, curriculum vitae, application photograph, copy of certificates.
MIME_TYPE Importing W3CONTTYPE MIME content type according to the file name extension. The parameter is not supplied in general since it can be determined automatically when saving the file (see function module SDOK_MIMETYPE_GET).
IS_NOT_VALID Exporting BOOLE_D Result of check: The file format is not permitted - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.
RETURN Exporting BAPIRETTAB Table with return information in the case of an error during the check. If this table contains an entry, the file is no longer processed and is not uploaded to the system. There is no further handling of the error.

CHECK_ATTACH_FILE_SIZE

This method checks the file size of an attachment. A maximum size may be specified. If files exceed the maximum size, they cannot be saved and the user receives notification of this.

Parameter Type Reference Type Description
CONTENT Importing XSTRING File content in the form of a byte sequence of variable length
HROBJECT Importing HROBJECT Key of HR object with which the file is to be linked as attachment. The following object types are possible: Candidate = 'NA', Requisition = 'NB', Application = 'ND', Candidacy = 'NE'.
SUBTYPE Importing SUBTY Subtype for Attachments infotype (5134) according to control table T778U. Specifies the purpose of the attachment, for example, candidate profile, Talent Relationship Management, requisition.
ATTACHMENT_TYPE Importing RCF_ATTACHMENT_TYPE Attachment type according to the Customizing table T77RCF_ATTTYPE. Specifies the content the attachment has, for example, curriculum vitae, application photograph, copy of certificates.
MIME_TYPE Importing W3CONTTYPE MIME content type according to the file name extension. The parameter is not supplied in general since it can be determined automatically when saving the file (see function module SDOK_MIMETYPE_GET).
IS_OUT_OF_RANGE Exporting BOOLE_D Result of check: The file size exceeds the permitted limit - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.
RETURN Exporting BAPIRETTAB Table with return information in the case of an error during the check. If this table contains an entry, the file is no longer processed and is not uploaded to the system. There is no further handling of the error.

CHECK_NUMBER_OF_ATTACH

This method checks the number of files already uploaded for an object. A maximum number of files or a maximum amount of memory space for all files may be specified. When the maximum specified is reached, no more files may be uploaded and the user receives notification of this.

Parameter Type Reference Type Description
CONTENT Importing XSTRING File content in the form of a byte sequence of variable length
HROBJECT Importing HROBJECT Key of HR object with which the file is to be linked as attachment. The following object types are possible: Candidate = 'NA', Requisition = 'NB', Application = 'ND', Candidacy = 'NE'.
SUBTYPE Importing SUBTY Subtype for Attachments infotype (5134) according to control table T778U. Specifies the purpose of the attachment, for example, candidate profile, Talent Relationship Management, requisition.
ATTACHMENT_TYPE Importing RCF_ATTACHMENT_TYPE Attachment type according to the Customizing table T77RCF_ATTTYPE. Specifies the content the attachment has, for example, curriculum vitae, application photograph, copy of certificates.
MIME_TYPE Importing W3CONTTYPE MIME content type according to the file name extension. The parameter is not supplied in general since it can be determined automatically when saving the file (see function module SDOK_MIMETYPE_GET).
IS_OUT_OF_RANGE Exporting BOOLE_D Result of check: The maximum number of attachments was exceeded - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.
RETURN Exporting BAPIRETTAB Table with return information in the case of an error during the check. If this table contains an entry, the file is no longer processed and is not uploaded to the system. There is no further handling of the error.

CHECK_VIRUS

This method scans files for viruses before the files are stored in the database. SAP recommends that you use the method CHECK_ATTACH_VIRUS_VIA_VSA for SAP E-Recruiting, Release 3.00 and higher.

Parameter Type Reference Type Description
CONTENT Importing XSTRING File content in the form of a byte sequence of variable length
IS_INFECTED Returning BOOLE_D Result of virus scan: The file contains a virus - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.

CHECK_ATTACH_VIRUS_VIA_VSA

This method scans files for viruses before they are stored in the database. The method uses the virus scan interface to integrate external virus scanner programs. The interface is generally available as of SAP NetWeaver 04. For more information, see the SAP Library under SAP NetWeaver -> Security -> System Security-> Virus Scan Interface.

Parameter Type Reference Type Description
CONTENT Importing XSTRING File content in the form of a byte sequence of variable length
HROBJECT Importing HROBJECT Key of HR object with which the file is to be linked as attachment. The following object types are possible: Candidate = 'NA', Requisition = 'NB', Application = 'ND', Candidacy = 'NE'.
SUBTYPE Importing SUBTY Subtype for Attachments infotype (5134) according to control table T778U. Specifies the purpose of the attachment, for example, candidate profile, Talent Relationship Management, requisition.
ATTACHMENT_TYPE Importing RCF_ATTACHMENT_TYPE Attachment type according to the Customizing table T77RCF_ATTTYPE. Specifies the content the attachment has, for example, curriculum vitae, application photograph, copy of certificates.
MIME_TYPE Importing W3CONTTYPE MIME content type according to the file name extension. The parameter is not supplied in general since it can be determined automatically when saving the file (see function module SDOK_MIMETYPE_GET).
IS_INFECTED Exporting BOOLE_D Result of virus scan: The file contains a virus - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.
RETURN Exporting BAPIRETTAB Table with return information in the case of an error during the check. If this table contains an entry, the file is no longer processed and is not uploaded to the system. There is no further handling of the error.

CONVERT_FILE_TYPE

This method lets you convert files uploaded as attachments to a specific file format. Conversion is done using third-party software.

Parameter Type Reference Type Description
CONTENT Changing XSTRING File content in the form of a byte sequence of variable length
FILENAME Changing STRING Name of file. Using the function module SKWF_MIMETYPE_OF_ FILE_GET, the file type can be determined from the file name extension. After the file format has been converted, the file name extension must be modified accordingly.
HROBJECT Importing HROBJECT Key of HR object with which the file is to be linked as attachment. The following object types are possible: Candidate = 'NA', Requisition = 'NB', Application = 'ND', Candidacy = 'NE'.
SUBTYPE Importing SUBTY Subtype for Attachments infotype (5134) according to control table T778U. Specifies the purpose of the attachment, for example, candidate profile, Talent Relationship Management, requisition.
ATTACHMENT_TYPE Importing RCF_ATTACHMENT_TYPE Attachment type according to the Customizing table T77RCF_ATTTYPE. Specifies the content the attachment has, for example, curriculum vitae, application photograph, copy of certificates.
MIME_TYPE Importing W3CONTTYPE MIME content type according to the file name extension. The parameter is not supplied in general since it can be determined automatically when saving the file (see function module SDOK_MIMETYPE_GET).
IS_NOT_VALID Exporting BOOLE_D Result of check: The file coult not be converted in the save format - TRUE = 'X' or FALSE = ' '. If the check ends with a negative result, the file is no longer processed and is not uploaded to the system. The user receives an onscreen notification.
RETURN Exporting BAPIRETTAB Table with return information in the case of an error during the check. If this table contains an entry, the file is no longer processed and is not uploaded to the system. There is no further handling of the error.

BAPIRETTAB

BAPIRETTAB

BAPIRETTAB

After you have called the IMG activity, proceed as follows:

  1. In the following dialog box, enter in the field "Implementation" a name for the BAdI implementation and choose Copy.
If implementations have already been created for the BAdI, a dialog box with the existing implementations will be displayed. In this dialog box, choose Create.
  1. In the corresponding field, enter a short text for implementation .
  2. In the tab Propertiesenter filter properties - if this is a filter-dependent BAdI.
  3. Choose the tab Interface.
The name of the implementing class is generated by the system based on the name of your impmlementation. You can change the name.
If the BAdI is a menu exit, the tab FCodes also appears.Enter a function here and, if necessary, additional data.
  1. Save your entries and assign a package.
  2. Position the cursor on a method. Call up the Class Builder by double-clicking it.
  3. Between the statements method <Interface-Name>~<Name of Method>. and endmethod, enter the coding you request for the implementation.
  4. Save and activate your coding, and navigate back to the screen Change Implementation.
  5. Save on the screen Change Implementation.
Note: You can first create an implementation for the BAdI and then activate this later on. In this case, close the processing function at this time.
  1. Choose Activate.
When the application program is executed, the coding you have created will be run.
BAPIRETTAB






Fill RESBD Structure from EBP Component Structure   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 19422 Date: 20240523 Time: 201709     sap01-206 ( 280 ms )