cancel
Showing results for 
Search instead for 
Did you mean: 

problem in message mapping

Former Member
0 Kudos

Hi experts

I am doing an idoc to file scenario whose idoc structre is given below

EIMARM(parent segment)

EAN11(field)

EIMARMM(child segment)

EAN11(field)

EIVKEMM(child segmnet)

VKORJ(field)

i have to generate datarecord for each VKORJ in E2MVKEM :If EAN11 is present in E2MARAM and if EAN11 is present in E2MARMM.

for ex:. if EIMVKEM segment come twice and EIMARMM SEGMENT 4 time then total 8 data records to be created.The E1MARM SEGMENT (first one) is the parent segment and it will come only once.

To achive this i used one if codition and one udf as follow

EAN1 [context change to upper level]....>exists ->ifWithoutElse

then take E1MARMM as one input to the UDF

and E!VKEM other input to the UDF

output of udf is mapped to the target

the udf is :Logic:for(int i=0; i<EIMVKEM.length; I++)

{

if( EIMVKEM.equals(ResultList.CC)) continue;

for(int j=0; j>< EIMARMM.length; j++)

{

if( EIMVKEM.equals(ResultList.CC)) continue;

result.addValue{“ “);

}

}

Its generating 8 data record for 6 E1MARMM (two E1MARMM not satisfying if condition so only 4 EIMARMM is going as input)and 2 EIVKEM but while taking value its taking value of those EIMARMM SEGMENT which doesnot satisfy that if condition also.i tried to change context or use some node function but didn't got the desired result.

Plz help me as its uregent I have tried my best to describe the situation but if u have any doubt also then plz ask and guide me to achieve the desired result

Regards

Neha

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Ya vijay u r right i have not used this logic to generate each field as preivously when i have generated multiple records based on some condition i have not mapped the codition to all the field under record.ok i will try it and let u know

secondaly i am telling that two data record its taking from the segment which dont

have ean11 as i have mapped one field of each segmnet so i came to know that the last segmnet is repetating

by the way thanks for ur help

Regards

Neha

Former Member
0 Kudos

ok i will send it.By the way similar type of problem i have privious object where E1SIFEG SEGMNET WAS REPETEING then u told to change the context to original level and use removecontext before creatif the it had worked.

however i am sending u screenshots

Regards

Neha

Former Member
0 Kudos

Hi Neha,

I got your screen shots and it was working fine. You have done well.

<b>"but the last two record is created by the E1MARMM SEGMNET which don’t have ean11."</b>

There is no problem with the UDF. It is working fine. Now you have problem with the indivual fields which are under your target node RECORD. So you need to follow the same type of logic for each field. I think now you are appling this logic only to generate the RECORD not for each field under this node.

How you are telling that Last two records are created by the E1MARMM SEGMNET which don’t have ean11??? Please check that you have not mapped well with the elements under RECORD node.

Please correct me if i am wrong.

Warm Regards,

Vijay

Former Member
0 Kudos

Hi Vijay

This logic I am using from begining only but the problem here is suppose

U have 2 E1MVKEM segment and 3 E1MARMM SEGMENT 2 WITH EAN11 AND 1 WITHOUT EAN11 then with this logic it will create 4 data record which is desired also,but the problem comes when i find that the 4 data record contains the value

from that E1MARMM SEGMENT also which does not have ean11field.while those segment suppose to be discardedwhich does not have eanii. I tried to change context every thing but this problem is not getting rectified.

Regards

Neha

Former Member
0 Kudos

Can you please send me the all Queus screen shots for input and output and what you want output to my email id b4vijay@gmail.com. So that i can see and help you out in some way.

Because it is very confusion what you are saying in the mail. Please explain me more with the screen shot then i will help you out.

Warm Regards,

Vijay

Former Member
0 Kudos

Hi Vijay

EAN11.LENGTH will return 3 if EAN11 is persent in 3 E1MARMM segment out of 5.so the "if "condition will always true and udf will create 10 record from all 5 segment instead of 6 from only those 3 SEGMENTS which contain EAN11.

Actually I can check the EAN11 field outside the UDF and then pass only those E!MARMM to the udf which have EAN11 FIELD.Its generating also only 6 data record in display queue but while creating datarecord it takes value from those E!MARMM segment which does not contain EAN!!. This isthe main problem meanwhile i will try to check EAN11 condition inside the udf also which iam unable to do till now.

Regard

Neha

Former Member
0 Kudos

So Now i have the clearn picture of that. So now you change the one of the input parameter name EIMARMM to your UDF , just add the If condition there.so pass the values of if conditon to your UDF then your problem solved.

