ABAP/Excel: Method Save_as

Dear all,
Does anyone have experience with the method Save_as of the document proxy.
Although I supply a filename as parameter the document name in Excel (in this case) is always the Document title under which the Document has been created initially.
Does anyone have a solution?
Kind regards,
John.

I have used it without the problem you mention.  The following is the sample code from 46C:
****Save the document
  call method document->save_as
              exporting
                file_name = item_url.
  call method c_oi_errors=>show_message exporting type = 'E'.
I have also done it from OLE.  If you have problems you might try that:
handles for OLE objects
  data: h_excel type ole2_object,        " Excel object
        ole_books type ole2_object,
        ole_databook type ole2_object.
start Excel
  data: file_type type i.
  file_type = '-4143'.
  create object h_excel 'EXCEL.APPLICATION'.
  set property of h_excel  'Visible' = 0.
  call method of h_excel 'Workbooks' = ole_books.
  call method of ole_books 'Open' = ole_databook
  exporting #1 = i_source_file.
  call method of ole_databook 'SaveAs'
  exporting #1 = i_destination_file
            #2 = file_type.
  call method of h_excel 'Quit'.
  free object ole_databook.
  free object ole_books.
  free object h_excel.
The SaveAS with OLE lets you choose a filetype.  -4143 is native Excel.  44 is HTML and 46 is XML.

