cancel
Showing results for 
Search instead for 
Did you mean: 

idoc segement

Former Member
0 Kudos

Hi

I have BOMMAT idoc , where i have to repet MATNR value as many times as IDNRK and MENGE_C is having.

Bommat04 idoc

Segment 1 E1STZUM(1..1)>>E1MASTM(1..999)>> Field is MATNR(0:1)

Segment 2 E1STZUM(1..1)>>E1STPOM(0:99999)>> Field is IDNRK(0:1), MENGE_C(0:1)

Like

segment E1MASTM

MATNR = 1

Segment E1STPOM

IDNRK = 200

MENGE_C= 300

Segment E1STPOM

IDNRK = 201

MENGE_C= 301

So MATNR Shoud repet two times and give the results like 1,200,300 and 1,201,301.

Please suggest me the mapping to achive this.

regards

Laxmi Bhushan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I understood what output u want but i hve one doubt...

what happened when MATNAR root segment repeat more than one time...

segment E1MASTM

MATNR = 1

segment E1MASTM

MATNR = 2

Segment E1STPOM

IDNRK = 200

MENGE_C= 300

Segment E1STPOM

IDNRK = 201

MENGE_C= 301

In this case what output u r expecting...

the problem here is ur E1MASTM seg is repeating 0-999 as per ur structure...

chirag

Former Member
0 Kudos

E1MASTM segment would not repet more than 1. as it BOMMAT is executed with ARTMAS idoc. as said by functional.

so what will the solution in current design.

Regards

Former Member
0 Kudos

U can do it using UDF -

Use while loop - input MATNR and E1STPOM segment(take count of E1STPOM using count function)

Repeat the while loop as the E1STPOM count and output MATNR .

chirag

Former Member
0 Kudos

Hi Chirag,

Can u please give me udf code.

Regards

Former Member
0 Kudos

I have got very simple solution for u...

Use graphical variable------- option available in PI 7.1

Right click on target structure say add variable and give MATNR name - Now map the source field MATNR with this field.

Now Go to ur target MATNR structure and drag that target variable and map it to target field..

u can refer this blog for more understanding.../people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable

I have tried that and It is working very fine for me...U can use that MATNR field as a constant...other mapping will be same -wat I mean is map E1STPOM to root target node....

chirag

Former Member
0 Kudos

Hi Chirag,

Thanks a lot. solved the problem

Closing Thread.

Regards

Laxmi Bhushan

Answers (5)

Answers (5)

former_member581827
Participant
0 Kudos

You an use Use One as Many function first argument will be Matnr second will be E1PSTOM and thrid IDTNR ...

All three should be of same context which will be higer level than E1MASTM.

Former Member
0 Kudos

pls give some response

Former Member
0 Kudos

can u pls reply to my query..

chirag

shweta_walaskar2
Contributor
0 Kudos

Hello Laxmi,

When you use function useOneAsMany, before passing IDNRK to useOneAsMany, please change the context of IDNRK to E1MASTM.

(Only in case E1MASTM is the parent node of E1STPOM. Apologies if I have understood the structure incorrectly)

Can you please try this and let us know if it works?

Thanks.

Best Regards,

Shweta

Former Member
0 Kudos

Hi Laxmi,

You can use Useoneasmany function to repeat the field MATNR. There would be three arguments:

1. First argument u201Cwhat should be repeatedu201D.

2. Second argument u201Chow many times, first argument should repeatu201D.

3. Third argument u201CShould have same context of Item (Second argument)u201D.It maintains the context.

Thanks,

Former Member
0 Kudos

Please check the occurrence. i have tried with useoneasmany function . it sends only one time

Regards

Former Member
0 Kudos

Sorry, I haven't checked the occurance. Duplicate the segment and try to post the data.

Is there any specific reason why you would like to do it like this?

Thanks,

former_member183898
Participant
0 Kudos

Check useOneAsMany node function , you can use that.l

Thanks,

Pushkar