Pass the follwing values to the UDF

1)if(EAN11 exist) then pass the E2MARAM

2)if(EAN11 exist) then pass the E2MARMM

3) Pass the above 2 parameters to your UDF instead of passing direct E2MARAM & E2MARMM . Both input parameters can get from the input of IF conditons not directly. So Now you problem will be solved.

Logic is same as first time your used . Don't use the IF condition which i specidied in prvious post.

Warm Regards,

Vijay

Warm Regards,

Vijay

Former Member
0 Kudos

Hi Vijay

First of all thanks for ur reply.I am checking EAN11 because i have to use only those E!MARMM segment which contains this field otherwise i don't have to create datarecord from them.Thts why 2 E1MARMM fails as they dont have EAN11 FIELD.But while creating record its taking values from them also.This is the problem.IF i will give E!MARMM directly as input it will create datarecord for all E1MARMM.Plz guide me how to proceed.

Regards

Neha

Former Member
0 Kudos

if that is the case then you need to include the If logic in your UDF why because IF only pass the values which have the true in the condtion remaining values can be treat as false conditon. So in the UDF, change the logic as follows and take the one more input EAN11 to the UDF. then your problem will be sovled

if(EAN11.length > 0 )

{

for(int i=0; i<EIMVKEM.length; I++)

{

if( EIMVKEM.equals(ResultList.CC)) continue;

for(int j=0; j>< EIMARMM.length; j++)

{

if( EIMVKEM.equals(ResultList.CC)) continue;

result.addValue{“ “);

}

What i understood your quetion is if EAN11 has the value then only you need data records. otherwise you don;t want to create the records. so the first If conditon will do the same thing. But even if it has single value it will create the data records. Check whether it is satify your condtion otherwise give me some more information about IF.

Message was edited by:

Gangisetty Vijaya Bhaskarudu

Former Member
0 Kudos

u also need to use a else in this case as i think UDF wud expect a else statment otherwise u might get an error missing return

also use the length() function

Former Member
0 Kudos

Hi !!!

refer the below links for ur Sceanrio..and for the issue coming ....

IDOC - File scenario

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

configuring IDOCS

/people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii

IDOC scenarios

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb...

Idoc related setting

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/73527b2c-0501-0010-5398-c4ac372c...

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

see the below links

/people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

idoc settings /people/ravikumar.allampallam/blog/2005/02/23/configuration-steps-required-for-posting-idocsxi

Also

/people/sravya.talanki2/blog/2005/10/27/idoc146s-not-reaching-xi133-not-posted-in-the-receiver-sap-systems133

IDOc testing - /people/suraj.sr/blog/2005/12/29/generate-test-case-for-an-idoc-scenario

You have to do all this settings mentioned in the docuemnt:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/sapR3%28Idocs%29ToXI--Steps+Summarized&

Also can you check this weblogs on the same:

/people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi

/people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi

/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system

/people/ravikumar.allampallam/blog/2005/02/23/configuration-steps-required-for-posting-idocsxi

/people/saravanakumar.kuppusamy2/blog/2005/01/20/configuration-tips-for-a-business-serviceintegration-process-to-send-back-ale-audit-idoc

Check this links on IDOC on XI Wiki homepage:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/fileToIDOC&

<b>Pls Reward if useful </b>

Former Member
0 Kudos

Hi Neha,

I didn't understand why you are using the <b>EAN11 [context change to upper level]....>exists ->ifWithoutElse</b>. Just remove this condition. Directly map the UDF output to the target field. take 2 inputs for the Input to the UDF. Thats all. You need not to check the EAN11 with Ifwihtouelse conditon.

If my answer is wrong then please give me some more input related to why you are using the condition EAN11??

Why it is failing 2 conditios out of 6 means that your EAN11 has onlly 4 fields thatwhy it is not passing other 2 elements.

Warm Regards,

Vijay

Message was edited by:

Gangisetty Vijaya Bhaskarudu

Former Member
0 Kudos

is this ur requirment?

EIMARM(parent segment)

EAN11(field)

EIMARMM(child segment)

EAN11(field)

EIMARMM(child segment)

EAN11(field)

EIVKEMM(child segmnet)

VKORJ(field)

first u check if EAN11 exists in EIMARM parent

u check if VKORJ exists in EIVKEMM

if true

u want to map VKORG to a target field as many times EAN11 occurs in EIMARMM (i.e. 2 times in tis case as EAN11 occurs twice in EIMARMM)

Former Member
0 Kudos

Hi

Try with this

/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

Might be useful.