ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem Calling BAPI function BAPI_PO_CREATE1 SAP Adapter

Post new topic  Reply to topic
 Problem Calling BAPI function BAPI_PO_CREATE1 SAP Adapter « View previous topic :: View next topic » 
Author Message
mfractal
PostPosted: Sat May 03, 2008 11:03 am    Post subject: Problem Calling BAPI function BAPI_PO_CREATE1 SAP Adapter Reply with quote

Novice

Joined: 07 Apr 2008
Posts: 14

Hi All!
We're trying to use SAP adapter to invoke BAPI_PO_CREATE1 method.
The adapter was created using BAPI.
The call works fine when we're passing the minimal parameters needed, but once we try to pass a field which is defined "Decimal" in the Message Set the adapter fails.

Here's the XML we're sending with success :

Code:

<SapBapiPoCreate1>
      <SapPoheader>
         <Vendor>0000000007</Vendor>
         <Currency>BRL</Currency>
         <PurchOrg>GCCO</PurchOrg>
         <PurGroup>GCE</PurGroup>
         <DocType>NB</DocType>
      </SapPoheader>
      <SapPoheaderx>
         <PurGroup>X</PurGroup>
         <PurchOrg>X</PurchOrg>
         <Vendor>X</Vendor>
         <Currency>X</Currency>
      </SapPoheaderx>
      <SapPoitem>
         <PoItem>00010</PoItem>
         <PreqNo>0010000223</PreqNo>
         <PreqItem>10</PreqItem>
      </SapPoitem>
         <SapPoitemx>
         <PoItem>00010</PoItem>
         <PoItemX>X</PoItemX>
         <PreqNo>X</PreqNo>
         <PreqItem>X</PreqItem>
                    </SapPoitemx>
      <SapPoschedule>
         <PoItem>10</PoItem>
         <DeliveryDate>20080503</DeliveryDate>
      </SapPoschedule>
      <SapPoschedulex>
         <PoItem>10</PoItem>
         <PoItemX>X</PoItemX>
         <DeliveryDate>X</DeliveryDate>
      </SapPoschedulex>
   </SapBapiPoCreate1>


This call executes and everthing is fine.
The problem starts when we're trying to add another field to the xml - Quantity.
It is defined DECIMAL in the MessageSet and any attemt to pass this field resutls in an error that the adapter throws (it does not even go to SAP).

I have tried passing the Quantity in any way i could think of, with decimal point, without decimal point, float format and so on... Every time i get the same exception.

here's an xml example :
Code:

<SapBapiPoCreate1>
      <SapPoheader>
         <Vendor>0000000007</Vendor>
         <Currency>BRL</Currency>
         <PurchOrg>GCCO</PurchOrg>
         <PurGroup>GCE</PurGroup>
         <DocType>NB</DocType>
      </SapPoheader>
      <SapPoheaderx>
         <PurGroup>X</PurGroup>
         <PurchOrg>X</PurchOrg>
         <Vendor>X</Vendor>
         <Currency>X</Currency>
      </SapPoheaderx>
      <SapPoitem>
         <PoItem>00010</PoItem>
         <PreqNo>0010000223</PreqNo>
         <PreqItem>10</PreqItem>

                                                 <Quantity>1.0</Quantity>
      </SapPoitem>
         <SapPoitemx>
         <PoItem>00010</PoItem>
         <PoItemX>X</PoItemX>
         <PreqNo>X</PreqNo>
         <PreqItem>X</PreqItem>
                                                <Quantity>X</Quantity>
                    </SapPoitemx>
      <SapPoschedule>
         <PoItem>10</PoItem>
         <DeliveryDate>20080503</DeliveryDate>
      </SapPoschedule>
      <SapPoschedulex>
         <PoItem>10</PoItem>
         <PoItemX>X</PoItemX>
         <DeliveryDate>X</DeliveryDate>
      </SapPoschedulex>
   </SapBapiPoCreate1>



Here's the trace that the adapter generates :
Code:

--------------------------------------------------------------------------------------
|                              SAP Java Connector (JCo)                              |
|                Copyright (c) 2000-2005 SAP AG. All rights reserved.                |
|                                Version Information                                 |
--------------------------------------------------------------------------------------
Java Runtime:
 Operating System:    Windows XP 5.1 build 2600 Service Pack 2 for x86
 Java VM:             1.5.0 IBM Corporation
 Java Codepage:       Cp1252
