BAPI-VB, Unable to call method GetDetail of USER Object using SAP.BAPI.1

Hi,
I am trying to call SAP Methods using Excel VBA.
In the below example, I am trying to get the user details.
I can solve this, if I use SAP.Functions object, but not when I use SAP.BAPI.1 object.
The Procedure GetUserDetails() works fine, but the 2nd one GetUserDetails2() fails?
Can you tell what is the difference in calling SAP method with SAP.Functions and SAP.BAPI.1 ?
Also how can I run the program GetDetails2() using SAP.BAPI.1
Const CNT_STR_USR As String = "XXXXX"
Const CNT_STR_PWD As String = "XXXXX"
Const CNT_STR_APPLN_SRVR As String = "ides47"
Const CNT_STR_SYSTEM As String = "IDS"
Const CNT_STR_SYS_NUM As String = "00"
Const CNT_STR_CLIENT As String = "800"
Const CNT_STR_LOGON_LANG As String = "EN"
Const CNT_STR_LOG_FILE As String = "C:sap_vb.txt"
Const CNT_INT_LOG_LEVEL As Integer = 9
'Works Fine
Public Sub GetUserDetails()
'Using SAP Functions
Dim obSAPFn As Object
Dim obFuncUsrDtl As Object
Dim obFuncRtrn As Object
Dim obFuncLogDtl As Object
Dim sRetStatus As String * 1, sErrText As String, sUsrGroup As String * 12
Dim iRetRowCount As Integer, iLoop As Integer
Dim bErrFlag As Boolean
'Set obSAPFn = New SAPFunctions
Set obSAPFn = CreateObject("SAP.Functions")
obSAPFn.Connection.ApplicationServer = CNT_STR_APPLN_SRVR
obSAPFn.Connection.SystemNumber = CNT_STR_SYS_NUM
obSAPFn.Connection.User = CNT_STR_USR
obSAPFn.Connection.Password = CNT_STR_PWD
obSAPFn.Connection.Language = CNT_STR_LOGON_LANG
obSAPFn.Connection.Client = CNT_STR_CLIENT
obSAPFn.LogLevel = CNT_INT_LOG_LEVEL
obSAPFn.LogFileName = CNT_STR_LOG_FILE
'Check For Connection
If obSAPFn.Connection.Logon(0, True) = False Then
    MsgBox "R/3 connection failed"
Exit Sub
Else
    If obSAPFn.Connection.IsConnected Then
'    MsgBox "Connected"
    Else
    MsgBox "Not COnnected"
    Exit Sub
    End If
End If
'Get User Details.
Set obFuncUsrDtl = obSAPFn.Add("BAPI_USER_GET_DETAIL")
obFuncUsrDtl.Exports("USERNAME") = CNT_STR_USR
obFuncUsrDtl.Call
Set obFuncRtrn = obFuncUsrDtl.Tables("RETURN")
iRetRowCount = obFuncRtrn.RowCount
bErrFlag = False
For iLoop = 1 To iRetRowCount
    If obFuncRtrn(iLoop, "TYPE") = "E" Then
'        ErrorUsuario = True
        sErrText = "E" & obFuncRtrn(iLoop, "ID") & obFuncRtrn(iLoop, "NUMBER") & _
                     " " & obFuncRtrn(iLoop, "MESSAGE")
        MsgBox sErrText
        bErrFlag = True
        Exit For
    End If
