cancel
Showing results for 
Search instead for 
Did you mean: 

Help in Mapping

JM_Lalisan
Explorer
0 Kudos

Hi Gurus,

We have implemented an IDOC-to-FILE scenario. Now, the requirement is that even when the source field is blank in IDOC (no value), the target field must still have the xml tag (blank) in the file. The requirement goes with segments as well.

If you already have some example/s (nodes/udf/etc), kindly share. Thank you.

Regards,

John

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello John,

Use the map with default function in the message mapping

Source Field-------------->Map With Default---------------->Target Field.

                                                []

It will be under Node functions.

JM_Lalisan
Explorer
0 Kudos

Hi,

Yes, I already did that, but unfortunately, still missing in target field.

Sourcce Field -> MapWithDefault[] node -> Target Field

former_member182412
Active Contributor
0 Kudos

Hi John,

You need to provide more information about this, can you provide sample source xml and target required xml, and which field it is giving problem and what is the mapping you applied for that field.

Is your target file is xml file or text file which you converted via FCC??

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

John,

It should work, Please post the input queues and output queues screenshot.

Try the below logic as well using if then else and exists functions.

                                                                           

Source-------------exists--------------------------------IF----------------------------------Target

     |

     |---------------------------------------------------------Then

                                                                              

Constant-------------------------------------------------Else

    []

JM_Lalisan
Explorer
0 Kudos

Hi,

Thank you for the suggestion! I'll get back to you by tomorrow. Don't have remote connection for now.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi John,


Yes, I already did that, but unfortunately, still missing in target field.

Check your context handling.

Regards,

Mark

JM_Lalisan
Explorer
0 Kudos

Hi Gurus,

Good day. Below is the sample IDOC. Segment E1WBB13 does not appear in WE02 but it should appear in the XML file. Under E1WBB13 there's an extended custom segment ZKONP that should appear as well.

Basic Type: WBBDLD05

Here's the XML output:

In message mapping, I tried the following:

* Same output as above

* Same output as above

Hope the information is okay. Thank you very much in advance.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

If you recently added ZKONP in the idoc, reload your adapter metadata in NWA first.

Generally, 1..1 mapping should work, but try playing with the context of LIFNR + mapWithDefault.


Regards,

Mark

former_member182412
Active Contributor
0 Kudos

Hi John,

I just used below mapping and it works.

The input IDoc does not contain E1EDK01 but output XML got the E1EDK01.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Hello John,

Map with default should work for you.

JM_Lalisan
Explorer
0 Kudos

Thanks! I think it work with the context + mapWithDefault.

Answers (0)