Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

hi conca

Former Member
0 Kudos
115

hi

can one one explain me following syntax

data: w_num(2) TYPE n,

w_str(15) TYPE c.

CONCATENATE 'KOMGG-KUNNR(' w_num ')' INTO w_str.

it is combining two fields, but my query here is what if w_num has more than 99 number.

i would like to know about w_num i mean what it is indicating here.

this code is used in bdc.

thanx

5 REPLIES 5

Former Member
0 Kudos
75

hi Rocky ..


data: w_num(2) TYPE n value '2',
w_str(15) TYPE c.

CONCATENATE 'KOMGG-KUNNR(' w_num ')' INTO w_str.

write w_str.

Output..

<b>KOMGG-KUNNR(02)</b>

Reward if this helps..

Regards,

Santosh

Former Member
0 Kudos
75

hi,

w_num indicates to the number of lines in the table control u see on the screen. it cannot be 99 because we dont have such a big screen where we can accomadate 100 lines in a table control hence we can safely use w_num of length 2.

hope that helps.

santhosh

Former Member
0 Kudos
75

If the W_NUM is more than 99, the variable will store only the last two digits hence for 100 it would be indicating 00.

so if W_NUM = 100 the result of the below statement is

KOMGG-KUNNR(00) is the value for w_str.

Regards

Anurag

Former Member
0 Kudos
75

Hi Rocky,

I think this is taking the offset for the field KOMGG-KUNNR , suppose say KUNNR value is 1234567 , and w_num value is 3 , then it will take the first three charaters 123 in to w_str.

there is no chance of nore than 99 , as maximum kunnar length doesnt exceed 99

Former Member
0 Kudos
75

hi

try this declaration;

data: w_num(3) TYPE n

thanks

pavan