Versions:
 JCo API:             2.1.8 (2006-12-11)
 JCo middleware:      2.1.8 (2006-12-11)
 JCo library:         2.1.8 (2006-12-11)
 RFC library:         710.0.64
Paths:
 JCo classes:         C:\SAP_JCO\sapjco.jar
 JCo library:         C:\SAP_JCO\sapjcorfc.dll
 RFC library:         System-defined path
--------------------------------------------------------------------------------------
|                                      Manifest                                      |
--------------------------------------------------------------------------------------
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.4
Created-By: 1.3.1_18-b01 (Sun Microsystems Inc.)
Specification-Title: SAP Java Connector
Specification-Version: 2.1.8
Specification-Vendor: SAP AG, Walldorf
Implementation-Title: com.sap.mw.jco
Implementation-Version: 20070108 2139 [2.1.8 (2006-12-11)]
Implementation-Vendor-Id: com.sap
Implementation-Vendor: SAP AG, Walldorf
Main-Class: com.sap.mw.jco.About
--------------------------------------------------------------------------------------
Thread-15 [15:33:09:296]: ********************  Sat May 03 15:33:09 BRT 2008   ***************************
Thread-15 [15:33:09:296]: [JAV-LAYER] JCO.setProperty(jco.trace_level, 5)
-------------- Trace of where JCO.setProperty(jco.trace_level, 5) was called -----------------
   at com.sap.mw.jco.JCO.setProperty(JCO.java:546)
   at com.sap.mw.jco.JCO.setTraceLevel(JCO.java:730)
   at com.ibm.j2ca.sap.SAPManagedConnection.getSAPJCOConnection(SAPManagedConnection.java:412)
   at com.ibm.j2ca.sap.SAPManagedConnection.getWBIConnection(SAPManagedConnection.java:304)
   at com.ibm.j2ca.base.WBIManagedConnection.getConnection(WBIManagedConnection.java:263)
   at com.ibm.broker.jca.MbConnectionPoolManager.allocateConnection(MbConnectionPoolManager.java:186)
   at com.ibm.broker.jca.MbConnectionManager.allocateConnection(MbConnectionManager.java:95)
   at com.ibm.j2ca.base.WBIConnectionFactory.getConnection(WBIConnectionFactory.java:74)
   at com.ibm.broker.adapter.deploy.MbAdapterAccess.execute(MbAdapterAccess.java:109)
   at com.ibm.broker.adapter.nodes.MbAdapterRequestNode.requestData(MbAdapterRequestNode.java:368)
   at com.ibm.broker.plugin.MbRequestTemplateNode.requestData(MbRequestTemplateNode.java:51)
