on 03-27-2014 11:41 AM
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
* 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
HI,
Thanks for your response Mr. Andy and Mr. Sally. will try this and let you know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.