cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi ,

I am mapping GLMAST01 IDOC to a stored procedure to insert into SQL. The scenario is [IDOC to JDBC].

It is working fine except for some missing fields when more than one company codes are present.

The E1SKB1M segment 0-99999 is mapped to the statement_Name in the target which is 0-unbounded.

The E1SKA1M segment 1:1 has the fields  KTOPL and SAKNR and ESKA1M segment is  not mapped to anything in target. Thus KTOPL and SAKNR appear only once for the first company code XML structure of stored procedure but not for subsequent company code XML structure.

How can I map ESKA1M to make sure these two fields come in other company codes in the XML structure below .

Thanks,

Teresa

<MT_Insert>

<Statement_Name>

<Storedprocedurename action = 'EXECUTE'>

<Table>stored proc name<table>

<BUKRS>1101<BUKRS>

<KTOPL>AAAA<KTOPL

<SAKNR>1222222<SAKNR>

<STEXT>TEST<STEXT>

<Storedprocedurename>

<Statement_Name>

-<Statement_Name>

-<Storedprocedurename action = 'EXECUTE'>

<BUKRS>1201<BUKRS>

<STEXT> TEST INSERT<STEXT>

<Storedprocedurename>

<Statement_Name>

<MT_Insert>

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Use below kind mapping logic

     

  use one as many------->splitby value(each value)----->KTOPL

use one as many firrst argument---KTOPL,second argument-E1SKB1M,third argument--E1SKB1M

        use one as many------->splitby value(each value)----->SAKNR

use one as many firrst argument---SAKNR,second argument-E1SKB1M,third argument--E1SKB1M

above logic should work.

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You might want to try the wiki below to understand node functions.

http://wiki.sdn.sap.com/wiki/display/XI/Explain+node+functions

Former Member
0 Kudos

Thanks Baskar . I will check the link and try it .    

iaki_vila
Active Contributor
0 Kudos

Hi Teresa,

In this case is interesting to know the source structure where are the fields KTOPL and SAKNR.

I suppose that <Statement_Name> has  0..unbounded  ocurrency, and you map this field directly with the BUKRS from source XML.

The problem that you have, probably your source XML the KTOPL and SAKNR fields have different number of contexts than BUKRS in your case only appears once, if undesrtand well.

You do need the copy the same values for all occurrences of <Statement_Name>, do you?, if im right you could use the copyvalue function. See the example here http://wiki.sdn.sap.com/wiki/display/XI/Standard+Functions+in+PI+7.0

Another solution if you are in SAP PI 7.1 or higer is using two Variables in the target mapping and reuse those variables later to respective fields in their target fields.

Regards.

Message was edited by: Iñaki Vila

Former Member
0 Kudos

Hi Inaki,

The BUKRS in IDOC under segment E1SKB1M  is mapped to the target BUKRS field

. The segment E1SKB1M 0-99999 which has the BUKRS field is mapped to Statement_Name 0- unbounded.

The fields KTOPL and SAKNR come under E1SKA1M 1:1 . I need to copy the same value for all occurences of <Statement_Name> .

I am using PI 7.1.

I will follow the link and let you know.

Thanks,

Teresa

iaki_vila
Active Contributor
0 Kudos

Hi Teresa,

Raja Sekhar Reddy's answer or function value copyvalue that i mentioned you should work. Both put the source value on the target all the times that you need.

Good luck and regards.

Message was edited by: Iñaki Vila