Skip to Content
author's profile photo
Former Member

Context handling in message mapping for an IDoc to File Scenario

Hi,

Can somebody help me with this issue. I have an Idoc to file scenario. heres my idoc structure. Its a custom Idoc

Header (1..1)

Detail (0..Unbounded)

DependentDetail (0...Unbounded) Note: This dependentdetail is a subelement of Detail

Trailer(1...1)

I created my target structrure the same way as the Idoc structure.

My output is a simple text file. I need the output in this format

Header

Detail1

Dependentdetail1

DependentDetail2

DependentDetail3

.

.

.

.

Detail2

DependentDetail1

Dependentdetail2

.

.

.

Detail3

Detail4

.

.

.

Trailer

Since the Detail and Dependent Detail records are unbounded .

But right now i m getting my output like this:

Header

Detail1

Detail2

Detail3

Detail4

.

.

.

Trailer

But the DependentDetail record in not showing up in the output file. I didnot do any context change in my mapping. So do I need to do any context handling??...If so can somebody explain me with this.

Thanks,

Adam

Edited by: hymanroth on Apr 29, 2011 11:11 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on May 01, 2011 at 07:08 PM

    hi adam,

    I don't think there is any need for any context change in this case. I assume that in your output the dependentdetail is also 0..unbounded and not tags with different names.

    so try again having all fields with their initial context (lowest level possible in the context change)

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on May 02, 2011 at 08:00 AM

    Hi,

    Have you checked if the DependentDetail-segments exists in the message after the mapping in SXMB_MONI? Set parameter RUNTIME - LOGGING = 1 in SXMB_ADM - Integration Engine Configuration if you cannot select payload after mapping step in SXMB_MONI.

    If it exist there I think there is a problem with your content-conversion in file adapter (assuming you use content conversion since you say your target is a simple text file). Have you declared parameters for the DependentDetail-structure in the content-conversion?

    In the mapping you should not need any context changes if you have created the same structure for the target as the source. Simply map the source segment-node to the target segment-node and it should be created correctly.

    Br,

    Kenneth

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Kenneth foryour quick reply,

      Yes, I see the payload for Dependent detail in SXMB_MONI. So as you said earlier there's a problem with my content conversion.

      my content conversion is as follows:

      Header.fieldNames

      Header.fieldFixedLengths

      Header.endSeparator

      Detail.fieldNames

      Detail.fieldFixedLengths

      Detail.endSeparator

      DependentDetail.fieldNames

      DependentDetail.fieldFixedLengths

      DependentDetail.endSeparator

      Trailer.fieldNames

      Trailer.fieldFixedLengths

      Trailer.endSeparator

      So As I told earlier. With the above content conversion. I am not able to get the Dependent detail record in my output file. So If there is a change in my content conversion can u check it and tell me where I went wrong.

      Thanks,

      Harsh

      Edited by: hymanroth on May 2, 2011 7:03 PM

  • author's profile photo
    Former Member
    Posted on May 02, 2011 at 10:23 AM
    But right now i m getting my output like this:

    the output is correct....it is not possible to achieve the below structure:

    Header

    Detail1

    Dependentdetail1

    DependentDetail2

    DependentDetail3

    .

    .

    .

    .

    Detail2

    DependentDetail1

    Dependentdetail2

    .

    .

    .

    Detail3

    Detail4

    .

    .

    .

    Trailer

    i.e. pattern of Detail followed by DependentDetail

    You have to alter your target message structure like:

    Header

    Details

    ->Detail

    ->DependentDetail

    Trailer

    Now you should map the source occurence accordingly to Details Node (and to Dependentdetail) to get the required pattern.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Adam,

      Please try setting Detail as 0...Unbounded, DetailRecord as 1.1 and DependentDetail as 0...Unbounded.

      Where the segment DetailRecord is mapped with a constant.

      For every DetailRecord there is multiple DependentDetails. When Detail is made as unbounded and mapped with the Detail of the source it must work fine.

      Regards

      Sowmya