cancel
Showing results for 
Search instead for 
Did you mean: 

UDF required for Segment changes

vijender_p
Active Participant
0 Kudos

Hi Experts ,

Could you please help me out in the udf for which i have written .

Actually my requirement is that when ever the Z1P1208 segment Exist and PLANS of  E1P0001 segment & OBJID of E1P1005 are true file should create.

But, now the issue is that when there is equal number of segments in the IDOC like Z1P1208 ,E1P0001&E1P1005 are same the file is correct.

And when there is any different in the segment the file is corrupting.

The Udf which i have written for these is

Regards,

Vijender

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190293
Active Contributor
0 Kudos

Hi Vijender!

Wouldn't you please clarify your requirement?

What condition do you need to check:

1. If at least one E1PITYP/Z1P1208 segment exists and any of E1PITYP/E1P0001/PLANS equals to any of E1PITYP/E1P1005/OBJID in the same context?

2. For each existing E1PITYP/Z1P1208 segment values of E1PITYP/E1P0001/PLANS and E1PITYP/E1P1005/OBJID with same indexes must be equal?

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgenly ,

Thanks for quick reply,

yes my requirement is

If at least one E1PITYP/Z1P1208 segment exists and any of E1PITYP/E1P0001/PLANS equals to any of E1PITYP/E1P1005/OBJID in the same context?

Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

Hi Vijender!

Next question: do you need UDF or graphical mapping is enough?

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

could you please correct my UDF .where i was wrong

Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

Hi, Vijender!

Mapping:

Result:

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgenly ,

Unfortunately the UDF code is not working here .

As I think u didnt got my requirement ; Actually in ECC side there will be only one Z1P1208 segment Exist and PLANS of  E1P0001 segment & OBJID of E1P1005 will be differ .

Please Help out!

Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

Hi Vijender!

Please provide the example of your source message (with data), desired output message structure and explain more clearly what are your transformation logic requirements.

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgeniy,

Please Find source message when the file is reading correct

Here you can find that when ever the IDOC is having the equal number of segments of Z1P1208 and E1P0001(PLANS) & E1P1005(OBJID) and out put should be 6 lines and my logic is running fine .

Logic( UDF) had shared in the previous conversion ,

And when the IDOC structure is some what like :

My logic is failing ;

I hope you have understood the requirement

Please help me out in these issue

Best Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

Hi, Vijender!

1. Could I ask you to provide source XML fragments with data for both of your cases (fragments containing E1PITYP node sets)?

2. What is the context of Z1P1208 in your mapping? E1PLOGI?

3. What is your UDF type: "All values of the context" or "All values of the queue"?

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgenly ,

1. source XML with the with  wrong node set ( attached XML file name with 1.xml )

    source XML with correct node set (attached XML file name 2.xml )

2. Context of Z1P1208 is :

3. UDF Type :

Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

Hi Vijender!

I took your example with correct nodeset and applied your UDF to it.

Here you can find that when ever the IDOC is having the equal number of segments of Z1P1208 and E1P0001(PLANS) & E1P1005(OBJID) and out put should be 6 lines and my logic is running fine .


I've got 4 lines as result, not 6.


Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgeniy ,

Yes that is right as we are passing only 2 cost centers so it will be 4 lines .

But , when you took the node set of wrong one the udf is failing for that .

Regards,

Vijender

former_member190293
Active Contributor
0 Kudos

And how many lines should your UDF return in case of "wrong" xml?

Regards, Evgeniy.

vijender_p
Active Participant
0 Kudos

Hi Evgeniy,

UDf should return 4 lines &  if any of E1P0001(PLANS) & E1P1005(OBJID) is not there it should return blank .


Regards,

Vijender



former_member190293
Active Contributor
0 Kudos

Hi Vijender!

Sorry, but I still can't catch your mapping logic According to your UDF code, for each Z1P1208 you create a line when PLANS in one queue equals to OBJECTID in another queue. So you get 4 lines, two for each Z1P1208 segment.

How can you get 4 lines, when you get only one Z1P1208 in your "wrong" xml?

Please try to clarify this one more time.

Regards, Evgeniy.