Skip to Content
author's profile photo Former Member
Former Member

Problem in creating UDF to read multiple rows of IDOC segment

Hi Experts,

I am working on IDOC to File scenario, in message mapping i have to read segment of idoc (occurence of this segment is 0..4) and check the key of this segment and accordingly pass the value. I am creating a UDF to send the data in target field

My logic in UDF is as follows

if id = BB and payment = V

return variable1

else

return variable2

this logic is not working

Note: The id BB is in second line of the segment and first line of the segment has id BA.

Please help me to send me the correct logic.

Regards,

Shradha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2010 at 02:07 AM

    Hi,

    After analysing this issue i come to know that the if condition is using data from 2 different segments

    Segment1 (key fiiqualli)

    The occurence of this segment is 0....4, Inside this segment i have 2 rows first row has Key Fiiqualli = BA, second row has key Fiiqualli = BB

    Segment2 (Key payment id)

    The occurence of this segment is 0....1

    Inside this segment i have only 1 row with Key payment ID= V

    Now if i write the condition if fiiqualli = BB and payment ID = V

    return 1

    else

    return 2

    Here if condition fails for second line but works for first line because it is unable to read payment ID for second row as payment id is in different segment.

    Is there any way to read the data from two different segment where the occurence of one segment is 0..4 and other is 0..1

    Regards,

    Shradha

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2010 at 04:59 AM

    Hi,

    Paste ur input XML structure and the desired output structure??

    i think u need to take care abt the context...

    Thanks

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.