Using active x reference in teststand

I make multiple calls to active x dlls in multiple subsequences. Can anyone explain the advantages and disadvatages of creating a new object for each call?
I initially created a new object only on the first call and then used the same local active x variable on subsequent calls within the sequence. However, an error (ACT X Ref = "NULL") occurs in debug mode when that first step is not run.
What is the downside of creating a new object everytime?
Should I create a "dummy" Active X dll call in the sequence setup for ech subsequence to fill the reference variable locally?
How about using a global Act X ref variable? (most calls are within the same dll class)
If it matters, the dlls are Visual Basic Active X dlls.
Thanks in advanc
e for you advice.

Hi,
what you need to remember, is that you're creating objects from a class, so say you had a class of object called orange. Every time you create an object, and put a reference to it somewhere, it's a whole separate orange. This is fine if every time you create a orange object, you use it up and throw it away afterwards. You can even have lots of these objects open at once, and discard them when you've finished with them.
Now consider a class called apple which has methods that are reliant on each other. If you create an object like this, and call a method (say peel(long strip)), it will have changed something about that object. If you create another object, and call peel again with a different parameter (say peel(6 strips)), it will have performed this action on a wh
ole different object to the first one (- there is an exception to this which is the singleton server).
So it depends on how your server is supposed to work.
Can you create one object, and keep using it, or is there some dependency that requires you to create a new object of that class?
From your question, I don't think you're doing anything multi-threaded, so you could easily make one call to the Action step type, and get a reference to the new ActiveX object without calling any methods (un tick the call method checkbox). This can then repeatedly be used. You can have this as one of the first setup things your sequence does.
Another trick would be to pass the original ActiveX reference down as a parameter, and copy the creation step to the start of the subsequences, using a precondition, that if the Parameters.xxxxx == Nothing, then run the step, and create a new object, otherwise, use the one that's available.
Hope that helps.
S.
// it takes almost no time to rate an answer

