SAP Record Macro Help

Hello all,
I am not sure how we can use loop.
If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"
End If
Dim i
Set xclapp = CreateObject("Excel.Application")
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = xclapp.Workbooks.Open("c:\tmp\prices.xlsx")
set xclsht = xclwbk.Sheets("Sheet1")
For i = 2 To 50
Macro will run for 50 rows.
but i am required based on A column.
if a colum have have only 10 the macro will be run only for 10.
Please help.
how can i modify the code?
thanks

Hello sir,
I am not clear.
Can you Please explain.
If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"
End If
Set xclapp = CreateObject("Excel.Application")
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = xclapp.Workbooks.Open("c:\tmp\prices.xlsx")
set xclsht = xclwbk.Sheets("Sheet1")
For i = 1
While (not Range("A" & i).Value = "")
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nmen"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0016/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:3212/cntlGRIDCONTROL/shellcont/shell").modifyCell 0,"BNFPO",xclsht.cells(i,1).Value
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[1]/usr/btnSPOP-VAROPTION1").press
i = i + 1
    Wend
Can you Please
Edited by: hpvinu on Mar 1, 2012 4:19 PM

Similar Messages

  • SAP Record-to-Report in SAP FI

    Hi SAP Gurus,
    I want the details of SAP Record-to-Report and any configuration steps also.
    Help me ASAP.
    Regards
    Shruthi

    Bashir,
    Report to Report Interface doc
    This is called "opendocument", which is a special facility within the software that allows you to build a hyperlink on a value in the "parent" report, then click on that link and it passes a response to the "child" report that would be prompting for the same.  Once the parameter is passed the "child" report appears.  Depending on the version (XI R2 or XI 3) determines how the hyperlink is built.  Please refer to the appropriate documentation for the version you are working under for the correct syntax/workflow to create the hyperlink.
    Thanks,
    John

  • Digital signature in SAP Records Management (SAP Netweaver Folders Manager)

    Hi experts,
    I have a record with various documents and I want to implement digital signature in documents (Transaction: ORGANIZER). I read in IPS640 SAP Manual that there are a button (key symbol) to do this but I don't have this button. Can you explain me how to implement this?
    A lot of thanks in advance.
    Regards,

    Hi JV,
    You need to define the repository in OAC0 transaction. As per my analysis now your document are stored in sap database.
    If you are using separate serever then confuigure as follows in OAC0:
    Document area : SAP Records Management
    Storgae type : RFC Archive
    define IP address and port. Then goto CSADMIN and activate the certificate for the same.
    or if using SAP Database then make the changes in above areas.
    Then these archived documents will get saved in content server instead of sap database.
    Hope this will help.
    Regards,
    Ravindra

  • Archiving documents in SAP Records Management

    Hello experts,
    Does anybody know how to archive documents in SAP Records Management? By default, they are stored somewhere in SAP database. However, based on the SAP documentation, they can be stored also to archive by using ArchiveLink. Where is this configuration done and how? Or do we need some coding here?
    I'm interested in two different solutions:
    1) Document will be stored on an archive server right from the start. By doing this, I no longer need to move the document content myself.
    2) Moving existing Records Management documents to archive. I know there is a program SRM_KPRO_CONTENT_RELOCATION for this purpose, but it doesn't seem to be working without some archiving/RM configuration before somewhere else.
    We are using Records Management as part of Digital Personnel Files and the documents to be archived are completed Adobe forms.
    Best Regards,
    JV

    Hi JV,
    You need to define the repository in OAC0 transaction. As per my analysis now your document are stored in sap database.
    If you are using separate serever then confuigure as follows in OAC0:
    Document area : SAP Records Management
    Storgae type : RFC Archive
    define IP address and port. Then goto CSADMIN and activate the certificate for the same.
    or if using SAP Database then make the changes in above areas.
    Then these archived documents will get saved in content server instead of sap database.
    Hope this will help.
    Regards,
    Ravindra

  • Could scenario 161 of SAP best practice  help to generate aut. posting?

    Dear All,
    We need to generate automatic postings for Sales costs, admin costs in FI. This sums we have on our cost centers groups accordingly.
    Could scenario 161 of SAP best practice help us?
    Best regards,
    Kamila

    Be in the monitor window where u got the below issue
    when I start the "schedule process" the status getting still "yellow 14:27: 31(194 from 0 records)"
    and go to environment in the menu options TransactRFC--->in the sourcesystem...
    give the logon details and enter and from there give the correct target destination as ur BI server and execute...
    if u find some idoc's pending there push that manually using F6..
    and come back to ur load and refresh....
    if still it doen't turn green u can manully change status to red in STATUS tab and come to processing tab and expand ur processing details and right click on ur data packet which was not yet updated and select manual update...
    it shows busy status and when it comes out of that once again refresh...
    rgds,

  • Integration with SAP Records Management

    Dear SAP gurus,
    We are in SRM 7 EHP 1 with backend ECC 6 EHP 5. We are exploring PPS (Procurement for Public Sector) feature in SRM. We see that using PPS we can have integration with SAP Records Management. To be honest, I never see SAP Records Management so we want to confirm the functionality. Our legacy system require a electroning filing system, in which all documents related to procurement is scanned (whether it is document from system, or the one created manually), and then stored in a server in a pdf format.
    Does SAP Records Management have this functionality in which it stores the pdf doc inside one server? If not, what is exactly the functionality of SAP Records Management?
    Best regards,
    John

    Hi,
    SAP Record Management is now known as SAP NetWeaver Folders Management.
    Contact your NetWeaver consultant to imlement SAP NetWeaver Folders Management.
    Some important links:
    1. http://wiki.sdn.sap.com/wiki/display/HOME/SAPRecordsManagement
    2. http://www28.sap.com/businessmaps/0531547C7FE54C6A9E9B5850836F5E43.htm
    3. http://help.sap.com/saphelp_nw04/helpdata/en/f5/18fc39eb31a700e10000000a11402f/frameset.htm
    Regards,
    yaniVy
    reward if helps

  • Excel using PivotCaches.Create from recorded macro

    I am trying to create a pivot table. Using the record macro function I created a small pivot table, however when I try to adjust the code from the recorded macro I get an error (Type mismatch).
    The recorded macro looks as follows:
    Sheets.Add
    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "tadasEquities_20150223133033!R1C1:R780C71", Version:=xlPivotTableVersion14). _
    CreatePivotTable TableDestination:="Sheet52!R3C1", TableName:= _
    "PivotTable32", DefaultVersion:=xlPivotTableVersion14
    Sheets("Sheet52").Select
    Cells(3, 1).Select
    With ActiveSheet.PivotTables("PivotTable32").PivotFields("Research type")
    .Orientation = xlRowField
    .Position = 1
    End With
    This is the part of the code I adjust.
    Worksheets("Pivot Table").PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    rngData, Version:=xlPivotTableVersion14). _
    CreatePivotTable TableDestination:=Worksheets("Pivot Table").Cells(1, 1), TableName:= _
    "PivotTable", DefaultVersion:=xlPivotTableVersion14
    rngData is defined as:
    Set wsData = Worksheets(1)
    Set rngData = wsData.Range(Worksheets(1).Cells(1, 1), Worksheets(1).Cells(downlast, rightlast))
    Worksheet("Pivot Table") is
    Worksheets.Add(After:=Worksheets(1)).Name = "Pivot Table"
    where rightlast and downlast are the last cells of a table.
    As you can see I only adjust SourceData and TableDestination and use Worksheets instead of ActiveWorkbook. Could someone tell me what I am doing wrong?

    Hi sakew,
    The PivotCaches method is in workbook object instead of worksheet, there isn’t that method or property in worksheet object. The workbook and worksheet are different object.
    More information, please refer to:
    # Workbook.PivotCaches Method
    https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.pivotcaches.aspx
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SAP Record & Document mangement.

    Dear All,
    This is regarding Record management. How this can be useful to a business and what are the benefits of this. In which scenario we use this and is this related to document management?? I am trying to understand its feature and business benefits.
    Please share your views and experiance on this. Thanks in advance...
    Regards,Kundan

    Hi Kundan
    Have you read SAP help on Records management?
    SAP help has answers to all the question you have asked. Following is a snap shot of what SAP help says:
    Records Management is a standard solution for the electronic management of records.
    SAP Records Management not only provides an electronic representation of the conventional paper record, but also offers functions that far exceed those available for conventional records management: you have fast and secure access to archived documents. You can enter Office documents and notes directly in a record, using document templates if required. You can include Internet or intranet pages in a record.
    Please read it in detail from the following link:
    http://help.sap.com/saphelp_nw04/helpdata/en/f5/18fc39eb31a700e10000000a11402f/frameset.htm
    I hope this helps you
    Regards
    Amaresh Makal

  • How can I create a model node in SAP Records Management

    Product: SAP Records Management
    Hi,
    I would like to create a model node in a record tree.
    I found in the function modul BAPI_RECORD_ADDELEMENT no entry for the creation of a model node. Only the instance and the structure node can create by this function modul.
    So, does anyone know a solution to create a model note?
    Regards,
    Thomas Fanninger

    Hi Thomas,
    it is not possible with the BAPI due to the piece of coding:
    case  myElementType.
            when glob_const_elem_type_instance.
              myRecordElement->Type_Set( if_srm_sp_record_element=>type_instance ).
              myRecordInstanceElement ?= myRecordElement.
              loop at element_sp_poid into myElementSpPoidWa.
                mySpPoidWa-id = myElementSpPoidWa-name.
                mySpPoidWa-value = myElementSpPoidWa-value.
                insert mySpPoidWa into table myElementSpPoidTab.
              endloop.
              myElementSpsId = sps_id.
              myElementPoid = myClientService->poid_get_instance( im_rms_id  = myRmsId
                im_sps_id  = myElementSpsId  im_sp_poid = myElementSpPoidTab ).
              myService->check_sp_connection( myElementPoid ).
              myRecordInstanceElement->poid_set( myElementPoid ).
            when glob_const_elem_type_folder.
              myRecordElement->Type_Set( if_srm_sp_record_element=>type_folder ).
            when others.
              perform set_error using '852' return.
              return.
          endcase.
    But you can do that by using directly the Records API. How to use this is demonstrated in the report 'SRM_RECORD_API_HOWTO'. Search there for the subroutine 'fillrecordelement'. There a record element for insert is created and its type is set. You can set the type there to 'IF_SRM_SP_RECORD_ELEMENT~TYPE_MODEL'. Of course your POID then may not be an instance POID.
    Best regards,
    Thomas

  • TREX on Portal-Server also used for search/index for SAP Records Management

    Hi all,
    can a installation of the TREX on the Portal-Server (or as separate Server) used for Portal Index/search and also in parallel for searching of Content in an SAP Records Management (means full text research of records/ dossier in the SAP RM) ? Some ideas, tips or settings to keep in mind ?
    THX
    mario

    Hi Neil,
    We have exactly the same problem. We installed a new SAP E-Commerce system on Microsoft Windws 2008 R2 with TREX Version 7.10.43.00. The TREX connection is okay. Also the catalogue replication works without any problems. The SAP support means it is a permission problem on the IIS. The problem isnu2019t solved yet and the message to the SAP support is in process.
    What is your effect with this link?
    http://localhost:<TREXNAMESERVER>/TREXHttpServer/
    Default:
    http://localhost:<30305>/TREXHttpServer/
    Kind regards,
    Roland

  • SAP with Macros

    Hi Experts,
    I am working on Single click entry tool, my requirement is
    1. I want to know how many sessioned i have opened in SAP through Macros in a popup.
    2. suppouse i am getting 2 sessions in popup and i am selecting any one then automatically macro will focus in selected one in SAP.
    urgent.....

    Back again to tell you this is a common task and has been solved like a zillion times, check for example these links:
    http://www.sapdev.co.uk/file/file_upexcel.htm
    http://www.sap-img.com/abap/upload-direct-excel.htm
    And I would put some money on the fact there is some demo report on this topic in your ERP (but I am sorry, I don´t know any useful rpogram name, maybe you can try to seacrh a little using wildcards... XLS maybe?).
    Regards Otto

  • Sap isu-utility help find

    Hi,
    i am new to  industry specific solution utility,now i need to download help file for that.can anybody pls tell me how to do it?
    thanks,
    raman

    Hi Radharaman,
    In utilities you have lots of areas like
    device management
    waste and recycle management
    energy data management
    customer service...etc
    Please refer to the following link for full data on SAP utilities:
    http://help.sap.com/saphelp_utilities472/helpdata/EN/c6/4dce68eafc11d18a030000e829fbbd/frameset.htm
    Hope it helps!!
    Thanks!
    Preethi

  • Sap Records Management: how to get attributes of record?

    Hi everybody who has had an experience in SAP Records Management programming.
    Tell me please how can i get a list of attributes of certain record or document? I have an instance of CL_SRM_POID class and I also can get an instance of CL_SRM_SP_RECORD clas. But i haven't found out exactly what method gets attributes.
    Thanks a lot.

    Finally i have sorted it out. Following procedure gets properties of record or document.
    form get_record_attributes using    uif_poid   type ref to IF_SRM_POID
                               changing ct_properties  type SRM_LIST_ATTRIBUTE_VALUE.
      data: lif_srm                   type ref to if_srm,
            lif_srm_service           type ref to IF_SRM_SRM_SERVICE,
            lif_prop_service          TYPE REF TO IF_SRM_SRM_SERVICE_PROP,
            lif_repository            type ref to IF_SRM_SRM_PROP_REPOSITORY,       
            lif_attribute             type ref to IF_SRM_ATTRIBUTE_VALUE,
            lif_context               type ref to IF_SRM_PROP_CONTEXT.
      refresh ct_properties.
      try.
        lif_srm         ?= uif_poid.
        lif_srm_service  = LIF_SRM->GET_SRM_SERVICE( ).
        lif_prop_service = lif_srm_service->get_property_service( ).
        lif_context      = LIF_PROP_SERVICE->GET_CONTEXT( ).
        lif_repository   = lif_prop_service->GET_REPOSITORY( uif_poid ).
        ct_properties    = LIF_REPOSITORY->GET( lif_context ).
        CATCH CX_SRM_INITIALIZATION .
        CATCH CX_SRM_POID .
        CATCH CX_SRM_REGISTRATION_DATA .
        CATCH CX_SRM_SRM_PROP_REPOSITORY .
      endtry.
    Edited by: Petr.Plenkov on Mar 4, 2010 1:43 PM

  • ADD a BOR to SAP Records Management

    Hello,
    I need to know which BAPIs I have to call to post a BOR to SAP Records Management.
    There is BAPI_RECORD_ADDELEMENT but I don´t know what parameters are necessary.
    thanks,
    Iñaki

    You can not 'add' simply a BOR object to RM.
    1.) You have to create a element type in the TA srmregedit for you BOR object and set the necessary connection parameters. Also you have to classify your element type according to your RMS ID and your AREA (case or records management).
    2.) Then your new element type appears in TA organizer or TA scase. It has autmatically the BOR methods as activity.
    3.) The BAPI adds an instance of the BOR object to a RM records (file).
    Best regards,
    Thomas

  • SAP HR Introduction help needed

    Hello, I am very new to SAP, and am currently a student looking up information about SAP for an academic exercise. Just to get a handle on SAP HR portal, does anyone know of some good books or links for information on how to start building an SAP HR portal. I need to understand more information about the usual setups, costs, and other general information about this type of setup and I don't have too much experience with SAP to begin with. Any help would be greatly appreciated. I have looked around the wiki here and there is a ton of information, and I haven't found any really beginner or intro data that has what I am looking for.
    Thanks
    Message was edited by:
            jon brown

    Hi Jon,
    For SAP HR you can use the ESS (Employee Self Services) and MSS (Manager Self Services). These can be implemented into the business logic and processes via the SAP Portal.
    Links:
    -> ESS
       - /thread/428959 [original link is broken]
    -> MSS
       - <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/29/d7844205625551e10000000a1550b0/frameset.htm">MSS configuration</a>
    Use the key words "MSS configuration" on the SDN, this brings you a lot of practical stuff (unfortunately not on the lowest level of expertise).
    Additional HR fields are:
    -> Learning Portal
    -> E-recruiting
    You can find helpful documentation on the http://help.sap.com
    http://help.sap.com/erp2005_ehp_02/helpdata/en/80/ea89395eb58c4f9d0c3e837cf0909d/frameset.htm
    In case you had any other questions, feel free coming back to this thread
    Best regards,
    Zsolt

