Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Execel sheet overwrite pop up in SAP

Former Member
0 Kudos
1,593

While downloading Excel sheet file into particular location in local folder

if there is a file  already exist with a same name then it pops up a box asking do you want to replace it ?

The pop up comes on excel sheet screen .

is it be possible to display the pop up in SAP screen instead of excel screen.

Any input please and let me know for further info .

Regards,

Prabin

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
757

You could use the available methods of class cl_gui_frontend_services to check existence and delete file before triggering save in Excel (ole2, SaveAs ?) Did you already try methods like file_save_dialog or file_exist?

Hint: In Excel you can use Application.DisplayAlerts = False to prevent display of such pop-ups. Don't forget to reset it to true...

Regards,

Raymond

14 REPLIES 14

Former Member
0 Kudos
757

I am using OLE  for excel generation

raymond_giuseppi
Active Contributor
0 Kudos
758

You could use the available methods of class cl_gui_frontend_services to check existence and delete file before triggering save in Excel (ole2, SaveAs ?) Did you already try methods like file_save_dialog or file_exist?

Hint: In Excel you can use Application.DisplayAlerts = False to prevent display of such pop-ups. Don't forget to reset it to true...

Regards,

Raymond

0 Kudos
757

Hi Raymond,

I don't  want delete the existing file . I just want to see the overwrite pop up screen in SAP instead in Excel sheet.

i am using  cl_gui_frontend_services=>file_save_dialog for  file location selection.

I think, if i can find a way to Suppress the excel sheet (while using OLE it brings excel sheet screen to user front end) then probably i can achieve my goal.

Thanks

0 Kudos
757

Hint 2: Raymond's hint can help you with hiding that pop-up window.

-- Tomas --

0 Kudos
757

By default the FILE_SAVE_DIALOG should have already raised an overwrite pop-up, parameter PROMPT_ON_OVERWRITE is checked by default, You didn't clear it?

If returned USER_ACTION was CL_GUI_FRONTEND_SERVICES=>ACTION_OK (or ACTION_OVERWRITE depending on your ECC version) hide the Excel pop-up clearing Application.DisplayAlerts.

Regards,

Raymond

0 Kudos
757

Working.... fine as expected .

Got pop up while providing file path

Is there anyway i can generate excel sheet through OLE without showing the excel sheet to user , Any OLE parameter can be used for the same?

Could you please give  bit more info about the below sentence where it can be use ?


If returned USER_ACTION was CL_GUI_FRONTEND_SERVICES=>ACTION_OK (or ACTION_OVERWRITE depending on your ECC version)

Thank you .

0 Kudos
757

Many OLE2 applicaiton/objects have an attribute 'Visible'.


SET PROPERTY OF application 'Visible' = 0.

Regards,

Raymond

0 Kudos
757

Hi Raymond,

Hope you are doing good.

I need One clarification.

After generating .xls file when I open the excel file it gives security warning,

Though  Application.DisplayAlerts = False   condition is already there.

Is there anyway the warning screen can be suppressed  ?


Thanks

Regards,

Prabin

0 Kudos
757

This warning I was only able to remove (import warning) by providing a true Excel file (XLSX aka a zipped xml) and not a csv in disguise or naming the file with an honest csv suffix and not xls...

Else look in microsoft support for 'Group Policy setting' or regedit on HKEY_CURRENT_USER\Software\Microsoft\Office\<version number>\Excel\Security for xtensionHardening (set to 0) don't know if some method can do the same - but some security risk?

Regards,

Raymond

0 Kudos
757

Yes , XLSX file doesn't throw any Waring pop up. 

But as per the requirement .XLS file is the preference.



Thank you.



Regards,

Prabin

0 Kudos
757

As good old xls was a Microsoft poprietary format, you should have generated the file thru Excel (e.g. using OLE2)

NB: As of Microsoft Open Specification Promise (OSP) you may find some tools, but as most people switch for xlsx...

Regards,

Raymond

matt
Active Contributor
0 Kudos
757

Why? What does it matter?

Former Member
757

It's a requirement from client   

manjunath_yallankar
Discoverer
0 Kudos
757

SET PROPERTY OF wf_excel 'DisplayAlerts' = 'FALSE'.

worked for me.