cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC - JDBC Problem

Former Member
0 Kudos

Hi,

I have a scenario from IDOC to JDBC. I have a problem in mapping because I want to send Data from Control Record of IDOC to JDBC. Here is an example of my IDOC Data.

<IDOC>

<Control Record>

<Data1>XX</Data1>

</Control Record>

<Item>a</item>

<item>b</item>

<item>c</item>

</IDOC>

From this IDOC, data will be inserted into record in JDBC. The number of record depends on no. of tag <item> in each idoc. Therefore, in my mapping, i map <item> with field access. However, I also want to get data in <data1> in Control Record to each record of JDBC. The problem is that only my first item record can get data from control record.I already try to change the context in mapping but it still doesn't work. I think it's because I map <item> with access ;therefore, SAP XI could not get data from <control record> which is a higher level.

Any solution for this? or Is it possible to write a UDF to get data from Control Record in IDOC in mapping? If so, please provide me a sample code for this UDF?

Thanks,

Pavin

Accepted Solutions (1)

Accepted Solutions (1)

former_member187563
Contributor
0 Kudos

hi,

you can use the standard function UseOneAsMany for your case.

DATA1 will be first input and item will second and third input.

you can refer to:

regards,

ujjwal kumar

Former Member
0 Kudos

Hi,

I already try to use function UseOneAsMany.However, only the first record can take the value. The rest still get blank. When I display queue from function it seems ok, but it still doesn't work. Is there any part I should try?

Thanks,

Pavin

former_member187563
Contributor
0 Kudos

hi,

there must be some context problem with the third input.Try to use SplitByvalue(each value) after that third input.

regards,

ujjwal kumar

Former Member
0 Kudos

Hi,

Problem Solved, I have to add function SpliyByValue then it works perfectly. Thank you very for your help. Point rewards.

Thanks,

Pavin

Answers (0)