cancel
Showing results for 
Search instead for 
Did you mean: 

UDF reqiured for the below reqiurement

Former Member
0 Kudos

Hi ALL,

Can any one help me out by sending the javacode for the below reqirement.

My sender data is coming from database.So based on 2 fields i have to spilt the idocs at target side.

my reqirement is

1)Material number and 2)Batch

Case 1: For the same material number if the batch is empty spilt it into idocs

I.e material number -


> 123

batch -


> empty

123

empty

In the above case it must be splited into 2 idocs

Case 2: For the same material number if the batch is same then spilt these data into idocs

material number -


> 123

batch -


> 11

123

11

In the above case it must be splited into 2 idocs

Case 3: For the same material number if the batch is different then combine these data into one idoc

material number -


> 123

batch -


> 11

123

12

In the above case it must be combined into 1 idoc

however if material number changes new idoc must be cretaed.

Good points will be given

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Abhishek/Raj,

Now the reqirement has changed.

They want it whenever the same materials appears then check the batch of both the materials and then spilt accordingly.

If batch of both repeating materials is same then spilt into different idocs.If batch of both repeating materials is different

then

example:

materials: 123

133

144

155

123

111

110

In above case from 123 to 155 it should be in one idoc.Since material is repeating(123) then check batch of both

123 materials .If they are different then whole set of materials should go into one idoc.Else materials from 123 to 155 in one idoc

and 123 ,111,110 into another idoc.

or just split the same materials with same batch into different idocs .

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

useoneas many node function to split. or iusing JAVA Mapping you can split IDoc and we can genarate Multiple IDocs.

Regards,

Raj

stefan_grube
Active Contributor
0 Kudos

> Now the reqirement has changed.

>

That is the reason why I not be willing to respond to mapping questions.

The requirements always change

I recommend to create a formula to define the rules for the split logic.

After having a logical rule, you will find a UDF easly.

Former Member
0 Kudos

Hi Stefan,

Can you provide me with the udf for the above logic.

Former Member
0 Kudos

Hi Nagendra,

After reading all the posts above, vt i can draw the conclusion is... Thz requirement is nt possible with a single UDF..

U have to write many UDF's for different purposes...

Vt i recommend is better go for a Java mapping... In java mapping u have lot of control on data and structure.. thtz y..

Also if the functional guyz change the logic again and again... even then u can handle it well with the Java mapping.. else u need to completely create a new UDF's...

For java mapping u have lot of posts in SDN.. plz search it..

If still any confusion.. pl do post

Babu

former_member200962
Active Contributor
0 Kudos
My sender data is coming from database.So based on 2 fields i have to spilt the idocs at target side.
In the above case it must be splited into 2 idocs

I dont think IDOC allows split.......or are you referring to IDOC bundling?

justin_santhanam
Active Contributor
0 Kudos

Will all the Materials/Batch numbers come in sorted order? Just give the structure how the xml looks like

is it


<Material number> (0..unbounded)
<BatchNumber/> (0..unbounded)
</Material number>

Former Member
0 Kudos

Hi Raj,

Please see the xml structure.It does not come in the sorted order

<?xml version="1.0" encoding="utf-8" ?>

- <row>

<BEGIN />

<IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>

<TS>2010-03-30 15:04:52.781957</TS>

<STATE>1</STATE>

<PLANT>2401</PLANT>

<COUNTRYCODE />

<STGE_LOC>0100</STGE_LOC>

<DOC_DATE>20100330</DOC_DATE>

<MATERIAL>000000000001201501</MATERIAL>

<BATCH />

<SERIALNO>000000000000000000</SERIALNO>

<ZREASON>45</ZREASON>

<ZQUANTITY>00000000000003-</ZQUANTITY>

<ZQUAN_UNIT>STK</ZQUAN_UNIT>

<IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>

</row>

- <row>

<BEGIN />

<IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>

<TS>2010-03-30 15:04:52.781957</TS>

<STATE>1</STATE>

<PLANT>2401</PLANT>

<COUNTRYCODE />

<STGE_LOC>0100</STGE_LOC>

<DOC_DATE>20100330</DOC_DATE>

<MATERIAL>000000000001201501</MATERIAL>

<BATCH />

<SERIALNO>000000000000000000</SERIALNO>

<ZREASON>45</ZREASON>

<ZQUANTITY>00000000000002-</ZQUANTITY>

<ZQUAN_UNIT>STK</ZQUAN_UNIT>

<IDOC_ID>5c6b4851bb25583baa47b0c8ff6b8ce4</IDOC_ID>

</row>

VijayKonam
Active Contributor
0 Kudos

> Good points will be given