cancel
Showing results for 
Search instead for 
Did you mean: 

File Size on Candidate Profile in E-Recruting (on Portal)

Former Member
0 Kudos

Hi Experts,

I got a requirement i.e to limit file size when candidate trying to Upload document.

Went through many threads........please go through my requirement and help me.....

I got a badi HRRCF00_DOC_UPLOAD.

I couldn't get file size using method CHECK_ATTACH_FILE_SIZE of the same BADI.

I have done the following coding referencing some other thread  -

Data: lv_size type i.
 
lv_size = XSTRLEN( content ).

*Bigger than 4 MB?

if lv_size > '2000000'.

   is_out_of_range = 'X'.

  endif.


When i am debugging, any file i upload, always getting the value of CONTENT same and not getting the file size.


Can you tell me what else i need to do to get the file size.


Please help as this is urgent.


Thanks,

Rupam



Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

   * Convert xstring to calculate length
                CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
                  EXPORTING
                    buffer        = lf_content
                  IMPORTING
                    output_length = lf_sizetemp
                  TABLES
                    binary_tab    = lt_binary.

0 Kudos

Andy has already highlighted the code but just to add that you can set a particular length for the parameter CONTENT. Then you just have to check if this is too much and up to what value you wish to set  for value IS_OUT_OF_RANGE.

cheers
Sally

Former Member
0 Kudos

Hi Andy,

Still , any file I upload in parameter CONTENT , its automatically converted to 'D0' while executing the "CHECK_ATTACH_FILE_SIZE" method of the BADI " HRRCF00_DOC_UPLOAD "..

I have done the following coding as per your suggestion -

Data: lf_sizetemp type i.
Data: lf_content type XSTRING.
DATA: lt_binary TYPE TABLE OF x.


  " Convert xstring to calculate length

  lf_content = CONTENT.

  lf_sizetemp = XSTRLEN( content ).

  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
      buffer        = lf_content
      IMPORTING
      output_length = lf_sizetemp
      TABLES
      binary_tab    = lt_binary.


  if lf_sizetemp > '4194304'.

   is_out_of_range = 'X'.

  endif.


Please help where i need to rectify the coding.


Urgent.


Thanks,

Rupam

Former Member
0 Kudos

Hi Sally,

Still , any file I upload in parameter CONTENT , its automatically converted to 'D0' while executing the "CHECK_ATTACH_FILE_SIZE" method of the BADI " HRRCF00_DOC_UPLOAD "..

I have done the following coding as per your suggestion -

Data: lf_sizetemp type i.
Data: lf_content type XSTRING.
DATA: lt_binary TYPE TABLE OF x.


  " Convert xstring to calculate length

  lf_content = CONTENT.

  lf_sizetemp = XSTRLEN( content ).

  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
      buffer        = lf_content
      IMPORTING
      output_length = lf_sizetemp
      TABLES
      binary_tab    = lt_binary.


  if lf_sizetemp > '4194304'.

   is_out_of_range = 'X'.

  endif.


Please help where i need to rectify the coding.


Urgent.


Thanks,

Rupam

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

Thanks for your response Mr. Andy and Mr. Sally. will try this and let you know.