cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to JDBC scenario in case of Cost Element Group IDOC.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

The issue is with the UseOneAsMany function that you have used in your mapping. This mapping requires that the first and second input parameters have the same number of contexts. Try changing the context of these 2 input fileds and keep it at the highest level so that there are no context changes in the input queues.

Regards

Former Member
0 Kudos

if u r getting more than once E1OGS and E1COGV

1st input, Use mapWithDefault in front of fields under E1OGS and E1COGV segment and keep the context in E1OGS and E1COGV,

2nd and 3rd input field i.e. field from E1COGH, keep the context in E1COGH