on 05-12-2005 7:37 PM
Hello,
I have developed a file upload / download interface on ITS (Templates are built using Interent Services - Classic HTML in SE80). The problem is interemediary screens appear during file upload / download. I have the ~GENERATEDYNPRO paremeter value = 1 , meaning if my IAC does not have the relevant screen, an equivalent webgui screen would be generated. My questions are:
1. If I use mime-download, would I be able to select the file from the workstation? <b>is there any macro for file selector from workstation?</b>
2. I'm ok with the intermediary screen, <b>but is there an option not to show the menu bar, like open session etc.</b>
I have ~DONTSHOWACCESSIBILITYONLOGIN = 1, so it does not show the transaction command box.
Hi Michael,
Will you please tell me how to prepare this INternal Table (Tab separated and with Carriage return). I tried it..but it is not working Fine..
I would appreciate if you can help me out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the data you get after mime-upload is in binary format. If you want to convert it into character string (unicode)
you have to write something like this:
data: data_tab type table of w3mime
data: i_xstring type xstring.
data: i_string type string.
data: wa_w3mime type w3mime.
data: l_conv type ref to cl_abap_conv_in_ce.
loop at mime_info.
mime-upload sy-tabix data_tab datalen.
loop at data_tab into wa_w3mime.
concatenate i_xstring wa_w3mime-line into i_xstring in byte mode.
endloop.
endloop.
l_conv = cl_abap_conv_in_ce=>create( input = i_xstring ).
call method l_conv->read( importing data = i_string ).
* now you can read i_string
* you can use an additional try / catch block in case you want to prevent from
* the file not being a text file.
Regards,
Houcine Bourquouquou
> Hi Michael,
> Will you please tell me how to prepare
> ow to prepare this INternal Table (Tab separated and
> with Carriage return). I tried it..but it is not
> working Fine..
> I would appreciate if you can help me out.
hi s t ,
sure, I will try.
My w_output structure simply looks like this:
DATA: BEGIN OF w_output OCCURS 0,
string(300),
END OF w_output.
My concatenate looks like this for the Excel header line:
CONCATENATE 'Schedule'
'Material Number'
'Description'
'Plant'
'Receipt'
'Schedule Date'
INTO w_output-string
SEPARATED BY con_tab.
(it looks similar for the detail line, obviously)
after the concatenate, there are some more string manipulations to be done:
PERFORM fill_spacer.
CONCATENATE w_output-string con_lf INTO w_output-string.
DO.
REPLACE '|' WITH ' ' INTO w_output-string.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
APPEND w_output.
I use the '|' pipe symbol to force spaces between the texts, by the way.
Lastly, my fill_spacer subroutine looks like this:
FORM fill_spacer.
len = strlen( w_output-string ).
i = len + 1.
DO.
IF i = 299.
EXIT.
ENDIF.
w_output-string+i(1) = '|'.
ADD 1 TO i.
ENDDO.
ENDFORM. " fill_spacer
This prevents the texts from being squashed up.
Now, one more thing: it took me a while to find the correct codes for the tab and carriage return to make Excel start new lines - I'll save you some time. Here they are:
CONSTANTS: con_tab TYPE x VALUE '09',
con_lf TYPE x VALUE '0D'.
use "con_tab" for a column seperator and use "con_lf" for a line feed.
Hope this helps!
Kind regards,
Michael
P.S.: Please don't forget to reward points if this is what you are looking for! Ta.
The mime-download call automatically associate program to the file extension. If you use for example "application/execel" the system open Microsoft Excel and display the data. After this, the user select to save the file with file name on the workstatio.
Gianluca
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
s t,
I have used this solution before:
In your HTML code, simply trigger a new browser window (via window.open) with an ABAP Dummy-screen that only consists of a PBO event (like FORM mime-download).
This is the HTML for it:
<input class="button" type=submit value="Download" onclick="window.open('`wGateURL(~okcode="DOWN")`','','left=5, top=0, status=yes, menubar=yes, resizable=yes, scrollbars=yes')" >
And this is your business logic in your dummy-screen's PBO that's triggered when the button in your HTML was selected:
mime-download w_output '750000' 'application/vnd.ms-excel'.
LEAVE TO SCREEN 1000
.
w_output is simply a long text string that contains tab delimited column information for the Excel browser plugin - it also needs a CR at the end of the line to tell excel to start a new row. The LEAVE TO SCREEN 1000 automatically goes back to the calling screen (1000 in this example), as there is no PAI in the dummy screen.
However, I have never seen this working as an upload. though...
Hope this is of any help,m
Michael
MIME-UPLOAD
For the html:
<input type="FILE" name="LOCALFILE" size=30>
<input type="SUBMIT" name="~OkCode(FIUP)" value="File Upload">
The corresponding source abap is:
data: mime_info like savwmpmime occurs 0 with header line
mime-info mime_info.
loop at mime_info.
mime-upload sy-tabix data_tab datalen.
endloop.
where data_tab is the internat table that contain information; datalen is a variable type "i".
Gianluca
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.