Next
If bErrFlag = False Then
Set obFuncLogDtl = obFuncUsrDtl.Imports("LOGONDATA")
sUsrGroup = obFuncLogDtl("CLASS")
MsgBox sUsrGroup
End If
Set obFuncRtrn = Nothing
Set obFuncLogDtl = Nothing
Set obFuncUsrDtl = Nothing
obSAPFn.Connection.LogOff
Set obSAPFn = Nothing
End Sub
' Does not work
Public Sub GetUserDetails2()
'Using BAPI Object
Dim obSapBAPICtrl As Object 'BAPI control object
'Dim obSAPConn As Object 'Connection object
Dim obSAPUSER As Object ' To Get Details of USER Object
Dim obLogondata As Object, obDefaults As Object, obAddress As Object, obCompany As Object
Dim obSnc As Object, obParameter As Object, obProfiles As Object, obActivitygroups As Object
Dim obReturn As Object, obAddComrem As Object, obAddRml As Object, obAddPag As Object
Dim obAddUri As Object, obAddSsf As Object, obAddPrt As Object, obAddRfc As Object
Dim obAddX400 As Object, obAddSmtp As Object, obAddTlx As Object, obAddTtx As Object
Dim obAddTel As Object, obAddFax As Object, obParameter1 As Object
Dim sRetStatus As String * 1, sTransId As String, sUsrGroup As String
Dim iRetRowCount As Integer, iLoop As Integer
Set obSapBAPICtrl = CreateObject("SAP.BAPI.1")
obSapBAPICtrl.Connection.ApplicationServer = CNT_STR_APPLN_SRVR
obSapBAPICtrl.Connection.SystemNumber = CNT_STR_SYS_NUM
obSapBAPICtrl.Connection.User = CNT_STR_USR
obSapBAPICtrl.Connection.Password = CNT_STR_PWD
obSapBAPICtrl.Connection.Language = CNT_STR_LOGON_LANG
obSapBAPICtrl.Connection.Client = CNT_STR_CLIENT
obSapBAPICtrl.LogLevel = CNT_INT_LOG_LEVEL
obSapBAPICtrl.LogFileName = CNT_STR_LOG_FILE
'Don't show the logon details
'Connect to SAP
If obSapBAPICtrl.Connection.Logon(0, True) = False Then
    MsgBox "R/3 connection failed"
    Exit Sub
Else
    If obSapBAPICtrl.Connection.IsConnected Then
'    MsgBox "Connected"
    Else
    MsgBox "Not COnnected"
    Exit Sub
    End If
End If
‘Could not find a way to pass the User Id?
‘ Is this the right way to pass the user Id for this Object?
Set obSAPUSER = obSapBAPICtrl.GetSAPObject("USER", CNT_STR_USR)
Set obLogondata = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Logondata")
Set obDefaults = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Defaults")
Set obAddress = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Address")
Set obCompany = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Company")
Set obSnc = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Snc")
Set obParameter = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Parameter")
Set obProfiles = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Profiles")
Set obActivitygroups = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Activitygroups")
Set obReturn = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Return")
Set obAddComrem = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddComrem")
Set obAddRml = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddRml")
Set obAddPag = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddPag")
Set obAddUri = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddUri")
Set obAddSsf = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddSsf")
Set obAddPrt = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddPrt")
Set obAddRfc = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddRfc")
Set obAddX400 = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddX400")
Set obAddSmtp = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddSmtp")
Set obAddTlx = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTlx")
Set obAddTtx = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTtx")
Set obAddTel = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTel")
Set obAddFax = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddFax")
Set obParameter1 = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Parameter1")
sTransId = obSapBAPICtrl.CreateTransactionID()
'obSapBAPICtrl.TransactionId = sTransId
obSAPUSER.GetDetail Logondata:=obLogondata, Defaults:=obDefaults, Address:=obAddress, _
Company:=obCompany, Snc:=obSnc, Parameter:=obParameter, Profiles:=obProfiles, _
Activitygroups:=obActivitygroups, Return:=obReturn, AddComrem:=obAddComrem, _
AddRml:=obAddRml, AddPag:=obAddPag, AddUri:=obAddUri, AddSsf:=obAddSsf, _
AddPrt:=obAddPrt, AddRfc:=obAddRfc, AddX400:=obAddX400, AddSmtp:=obAddSmtp, _
AddTlx:=obAddTlx, AddTtx:=obAddTtx, AddTel:=obAddTel, AddFax:=obAddFax, _
Parameter1:=obParameter
iRetRowCount = obReturn.RowCount
If iRetRowCount > 0 Then
    For iLoop = 0 To iRetRowCount
        sRetStatus = obReturn(iLoop, "TYPE")
        If sRetStatus = "S" Then
        sUsrGroup = obLogondata("CLASS")
        MsgBox sUsrGroup
        End If
    Next
