cancel
Showing results for 
Search instead for 
Did you mean: 

Problem insert JDBC Tables...

Former Member
0 Kudos

hello all !

I`m Sorry by open a new Thread about this problem ...but is very urgent !

I have Two problems..

1 - I need to insert in SQLServer 4 tables CRHE, CRFT, CRFV, TLINES !

CHRE is only one data - Father Table ! its OK !

The tables CRFT, CRFV exists many VML segments, but insert only one line in database ..only the first XML elements is inserted ...How a can to make to insert all xml segments for these tables !

2 - I have problem is TDLINE Table --> i need to concatenate the items of TDLINE ...If you to analyze 3 first fields CRID, FTNO, FVNO are equal because of the key ok?

The Last field TDLINE was broken in segments of the XML and I need to concatenate this fields to insert an one only line of the database !

this is the XML come from R/3:

thank you very much for help !

Boni.

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi ,

For first question, do you have multiple occurences for the Statement Node in the target structure?

Refer this thread-

For second one, I did not get fully..

Regards,

Moorthy

Former Member
0 Kudos

Hi Moothy !

for example:

RFC Structure:

CRFT 1..1 (ocur)

item 0..unbounded

CRID 0..1

FTNO 0..1

FTTYP 0..1

COSTR 0..1

VORNR 0..1

FTRNR 0..1

My XML receiver structure is:

CRFT 1..1 (ocur)

action(Insert) optional

CRID 1..1

FTNO 1..1

FTTYP 1..1

COSTR 1..1

VORNR 1..1

FTRNR 1..1

The problem is here??? i need to change the Occurrences??

Thanks..

Boni.

moorthy
Active Contributor
0 Kudos

Hi,

SO you will get multiple items from the RFC. And you need to post each items into the data base right ?

Is your Receiver Structure is only that much~ there is no somethig like this-i.e wrapper to this structure

Statement <b>(1..n)</b> change here.

-CRFT (1..1)

Also the thread mentioned has discussed same .just check this also..

Regards,

Moorthy

Former Member
0 Kudos

Hi !

Yes ..multiple items in RFC ...to insert all in DataBase !

My problem is that insert only the first item ...hoe i do to insert all???

I change the structure of XML Receiver Structure !

This is my complete XML Receiver Structure:

statement_TABELA2 1 (ocur)

CRFT O..unbounded

action(Insert) optional

access 0..unbounded

CRID 0..1

FTNO 0..1

FTTYP 0..1

COSTR 0..1

VORNR 0..1

FTRNR 0..1

This is Rigth ??? ...you can Show me how i can make this !!

Thank You...

moorthy
Active Contributor
0 Kudos

Hi,

You can either change your Occurence of Statement into 0..n or Access occurence 0..n. Either of one will lead into multiple insert.

If you are changing the occrence of Statement then it should look like this

statement_TABELA2 <b>1 ..n</b>

....other elements as normal. don't change any occurence

2nd way is just change the occurence of access element as 1..n

Choice is yours..

regards,

Moorthy

Former Member
0 Kudos

Hi Moorthy !

Sorry ..

You can copy the structure and show me how..???

statement_TABELA2 ??? (ocur)

CRFT ???

action(Insert) optional

access ???

CRID ???

FTNO ???

FTTYP ???

COSTR ???

VORNR ???

FTRNR ???

thank you !

Boni.

moorthy
Active Contributor
0 Kudos

Here you go ~

statement_TABELA2 1..unbounded

CRFT 1..1

action(Insert) optional

access 0..1

CRID 0..1

FTNO 0..1

FTTYP 0..1

COSTR 0..1

VORNR 0..1

FTRNR 0..1

Hope this works,

Regards

Moorthy

Former Member
0 Kudos

Moorthy !

I appreciate your Help !

thank you !

I go change the structure and test again !

I return to you to cose the threat !

Best Regards.

Boni.

Former Member
0 Kudos

Hi...

to the second problem...

I can explain the problem better to your analyze ???

look this: this is the last table that i need to insert in DataBase !

- Verificar se a área e os equipamentos encontram-se limpos e identificados. Utilizar EPIs conforme POP nº EU II GE 001.

...or I need to create a user defined function in JAVA to make this ???

Tahnks you Moorthy !!

Regards.

Boni.

moorthy
Active Contributor
0 Kudos

DO you mean to say, All TDLINE should be concatenated and insert into one line of the database ? Or

All data ie. CRID of item1,CRID of Item2,FTNO of Item1,FTNO of Item2.......

Because you have e.g 4 items in your source structure. It will create 4 records in the Database. But do you require one record in the database ??? Is this is the requirement?

Regards,

moorthy

Former Member
0 Kudos

Hi...

Yes !! ...All TDLINE should be concatenated and insert into one line of the database !!! This is my problem !!

I have 4 items im structure ....but i need insert only one records in the database !

if you see the data of items CRID FTNO FVNO ...this is repeating in the others 3 items because these items are related with other tables with Foreign Key !

The RFC come from R/3 was broken in item TDLINE because the elements are very big... then I need to record only one line and concatenating all 4 items of TDLINE !

Thanks for your atention...

moorthy
Active Contributor
0 Kudos

HI,

Now you can make use of Java User Defined function , and to concatenate the TDLINE for each item.

SO logic should be , for each TDLINE keep on store the value and then return the result to the target field

Regards,

Moorthy

Former Member
0 Kudos

OK Moorthy !

I go create the Java User defined Function as your information !

I return to you !

Thanks...

Former Member
0 Kudos

Hi...

Sorry !

the problem one still

I change the XML Structure as ypur information ...but it was not solved !

Still insert only one element !!

any other idea ???

Thanks...

moorthy
Active Contributor
0 Kudos

Are you able to see multiple Statement nodes in the XML i.e in the SXMB_MONI after mapping?

After Mapping are you able to see your xml message like this ?

i.e<Root>

<STATEMENT>

-


</STATEMENT>

<STATEMENT>

-


</STATEMENT>

</Root>

here each statement belongs to 1 item..

Regards,

Moorthy

Former Member
0 Kudos

Yes ..in SXMB_MONI the XML has many elements ....but in message monitoring the XML messsage don`t contain the elements ..only 1 element that iserted in database !