Similar Messages

  • ABAP OO Method

    Greeting Gurus,
    I am working with the Purchasing cube and I have come accross a routing that PERFORMs LOC_CURR_CONVERT.  I need to convert this to a ABAP OO Method.  I find it difficult to find any information on this.  Does anybody have any suggestions?
    I am on SP8, waiting on SP10.
    Does SAP have a method name that replaces this ABAP Routine?  Or do I need to code myself?  Is there any handy documentation (I found HOW To... Routines within Transformations already, however, not explicity to Methods.)
    Kind Regards,
    Alex

    Hi KJ,
    I have executed the steps already on the document you gave me.  I am on the "further edit the transformation manually" step.  Since I am on SP8, my guess, is that it is not giving me the "proposal" of migrating the PERFORM call to a FUNCTION call.
    Please see the following post, where Rohan also is experiencing the same problem in SP8.  Re: How to convert  old Abap routine in to ABAP OO in 2004s
    My guess is I need a comperable FUNCTION call to that of the old LOC_CURR_CONVERT.

  • ABAP OO method on Task - won't execute in background

    I've been trying to get workflow with ABAP OO methods up and running on our 6.20 system.  I've followed Jocelyn's blog series and the associated white paper, and can get the DISPLAY method working for her example ZCL_PLANT class.
    I can't seem to get a task working with the static CREATEINSTANCE method, however.  The method works fine (tested in SE24), but when I create an associated task and test it in SWUS, the log shows the status of the work item as Ready, with my name as the Agent.
    I've flagged the task as synchronous and background - is there anything else I should be doing?
    Thanks in advance,
    Andrew

    Hi Andrew,
    Check your Synchronous and Background parameters on the Task again, activate your WF again and start a new workflow.
    This should definitely work and not have you as an agent. But sometimes it can be a bit stubborn if you e.g. stay in the same transaction and make changes in another session. Always go back to the main Easy Access menu before testing changes.
    Cheers,
    Mike

  • ON COMMIT ABAP CLASS METHOD

    Hi Friends,
    Can i execute and abap oo method on commit work.
    similiar to perform form on commit.
    thanx

    Hi Kaushik!
    This should be possible, but with a little bit different approach:
    You can implement an event handler for the commit event. Then you have to register this method for the commit event. Have a look at program SAPMSSY0. In routines %_before_commit, %_commit and %_after_commit you will find some events, e.g.
    * Raise event 'Commit Requested' for Object Manager
      CALL METHOD cl_os_transaction_end_notifier=>raise_commit_requested.
    , for which you might like to register your method.
    Regards,
    Christian

  • ABAP OOP method in Workflow task 6.20

    Hello all!
    In the following blog /people/jocelyn.dart/blog/2006/07/25/using-abap-oo-methods-in-workflow-tasks it is mentionned that to enable OOP methods for workflow tasks on 6.20 one needs to run report SWF_CATID.
    I'm currently on a customer system 6.20 ABAP SP50 and this report simply does not exist. Is this report appearing in a later support pack or is this not available until 6.40 as I belived....
    Any advise on how to enable this on an above system is highly appriciated!
    Regards
    Martin Jonsson

    Hi,
    Check this Report - RSWF_CATID.
    Regards,
    Surjith

  • ABAP class method with dialogue

    Hi all,
    I want to use a ABAP class method within a Workflow definition with user interaction. The SAP help says, that is possible, but I couldn't find a way, to mark the method as "with dialogue".
    For BOR-objects there is a checkbox in the details for the method definition. Can anybody tell me, how it can be done?
    Thanks in advance
    Nick

    Hi Nicolas,
      When you create the Task with the ABAP OO Method, you can select it as "Background Processing" else it will be a "Dialog Process".
    If you notice here, "Background Processing" checkbox will be editable if ABAP OO Method is used, whereas in case of Business Objects it directly comes from method definition.
    Reward points if useful.

  • Function module or ABAP-OO method to start DTP via Coding

    Hello experts,
    is there any function module or ABAP-OO-method, which I can use to start DTP's via ABAP-Coding (e.g. in my own programm)? I know there are FM's to start, change, delete, etc. InfoPackges. Are there any functions like them also available for DTP's?
    Kind regards,
    André

    Hello Andre,
    [Re: CL_RSBK_DTP - How to use...]
    I've tested and it works fine!
    Regards,
    William

  • How The ABAP Proxy method gets triggered

    Hi All,
    I have created a ABAP Proxy for inbound interface.For this interface the data is coming from XI system.So i am writing the logic to read the XI data into an internal table and am populating the same data into a BAPI.
    So my question is,once the XI system sends the data, Will this ABAP Proxy Method automatically gets trigger or Do we need to make any settings?
    Please Help me As early as possible.
    Thanks in advance
    Regards
    Srinivas Kodukula

    Hi srinivas,
    Refer the below points for the configuration needed at R/3 side:
    1. Create a HTTP connection in the business system using transaction SM59
    2. Configuration Business system as local Integration Engine in SXMB_ADM
    3. Connection between Business System and System Landscape Directory. For this check the RFC destinations LCRSAPRFC and SAPSLDAPI
    4. Maintaining the SAP J2EE Connection Parameters for LCRSAPRFC and SAPSLDAPI in SAP J2EE engine
    5. Maintain SLD access details in Transaction SLDAPICUST
    Regards,
    Kiran Bobbala

  • Using arguments to invoke an excel method from PL/SQL with Oracle COM

    Hello Gentlemen,
    I has been trying to export an excel sheet to a PDF file format using “ExportAsFixedFormat” method, with no success or error message.
    Moreover, I tried to use “PrintOut” method, if I use it with no parameters/arguments it executed without errors and display the sheet to an application installed in my PC (“SnagIt”), if I try to use it with an argument to assign a printer for it, I got this error message “PrintOut method of Workbook class failed xlmain11.chm”.
    I believe I have a problem with using arguments, and I don’t know how to use it in a proper way; the code I used is listed below for your review and your kind help, thank you a lot, and I appreciate so much your helpful feedback.
    Best regards,
    Nabil
    List 01 – using “ExportAsFixedFormat” method
    ==============================
    ORDCOM.InitArg();
    ORDCOM.SetArg('xlTypePDF','XlFixedFormatType');
    ORDCOM.SetArg('E:\ TestDelete.pdf','BSTR');
    ORDCOM.SetArg('xlQualityStandard','BSTR');
    ORDCOM.SetArg('True','BOOL');
    ORDCOM.SetArg('False','BOOL');
    ORDCOM.SetArg('True','BOOL');
    dbms_output.put_line('WorkSheetToken................WorkBookToken........'||WorkBookToken);
    i := ORDCOM.Invoke(WorkBookToken, 'ExportAsFixedFormat', 6, DummyToken);
    List 02 – using “PrintOut” method:
    ======================
    ActivePrinter := 'Macromedia FlashPaper';
    ORDCOM.InitArg();
    ORDCOM.SetArg(activeprinter,'BSTR');
    i := ORDCOM.Invoke(WorkBookToken, 'PrintOut', 1, DummyToken);

    Hello,
    Any help please? I believe I have a problem with using arguments, and I don’t know how to use it in a proper way; the code I used is listed above for your review and your kind help, thank you a lot, and I appreciate so much your helpful feedback.
    Best regards,
    Nabil

  • How would YOU retype these old XM08 types for use in an ABAP OO method?

    The XM08 function group has the following type declarations:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr LIKE drseg_cr    OCCURS 0,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    TYPES: mmcr_tdrseg TYPE mmcr_drseg OCCURS 0,
    TYPES: BEGIN OF mmcr_drseg.
            INCLUDE STRUCTURE drseg.
    TYPES: cr LIKE drseg_cr OCCURS 0,
           co TYPE mmcr_drseg_co OCCURS 0,
           sm LIKE drseg_sm OCCURS 0,
           charact TYPE rbcharact_instance OCCURS 3,
                                           "instances of characteristics
           uebgmat  TYPE matnr,
           uebrblgp TYPE rblgp,
           selkz_db TYPE selkz,
           rblgp_old TYPE rblgp,           "rblgp before aggregation
           END OF mmcr_drseg.
    How would YOU redeclare these types so that they work in an ABAP Objects class?  
    Some of the "fixes" are easy, like replacing "LIKE" with "TYPE:".
    But what about the "INCLUDE STRUCTURE" and the "occurs 0" specifications?
    The reason I'm asking this is that I have to call a method from ZXM08U16 and I'd like to be able to pass this method exactly what XXM08U16 gets from SAP, i.e. the table E_TDRSEG of type  MMCR_TDRSEG

    David,
    I wonder it can be directly in ABAP (I would like to hear opinions from others as well!), I needed to use Data Dictionary as well:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr TYPE z_tt_drseg_cr,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    z_tt_drseg_cr is a table type created in SE11, based on structure drseg_cr.
    the way to create internal table and work area, based on the above:
    DATA : gt_... TYPE TABLE OF mmcr_drseg_co.
    DATA : gw_... TYPE mmcr_drseg_co.
    hope this helps some
    ec
    UPDATE : Rich is right, it is possible to do it only in ABAP with the DEFAULT KEY addition.

  • Call an URL with ABAP program (Method POST)

    Hi everyone,
      I need to call an URL for example "www.google.com?q=hello" with ABAP using POST method.
      Like the FM "Call_Browser", but my variable q=hello need to be passed with POST method.
    Any idea ?
    Thanks.

    here is one example I use from abap to call a web browser ITS solution with a project number, I guess you can adapt the it for your purpose?
          check <data>-pspid is not initial.
          concatenate gv_pfs_link
                      'zpfs2?~okcode=PROJ_SEL&zpspid=<###>&sel_action=X'
          into lv_url.
          replace '<###>' with <data>-pspid into lv_url.
          condense lv_url no-gaps.
          cl_gui_frontend_services=>execute(
            exporting document = lv_url ).

  • ABAP OO: methods as method params, method chains

    Hello all,
    I am currently developing quite much ABAP OO and wonder if this is possible, because I got compilation errors.
    a) Methods as method params w/o temp vars:
    I have a method whose parameter shall be the return value (let s say a string) shall be the parameter:
    document->set_owner( owner = person->get_name( ) ).
    This throws an error and I have to code this instead
    data: owner type String.
    ownerString = person->get_owner( ).
    document->set_owner( owner = ownerString ).
    ... so I have always a temp variable which is getting MUCH overhead when having such stuff often...
    Am I doing wrong or is this impossible in ABAP OO? ...am used to do such things in all other languages I know... mean, that methods can be params of other methods.
    b) "chaining of methods"
    Is this possible somehow?:
    data: tmp type String.
    tmp = employee->get_orgUnit( )->get_name( ).
    Calling one level (the get_OrgUnit() method) works fine, but an immediate call to the second level ( get_name() method) fails and I have to code this:
    data: tmp     type String,
          orgUnit type ZOrgUnit.
    orgUnit = employee->get_orgUnit( ).
    tmp = orgUnit->get_name( ).
    This also very annoying to have so much temporary help variables on the way.
    Is there any help for me?
    Thank you for any hints and reagrds,
    Timo

    Hi Timo,
    as Richard's reply says it's impossible in ABAP-OO. The nature of this language is ABAP not OO
    Only helpful for you, could be the returning parameter. It's very useful in conditional expressions like
    if m1->a() = '2'.
    A preferred parameter to avoid writing parameter names like
    m1->b( '2' ).
    All other useful stuff of method or parameter chaining, and so on is NOT possible. Sorry.

  • HR ABAP - Generic method or function to create a PD object & Relat (IT1001)

    Hi,
    This question is related to HR Abap .
    Do we have a generic class method or function module which can be used to create any PD object(O,S,C,...) and relationships (A008, A003, 007,...)between these objects .(not RH_INSERT_INFTY) . It should also trigger change pointers .
    And also do we have a decoupled or generic infotype(1000,1001,1002,....) classes in PD side also similar to PA infotype classes(CL_HRPA_INFOTYPE_0002, CL_HRPA_INFOTYPE_0008,....) . It should also trigger change pointers .
    Thanks in advance

    Generic function to create infotypes 1000 and 1001 is RH_INSERT_OBJECTS
    Classes are CL_HRBAS_INFTY_1000, CL_HRBAS_INFTY_1001, etc

  • Calling ABAP class methods from JAVA application

    Hi All,
    I want to fetch ITS related information (SITSPMON Tcode) in my JAVA application. But i didnt find much BAPIs for the same. While debugging I came accross few class methods with help of which I can get the required information. So is there any way we can call and execute methods of ABAP classes through java application?
    for e.g. I want to call GET_VERSION method of CL_ITSP_UTIL class.
    Thanks,
    Arati.

    Hi,
    Yes, as per my knowledge the only way to interact is using BAPI exposed as RFCs. So try to invoke those class methods in one CUSTOM BAPI and expose that BAPI as RFC and consume that RFC to get those details.
    Regards,
    Charan

  • How can i write code in Inbound ABAP proxy method

    Hi,
    All
    Iam doing server proxy ascenario
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    i have done
    steps:
    1:I have done inbound  proxy interface in xi
    2:i have created a inbound abap proxy in my SAP WEB AS6.4 using SPROXY.
    3:I need to write code in Z11_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS method
    if i double click on that method it is not opening how can I write code.

    Hi,
    You have to goto the class
    <b>ZCL</b>_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS not
    <b>Z11</b>_EMPDETAILS_IN~EXEXUTE_ASYNCHRONOUS
    Check on the third step.
    Regards
    Vijaya