--------------------------------------------------------------------------
Thread-15 [15:33:09:296]: [JNI-LAYER] RFC.nativeSetTraceLevel()                                    enter, [SUCCESS]
Thread-15 [15:33:09:296]: [JNI-LAYER] RFC.nativeSetTraceLevel()                with rc = RFC_OK   leave, [SUCCESS]
Thread-15 [15:33:09:312]: [JAV-LAYER] JCO.Client.execute (BAPI_TRANSACTION_ROLLBACK) on handle [3]
Thread-15 [15:33:09:312]: [JNI-LAYER] RFC.nativeExecute()                                          enter, [SUCCESS]
Thread-15 [15:33:09:312]: [JNI-LAYER] RFC.createRecord("OUTPUT"(04F03B30),094BD9E0) enter  [SUCCESS]
Thread-15 [15:33:09:328]: [JNI-LAYER] RFC.createRecord("BAPIRET2"(04F03AD0),04248320) enter  [SUCCESS]
Thread-15 [15:33:09:328]: [JNI-LAYER] RFC.getTypeHandle() before RfcInstallStructure2("BAPIRET2",0581E170,14,042483C4)
Thread-15 [15:33:09:328]: [JNI-LAYER] RFC.getTypeHandle() after  RfcInstallStructure2("BAPIRET2",0581E170,14,042483C4) = RFC_OK
Thread-15 [15:33:09:328]: [JNI-LAYER] RFC.nativeExecute() before RfcCallReceive(3,"BAPI_TRANSACTION_ROLLBACK",00000000,075C1248,00000000,094BDD0C)
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.nativeExecute() after  RfcCallReceive(3,"BAPI_TRANSACTION_ROLLBACK",00000000,075C1248,00000000,094BDD0C) = RFC_OK
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers()                                   enter, [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers("OUTPUT"(001F4E64),094BD9E0) enter [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers()               with rc = RFC_OK   leave, [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers()                                   enter, [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers("BAPIRET2"(001F4F34),04248320) enter [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.reallocRecordBuffers()               with rc = RFC_OK   leave, [SUCCESS]
Thread-15 [15:33:09:359]: [JNI-LAYER] RFC.nativeExecute()                      with rc = RFC_OK   leave, [SUCCESS]
Thread-15 [15:33:09:359]: [JAV-LAYER] JCO.Client.execute (BAPI_TRANSACTION_ROLLBACK) on handle [3] returns after 47 ms


Here's the exeption that i am getting when debugging the broker:
Code:

ExceptionList
   RecoverableException
         File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
         Line:INTEGER:739
         Function:CHARACTER:ImbDataFlowNode::createExceptionList
         Type:CHARACTER:ComIbmWSInputNode
         Name:CHARACTER:BUNGE_EAI_BAPI_PROCESSING#FCMComposite_1_10
         Label:CHARACTER:BUNGE_EAI_BAPI_PROCESSING.HTTP Input3
         Catalog:CHARACTER:BIPv610
         Severity:INTEGER:3
         Number:INTEGER:2230
         Text:CHARACTER:Node throwing exception
         RecoverableException
               File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\TemplateNodes\ImbRequestTemplateNode.cpp
               Line:INTEGER:371
               Function:CHARACTER:ImbRequestTemplateNode::processMessageAssemblyToFailure
               Type:CHARACTER:ComIbmSAPRequestNode
               Name:CHARACTER:BUNGE_EAI_BAPI_PROCESSING#FCMComposite_1_9
               Label:CHARACTER:BUNGE_EAI_BAPI_PROCESSING.SAP Request
               Catalog:CHARACTER:BIPv610
               Severity:INTEGER:3
               Number:INTEGER:2230
               Text:CHARACTER:Caught exception and rethrowing
               RecoverableException
                     File:CHARACTER:MbAdapterErrors.java
                     Line:INTEGER:151
                     Function:CHARACTER:requestData
                     Type:CHARACTER:
                     Name:CHARACTER:
                     Label:CHARACTER:
                     Catalog:CHARACTER:BIPv610
                     Severity:INTEGER:3
                     Number:INTEGER:3442
                     Text:CHARACTER:Caught Throwable
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:SAP Request
                     Insert
                           Type:INTEGER:5
                           Text:CHARACTER:CreatePoTx.outadapter
                     RecoverableException
                           File:CHARACTER:MbAdapterErrors.java
                           Line:INTEGER:121
                           Function:CHARACTER:execute
                           Type:CHARACTER:
                           Name:CHARACTER:
                           Label:CHARACTER:
                           Catalog:CHARACTER:BIPv610
                           Severity:INTEGER:3
                           Number:INTEGER:3450
                           Text:CHARACTER:throw a RecordNotFoundException
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:com.ibm.j2ca.sap.exception.SapBAPIException:



And this is the exception that is returned to me :
Code:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>BIP3113E: Exception detected in message flow HTTP Input3 (broker BROKER0001) </faultstring>
<faultactor>HTTP:/bapiTest3</faultactor>
<detail><text>Exception. BIP2230E: Error detected whilst processing a message in node 'BUNGE_EAI_BAPI_PROCESSING.SAP Request'. : F:\build\S610_P\src\DataFlowEngine\TemplateNodes\ImbRequestTemplateNode.cpp: 371: ImbRequestTemplateNode::processMessageAssemblyToFailure: ComIbmSAPRequestNode: BUNGE_EAI_BAPI_PROCESSING#FCMComposite_1_9
BIP3442E: An exception occurred in adapter node ''SAP Request'', which is using adapter component ''CreatePoTx.outadapter''.. : MbAdapterErrors.java: 151: requestData: :
BIP3450E: An adapter error occurred during the processing of a message. The adapter error message is ''com.ibm.j2ca.sap.exception.SapBAPIException: ''. : MbAdapterErrors.java: 121: execute: : </text></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



Had anybody faced the same issue with sap adapter ?
BTW - It does not matter which field i am passing, the same result happens with any field that is defined DECIMAL in the MessageSet generated using the Adapter.


Broker Version - 6.1
Adapter Version - 6.1.0.1


Any input would be highly appreciated!


- Michael Shvartsman
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat May 03, 2008 11:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'm a little confused about what you're trying to do here.

Are you building a message to pass to the standalone WBI Adapter for SAP/

Or are you using the SAPRequest node that runs native in Broker v6.1?

Also, you say that the request isn't getting to SAP, but the errors you've posted are coming back from SAP, complaining about the record you're trying to request on or send...

So that's also confusing.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mfractal
PostPosted: Sat May 03, 2008 11:52 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2008
Posts: 14

jefflowrey wrote:
I'm a little confused about what you're trying to do here.

Are you building a message to pass to the standalone WBI Adapter for SAP/

Or are you using the SAPRequest node that runs native in Broker v6.1?

Also, you say that the request isn't getting to SAP, but the errors you've posted are coming back from SAP, complaining about the record you're trying to request on or send...

So that's also confusing.

Hi!
I am using Message Broker's SAPRequest node but since i am a newby with sap i assumed this is the SAP adapter node.. Isn't it ?

And it does not seem like SAP error, i've recieved sap errors before, they look different. It looks like the SapRequest throws the error during the parsing of the XML when it encouters field that is DECIMAL. BTW- In sap, the field is defined as QUAL.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 05, 2008 2:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Remember that sometimes the SAP quantity fields are not what they seem.
a) there is no quantity without a qualifier (unit) so you need to have the quantity unit field filled as well.
b) depending on the programs & Bapi and when created (floating point problem) you may need to multiply the quantity by 100 or 1000 to show in SAP the desired value...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mfractal
PostPosted: Mon May 05, 2008 6:24 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2008
Posts: 14

fjb_saper wrote:
Remember that sometimes the SAP quantity fields are not what they seem.
a) there is no quantity without a qualifier (unit) so you need to have the quantity unit field filled as well.
b) depending on the programs & Bapi and when created (floating point problem) you may need to multiply the quantity by 100 or 1000 to show in SAP the desired value...

Enjoy


Thanks a lot for your input, i was trying to follow the advice and specifying the unit for the quantity. I got to the point where i am actually sending all the possible fields to the BAPI function.
Nothing helps, the adapter fails with the previously mentioned error BEFORE sending the request to SAP.
The error occurs during parsing of the message.
It can not convert the value in quantity field to QUAN or something like that.
i would highly appreciate any ideas or possible solutions to that problem.

I am kind of lost here
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 05, 2008 1:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Like I said,
you need to find the associated uom (Unit of Measure) field to your quantity field. (See SAP DDIC). You then need to know what the adequate value is for the uom field. Remember the field has a uom_conversion_exit.

Once you know what the relevant values are you should be able to deal with the quantity problem (*1, *100, *1000 etc...)

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mfractal
PostPosted: Mon May 05, 2008 3:51 pm    Post subject: Reply with quote

Novice

Joined: 07 Apr 2008
Posts: 14

fjb_saper wrote:
Like I said,
you need to find the associated uom (Unit of Measure) field to your quantity field. (See SAP DDIC). You then need to know what the adequate value is for the uom field. Remember the field has a uom_conversion_exit.

Once you know what the relevant values are you should be able to deal with the quantity problem (*1, *100, *1000 etc...)

Enjoy


Thanks for your answer!
I will try to investigate it more as soon as i get to work tomorrow!
Back to top
View user's profile Send private message
DH
PostPosted: Fri May 23, 2008 6:45 am    Post subject: Reply with quote

Newbie

Joined: 23 May 2008
Posts: 3

I think this may be to do with the definition of the field Quantity in SAP. When the Adapter tries to set values for certain fields, even though you don't set an explicit value for the field yourself, it registers a conflict of data types.
When running the SAP Adapter wizard, you see a pop-up window which asks you to specify Optional Parameters. This pop-up appears shortly after selecting the particular BAPI function you are using. By default, I suspect all the optional fields may all be checked, and probably contain the Quantity field. Try unchecking these fields (in particular Quantity). Otherwise, proceed as normal.
Back to top
View user's profile Send private message
kirankinnu
PostPosted: Fri May 23, 2008 11:48 am    Post subject: Reply with quote

Centurion

Joined: 12 Jun 2004
Posts: 128
Location: Chicago, IL

Hi mfractal,
Did you figure out a solution for this problem.....

Thank You,
Kiran
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem Calling BAPI function BAPI_PO_CREATE1 SAP Adapter
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.