Tks...

moorthy
Active Contributor
0 Kudos

Test your mapping in the Repository with the data taken from SXMB_MONI. It should give multiple STATEMENT nodes. then it will insert multiple lines..

Check the mapping also.. I remember that, you told me , you have changed the Structure i.e Occurence for the STATEMENT node

Former Member
0 Kudos

Ok Moorthy !

I am to check all the itens and try again !

Thank you !!

boni.

Former Member
0 Kudos

Moorthy...

I return to you the status of the multiple insert !!

With your help ...now its is running and insert multiple lines OK???

Thank You Very Much for your help man !!

Look this:

statement_TABELA2 1..unbounded

CRFT 1..1

action(Insert) optional

access 0..1 --> I change here to 0..unbounded and this OK

CRID 0..1

FTNO 0..1

FTTYP 0..1

COSTR 0..1

VORNR 0..1

FTRNR 0..1

the problem of the multipe insert is in item Acces

0..1 to 0..unbounded and this is ok ...it is running !

Now ..I go make the JAVA function to concatenate the filed TDLINE in Table TLINES.

Do you wanna that i close the Thread now or i can return before meke the JAVA function.

Best Regards...

Boni.

moorthy
Active Contributor
0 Kudos

Glad to know

After completing the entire scenario , you can close the thread..that's not a problem at all.

Appreciate your update..

Regards,

Moorthy

Former Member
0 Kudos

Ok Moorthy !

...me to ..very Glad ! ...and my boss to !!.. rsss

after completing the scenario ...i close the thread and Show to you my Java Function !

Thank you very much Moorthy !

Boni.

Former Member
0 Kudos

Hi Moorthy..

Can you help me how to create a UDF to TLINES ??

Thanks.

Boni.

Answers (0)