Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

IDOC Mapping.

Hi All,

I have a scenario like this

Source:

Organisation(0...Unbound)

->TAG019(0...Unbound)

-> Custno(1..1)

-> System ID(1..1)

Now in the target I have a field called SORTL which needs to be filled with Custno, when SystemID is "2".

and one more thing is I am creating IDOC's only when SystemID is "1"

Example:

Organisation(0...Unbound) value

->TAG019(0...Unbound)

-> Custno(1..1) XYZ

-> System ID(1..1) 1

->TAG019(0...Unbound)

-> Custno(1..1) Test

-> System ID(1..1) 2

Then I need to create IDOC for systemID "1" which is working

and I need to pass the Value "Test" of Custno, when SystemID is "2" to SORTL(which is my target)....which is mot happening.

I have written an UDF for this which is working fine when the scenario is like above.

public void createSortL(String[] a,String[] b,ResultList result,Container container){

for(int i=0;i<a.length;i++){

if(a<i>.equals("2")){

result.addValue(b<i>);

}

}

return;

But it fails when the scenario is other way.like this when 2 comes first, where i need to pass XYZ.

Organisation(0...Unbound) value

->TAG019(0...Unbound)

-> Custno(1..1) XYZ

-> System ID(1..1) 2

->TAG019(0...Unbound)

-> Custno(1..1) Test

-> System ID(1..1) 1

can u please let me know wht is wrong?

Regards,

Chaitanya.

Former Member
Former Member replied

Hi,

If you are using for loop and you are incrementing the value of i then u have to use the array as I said use a(i) and b(i).

Thanks and Regards,

Chirag Gohil

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question