Maybe you are looking for

  • Is there a way to synchronize Outlook 2011 on two macs?

    Hi I just bought my wife a macbook air.  She uses roadrunner mail service (so only pop, no imap) and is using outlook 2011 on both the home imac as well as her laptop.  Only problem is that messages get deleted from the server as we are constrained t

  • How can I repair my Bootcamp Windows XP partition?

    Hi! I've had Bootcamp for over a year, but last night, when I tired to open an application, Windows crashed giving me a blue screen telling me "IRQL_NOT_LESS_OR_EQUAL." I've had this problem sometimes before, but this time, whenever I try to boot fro

  • Ipad2 suddenly can't connect to wifi - password help ?

    Hello We've had an ipad2 for about 2 months. We got it connected to WiFi fine by putting in the security key from the Livebox modem and everything was hunkydory. Then we went on holiday for a fortnight and when we got back, there was no way of connec

  • Acrobat 8.1.4 only prints 1 page when I select "all"

    Hi all, I'm hoping you can help me. Just spent 27 minutes on hold with Adobe tech support and gave up. I have an iMac running OS 10.5.8 and had successfully used other versions of Acrobat. I bought a ScanSnap printer and it was bundled with Adobe Acr

  • NI9870 with cRio9024 interfacing

    Dear NI engineer, my problem is that i am totally new to FPGA as well as LABview I started my work last week I have labview 2010 in this 2010 there is a link getting started with labview when i click it it opens apdf that is very good from that pdf i