cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in Message Mapping

former_member191435
Contributor
0 Kudos

Hi Folks,

I have below Query. Can you please suggest how do i solve below case.

My source system has 4 fileds A , B, C, D and the target system has 1 Filed TOTAL.

I have to concatenate all the 4 source fields by using slash(/) and placed in TOTAL target field.

i need output has A/B/C/D.

but here is my Query? if any one of the field is not present in source field i.e. if source B filed is empty then I have to print Output has A/C/D.

NOTE: there is no empty slashes for B.

Please help me on this issue.

Thanks,

Enivass

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

You can do it using standard functions easily.

1) you have to check B exists in source file or not, check previos reply to hot to check.

2)If B exists then you have concatanate all four filed(use concat function and use constant to add /).

3)if b not exists concatenate 3 fields.

Regards,

Raj

former_member191435
Contributor
0 Kudos

Hi Raj,

Thanks for ur reply.

We are not sure that to check only B if C is not coming then I have to get the output as A/B/D. like this.

Plese help me

Thanks,

Enivass

rajasekhar_reddy14
Active Contributor
0 Kudos

if you want to implement logic for C also then check C exists or not and floow similar logic like B... it is very simple

former_member207622
Contributor
0 Kudos

Hi niwas

If A -- exists -


if -- then A concat "/" to ( then of second if ) if B exists then ( A/ concat B/ TO then of third if) if if C exists then

A/B concat /C/ ( to then of 4th if ) if D exists then ( A/B/C CONCAT D ) TO TARGET

like wise you have to try

former_member191435
Contributor
0 Kudos

Hi Ninad,

Thanks for ur reply,

I mean that if any one of the field not exists in the source side i dont want empty slashes.

suppose in A B C D source if B is not present then i am getting output as A/ /C/D

but i need output as A/C/D.

If C is not exists then I need output as A/B/D.

Thanks,

Enivass

Former Member
0 Kudos

You can implement it using, first using separator one blank space and then replacing it with slash '/'.

Try the below mapping:

A -->

Concat[ ] ---> trim --> concat[ ] --> trim > concat[ ]> trim --->replaceString --> TOTAL

B > C> D -->

For second input of replaceString, put '/] and third input as blank space[ ].

-Supriya.

former_member191435
Contributor
0 Kudos

Hi Supriya,

Actually I didnot get ur mapping shot

Can u tell me some more briefly plzzz

I tried blow

A

concat -


> trim -


> then what i have to use.

/

Thanks,

Enivass

Edited by: enivas on Oct 20, 2010 9:47 AM

Former Member
0 Kudos

Hi,

Map the A,B,C,D to the consecutive 'Concat' functions.

And after every concat function use trim.

Also in concat funtion use,1 blank space as separator.

Later at the end replace all blank values by slash using 'replaceString' function.

-Supriya.

former_member191435
Contributor
0 Kudos

Hi Supriya,

How would i use replace string at the last. Please tell me

Thanks,

Enivass

Former Member
0 Kudos

Hi,

Use replaceString function, put 1st input as the output of final trim, 2nd input is blank space[ ] & 3rd input is slash '/'.

Refer the 'replaceSTring' functionality from the below link:

http://help.sap.com/saphelp_nwpi71/helpdata/EN/2c/2d8c4024d26e1de10000000a1550b0/content.htm

-Supriya.

former_member191435
Contributor
0 Kudos

Thanks Supriya

I got it.

Answers (1)

Answers (1)

vkaushik82
Active Participant
0 Kudos

You can use exist function for checking whether field exist or not.

If exist then perform concat otherwise skip