cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed Length of a field in the File-XI-RFC Scenario

Former Member
0 Kudos

Dear All,

I am doing one File-XI-RFC scenario in which user is sending me the file with some delivery nos (VBELN) in it and I am sending those all delivery nos to my RFC in R/3.

Now I want one conition to be put that if any delivery no is of less than 10 characters than that delivery no should not be sent to RFC rest the remaining will be processed to RFC.

I have put one UDF for this whose code is as follows:

int len = a.length();

if (len == 10)

{

int b=1;

b = (1/len);

}

return a;

But this code is not working. Please guide me how to solve this problem.

Regards,

N.Jain

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Input is A : Delivery No take all the delivery no in one context.

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

{

int b= Integer.parseInt(A<i>); it will remove all the leading zeros if it has any.

int j=(new Integer(b).toString().length()); count the lenght of the Del no.

if(j>10)

{

result.addValue(A(i));

}

else

{

result.addValue("null"); will not send anything.

}

}

Thanks and Regards,

Chirag gohil

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I used the following code and my problem is solved:

int len = a.length();

if (len==10)

{

return a;

}

else

{

len =0;

int b=1;

b = (1/len);

return a;

}

Thanks for your valuable replies.

aashish_sinha
Active Contributor
0 Kudos

Hi,

First of all , can you please close the thread or mark it answered (the Surpassing zero problem) and also reward points if the ans helped you.

For this

try like this

if(len <= 10)

return

else

do watevr you want

regards

Aashish Sinha

PS : reward points if helpful