Similar Messages

  • Any Resources for Learning Object Reference in TestStand?

    Hi All,
    I have been using Active X servers in TestStand for several years and now some of the newer stuff I am being supplied with is Dot Net objects. Does anyone know of somewhere to learn the correct way to use object references in TestStand. I don't understand when you should create a new object  vs just using an existing object reference. I also would like to understand how to use an object reference variable.
    I looked at the TS examples, but there is not an explanation. 
    Any ideas?
    TIA,
    Jim

    Jim,
    You may try reading through the NI TestStand Advanced Architecture Series, specifically Chapter 2: Using the NI TestStand Object Model. These may shed some light on the issue.
    Regards,
    Steven Zittrower
    Applications Engineer
    National Instruments
    http://www.ni.com

  • How to use active X controls to read/write protect an excel or word document created by created by Save Report to File VI

    Hi all,
    I'm trying to creat a word and excel documents using Save Report to File VI. When wiring a password to this last VI, the document created are only protected against writing but not reading. How can I use active X controls to password protect these documents against reading?
    Thanks a bunch!
    O

    There is no predefined functionality available in LabVIEW. So you have to implement this on your own.
    It seems to me that you own the Office Report Generation Toolkit. You can use the Excel Get ActiveX References.vi from the Excel Specific >> Advanced palette to get access to the "generic" ActiveX Excel references. Starting from this point, you can use property and invoke nodes to get to the setting you are going to modify.
    Please refer to this link for information on Excel password protection. I have not searched for the object giving you access to those settings though....
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Threading and Re-Use of buffers Using Call By Reference node (Duct Tape required)

    I have been trying to get the following information into the public domain for years and now that I have the answers, I will share with those that may be interested.
    Warning!
    Wrap your head in duct tape before reading just for safety sakes.
    My two questions have been;
    1) can LV Re-use the buffers of the calling VI when using VI Serve Call by reference?
    2) Is the UI thread used when using Call by reference?
    1. When calling a VI using the call by reference node, does the data going into the connector pane of the node get copied, or is it in-line as it would be with a properly set up subVI?
    Short answer: It is somewhere in-between.
    Long answer:
    The compiler doesn't know what VI will be called, but it does have a hint:
    the reference wired into the Call By Reference node. It uses that to get the "Prototype" for the call. So for the best performance, use a prototype that has the same "in-placeness characteristics" as the called VI. That being said, users don't know what the "in-placeness characteristics" are.
    Before I go into the details, I should say that the overhead of these copies shouldn't matter much unless it is a large data structure (an array with a lot of elements, or a cluster/class with many fields or containing large arrays etc.).
    Example 1:
    If the prototype does not modify the data then the compiler assumes that the Call By Reference node will not modify the data. However at run-time a check is made to see if the actual called VI will modify the data. If so, then a copy is made and passed in so that the original data can remain unmodified.
    Example 2:
    If the prototype contains an input that is wired through to an output in such a way that both the input and output terminals can use the same memory buffer, but at run-time a check determines that the actual called VI's input and output do not share a buffer, then a copy will be made from the actual call's output to the original VIs (combined input and output) buffer.
    I should also mention that even with this "attempt to agree with the prototype" behavior, it's not always possible to get as good performance as a regular SubVI call. For instance if you have a situation where the prototype does not modify the data and passes it through to an output then the compiler must assume that the data is modified (because as in example 2, there exist VIs that may modify it even if the actual VI called does not).
    And there are some caveats:
    1) This "using a prototype" behavior was new to 2009. Before that we used a more naive way of passing data that assumed all inputs will be modified and no outputs share a buffer with an input.
    2) This behavior is subject to change in future versions, if we find further optimizations.
    3) This behavior is the same as we use for dynamic dispatch VIs (when using LV classes)
    4) If you want to create a VI only to be used as a prototype, then you can use features of the In-Place Element Structure to control the "in-placeness characteristics" Namely the In/Out Element border nodes, the "Mark as modifier" feature of the border nodes (note the pencil icon on the In Element), and the Always Copy node.
    5) The prototype is only the first reference ever wired into the Call By Reference node. So if you do make a new prototype VI, you can't just make a reference out of it to wire to the Call By Reference node. I suggest deleting the Call By Reference node and dropping a new one.
    6) For remote calls, we always have to "make copies" by passing data over a network.
    I hope this helps, if you want any further information/clarification, then feel free to ask.
    2. Does the call by reference node execute in the UI thread? If the call is being made by a remote machine over ethernet, which thread does the host (the machine that makes the call by reference) execute on and which thread does the target (the machine that contains the VI file) execute on?
    In the local case, the Call by Reference node does not require the UI thread and can run in whatever thread the VI wants to execute in.
    When calling a remote VI, the Call by Reference node uses the UI thread (detailed below) on both the client and on the server.
    The client uses the UI thread to send the call request to the server and then again when the response comes back. The UI thread is not blocked during the time in between.
    The server receives the TCP message in the UI thread and then starts the call in the UI thread. The server also uses the UI thread to send the response back to the client. The UI thread is not blocked on the server during the execution of the VI.
    I hope people find this when they need it!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    I never use duct tape. I wrap my head in aluminum foil and thus get much better shielding from the aliens trying to tap my mind.
    Also easier to remove later, but why risk taking it off??
    LabVIEW Champion . Do more with less code and in less time .

  • Can PQA use a single reference frame against a test video stream?

    For R&D testing of video "set-top" devices I want to initiate some internal processing on our UUT, then using a PXI-1491 analyze the digital (HDMI) video output of the UUT for some large number of seconds (180 seconds or more for example).
    The video that is being analyzed will have static image content. The amount of time I want to analyze the test stream after doing some stuff on the UUT is variable, but I always anticipate it being fairly long.
    It currently appears that I have to have a reference stream that contains exactly the same number of frames as the test stream.
    This makes the reference vbf files very large. My test requirements include a large number of resolutions that must be tested through the UUT. Having an extensive library of very large vbf files is logistically difficult, it would much easier to maintain such a library made up of single "golden" frame reference files instead.  Additionally, since my analyze time needs to be variable depending on test setup and UUT processing options, it would be better for me to have a single golden reference frame and validate alot of test frames against it.
    Since the analyzed video will have static images, is it possible to run a test video stream against a single reference frame (reduced reference) instead of having a full reference stream frame by frame?
    Solved!
    Go to Solution.

    Doing exactly what you are asking is not within the design of PQA.  Of course, the best option that we would recommend when working with video test is a large capacity hard drive, probably in a RAID configuration for more space and better performance, and then just taking a golden reference with 10k frames, and doing what you originally suggested.  
    One method of achieving what you are looking for without using a large reference file is through offline processing.  This would allow you to acquire 10,000 consecutive frames, which I understand is one of your concerns, and then after the fact run them back through the analyzer.  You would still be performing a looping type of action in TestStand or LabVIEW.  The process would be:
    1) Acquire your source from your 1491 provider with no processors, and saving the media stream to disk.
    Loop:
    2) Load PQA with the disk buffer provider instead of the 1491, the disk buffer file will be the acquisition from above
    3) Point the start frame to your current location.
    4) Perform your processor with the results.
    5) Repeat and iterate to a new start frame location
    This process is going to be much slower as you load and unload resources every time.  If you choose to go this way, a better implementation would be to maybe consider doing 100 frames at a time, or some number larger than 1, because the processing time of handling the extra frames is going to be less than loading/unloading PQA.
    Your second option is going to require more work outside of PQA to implement custom functionality through a Custom User Processor.  Effectively this allows you to come up with a way to process incoming data in ways that you'd like.  To do this you will need:
    1) LabVIEW 2011 - Custom User Processors for PQA can only be developed in LabVIEW 2011.  If you are under a SSP agreement with NI and only have LabVIEW 2012 currently, you still have access to older versions.
    2) Vision Development Module - To perform your image processing
    3) An unencrypted video source - Due to limitations of HDCP we can not expose the raw video feed to user processors.
    In this user processor you would:
    1) Load your static image/frame in directly, you wouldn't need to use the Media Ref input
    Loop
    2) Load the current frame from the incoming video array
    3) Perform your video measurement with the Vision function, likely PNSR or SSIM since these are currently the only 2 referenced measurements in PQA.
    To learn more about Custom User Proessor's, in the PQA help check out: NI PQA Executive and the NI PQA Configuration Panel>NI PQA Tabs>Processors tab>Customizable Output Processors>User Processor  as well as: http://digital.ni.com/public.nsf/allkb/514058CC830D86EE86257881004CB45F
    Paul Davidson
    Sound and Vibration Software Staff Product Support Engineer
    National Instruments

  • When to use Active X

    Hi all,
    Thought this might be a good general question.  I go through posts on the message board and it looks a bit like whenever someone is unsure of how to do something complicated, they always ask if active X is needed to program it.
    I won't lie I've done it to, mainly in regards to Excel, but thats another beast.
    Anyhow, does anyone have a good, to the point answer as to when its a good idea to use Active X, and when its not.  Maybe an answer for what Active X does that can't be done using properties, or manipulating included functions?  Who knows maybe even a short list of ideas that are pretty common in the labVIEW environment that are pretty much agreed upon that Active X is the way to do it, even if its possible with given functions?
    Thanks for the contributions, I think this might add some good perspective on the whole topic, for me and countless others!
    LV7.1, LV8.5

    That's quite a broad question! I might not be able to answer it fully, but hopefully I can contribute some...
    Let's take a look first at using ActiveX in LabVIEW vs. calling a DLL.
    1. The first bonus for using ActiveX is that the ActiveX server (whether it's an ActiveX dll or an application like Excel) exposes properties and methods with (commonly) known datatypes to LabVIEW. It's nice to be able to set properties directly in many cases, rather than using some sort of wrapper function to accomplish that. Furthermore, the methods expose all the input and output arguments and whether they're required or not. This means you don't have to look through some cryptic header file to determine exactly what to input into a given function, and LabVIEW is much less likely to crash if you don't get it just right. Standard DLLs operate pretty much like a black box. LabVIEW passes data into them and has no idea what happens after that. The DLL may end up overwriting parts of LabVIEW's internal memory and wreaking havoc if you don't pass in enough pre-allocated data. If you've heard of .NET, that is taking this one step further by creating a platform with standard datatypes and memory management schemes. For Windows at least, that may be the platform of the future.
    2. When you load a DLL in LabVIEW or any other language, you load it into LabVIEW's memory space. This means it's a dependency of LabVIEW. If that DLL is simultaneously being called by another application, there will be two separate copies of it in memory, and they can't communicate with each other at all. ActiveX, on the other hand, allows for communication between separate applications that have distinct memory spaces. This is how you were able to manipulate Excel through LabVIEW. You didn't have to load Excel as a dependency of LabVIEW; you were able to send commands to it across application barriers. So ActiveX can be beneficial if you have two applications that are running independently and need to communicate with each other.
    3. One downside of using ActiveX in LabVIEW is that it can sometimes be tedious to navigate through the various levels of the object hierarchy. You doubtless experienced some of this when using Excel. First you open a reference to an application object, then the workbooks object, then a specific workbook, then the worksheets, and so on until you finally get all the way down to the one property you want to read or manipulate. That's a lot of property nodes
    4. I'm very much on fuzzy ground with this one, but I have often heard that there's a lot of complexity involved in creating ActiveX-compliant applications and DLLs. Standard DLLs are comparably easy to compile and the process is well understood.
    5. Cross-platform compatiblity: ActiveX is definitely Windows-only. You won't be able to port your application to other platforms. This is somewhat true of standard DLLs, too. You can't just port the compiled object code to another platform and expect it to work. But often the source code for the DLLs can be somewhat salvaged and recompiled on the target platform.
    OK, that's a start. And take this all with a grain of salt, but it should help get you started!
    Message Edited by Jarrod S. on 11-22-2006 03:17 PM
    Jarrod S.
    National Instruments

  • Find memory leakage when passing Object Reference from Teststand to vi

    I am using Teststand to call labview vi, and pass ThisContext of sequence to vi as object reference, but if I just loop this step and I can find the memory using keep increasing, how can I avoid the memory leakage inside the vi.
    see my vi, it is to post message to UI.
    Solved!
    Go to Solution.

    You should be using a close reference node to close the references you get as a result of an invoke. In the code below you should be closing the references you get from the following:
    AsPropertyObject
    Thread
    Close those two references once you are done with them.
    Also make sure you turned off result collection in your sequence or you will be using up memory continually for the step results.
    Hope this helps,
    -Doug

  • How can I use Active Print on my Ipad and print to my usb connected HP officejet 6110 all in one

    I was previously able to use Active Print on my Ipod to print to my usb connected HP officejet 6110 all in one.  Now, however, with my Ipad version 2 I can no longer get this to work.  Can anyone help?  Thanks.

    Hi,
    HP do not provide any USB connection solution for iOS.
    As Active Print is a 3rd party application which provide this functionality, i believe you may find a better help within Active Print support as they more familier with their application requirement and functionality:
    http://www.activeprint.net/support/
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How do I use a static reference to keep a VI in memory but then call it in parallel?

    Hello all,
    I have a MainVI and I want to call from it a SubVI in parallel so that I can have both windows open and responsive at the same time.  The SubVI may be closed and reopened any number of times, but only one in existance at a time.  I know how to do this using Open VI Reference, providing a relative path to my SubVI, checking its state to see if its already running, and if so bring the window to the front (using Front Panel: Open method with True/Standard inputs), and if not run it using the Invoke:Run method (and optionally opening its front panel programmatically).  This method was working fine.
    Now I have added functional global variables in my SubVI, and I want to keep them in memory inbetween opening the SubVI window.  I can do this by putting a copy of the functional global in my MainVI, even though I don't use it there for anything.  This works fine.
    By accident, I have come across a reference to a Static VI Reference, which sounded like a vast improvement to my methodology, for the following reasons:
    1) Keeps SubVI in memory all the time, eliminating the need to put the functional global in MainVI when it is not used there.
    2) Tells LabVIEW to include SubVI when I build my executable, rather than me having to specifically mark it as Always Include in the build specification.
    3) Eliminates the need to keep the path and SubVI name updated in a string constant in my code, in order to use the Open VI Reference.
    However, trying to implement this solution, I have run into the problem that once you put a strictly-typed static VI reference (strict typing is required to keep it in memory) onto the block diagram, that VI is reserved for execution.  That means I cannot run it using the Invoke:Run method.  I haven't tried just putting it on the diagram directly as a subVI because I need it to run in parallel to the MainVI.  I have searched through these forums extensively, and although there are several references to a static VI reference, none of them say explicitly how to actually run the darn thing!  :-P
    I very much appreciate any insight into my problem.  If I have to go back to the old way it will work fine, but I really like the seeming elegance of this solution.  I hope that it is technically feasible and I'm not misunderstanding something.
    Thank you for your help,
    -Joe
    Solved!
    Go to Solution.

    > If I understand you correctly, they can only really be used for re-entrant VIs. 
    No, a static VI reference can be used anywhere a regular VI reference (property nodes etc.) The reason for the hoop-jumping above is that we are really opening a reference to a CLONE (copy) of the VI identified by the static VI reference.
    > Okay, I tried it, and got the code shown below... Any idea why it isn't working?
    The VI you want to clone can't be on the diagram as a "normal" subVI. When you run your application you should be able to open that VI and see it just sitting there with a run arrow waiting to run. See attached example (LV2009SP1).
    "share clones" vs "preallocate" has to do with whether you want each clone to preserve state (such as in an uninitialized shift register). Generally you use share clones. Occasionally it is useful to have multiple copies on a diagram that each remember some data, like "timestamp of last execution" in a shift register.
    Other VIs in your spawned process don't have to be re-entrant unless they are functions that "wait forever". All the built-in G functions are re-entrant. It's pretty common to use a queue to feed data to a spawned process.
    Spawning a process is more difficult than just running two parallel loops. It's useful because once you've made 1 copy, you can make 50. If you just want to do two things (vs n things) at once, I would just use two loops.
    Attachments:
    SpawnProcess.zip ‏20 KB

  • How do I use Active Sync to view SharePoint Lists (Contacts and Calendars) on a Mobile Phone?

    We are attempting to use SharePoint 2010 in combination with Exchange 2010 to implement shared calendars and contact lists throughout our organization.  We are able to connect the lists to Outlook 2010, but have been unsuccessful in viewing
    the calendars and contact lists from our mobile phones.  How do we use Active Sync to view SharePoint Lists (Contacts and Calendars) on a Mobile Phone?
    In trying to answer this question, we have come across a few different possibilities, all of them falling just short of a long term solution for us.  After doing research, we found that Active Sync will only show the default folders of the account.  To
    solve this, we downloaded an Add-In for Outlook (CodeTwo FolderSync) to synchronize folders and synchronized our SharePoint list with a new Contact list in the default folder.  The issue we came across with this method is that the Add-In we are using
    is not capable of automatic synchronization.  There is a button and it must be clicked after every update is made, which is not ideal for our solution.  We then went to the company (CodeTwo) and found server side software (Exchange Sync) that they
    offer which will automatically synchronize the folders.  After installing that on the Exchange Server, we now are running into the issue of not being able to locate the SharePoint lists on the Exchange Server.
    Does anyone happen to know how we can get to the SharePoint lists from the Exchange Server?  Has anyone else been able to use shared contacts lists and calendars from SharePoint on their mobile phones using Active Sync?  If so, are we in the right
    direction with what we have found so far?
    Thanks,
    Brad

    You cannot use ActiveSync for that, but there are SharePoint clients for the iPhone. Windows Mobile 7 natively supports SharePoint with SharePoint Workspace Mobile, part of Microsoft Office Mobile. Android and BlackBerry might also have some apps.
    Use Microsoft SharePoint Workspace Mobile
    http://www.microsoft.com/windowsphone/en-us/howto/wp7/office/use-office-sharepoint-workspace-mobile.aspx
    iPhone SharePoint Apps Shootout
    http://www.codeproject.com/KB/iPhone/iPhoneSharePointApps.aspx 
    Comparing SharePoint iPhone Apps
    http://blog.praecipio.com/2010/11/02/comparing-sharepoint-iphone-apps/
    MCTS: Messaging | MCSE: S+M

  • Using Open VI Reference to run a VI, on an RT target, with sub-VIs not loaded

    I've been using Open VI Reference and Call By Reference Node to remotely run VIs on my RT controller.  I
    usually wire string data to the vi path input, but this
    requires the VI to be in memory.  I understand (from LabVIEW help) that I can wire a path to this terminal and specify a VI that is
    not in memory, but is on the disk.  NI has an example that
    confirms my understanding.  I get errors when I attempt to do the same
    with VIs that have sub-VIs; I suspect that the problem is that
    the sub-VIs aren't in memory and that the top-level vi doesn't know where to
    look for them (because the paths aren't specified).  All of the sub-VIs are on the RT system (in the same directory), they're just not in memory.
    Is there a way to get LabVIEW to look for sub-VIs on the disk?  I don't want to rely on using a startup application and rebooting to get my VIs into memory.
    Thank you,
    Jim Carmody
    Software Engineer
    G2 Technologies
    www.g2tek.com
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

    Hi Jim,
    It sounds like you are going about calling VIs remotely the correct way.  It would be very helpful if you could post the errors you are receiving.  I also wanted to know if you saw the note at the bottom of the article that says your VI library must contain everything your top level VI calls.
    Eric A.
    National Instruments
    Distributed I/O Product Support Engineer

  • How to use application class reference in the controller methods of BSP

    Hi,
    I have created a bsp application and also created an application class and assigned it to the application class. In the application class, I have created attribute TEXT type string(public and instance parameter).
    In the controller let's say main.do, I am trying to give a value to to the text by adding the following code.
    application->text = 'test'.
    I am getting syntax error saying field 'text' is unknown. It is not contained in one of the specified tables nor defined by DATA statement. 
    Please can someone let me know how to use the application class in the coding with an example. I couldn't find how exactly this has to be reference. Please help.
    Best regards
    Siva

    Hi,
    if you are having main controller and sub-controller then you may need to use below coding to use application class reference.
    *Data declaration
      DATA:  obj_cntrl        TYPE REF TO cl_bsp_controller2,
             obj_sub_cntrl   TYPE REF TO z_cl_sub_cntl,
             application TYPE REF TO z_cl_application.
    *Get the controller
      CALL METHOD obj_main_cntrl->get_controller   "obj_main_cntrl is the object of main controller
        EXPORTING
          controller_id       = 'SUB'   "Controller ID
        RECEIVING
          controller_instance = obj_cntrl  .
      obj_sub_cntrl ?= obj_cntrl  .
      application ?= obj_sub_cntrl ->application.
    or simply use below code in your controller method.
      application ?= me->application.
    Thnaks,
    Chandra

  • Client Certificate Mapping authentication using Active Directory across trusted forests

    Hi,
    We currently have a setup where the on-premises environment and the cloud environment are based on two separate forests linked by a 1-way trust, i.e., the exist in the on-premises AD and the 1-way trust allows them to use their
    credentials to login to a cloud domain joined server. This works fine with the Windows authentication.
    We are now looking at implementing a 2-Factor authentication using Certificate. The PKI infrastructure exists in the On-Premises Forest. The users are able to successfully login to on-premise servers configured with "AD CLient Certificate
    Mapping".
    However, we are unable to achieve the same functionality on the cloud domain joined servers. I would like to know
    1. Is this possible?
    2. If yes, what do we need to do to make this work.
    Just to clarify, we are able to authenticate using certificates by enabling anonymous authentication. However, we are unable to do the same after turning on "Client Certificate Mapping authentication using Active Directory"

    1. Yes!
    2. Before answering this I need to know if your are trying to perform a smart card logon on a desktop/console or if you just want to use certificate based authentication in an application like using a web application with client certificate requirements
    and mapping?
    /Hasain
    We will eventually need it for smartcard logon on to desktop/console. However, at present, I am trying to use this for certificate based authentication on a web application.
    To simulate the scenario, I setup up two separate forests and established a trust between them.
    I then setup a Windows PKI in one of the forests and issued a client certificate to a user.
    I then setup a web server in both the forests and configured them for anonymous authentication with Client SSL requirement configured.
    I setup a test ASP page to capture the Login Info on both the servers.
    With the client and the server in the same forest, I got the following results
    Login Info
    LOGON_USER: CORP\ASmith
    AUTH_USER: CORP\ASmith
    AUTH_TYPE: SSL/PCT
    With the client in the domain with the PKI and the server in the other Forest, I got the following response
    Login Info
    LOGON_USER:
    AUTH_USER:
    AUTH_TYPE: 
    I tried the configuration with the Anonymous Authentication turned off and the AD CLient Certificate mapping turned on.
    With the client and the server in the same forest, I am able to login to the default page. However, with the server in a trusted forest, I get the following error.
    401 - Unauthorized: Access is denied due to invalid credentials.
    You do not have permission to view this directory or page using the credentials that you supplied

  • Dump - Access using NULL object reference is not possible!!!

    Hi,
    I'm using the BCS class for sending HTM format email so i use the below code for that its working,
    DATA: gr_document      TYPE REF TO cl_document_bcs,
    gr_document = cl_document_bcs=>create_document(
                          i_type    = 'HTM'
                           i_text    = t_html
                           i_importance = '5'
                           i_subject = gc_subject ).
    Next task is to send the image so i'm creating an another object to the same class, below code
    *Image from MIME
    DATA: o_mr_api         TYPE REF TO if_mr_api.
    DATA is_folder TYPE boole_d.
    DATA l_img1 TYPE xstring.
    DATA l_img2 TYPE xstring.
    DATA l_loio TYPE skwf_io.
    DATA: lo_document   TYPE REF TO cl_document_bcs.
    IF o_mr_api IS INITIAL.
       o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
    ENDIF.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/tick.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img1
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/Delete.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img2
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    *Convert XSTRING to ITAB
    DATA :lt_hex1 TYPE solix_tab,
           lt_hex2 TYPE solix_tab,
           ls_hex LIKE LINE OF lt_hex1,
           lv_img1_size TYPE sood-objlen,
           lv_img2_size TYPE sood-objlen.
    CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
    WHILE l_img1 IS NOT INITIAL.
       ls_hex-line = l_img1.
       APPEND ls_hex TO lt_hex1.
       SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    WHILE l_img2 IS NOT INITIAL.
       ls_hex-line = l_img2.
       APPEND ls_hex TO lt_hex2.
       SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    *Findthe Size of the image
    DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
    DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
    lv_img1_size = lv_img1_size * 255.
    lv_img2_size = lv_img2_size * 255.
    *Attach Images
    clear: lo_document.
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img1'                " Attachment Title
         i_attachment_size     =  lv_img1_size           " Size of Document Content
         i_att_content_hex     =  lt_hex1  " Content (Binary)
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img2'                " Attachment Title
         i_attachment_size     =  lv_img2_size           " Size of Document Content
         i_att_content_hex     =  lt_hex2  " Content (Binary)
    but it throws the dump " Access using NULL object reference is not possible"  when i tries to access for method add_attachment...
    Thanks,
    Siva

    Yes there is commit work after that, Below code
          gr_document = cl_document_bcs=>create_document(
                           i_type    = 'HTM'
                            i_text    = t_html
                            i_importance = '5'
                            i_subject = gc_subject ).
    *Image from MIME
    DATA: o_mr_api         TYPE REF TO if_mr_api.
    DATA is_folder TYPE boole_d.
    DATA l_img1 TYPE xstring.
    DATA l_img2 TYPE xstring.
    DATA l_loio TYPE skwf_io.
    DATA: lo_document   TYPE REF TO cl_document_bcs.
    IF o_mr_api IS INITIAL.
       o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
    ENDIF.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/tick.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img1
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/Delete.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img2
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    *Convert XSTRING to ITAB
    DATA :lt_hex1 TYPE solix_tab,
           lt_hex2 TYPE solix_tab,
           ls_hex LIKE LINE OF lt_hex1,
           lv_img1_size TYPE sood-objlen,
           lv_img2_size TYPE sood-objlen.
    CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
    WHILE l_img1 IS NOT INITIAL.
       ls_hex-line = l_img1.
       APPEND ls_hex TO lt_hex1.
       SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    WHILE l_img2 IS NOT INITIAL.
       ls_hex-line = l_img2.
       APPEND ls_hex TO lt_hex2.
       SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    *Findthe Size of the image
    DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
    DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
    lv_img1_size = lv_img1_size * 255.
    lv_img2_size = lv_img2_size * 255.
    *Attach Images
    create object lo_document type cl_document_bcs.
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img1'                " Attachment Title
         i_attachment_size     =  lv_img1_size           " Size of Document Content
         i_att_content_hex     =  lt_hex1  " Content (Binary)
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img2'                " Attachment Title
         i_attachment_size     =  lv_img2_size           " Size of Document Content
         i_att_content_hex     =  lt_hex2  " Content (Binary)
           "Add document to send request
           CALL METHOD gr_send_request->set_document( gr_document ).
           TRY.
             CALL METHOD gr_send_request->SET_SEND_IMMEDIATELY
               EXPORTING
                 I_SEND_IMMEDIATELY = 'X'.
    *    CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .
    **Catch exception here
           ENDTRY.
           DATA: LO_SENDER TYPE REF TO IF_SENDER_BCS VALUE IS INITIAL.
           TRY.
             LO_SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ). "sender is the logged in user
    * Set sender to send request
             gr_send_request->SET_SENDER(
             EXPORTING
             I_SENDER = LO_SENDER ).
    *    CATCH CX_ADDRESS_BCS.
    ****Catch exception here
           ENDTRY.
           "Send email
           CALL METHOD gr_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE 'Email sent!'.
           ENDIF.
           "Commit to send email
           COMMIT WORK.
           "Exception handling
         CATCH cx_bcs INTO gr_bcs_exception.
           WRITE:
             'Error!',
             'Error type:',
             gr_bcs_exception->error_type.
       ENDTRY.

  • Creation of Delivery Using IDOC without reference to order

    Pls suggest is there is any way to create delivery using idoc without reference to order. This is very urgent.

    Hi
    Design the inbound idoc in such a way that it carries all the essential data needed to create a delivery document namely the material number, no of units to be deilvery, delivering plant, storage location, shipping point, warehouse number(if applicable) etc.
    Pass all these details to the function module  RV_DELIVERY_CREATE while creating delivery in VL01N and pass the document type as LO which is delivery document without reference to order.
    But it is advised to have atleast a pseudo order with which we have to create the delivery document.
    Pls reward points.

