Idoc - to - JDBC mapping..
Can any one help me on step-by-step Idoc to JDBC mapping ..
Check this link for jdbc receiver adapter. and follow the instructions. If you need more assistance let us know with your requirement
For configuring JDBC adapter
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
For creating jdbc structure on the inbound side
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Similar Messages
-
IDOC to JDBC - mapping test versus actual run
Hi
When I test the message mapping for the idoc-to-jdbc sender scneario, where one sales order idoc has multiple line items in segment E1EDP01, the statement => access structures repeat properly for 2 line items. Here I am giving the idoc xml file (data file) in the payload in the test tab of message mapping)
However in the communication channel log (with sql statement log = true), when I try to process an actual idoc from ECC, in the sql log of the processed message, I can see an insert statement only for the first line item of the sales order.
Please can somebody guide me as to what must be the problem?
Statement occ is 1.
tablename occ is 1.
Access structure occ is 0...unbounded.
The segment E1EDP01 is currently mapped to acess node.
The sales order number is repeated over the 2 line items using below mapping -:
E1EDP01 (with context as root) => "useasmany" => split by value => Item no.
Please advise.Hello Gary,
Make the statement 0..unbounded or 1..unbounded then make the access 0..1. One statement is needed per action
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm
If the statements are so complex, you can also opt to use SQL_QUERY instead.
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm
Hope this helps,
Mark -
Idoc to jdbc mapping duplicate source node to target structure
Dear all,
I am working on PI 7.1
My sceniro
IDOC to JDBC [sap to mssql ] where the target is a table structure shown below: I execute a stored procedure to insert the below message type into sql table.
<ns0:MT_SP_LFBK xmlns:ns0="http://test.com">
- <Statement_Name>
- <storedProcedureName action="EXECUTE">
<table>spr_test</table>
<BANKS type="Char">BOA</BANKS>
<BANKL type="char">122207</BANKL>
<BANKN type="char">4555--0</BANKN>
<LIFNR type="char">1100000218</LIFNR>
<KOINH type="char">varchar</KOINH>
<BKONT type="char">01</BKONT>
<BANKA type="varchar">S.A.</BANKA>
</storedProcedureName>
</Statement_Name>
</ns0:MT_SP_LFBK>
The mapping is between source CREMAS02 and the above target structure. Everything works fine.
The problem is when the vendor has more than one bank account number the IDOC CREMAS02 replicates the below segment E1LFBKM for each BANK account information. Since target and source are mapped one to one how can i map the second bank account information to the same target structure or genereate a new target Message type for the second bank account information and send it to sql ?
<E1LFBKM SEGMENT="1">
<MSGFN>005</MSGFN>
<LIFNR>110000021</LIFNR>
<BANKS>BOA</BANKS>
<BANKL>122207</BANKL>
<BANKN>4555-0</BANKN>
<BKONT>02</BKONT>
<BANKA>S.A.</BANKA>
<BNKLZ>3000000</BNKLZ>
</E1LFBKM>
Thank you ,
TeresaHi Teresa,
which segment have you mapped with <storedProcedureName action="EXECUTE"> ?
Because according to me , if you send <E1LFBKM> to <storedProcedureName action="EXECUTE">
, you will be able to use your stored procedure several times, in fact each times that you have a <E1LFBKM>.
Reminds: inside <Statement_Name> you can do several SQL actions like execute one or several stored procedures (could be different).
Of course, after that your table should accept to have several bank account for a same customer.
So to have something like that:
<Statement_Name>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
</Statement_Name>
regards
mickael -
IDOC-XI-JDBC: mapping error
Hi sap gurus...
I had a problem in IDOC mapping to JDBC.
If any body have mapping template or any blog.. related to MATMAS.. please help me..
I don't know how to map the idoc structure to JDBC structure..
points will be given immediately..
KumarHi sheetal
My IDOC structure is----
MY JDBC Struc is
as................................................................MT_MATMAS_MSSQL(Msg type name)
This struc...is common----
STATEMENTNAME(0..1)
............................................................................TEST (1..1)
.................................................................................ACTION ..REQUIRED
.................................................................................TABLE...(MATMAS TABLE IS CREATED IN MSSQL)
.................................................................................ACCESS(1..1)
......................................................................................BEGIN ...REQUIRED
......................................................................................EDI_DC40..1...1
......................................................................................E1MARAM...1...9999
......................................................................................E1UPSLINK..1...1
THIS IS MY JDBC STRUCTURE..
I sent the screen shorts to your company email id..please check it and help me..
i am able to get the idoc from sap r3 to Xi ,,, now i want to send that idoc to database..
help me please.
Kumar..
[email protected] -
Mapping issue in idoc to JDBC scenario
mapping issue in idoc to JDBC scenario
source structure
E1KNB1M
BUKRS = 1000
E1KNB1M
BUKRS= 9000
E1KNB1M
BUKRS= 2000
THE NODE E1KNB1M is repeated many times and the field BUKRS is also repeated with E1KNB1M as above
TARGET field : ISFRANCHISE
if any where value of BUKRS =9000 we have to pass Y to the target filed, else N
if BUKRS = 9000 THEN ISFRANCHISE= Y
ELSE
ISFRANCHISE=N
I've done the mapping as below
BUKRS = 9000--> IF THEN Y ELSE N--
> ISFRANCHISE
BUT everry time the target value is N only
pl suggest
rgds
mojibmapped like this
BUKRS--->SORT---->
EQUALS --------IF---THEN Y
9000------------------------> ----------------->ISFRANCHISE
ELSE N
context of BUKRS set to parent node
its worked
thanks to all for valuable suggestions
rgds
mojib -
Message mapping issue in idoc to jdbc scenario
We have a scenario of idoc->XI-JDBC
the below given segment may get repeated , as shown below ,
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000034(EAN No)
Reqd mapping
if QUALF=003
THEN IDTNR----->Bar_code_Number_EAN
Now IDTNR has to be mapped with Bar_code_Number_EAN for the segment which comes last
Pl suggest how to map using graphical mapping for the above scenario.Hi Raj ,
The current mapping works fine if the parent segment E1EDP01 is only one but if that gets repeated then the last value of IDTNR is getting populated in the target side, very clearly i m giving the source and target structure and the mapping done using the UDF
Source structure
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000030(EAN No)
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000031(EAN No)
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000032(EAN No)
Target mapping
if QUALF=002
THEN IDTNR--->Article_No this is the direct mapping so , no issues
if QUALF=003
THEN IDTNR----->Bar_code_Number_EAN, now this IDTNR should get repeated every time the segment E1EDP01 gets repeated , currently only the last value form all the IDTNR is coming to the target side.
The current mapping works fine if the parent segment E1EDP01 is only one
Target structure
Access1
IDTNR--> Bar_code_Number_EAN( value is 20500000000030)
Access2
IDTNR--> Bar_code_Number_EAN( value is 20500000000031)
Access3
IDTNR--> Bar_code_Number_EAN( value is 20500000000032)
Current mapping
If QUALF = 003
Then QUALF ---->
mapBarCodeEAN---->Bar_code_Num_EAN
If QUALF = 003
Then IDTNR ---->
Context of QUALF is set to E1EDP01
Context of IDTNR is set to E1EDP01
thanks for your personalised help
rgds
mojib
Edited by: mohammad mojib ur rahman on Apr 9, 2010 1:30 PM -
Mapping Issue for IDoc to JDBC interface
Hi All,
I am having problem in implementing logic in IDoc to JDBC interface where I have to filter out E1WBB07-KSCHL = VKP0.
Source IDoc structure is like ->
E1WBB01(occ 0 -1000)
|-> E1WBB03 (occ 0-100)
|-> E1WBB07(occ 0-1000)
|-> KSCHL
DATAB
DATBI
Now, For each KSCHL = VKA0 there should be a duplicate VKP0 record. From these 2 records only the VKA0 should get processed and VKP0 ignored.
Duplicates for VKP0 and VKA0 can be identified by identical DATAB and DATBI.
Suppose, in one E1WBB03 segment,there are 4 E1WBB07 segment having following values.
1: KSCHL=VKP0, DATAB=20102011, DATBI=25102011
2: KSCHL=VKP0, DATAB=26102011, DATBI=30102011
3: KSCHL=VKA0, DATAB=26102011, DATBI=30102011
4: KSCHL=VKP0, DATAB=01112011, DATBI=31129999
2 & 3 are duplicates. From these, 2 should get dropped.
As a result only 1, 3 and 4 should get processed.
How can I proceed with this..?...I have tried some work around but not able to do it successfully. Is a UDF required to compare DATAB and DATBI. If yes how it can be written.?
Thnx in advance,
Praveen.chk below mapping:
change the context of DATAB, DATAB1 and KSCHL to E1WBB03 (right click-> context) in all the mappings shown below
1)
DATAB
------------concat-----sort----splibyvalue(value change)-----collapse context---TargetNode
DATBI
2)
DATAB
------------concat-----sortbykey \
DATBI / \
KSCHL------------/ \
----------------------------------------FormatByExample----sort-----UDF1----Target KSCHL
DATAB /
----concat---sort--splibyvalue(value change)-
DATBI
3)
DATAB
---concat ( ; )-----sort-splibyvalue(value change)---collapse context--splitbyvalue (each value)--UDF2---TargetDATAB
DATBI
4)
DATAB
------------concat ( ; )-----sort----splibyvalue(value change)-----collapse context--splitbyvalue (each value)--UDF3---TargetDATABI
DATBI
UDF1: execution type : all values of a context...input: var1
int a=var1.length;
int count=0;
if(a>=2)
for(int i=0;i<a;i++)
if(var1<i>.equals("VKA0"))
count= count+1;
else
result.addValue(var1[0]);
if(count>1)
for(int i=0;i<count;i++)
result.addValue("VKA0");
UDF2:execution type: single value...input: var1
String [] temp= var1.split(";");
return temp[0];
UDF3: execution type: single value...input: var1
String [] temp= var1.split(";");
return temp[1]; -
PI : Idoc to JDBC scenario : repeating segments mapping issue
Experts
Please help.
Question reg. mapping for ECC idoc to JDBC scenario.
I am using the ORDRSP idoc which has multiple segments as below.
IDOC -> multiple E1EDK14 segments with 2 fields (QUALF and ORGID)
Depending on the value of the QUALF field i need to populate the column in my target structure.
QUALF 001 => Colmn a
QUALF 002 => Colmn b
For now my graphical mapping is very simple - QUALF => column a (done just to find out how PI mapping works)
What happens in my case, is the PI Payload shows all the E1EDK14 segments however only the value 006 present in the first occurence goes into the target column.
How do I repeat a mapping between QUALF and target col. for multiple occurences of the same segment?
Please can you guide me reg. use of context, loop over segment, UDF = which will be the best solution to achieve this?Hi
My mapping is as below. I will take an example of a sales order that has 2 line items 00010, 00020. The payload is as follows
I see this payload in the SXMB_MONI transaction => Receiver grouping => Payloads
- <ZORDRES>
- <IDOC BEGIN="1">
+ <EDI_DC40 SEGMENT="1">
+ <E1EDK01 SEGMENT="1">
+ <E1EDK14 SEGMENT="1">
<QUALF>006</QUALF>
<ORGID>01</ORGID>
</E1EDK14>
+ <E1EDK14 SEGMENT="1">
<QUALF>007</QUALF>
<ORGID>01</ORGID>
</E1EDK14>+ <E1EDK03 SEGMENT="1">
+ <E1EDK03 SEGMENT="1">
+ <E1EDK03 SEGMENT="1">
+ <E1EDK03 SEGMENT="1">
+ <E1EDKA1 SEGMENT="1">
+ <E1EDKA1 SEGMENT="1">
+ <E1EDKA1 SEGMENT="1">
+ <E1EDKA1 SEGMENT="1">
+ <E1EDKA1 SEGMENT="1">
+ <E1EDK02 SEGMENT="1">
+ <E1EDK02 SEGMENT="1">
+ <E1EDK17 SEGMENT="1">
+ <E1EDK18 SEGMENT="1">
+ <E1EDK18 SEGMENT="1">
+ <E1EDP01 SEGMENT="1">
<POSEX>000010</POSEX>
+ <E1EDP01 SEGMENT="1">
<POSEX>000020</POSEX>
</E1EDP01>+ <E1EDS01 SEGMENT="1">
<SUMID>001</SUMID>
<SUMME>2</SUMME>
</E1EDS01>
+ <E1EDS01 SEGMENT="1">
<SUMID>002</SUMID>
<SUMME>1100.00</SUMME>
<SUNIT>GBP</SUNIT>
</E1EDS01>
</IDOC>
</ZORDRES>
There are 2 problems. First one which I discovered after posting the query. I can see only the line item 10 in the query that gets contructed in PI to insert the data into the target jdbc table. Please see jdbc receiver communication channel log below
If you see above there are 2 E1EDP01 segments for line 00010, 00020.
INSERT INTO tblOItem (IDocDate, IDocTime, SalesOrderNo, ItemNo, Plant, ItemCategory, UnitSellPrice, QuantityOrdered, QuantityAllocated, ScheduledDeliveryDate) VALUES (20111206, 135530, 0015002085, 000010, 0086, ZTAN, 0.00, 1.000, 1.000, 20111201)
My source and target mappings are as below.
ZSALORD
IDOC
BEGIN
E1EDK01
E1EDP01
POSEX =============> SalOrdItm table column itemno
My target side structure (idoc to jdbc scenario is as follows)
I have mapped the E1EDP01 to Statement - I thought this will build one query per line item (per occurence of E1EDP01) but this is not working.
MT_OITEM
Statement
dbtablename ============> SalOrdItm
action =================> Insert
table
access
Itemno (this is one of the columns from the table)
The occurence of E1EDP01 is 0..9999999 while the occurence of Statement node is 1...unbounded.
Please is there any email address where I can send you screen shots if the above is not clear.
I need to get this interface delivered as soon as possible but am STUCK.
Edited by: gary jojo on Dec 6, 2011 3:06 PM -
Hi,
I am mapping idoc to jdbc structure. My problem is i am not getting the data for some fields in the idoc structure and there is a custom field under a custom segment and i am also not getting the data for this field.
I have seen the incoming XML payload and there is no data for these fields.
can anybody suggest me how can i solve this issue.
Thanks,
snehaHi,
1. at first check TCODE : WE02 in R3
and check if your custom segment is there
2. if so then reload metadata (IDX2 from XI)
3. also check if the IDOC signature that you've uploaded to XI
(via repository) has those custom fields
4. you can also delete the cache to be sure
XI has the valid data in it
Regards,
michal -
Message mapping from 0..1 to 1 (IDoc to JDBC)
Hi,
My Scenario is IDoc to JDBC. I have a field in IDoc which is optional, this optional filed is mapped to a mandatory field in JDBC.
If the optional filed in IDoc doesn't exist, then mapping between Optional field and mandatory field is not happening and hence the mandatory field is becoming null which is throwing error in JDBC.
Can any one guide me in how to map these fields and even if optional field in IDoc doesn't exits, a constant 'false' should be filled in mandatory field.Hi
Use mapwithdefault standard function. so even if your optional field does not occur then a blank value will still be pased to your target field.
Also you can check if your optional field exitst, if it does not then pass a blank constant else pass your value.
You can use any of the above 2
FIELDNAME->MAPWITHDEFAULT->TARGET
Hope this solves your issue
THanks
Saiyog -
Pass system ack of JDBC adapter to ERP in IDoc - XI - JDBC scenario
Dear all,
i have an IDoc -> XI -> JDBC scenario (without using ccBPM). In the standard way the ERP system, sending the IDoc waits for an application acknowledgement. However the JDBC adapter is only capeable to send system acknowledgements.
Is there a way to pass these acknowledgements to the IDoc status record?
In help.sap.com (http://help.sap.com/saphelp_nwpi71/helpdata/en/ab/bdb13b00ae793be10000000a11402f/frameset.htm) under "IDoc Processing with the IDoc Adapter " there is a table that maps XI system/applic acknowledgement to IDoc status. So in my opinion the status record of my IDoc should at least chenge to the corresponding status for the system ack.
Can anyone tell, if this is really working? What if I deactivate the acknowledgement request in the NOALE programm?
In any case, can I achieve to transfer the system ack to the IDoc status without using a ccBPM?
Many thanks and best regards
FlorianIs there a way to pass these acknowledgements to the IDoc status record?
Without BPM, No.
So in my opinion the status record of my IDoc should at least chenge to the corresponding status for the system ack.
The ack referred here is related to idoc status whether it is properly reached till XI or not and not related to the JDBC ack.
What if I deactivate the acknowledgement request in the NOALE programm?
Then u won't have any ALEAUD message at sender R3.
In any case, can I achieve to transfer the system ack to the IDoc status without using a ccBPM?
No
Regards,
Prateek -
IDOC to JDBC scenario in case of Cost Element Group IDOC.
This is an IDOC to JDBC scenario.
The Cost Element Group IDOC is having different segments. The main segment E1COGH (1...unbound) is consisting of different subsegment like E1OGS (0...unbound) & E1COGV (0...unbound). The main segment (E1COGH) along with subsegments E1OGS & E1COGV) is occuring more that 1 times. I have to insert data into the table, which we can do in single rows (no hierarchy is possible in tables). I have used "use one as many" in message mapping. Now if E1OGS or E1COGV is repeating in a single E1COGH segment then we dont get any error. But if I duplicate the main segment then I am getting runtime exception.
Please suggest about how to map in this case.In my scenario:
E1COGH
|
-> E1COGS
E1COGV
where E1CGH -> Main segment
E1COGS & E1COGV -> sub segment
E1COGH -> 1..unbound
E1COGS -> 1..unbound
E1COGV -> 1..unbound
At the target side I have created two Statement Structure (ie.Statement & Statement_1) . One for E1COGS (ie. Statement) & the other for E1COGV (ie. Statement_1).
Case 1 -> If E1COGS is present in the main segment E1COGH then it is mapped AS IS.
Case 2 -> If E1COGS is not present in the main segment E1COGH then it is mapped as blank.
This will be mapped with Statement & in the absence of E1COGS this Statement structure is SUPPRESSED.
Similarly,
Case 1 -> If E1COGV is present in the main segment E1COGH then it is mapped AS IS.
Case 2 -> If E1COGV is not present in the main segment E1COGH then it is mapped as blank.
This will be mapped with Statement_1 & in the absence of E1COGV this Statement_1 structure is SUPPRESSED.
All the elements of the segment E1COGH, E1COGHT & E1COGHR are replicated in all the rows for X (no. of occurance of E1COGS) + Y (no. of occurance of E1COGV).
While testing in Message Mapping, I am able to get the output as for multiple occurence of E1COGS & E1COGV in a single E1COGH.
But if I increse the occurence of E1COGH the it is giving the following error :
Runtime exception during processing target field mapping /ns0:MT_Cost_Element_Group_Response/Statement/DBtablename/access/GROUPNAME. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too few values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[com.sap.aii.mappingtool.flib3.CollapseContexts@51197231, , ]
Please suggest how to map the occurence of E1COGH simultaneously with the occurence of E1COGS & E1COGV. -
IDoc to JDBC scenario strange bahaviour
Hi Experts,
My Scenario is IDoc to JDBC,
I am creating some vendor masters in ECC, CREMAS IDoc sent to PI, mapping everything executed perfectly but data not posted in to data base, it is taking min 20 mnts to post data.
When I monitor communication channel it is initiated and status (Dlvg) but after 20 mnts only it is showing message data posted successfully in Data base.
What I observed was in MONI, IDoc initial status shows still awaiting for acknowledgement, after 20 mnts status changed to Acknowledgement not possible, at this time data posted to ODS.
Why this is happening, it is really strange behaviour.
When I reprocess IDoc using WE19 without delay data posted to data base and IDoc status in moni " ack not possible.
How to solve this issue.
Toa a Thanks advance,
JamHi,
Please see the link, it might be useful to you.[Handle_Acknowledgements|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe]
Regards,
P.Rajesh
Edited by: Rajesh_1113 on Apr 29, 2011 3:24 PM -
Idoc to jdbc scenario of sap xi
Hi All,
i want step by step procedure for developing idoc 2 jdbc scenario. Anybody have this scenario, please send me that.
Thanks & Regards,
Nagarjuna.Hi
Have a look at these threads
/people/laxman.molugu/blog/2006/08/13/integration-with-databases-made-easy-150-part-1
Re: Idoc triggering from a transaction
Message Mapping - JDBC to IDoc
Re: JDBC - System/Application Acknowledgement
/people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
Process Integration (PI) & SOA Middleware
**Reward points if helpfull** -
Storage Issue in Database while executing Idoc to Jdbc scenario
Hi,
I am testing an Idoc to JDBC scenario. The scenario executes correctly, but the number of records getting stored in the database are not equalling the data present in the Idoc.
Eg: If the Idoc has data for around 75000 records to be saved, only around 50000 records are getting saved in JDBC SQl server database.
Please let me know what could be the issue and how to resolve it.
Regards
Kiran.Check the output XML in XI;ie, the output of your mapping. Does it have the same number of records as the Idoc? if no the issue is in the mapping.
Regards
Bhavesh
Maybe you are looking for
-
Can HPCM calculate percentages to use in allocations as well as perform the allocations
Hi All I have a client that is evaluating which products to purchase from the Oracle stack. Unfortunately I don't know HPCM yet so I'm not sure of its capabilities. I think they will definitely go with Hyperion Planning but they do some relatively
-
Carry over formatting to the next page without adding a text box
I've written 15 books on the old pages and had no trouble carrying the formatting to the next page without adding a page or adding a text box to the added page. I just kept on typing. I've added the new pages and had trouble right from the start so
-
Since updating I get a " start below fold message" pop-up. Excite is homepage.
Since I updated to 4.0.1 I have been having a message pop-up on the screen the says " start below fold" My homepage is Excite. I don't know if it is an Excite problem or a FireFox problem. If I am in another tab it will jump back to Excite when the m
-
Strange terminal command caching while manually running SWUPD.
I've built dozens of software update servers with little issues. This one has me stumped today. I built a software update server to update solely our Tiger machines. Initially, I had sent a command to the clients that hit the wrong IP address. Once I
-
hello, can u help me , my problem is that i had created the billing document but accounting document has not been created . so tell me where i have to go for setting it so while creating billing doc. acc. doc is also be created automatically. urgent.