Maybe you are looking for

  • Why does my iphone 4s no longer appear on my PC?

    Last week I downloaded to my PC some pictures from my Iphone 4s.  Since then, my Iphone does not appear as a device on my PC.  I have rebooted my PC. I've rebooted my Iphone.  I've deleted and reinstalled Itunes and made sure I have the latest issue

  • BPM payload value reading problem

    Hi all, In a bpm scenario, I have a switch that checks an element's attribute and another that checks an element's value.  In the former case, the TRUE branch gets executed when the condition is satisfied.  However, in the latter the condition is NEV

  • Required clarificatrion about  Netweaver 2004s

    Hi All, If anybody of you is having information about the following, please put it here. 1. Need confirmation about 'Record Management System' (DMS?) availability in base NetWeaver 2004s platform (not mySAP ERP or any other mySAP application) 2. Poss

  • Sign in password not recognozed problem - is there...

    I've browsed many posts where people cannot sign in due to a password not recognized error.  Has anyone found a fix for this? I've tried a hard power off/on and deleting and re-installing Skype, but still get the error.

  • Cannot update WEC7

    Hi, My system is Windows 7 with WEC7 licensed.  I try to run the update and it fails during downloading the Windows Embedded Silverlight Tools.  When failing a window popup, saying "Error - The package 'Windows Embedded Silverlight Tools Update 7' en