End If
Set obSAPUSER = Nothing
obSapBAPICtrl.Connection.LogOff
'Set obSAPConn = Nothing
Set obSapBAPICtrl = Nothing
End Sub
Regards,
Vikas

The problem was occuring because, the structure Return was not holding any values.
But the other tables which returned values were getting populated.
Regards,
Vikas

Similar Messages

  • Exception in calling methods on a com object using jcom

    Hi All,
    I am trying to conect to CognosUpfront thorugh there com interface using weblogic
    jcom architecture.
    Steps followed :
    Generated java classes for corresponding com dll
    Added it to classpath
    Enable the jcom mode and native mode of server.
    Register the server jvm for native mode using regjvm.
    After following all these steps I am able to create the object of UpfrontSession
    but I am not able to call any method on this.
    Its giving me NullPointerException
    Can someone help me to solve this problem...
    Stacktrace is below
    java.lang.NullPointerException
    at bicognos.UpfrontSession.login(UpfrontSession.java:192)
    at jsp_servlet._portlets._iframetest.__iframetest._jspService(iframeTest
    .jsp:29)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
    er.java:190)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6316)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Thanx and regards,
    Manish Rathi

    kamranA wrote:
    cout << "Part Number = " << part.getNumber() << endl;
    This is exactly what Jace, http://jace.reyelts.com/jace, helps you do. Your code would look exactly like this:JNIEXPORT jobjectArray JNICALL Java_translate_CgmTranslation_createCGM
      ( JNIEnv *env, jobject thisobject, jobject jPart ) {
      Part part( jPart );
      cout << "Part Number = " << part.getNumber() << endl;
    }The roughly equivalent bare-bones JNI would be:JNIEXPORT jobjectArray JNICALL Java_translate_CgmTranslation_createCGM
      ( JNIEnv *env, jobject thisobject, jobject jPart ) {
      jclass partClass = env->GetObjectClass( jPart );
      jmethodID partNumberMethod = env->GetMethodID( partClass, "getNumber", "()Ljava/lang/String;" );
      if ( ! methodID ) {
        cout << "Unable to locate the method ID for Part.getNumber()" << endl;
        return;
      jstring jPartNumberStr = static_cast<jstring>( env->CallObjectMethod( jPart, partNumberMethod ) );
      if ( env->ExceptionOccurred() ) {
        cout << "An exception occurred while calling Part.getNumber()" << endl;
        return;
      const char* partNumberStr = env->GetStringUTFChars( jPartNumberStr, NULL );
      if ( ! partNumberStr ) {
        cout << "A JNI failure occurred while trying to retrieve the contents of the part number string." << endl;
        return;
      cout << "Part Number = " << partNumberStr << endl;
      env->ReleaseStringUTFChars( jPartNumberStr, partNumberStr );
    }See any differences?
    God bless,
    -Toby Reyelts

  • Error calling method of a PBNI object

    Dear All,
    We are facing issue of "Error calling method of a PBNI object". We are calling web services of WCF after some time to refresh data.We need help to solve this issue as we have to go live with client.
    It's really urgent!
    Regards
    Imran Zaheer

    Hi Chris,
    Thanks for your concern.
    1) PB version & Build?
         PB builder 12.5.2 build 5609
    2) MS-Window version?
         Windows 7 professional.
    3) Why are you using PBNI and what kind of class are you utilizing in that context?
         We are calling webservices through soap objects.
    4) What error(s) codes and messages are you getting?
        we get "Error calling method of a PBNI object"
    5) Why are you not using PB.net that supports WCF natively (I wish PB classic did)?
        For this we need to convert our whole application in PB.Net which is not feasible for us.
    6) Can you lightly describe your over-all architecture and application approach to Web Services?
         We have replace EASERVER with WCFserver and we are calling webservices for fetching( pulling) data from WCF server. It's a soft of 3 tier architecture.
    Regards .... Imran

  • Calling methods from the Business Object BUS2032

    Hi all,
    Is it possible to call methods from the Business Object BUS2032.
    If so, how can it be done??
    Regards,

    Hi Marv,
    you sure can. Here is an extract from the SAP Help. I found it at http://help.sap.com/saphelp_46c/helpdata/en/c5/e4ad71453d11d189430000e829fbbd/frameset.htm
    <b>Programmed Method Call</b>
    Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paperformat and Printertype as input.
    * Call method Print of object type VBAK
    * Data declarations
    DATA: VBAK_REF TYPE SWC_OBJECT.
    SWC_CONTAINER CONTAINER.
    * Create object reference to sales document
    SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
    * Fill input parameters
    SWC_CREATE_CONTAINER CONTAINER.
    SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
    SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
    * Call Print method
    SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
    * Error handling
    IF SY-SUBRC NE 0.
    ENDIF.
    Cheers
    Graham

  • Calling methods located inside ActiveX objects from Java

    Hi folks,
    I understand that I can wrap ActiveX methods in C and call using JNI, but I am looking for an elegant way to call methods inside of Active X controls directly. There are a set of classes in com.ms.ActiveX package that allow this, but I am receiving a java.lang.UnsatisfiedLinkError: initPolicyEngine at runtime. I can't find any documentation from Microsoft on this (go figure). Has anyone ever used the com.ms packages, or does anyone know of an elegant solution avoiding wrappers and JNI? I have sucessfully used the neva objects vendor classes, but I find them too bulky for mainstream use. Any thoughts are appreciated. Thanks.

    Hi,
    - If you use the package com.ms.* You'll need to run your application in the Microsoft VM (jview.exe).
    - If you run it inside the browser you cannot use the java plugin, and your applet needs to be signed.
    If this doesn't help, please provide the version of your msjava.dll.
    Regards,
    Kurt.

  • Calling methods from inside a tag using jsp 2.0

    My searching has led me to believe that you cannot call methods from in the jsp 2.0 tags. Is this correct? Here is what I am trying to do.
    I have an object that keeps track of various ui information (i.e. tab order, whether or not to stripe the current row and stuff like that). I am trying out the new (to me) jsp tag libraries like so:
    jsp page:
    <jsp:useBean id="rowState" class="com.mypackage.beans.RowState" />
    <ivrow:string rowState="${rowState}" />my string tag:
    <%@ attribute type="com.mypackage.beans.RowState" name="rowState" required="true" %>
    <c:choose>
         <c:when test="${rowState.stripeToggle}">
              <tr class="ivstripe">
         </c:when>
         <c:otherwise>
              <tr>
         </c:otherwise>
    </c:choose>I can access the getter method jst fine. It tells me wether or not to have a white row or a gray row. Now I want to toggle the state of my object but I get the following errors when I try this ${rowState.toggle()}:
    org.apache.jasper.JasperException: /WEB-INF/tags/ivrow/string.tag(81,2) The function toggle must be used with a prefix when a default namespace is not specified
    Question 1:
    Searching on this I found some sites that seemed to say you can't call methods inside tag files...is this true?...how should I do this then? I tried pulling the object out of the pageContext like this:
    <%@ page import="com.xactsites.iv.beans.*" %>
    <%
    RowState rowState = (RowState)pageContext.getAttribute("rowState");
    %>I get the following error for this:
    Generated servlet error:
    RowState cannot be resolved to a type
    Question 2:
    How come java can't find RowState. I seem to recall in my searching reading that page directives aren't allowed in tag files...is this true? How do I import files then?
    I realized that these are probably newbie questions so please be kind, I am new to this and still learning. Any responses are welcome...including links to good resources for learning more.

    You are correct in that JSTL can only call getter/setter methods, and can call methods outside of those. In particular no methods with parameters.
    You could do a couple of things though some of them might be against the "rules"
    1 - Whenever you call isStripeToggle() you could "toggle" it as a side effect. Not really a "clean" solution, but if documented that you call it only once for each iteration would work quite nicely I think.
    2 - Write the "toggle" method following the getter/setter pattern so that you could invoke it from JSTL.
    ie public String getToggle(){
        toggle = !toggle;
        return "";
      }Again its a bit of a hack, but you wouldn't be reusing the isStriptToggle() method in this way
    The way I normally approach this is using a counter for the loop I am in.
    Mostly when you are iterating on a JSP page you are using a <c:forEach> tag or similar which has a varStatus attribute.
    <table>
    <c:forEach var="row" items="${listOfThings}" varStatus="status">
      <tr class="${status.index % 2 == 0 ? 'evenRow' : 'oddRow'}">
        <td>${status.index}></td>
        <td>${row.name}</td>
      </tr>
    </c:forEach>

  • Unable to view interactive forms that were archived using SAP ArchiveLink

    Hello
    We are just configuring Adobe interactive forms in SAP and are unable to view the documents after they have been archived in Livelink using SAP ArchiveLink. We have Adobe Reader v9.0  and SAP ECC 6 EHP 3, and Livelink viewer 9.7
    When the viewer comes up the text of the error message is as follows:
    Please wait...
    If this message is not eventually replaced by the proper contents of the document, your PDF
    viewer may not be able to display this type of document.
    You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by visiting
    http://www.adobe.com/products/acrobat/readstep2.html.
    For more assistance with Adobe Reader visit http://www.adobe.com/support/products/
    acrreader.html.
    Can anyone help me out?
    Thanks
    Steve

    Hi Steven,
    I have a requirement where I just need to Archive Adobe form in External repository.
    Since you are using the archiveLink functionality.
    Can you please help me how you Archived Adobe form?? What configurations need to be maintained for this?
    I am new to this. I did some Rnd on it and found that it can be achieved using HRFORM_HRF02 Business Add-In in the SET_ARCHIVE_INDEX method.
    But I have no clue how to do it?
    Can you please help me?

  • What transform engine does the 'transform' method on an xmltype object use?

    Does anybody know what transform engine is used when I call the 'transform' method on an xmltype object? I would like to use extension functions within my stylesheets but do not know what functions are available or the syntax for using them. Is there any documentation on this processor?
    I am using oracle 9.2.0.7.
    Thanks

    Thanks for your responses. I guess being written in C makes it faster than the java one (?). I understand I won't be able to add my own extension functions, but does anyone know if there are any built-in ones, for example a node-set function?

  • Unable to call method repaint()

    A problem occured to me when I tried to call the method repaint() within an event method. Here is a simple applet, showing a button with an attached ActionListener.
    On pressing the button, an array with the digits from 1 to 0 should be shown at a starting position 50,100. This is done with the help of a boolean variable initialized at false. When the button is clicked the System.out.println method throws the "Action" string at the console, meaning that b has changed its value to true, but the next line doesn't seem to be executing. The array is displayed when an occasional repaint is called by the GUI thread (resizing the applet, hiding the applet behind a window and then showing it back again or minimizing and maximizing the applet).
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class ActionEventsTest extends Applet {
    int[] a={1,2,3,4,5,6,7,8,9,0};
    boolean b=false;
    public void init() {
    add(new Button("Check")     {
    addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ev)     {
    b=true;
    System.out.println("Action");
    repaint();
    public void paint(Graphics g) {
    if(b)
    for(int i=0;i<a.length;i++)
    g.drawString(""+a,50+i*5,100);

    No, I think it's executing. You're probably just doing it wrong. Try something else. For instance, try drawing a big x through your applet (2 lines, 1 going from 0,0 to width,height, the other going from width, 0 to 0, height)

  • Unable to Access BI InfoSet in Crystal Reports using SAP Info sets driver

    Hi,
    I am looking to develop a report on top of BI InfoSet in Crystal Reports. However using the the SAP InfoSets driver I am only able to visualize 'Classic InfoSet' and 'SAP Query'. It does not show the option to import the regular InfoSet as a datasource. I am unable to access the InfoSet built by the db join on InfoCubes that is available in SAP BW System.
    Can anybody help.
    Thanks,
    Amogh

    Hi all,
    i know this discussion is abaout 2 years old, but i faced a similar problem. I try to get access to the regular InfoSets (SQ02) within a direct connection between SAP and Crystal Reports. Which components and tools did i need to get a connection?
    look here: http://scn.sap.com/thread/3365060
    Thanx for your help!
    Best Regards
    David

  • Unable to create sales Order/Inquiry object using SAP JCo

    Hi All,
    Pls can you help me.
    I am using BAPI_INQUIRY_CREATEFROMDATA2 and BAPI_Trancation_commit to create Inquiry object.From my Client JCo code there is no error.I debugged the BAPI_Trasaction_commit, there is no error,  return code is 0.  But th system is not creating Inquiry object. When I try the same from SAP GUI client with exactly the same input parameters it works.
    Do I need to set any option/value to commit the Inquiry to the SAP database? How to maintain the same session between the different BAPI's. Is there any issue with Session maintainance? I would appreciate if you can provide me any sample SAP JCo code for creating a Sales Order/Inquiry.
    Thanks
    mars

    Can you put the part of your code that fill the ORDER_PARTNERS table, also you could compare your coding with [Sales order creation using BAPI|http://wiki.sdn.sap.com/wiki/display/Snippets/SalesordercreationusingBAPI] in [Community Code Gallery |http://wiki.sdn.sap.com/wiki/display/Snippets/CommunityCodeGallery] (don't forget that there is a conversion exit on the partner role, so use internal codes "AG" and "WE")
    Regards,
    Raymond

  • ABAP Object Using standard BAPI

    When running ABAP program to convert Accounts Payable conversion documents, the program results indicate the document in the load program were created and returns the relevant document numbers.  However when validating the documents in BKPF, BSEG, or BSIK the documents are not in the table.
    There are no SM13 update log data listing entries for the missing documents.
    Example the conversion load file contained 50 documents, the program results indicated all 50 documents were created and provided 50 document numbers.  When those document numbers are run in SE16/BKPF only 41 of the documents are returned on the query. 
    The program was run with a Basis trace active and there were no errors. 
    The program run successfully without losing documents in our DE, QE and one SE client, the problem occurs in the second of our SE client.  There are no transport differences and no functional config differences between the two SE clients. 
    However, the SE cliient was created via a copy of PRD.

    you just forgot to give us information about this program (name if it's a standard one, and if it's a custom program you should investigate more because we can't help without having in-depth details)

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Java code to call methods in .ocx file

    dear friends,
    i have an .ocx file with me which is used to communicate with a specific device.it is an already existing one. i wish to know whether i can call method sin that .ocx file using java .using vb6 we can do this.
    if it is possible with java i wish to know how i can do this.please consider this query and please send me your responses. i know that using jni we can communicate with .dll files.but i am not sure about .ocx file. please help me.
    thank you
    arun

    i wish to know whether i can call method sin that .ocx file using java
    Probably
    db

  • CAll method inside layout

    Hi all,
             how can we call method inside Layout

    Hi,
    Layout is used for designing,
    Code can be written in eventhandler, you can call the methods in eventhandler.
    Please refer the following links for more information.
    [Layout|http://help.sap.com/saphelp_nw70/helpdata/en/e6/a85e3ba69d493ce10000000a11402f/content.htm]
    [Event Handler|https://wiki.sdn.sap.com/wiki/display/BSP/EventHandlersin+BSP]
    Hope this helps you.
    Regards
    Rajani

Maybe you are looking for

  • Issues using SUM Function in query

    I have pasted two queries Query1 (calculating counts for total_ships and ships_released) and Query2 (calculating the two same counts and then calculating SUM for total_shipments and I am having problem in this) Query 1: select  b.loc , b.week, b.vval

  • Is it possible to create a batch file in Mac OS?

    In MS-DOS, a batch file is a text file containing a series of commands intended to be executed by the command interpreter. It's very convenient and handy. Is it possible to do the same in Mac OS? I tried the automator of Mac OS and copied the workflo

  • I cannot get my adobe flash player to work

    I've installed flash player on a laptop with Win7 and IE10. Flash player does not work when login as an Administrator BUT flash player works when I login as a stander user

  • Issues with colour management when printing since resetting cs5

    I have recently reset my CS5 so that I could attempt to restore my auto color and auto tone options. Since doing this, my color management is very off when printing.  The images are darker, and more saturated than usual, as well as significant colour

  • Dynamic selections -reg.

    Dear All,           In the report fbl3n,there is no field called "entry date" in the dynamic selections tab.  Is it possible to add this field to the dynamic selections tab.  Kindly advice me in this regard. Regards, P.Krishna Chiatanya.