cancel
Showing results for 
Search instead for 
Did you mean: 

file to idoc scenario

Former Member
0 Kudos

I am doing file to idoc scenario.....where i have got stuck up...with 2 parts...

1. I need to validate the vendor name field coming from the sender.It can be any name.But,it should be filled with some name.........do we need to write a userdefined function...or is there any function i can use it...this is because,cremas idoc will be generated even thought if it comes without vendor name....

2. At the receiver,i have a segment.where i need to use it as unbounded....please do remember that i get only one vendor record at a time.....

EG: i need t o add a constant A for the segment1.

i need to add a constant B for the segment 1....I mean the segment is repeating......

<segment1>

<feild>A</feild>

</segment1>

<segment1>

<feild>B</feild>

</segment1>

can someone guide me.....

Edited by: PSRK on Jun 12, 2008 2:48 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>>It can be any name.But,it should be filled with some name.........

Use MapWithDefault here,if a name will come from sender system,that name will be transferred as it is,if no name comes in the default value will be transferred(you can give any default value)

>>At the receiver,i have a segment.where i need to use it as unbounded....please do remember that i get only one vendor record at a time.....

if i understood your question correctly you can use splitByValue here

Thanx

Aamir

Former Member
0 Kudos

Hi Aamir,

I get only on receord....but my segment will repeat here....

i am going to add constant value to the feild wich is under one segment with A and B...

is it posiible with Splitbyvalue..

Former Member
0 Kudos

Ohhhhh

you mean your sender is 1-1 but the receiver can be 0-unbounded? and you need to map this 1-1 occurring with every occurence of receiver field?If,yes then simply use copyValue function

sorry for misunderstanding the question first

Thanx

Aamir

Former Member
0 Kudos

just a change here in the first question....i need to validate the vendor name filed and if nothing is present...then i should fail the mapping.....how can we do that

Former Member
0 Kudos

Hi Aamir,

thanks for ur reply.....here only one sgement and a felid will repeat...others will be 1:1....no other segment will repeat.....

Only one segemnt and a single feild under that will repeat....

Edited by: PSRK on Jun 12, 2008 3:06 PM

Former Member
0 Kudos

>>i need to validate the vendor name filed and if nothing is present...then i should fail the mapping

well simply map it to some mandatory field on receiver side,i guess vendor Number is LIFNR.

if vendor number does not comes in,that mandatory field will not be populated and you will get mapping error.

if vendor number comes in the file,then it will be mapped to receiver and no error will be triggered

Thanx

Aamir

Former Member
0 Kudos

vendor name Aamir....not the number...

Former Member
0 Kudos

In UDF you can write a code and check for vendor number value.

Refer to below blog

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

Gaurav Jain

*Points if answer is helpful

Former Member
0 Kudos

any answers Plz......

for my second quetion.....

Former Member
0 Kudos

i already gave you answer for second question my friend:)

just use copyValue function and map the single occuring node of sender to the multiple occuring node of receiver.

Former Member
0 Kudos

I didn't understand your second answer properly.

But I guess if you Duplicate node <segment1> on target side and map it twice then it should work.

If this is worng then explain your requirement once again.

Gaurav Jain

Former Member
0 Kudos

Hi Gaurav,

Thanks for ur reply....

here i am doing 1:1 mapping...

but, at receiver side,we need to map to a segment with 2 constant values....

Consider there is segment and a field under it...for the receiver..then we need to map with Constant A for first time...and constant B for the smae feild second time.....

u got it....

Answers (0)