cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Item value Default and incrementing it

Former Member
0 Kudos

Hi all

I am new to sap XI, i am doing a file to idoc scenario,

how to map default value( for eg 0001) to an item field and keep on incrementing it by the occurence of no items in my file structure?

Full points are guaranteed .

Regards

Bhasker.

Accepted Solutions (1)

Accepted Solutions (1)

former_member193376
Active Contributor
0 Kudos

Hi

You can write a UDF

declare and Initialize your counter globally, and if you need to map this value to an item field then you map it using a constant.

int cnt = 0001;

and in your udf pass your item field as your input and check the value of your input if its a blank, if its not equal to a blank then increament the counter.

if(!item.equals(""))

{

cnt = cnt + 1;

{

Hope this is helpfull

Thanks

Saiyog

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

here a is the input field on which basis you want the occurencerences of your output field.

int i;

int b = 001;

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

{

result.addValue(String.valueOf(b));

b = b+1;

}

inputfield--


>udf--->splitbyvalue--


>outputfield

regards

Kasturika

sunilchandra007
Active Contributor
0 Kudos

Hi,

U can simply use counter function in Arithimatic function category.

Also u can write simple UDF for that.

Regards,

Chandra

Former Member
0 Kudos

Hello

could you please elaborate your problem more .

Regard's

Chetan Ahuja

Edited by: Chetan Ahuja on Jul 30, 2008 7:04 AM

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

Any default value can be mapped by using the constants in the graphical mapping.

Is your requirement is to count the no of occurance of a field i.e. item and map it to the target field..?

If so use this mapping..

items(Source) -

-


remove contexts(node function) -

-


count (Statistic function) -

-


item field(target)

Thanks

SaNv...

Edited by: Sãnthosh Kûmãr V on Jul 30, 2008 10:25 AM