cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove empty tag.

former_member203627
Participant
0 Kudos

Hi,

I have a scenario IDOC-XI-JDBC

From IDOC we are using change pointers and when something has been changed then those fields are being sent out but other few empty fields were coming out and to avoid that I used mapWithDefault to avoid the empty tags as target system used to error out.

But now when any field is empty coming from change pointer is also being caught in mapWithDefault....whereas it is expected to send blank.

Can anyone of you suggest any solution.

Regards

Ria

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member203627
Participant
0 Kudos

Resolved

henrique_pinto
Active Contributor
0 Kudos

Use a simple UDF like below (UDF must have Cache = Context or Queue):


for (int i = 0; i < a.length; i++) {
if (a<i>).length() = 0) {
  result.addSuppress();
}

Regards,

Henrique.

Former Member
0 Kudos

Hi,

Suppose the sender fields are not mandatory and receiver fields are mandatory then at this time we use the mapwithDefault function.

If suppose the empty value comes then it assigns the default value(we can set any default value here, this value goes to target when sender field comes empty)

Former Member
0 Kudos

Hi Ria,

You can use if without else and check the field exist or not in the source and then map it to target.

This is a bit tricky & if you dont feel comfortable with it, then use advanced UDF, and explicitely check ResultList.SUPPRESS object and remove it in UDF and form an output stream.

You can use any of the two.

Regards,

Shri.

<removed by moderator>

Edited by: Mike Pokraka on Jul 28, 2008 5:05 PM

former_member190389
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi,

Mapwith default is used to handle this type of situation.

if you are getting any blank value then, place a remove context function before the target field.so that you may solve the problem.

Thanks,

Madhu

Former Member
0 Kudos

Hi, ria:

mapWithDefault is used to handle the situation when the incoming xml does not contain that node, then you would like to target to have it with default value.

What would you l like to remove ?

Liang