Maybe you are looking for

  • How do I back-up Organizer tags from one computer to another?

    Having successfully restored my PSE6 Organizer from one computer to another as back-up,I wish to keep backing-up. However, I have tried CDs, DVDs,external hard drives and flash discs and the tags are not imported, or rather,just one or two are. I cli

  • Ipod not recognized on sony xplod

    Recently I plugged my daughter's ipod into my car stereo usb and got an error message that said "not supported". My own ipod plays fine as does my other daughter's ipod.(so 2 of 3 work fine). Wondering if this could be because of the itunes update to

  • Unrestricted inventory and deliveries

    Is it possible to create a delivery for an order that has no sales order stock, then when the actual stock is put to the delivery get it to become sales order stock at that point on the save?  We have been doing this but always get the deficit of sal

  • Can't see msgs in UWC / reconstruct fails with cannot retrieve message uid

    I have restored several email accounts into a test email account. I'm trying to move some of the .msg files around so that they are easier to find. I have created some new folders and when I move the messages into the folder, I cannot see them in the

  • Add new fields to coding block-transaction code-OXK3

    Hi Friends I need below clarification in addition of new fields to Coding block from transaction code- OXK3. 1) Which approach is adivsable either EXPERT MODE or BASIC MODE. 2) In Expert mode access key will be required to add field manually into BSE