2012 Dec 30 2:53 AM
Hi Experts
i have written peace code in that i have used sstrlen( ) but it is giving output as '*'.
it is terminated the program .
actually I have used the strlen( ) in internal tables two times first was giving correct length but not for second.
data : k ,l type ty_cust.
loop at itab assigning <kittu>.
k = strlen( <kittu>-cust_name ). "it is working fine
l = strlen( <kittu>-cust_addr ). "this is giving output as '*'.
endloop.
what would be the problem ?
how can I resolve this .
2012 Dec 30 3:35 AM
Hi,
what are the data types of cust_name and cust_addr?
-Ashwin
2012 Dec 30 8:55 AM
2012 Dec 30 8:55 AM
2012 Dec 30 1:13 PM
Hi Balakrishnan,
In you code above data : k ,l type ty_cust.
you have declared l type ty_cust.
Can you make this as char or int.
regards,
Amit
2012 Dec 30 3:43 AM
Hi Balakrishna,
The Strlen function takes value of char type only.
Kindly ensure that your cust_addr is of type char only.
length = STRLEN( variable ).” provides lenght of character variable
Regards,
Amit
2012 Dec 30 10:52 AM
You should declare the size of char variable l.
For example : Data: l(3) type c.
2012 Dec 30 1:12 PM
Hi,
I and K variables in your case should be of type I(integer type).
check here.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb37b2358411d1829f0000e829fbfe/content.htm