ABAP Proxy to JDBC : UPDATE_INSERT issue.
Dear Friends
I am inserting one ekpo records to MS SQL server. my structure and records are below.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_EKPO_RECEIVE xmlns:ns0="http://gspcgas.net/asset_rfid">
- <StatementName>
- <dbTableName action="UPDATE_INSERT">
<table>EKPO</table>
- <access>
<EBELN>4500000687</EBELN>
<EBELP>00010</EBELP>
<MATNR>000000000100000012</MATNR>
<MENGE>1.000</MENGE>
<MEINS>EA</MEINS>
<WERKS>1000</WERKS>
<LGORT />
<AEDAT>2011-12-12</AEDAT>
<BUKRS>1000</BUKRS>
<ANLN1>010023000315</ANLN1>
<PSTYP>0</PSTYP>
<KNTTP>A</KNTTP>
<LOEKZ /> <-- during insertion I am not updating this field ( this is for item deletion)
</access>
- <Key1>
<EBELN>4500000687</EBELN>
<EBELP>00010</EBELP>
</Key1>
</dbTableName>
</StatementName>
</ns0:MT_EKPO_RECEIVE>
this works absolutly fine and record inserted in the MS SQL server.
problem occurs when in second run my user is changing the fields means he deletes the item from the PO, but it is not reflecting in the data base. only I can see previously created entery not the changed one. I have below payload in RWB for the receiver communication channel.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_EKPO_RECEIVE xmlns:ns0="http://gspcgas.net/asset_rfid">
- <StatementName>
- <dbTableName action="UPDATE_INSERT">
<table>EKPO</table>
- <access>
<EBELN>4500000687</EBELN>
<EBELP>00010</EBELP>
<MATNR>000000000100000012</MATNR>
<MENGE>1.000</MENGE>
<MEINS>EA</MEINS>
<WERKS>1000</WERKS>
<LGORT />
<AEDAT>2011-12-12</AEDAT>
<BUKRS>1000</BUKRS>
<ANLN1>010023000315</ANLN1>
<PSTYP>0</PSTYP>
<KNTTP>A</KNTTP>
<LOEKZ>L</LOEKZ> <---- I receive the value here when user has deleted the item in the PO.
</access>
- <Key1>
<EBELN>4500000687</EBELN>
<EBELP>00010</EBELP>
</Key1>
</dbTableName>
</StatementName>
</ns0:MT_EKPO_RECEIVE>
Please help me to understand why the changed values are not reflecting in my MSSQL server from PI. and tell me what should i do to correct it. I have no error message in RWB for the receiver communication channel. please reply me. your any reply will be highly appreciated. Please reply me
Delete is handled differently when compared to an Update_Insert.
an Update_insert statement is like a modify command. it either inserts an entry or changes it, but does not delete it. You need to specify the keys in the Update_insert XML-SQL.
In case you have a scenario for delete along with update/insert, please do the following
1. Let the source system determine an action, and pass it to PI
2. Based on the action code, implement 2 split mappings using enhanced interface determination ( rule based interface determination).
3. Implement 2 seperate maps for Delete and Update, and call them based on the action code rule from the interface determinaton.
Hope this helps.
Regards,
Abhishek
Similar Messages
-
ABAP Proxy to JDBC syncronous method
Hi Experts,
I am very new to ABAP Proxy to JDBC syncronous method.
I have used 4 DT, 4 MT, 2 MI, 2 MM and 1 IM.
I have used reference from
SYNCHRONOUS SOAP TO JDBC - END TO END WALKTHROUGH
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3928. [original link is broken] [original link is broken]
My question is in Integration Directory how many sender agrement, receiver agrement, receiver determination and interface determination should i use?
Is my above DT , MT , MI , MM and IM is correct?
I am not using any BPM.
Thank you in advanced.
regards,
S.Saravannanmrsaravannan wrote:
> My question is in Integration Directory how many sender agrement, receiver agrement, receiver determination and interface determination should i use?
for a Sync sceanrio, you will create
1 RD
1 ID
1 SA (since its a ABAP proxy call this is optional)
1 RA
>
> Is my above DT , MT , MI , MM and IM is correct?
Yes -
Using of Integration Scenario in a Abap Proxy to JDBC receiver synchronous
Hi ,
Can any one help me out how to go about for creating Integraion scenario in ESR as i'm new to the use of Integration scenario..
its an Abap proxy to Jdbc synchronous scenario... kindly help in this regards.Hi Indudhar,
Right click on the namespace where you want to create the IS and say new, Select process integration scenario option, give a suitable name and say OK.
In the Component View section right click on the first grey column and Insert a sender Application component. Enter ur product and the software component version. Like wise in the next grey column enter the target Application component.
Now go to the top level menu and click on view and select grid.
Now right click on each App. component and insert the created actions. If the scenario is sync then the actions will be side by side otherwise the target one will be in the next grid of the target app. component.
After entering the actions click on the source action then press shift and click on the target action, right click and choose create connection between the two actions.
Fill in the info and then save.
Regards,
Anshul -
The scenario is Sender is ABAP proxy and receiver side is JDBC adapter.
While creating Purchase order(PO) in SAP, interface should be triggered and it should go and fetch the tax amount from a external Database(DB) and return the tax amount to SAP.
PO can have mulitple line items so for each item it should get the tax amount from DB.
I know we can change the occurence of Statement tag of JDBC structure to unbounded and accomplish multiple stored procedure calls.
But how to handle multiple response from DB for each line item and send it as a single message to SAP.
Is this possible without BPM ?For every purchase order there are mulitple line items and for each line item we need to extract tax amount.
Question: Are these line items are in single db table or different? If it is one table, Why dont you use jdbc lookup during mapping time to fetch item amounts (Just using Select queries.. if the requirement is feasible) ?
If there are multiple tables, receiving response from many tables might not be possible. If response fails from first table then further query to the tables will not proceed. Jdbc treats entire query as one transaction. -
Handling Transport ack. in Abap Proxy to JDBC Scanario
HI all
I have a scanario where i have message which is being sent from an abap proxy to a SQL Server database using JDBC adapter. The scenario involves a BPM.While sending the message the message shows delivered in MDT (Message monitor for Adapter ) but the Business process is still executing and is waiting for the acknowledgement(transport) . Can anyone please tell me how do find where the exact prblem lies.And how do i delete these acknowledgements. Even though i deleted the work items the Ack Status column still shows "Still Awaiting Acknowledgement"
regards
Nilesh TaunkHi,
As metioned check the Send Step Properties ( mode etc)..
After changing activate the BPM and refersh the cache in SXI_CACHE and test the scenario.
also check the BPM technical details. For this go to SXMB_MONI>PE>Technical Details so that you can find the logs in the monitor.
Regards,
Moorthy -
Sender Abap Proxy -- Receiver JDBC , catch communication channel exceptions
Hi All,
I have a sender abap proxy and a receiver jdbc asynchronous interface.
Now under some circumstances when I send some junk data for an update query(which satisfies metadata requirement but wrong primary key) it shows chequered flag in both XI and r/3.
But in communication channel it shows error.
Queries:
1. How do I handle this.
2. Since this is triggered from Abap wht will be subrc when method ends in this particular case.
3. Is there any possibility of program goin into dump?
Regards,
PremYou can catch the exception in cx_ai_system_fault.
http://help.sap.com/saphelp_nw70/helpdata/en/75/a55c3cff8ca92be10000000a114084/content.htm
DATA:
lo_mes TYPE REF TO
[Client proxy class],
l_sys_exc TYPE REF TO
cx_ai_system_fault,
l_app_exc TYPE REF TO
cx_ai_application_fault.
CREATE OBJECT lo_mes.
TRY.
CALL METHOD
lo_mes->EXECUTE_SYNCHRONOUS
EXPORTING
OUTPUT = ls_request
IMPORTING
INPUT = ls_response.
CATCH cx_ai_system_fault
INTO l_sys_exc.
* handle system error
EXIT.
CATCH cx_fault_1
INTO l_app_exc.
* handle application error 1
CATCH cx_fault_n
INTO l_app_exc.
* handle application error n
CATCH cx_ai_application_fault
INTO l_app_exc.
* handle other
* application errors
ENDTRY.
Thanks,
Beena. -
Reg. Client(ABAP) Proxy to JDBC scenario
Hi All,
I am working on a scenario of Proxy to JDBC. The scenario goes like this.....
SAP is the sender and I need to fetch data from the database table at the R/3 end and update in the legacy system at the receiver end .
Can anybody guide me apart from PI configuration, the settings need to be done at the R/3 end in the transaction sproxy i.e. the ABAP class and objects. Also let me know if I need to trigger the interface weekly once, is it possible to trigger it automatically by using ABAP class and objects else I need to write an ABAP program in order to trigger the interface.
Thanks for understanding in advance.
Regards,
Neethu ChordiaHi,
Can anybody guide me apart from PI configuration, the settings need to be done at the R/3 end in the transaction sproxy -
As Raj suggested please search on SDN, you will find lot of links on this.
Also let me know if I need to trigger the interface weekly once, is it possible to trigger it automatically by using ABAP class and objects else I need to write an ABAP program in order to trigger the interface. -
>For this you need to write Abap class program and override method "Execute asynchronous" this will send the SAP R3 data to XI and then you have to configure job on R3 to run this program periodically as per your requirement.
Divyesh Vasani -
Sender Abap Proxy -- Receiver JDBC MaxDB
Hi Experts,
Please, PI works with MaxDB database?
What is the procedure? Need to install drivers?
SO is Linux.
Thanks for the help!Hi,
>>>>Please, PI works with MaxDB database?
yes
>>>What is the procedure? Need to install drivers?
yes you need to install the driver - the rest is the same as with any other DB
Regards,
Michal Krawczyk -
Issue in Iodc- abap proxy scenario
Hi all
I have a idoc to abap proxy scenario. The issue is ,
when we send the idoc to client A of target system, it works ifne.
But when we send the saem mesage to Client B, we find a error message in sxmb_moni of Target system. the mesage is Application_fault.
Is it because of any error in XI configuration or somethin else.hi all
thanks for all your responses.
I forgot to mention that based on a particualr field value in the idoc , it will be routed to eihter Client 100 or 200 .
I gave the conditions in Receiver Determination.
Same Server Proxy is used in both the target business sytems.
I have done all the Configuration Steps ,( Created two separate business systems also )
Also I have checked wiht all the system settings to be made in the target system B.
When i trigger the idoc to Client 100, it goes to XI and then reaches Client 100 of System B
without any problem. I get the desired result from proxy code.
When i send the saem idoc to Client 200, it reaches the target system and routed to client 200. But getting this error message in
the Call Inbound PRoxy step. (from sxmb_moni)
<SAP:Category>Application</SAP:Category>
<SAP:Code area="ABAP">APPLICATION_ERROR</SAP:Code>
Since it reaches the target system correctly, i guess there is nothing wrong in the XI configuration side.
But if its Application fault, how come the same data is processed successfully in one client whereas it thorws error in another. -
Sender ABAP Synchronous proxy -- PI -- JDBC sync scenario pls!!
Hi Guys,
Can any one help to find one sample scenario like ABAP Proxy --> PI --> JDBC Sync call ? Sync ABAP proxy sample code any 2 or more filelds going from ABAP proxy and maps on JDBC sync request, up date target side SQL server database tables, in case if any error happens error/success message must go back to SAP one Z table with response.
Any help would be really great!!
Many thanks in advance
Sanup date target side SQL server database tables, in case if any error happens error/success message must go back to SAP
one Z table with response.
When you do an update you can get back the number of rows updated in the JDBC response....you can find this in the help page showing JDBC structure. If you are looking for any other response then probably the message needs to be genarated by PI itself after checking the response from JDBC.
Regards,
Abhishek. -
Error Handling for ABAP Proxy sender
Hello Everyone,
I am trying out a scenario of SAP R/3 to Oracle database (ABAP Proxy to JDBC).
I have the following code and it works fine.
CALL METHOD prxy->execute_asynchronous
EXPORTING
output = it.
commit work
CATCH cx_ai_system_fault .
DATA fault TYPE REF TO cx_ai_system_fault .
CREATE OBJECT fault.
WRITE :/ fault->errortext.
I know that the above Catch block would be used to handle system errors on the sender side.
Please tell me what kind of errors could these be and what I can do to test these errors. ie. I want to create error situations explicitely and see how they are handled.
Thanks and Regards,
AshwinThanks guys, this was useful.
My scenario is for Asynchronous communication.
I guess Fault messages are used in case of Synchronous communication for handling application errors. So if there was something wrong at the JDBC end then I could use the fault messages.
Have i got this right?
I also came across this piece on Acknowledgements. But is says that they can be used with the following Receivers:
The following receivers support acknowledgments:
ABAP and Java proxies (XI 3.0 SP1 for the latter)
Integration processes
IDocs (note that IDocs only return acknowledgments when they have been configured using the ALE audit)
Receiver adapters support system acknowledgments but not application acknowledgments
My Receiver is JDBC. So I guess I cannot use acknowledgements either.
Hence, I need to know what I can do to replicate the system errors eg. failed server etc...so that I can get catch these errors during sending.
I'll tell you abt what happened earlier.
My XI server was down. I executed the code for the sender ABAP Proxy and it did not catch the error. In SXMB_MONI in the R/3 system, I could see the messages queued up. When the XI server started, the messages were transferred to XI.
I need to handle such errors...ie. If the server is down or message did not reach XI then my ABAP program that sends data via ABAP proxy needs to know that something went wrong.
Thanks and Regards,
Ashwin -
Synchronous ABAP Proxy - no answer
Hello!
I have scenario ABAP Proxy --> PI --> JDBC
It's synchronous. Messages are sending, in PI in SXI_MONITOR I see a response from database, but in ERP in debug mode I don't see this response
My proxy call look like that:
TRY.
CALL METHOD g_proxy->OS_DOM_CAJO
EXPORTING
output = ls_out_mt
IMPORTING
input = ls_in_response_mt.
COMMIT WORK.
CATCH cx_ai_system_fault .
CATCH cx_ai_application_fault .
ENDTRY.
So, there is no data in ls_in_response_mt.Hi,
1. both of your service interfaces are sync right (outbound and inbound) ?
2. and did you try to use the reponse XML from JDBC in your message mapping (copy/paste) to check the mapping as Grzegorz suggested ?
3. just a reminder :
you can also turn on loggin_sync on ERP backend not only in PI system
to see sync calls in ERP backend too (req/resp)
Regards,
Michal Krawczyk -
Hello folks
Have a sender abap proxy to jdbc scenario.
Have a question: how do we trigger abap proxy from SAP ? can we do by scheduling a job or some other better ways exist ?
Thank you.>
> Ok req is : ABAP - > JDBC scenario : each xml payload is small... just 5 -6 fields coming over from SAP but it is very frequently triggered on SAP ... every 1 minute.. this will be triggeed.
>
> if its job / batch based: aggregate records come over for every 5 -10 minutes... which is good for PI but for SAP overhead is more since job is scheduled very frequently.
>
> if it is event based trigger of abap proxy from SAP then multiple small messages flood PI since data uis not aggregated.
>
> Dont know what is generally preferred?
>
Completely depends on how you want and depends on requirement,if you are able to generate multiple records at a time then it it would be really good , because resource utilization in ECC and PI also will be reduced.
else go with individual record.
Regards,
Raj -
Performance issues in Proxy-XI-Jdbc scenario
Hello,
I have developed a proxy to JDBC synchronous scenario.
My scenario works like this.
*i run an abap program which calls a client proxy,
the proxy fetches the data from database table and returns the data in the ABAP program.(select query)
there are serious performance issues when we are running the report
it is taking around 2-5 minutes and at times multiple users are logged in , it takes around 5-20 minutes.
it seems that most of the time is consumed in the data fetching.
please help me to find some solution so that we can fine tune the performance on the PI side.
Are there any options on JDBC CC which can help us in making the queries faster
thanks
kannu.Kanu16 ,
Issue seems to be at r/3 end..
1. Make sur ethat report program is using select query in proper fashion .
2. avoid using nested loops.
3. Hope not much validations are being done on selected data .
Abaper can help you optimizing this .
By debugging you can find out the exact reason behind.
Regards , -
Error while usinjg the JDBC to ABAP Proxy Scenario
Hello Rocks,
This is my scenario like JDBC --- Pi --- ABAP Proxy
while i am given a sender side jdbc XSD structure is like this
VWENTITYAGGREMENT
Row 1-unbound occurence
POOL_ID 0-1 occurence
CUST_ID
AGREEMENT
PRODUCT_ID
CONTRACT_TYPE
CONTRACT_TYPE_DESCR
AGRMNT_STATUS
STATUS_DESCR
EFFDT
TERMINATION_DT
ADD_DT
ADD_TM
while i am writing a select query in Sender JDBC CC is like this
SELECT POOL_ID,CUST_ID,AGREEMENT,PRODUCT_ID,CONTRACT_TYPE,CONTRACT_TYPE_DESCR,AGRMNT_STATUS,STATUS_DESCR,EFFDT,TERMINATION_DT,ADD_DT,ADD_TM FROM vwEntityAgreement.
Here i am getting this Error message like this :
Error Description: Database-level error reported by JDBC driver while executing statement 'SELECT POOL_ID,CUST_ID,AGREEMENT,PRODUCT_ID,CONTRACT_TYPE,CONTRACT_TYPE_DESCR,AGRMNT_STATUS,STATUS_DESCR,EFFDT,TERMINATION_DT,ADD_DT,ADD_TM FROM vwEntityAgreement'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'POOL_ID'.'. For details, contact your database server vendor.
So please give me your valuable inputs !
Regards,
Ravi.Invalid column name 'POOL_ID'.'. For details, contact your database server vendor.
Did you confirmed the name POOL_ID as suggested?
Why is the tablename different (check the case) in the query that you make and in the XSD structure that you mentioned......check if this is causing the problem.
Regards,
Abhishek.
Edited by: abhishek salvi on Jun 4, 2010 10:24 AM
Maybe you are looking for
-
I'm relatively new at this and having a difficult time. I'm trying to create an image gallery that dynamically loads, but also removes the loaded image when a new thumbnail is clicked. I have a remove child instance, but that only works for one image
-
Problem viewing videos and webcasts
When I try to view a music video or a sports webcast that is located on a website, the video and audio stop frequently and make the experience tolerable at best. Are there any suggestions? Thanks a lot.
-
How configure ICH8 on windows xp
i´m trying to enable the ICH8 on windows xp in the way lenovo says, but, doesnt works. somebody knows a different way?
-
Read_imag_file in oracle 6i Form
READ_IMAGE_FILE('d:\LOGO.GIF','GIF','image1'); now i have gif image but still not showned the image.
-
TS4268 How to install FaceTime in iPhone5
How to install FaceTime in iPhone5