2007 Jun 19 10:12 AM
hi all,
plz suggest me.
<b>LOOP AT T_DATA.
IF T_DATA-FLD+1(1) = '3'.
concatenate T_DATA-FLD+359(80) into w_data-zmardesc
separated by space.</b>
when i use the above code i am getting error as use char like field after concatenate.
reagrds,
siri.
Message was edited by:
sireesha yalamanchili
2007 Jun 19 10:18 AM
Hello,
When u r using concatenate then the fields used in statement should be of CHAR variable.
But in ur case I tnink there is no need of concatennate.
make th chnage like this.
LOOP AT T_DATA.
IF T_DATA-FLD+1(1) = '3'.
w_data-zmardesc = T_DATA-FLD+359(80).
Vasanth
Hello,
When u r using concatenate then the fields used in statement should be of CHAR variable.
But in ur case I tnink there is no need of concatennate.
make th chnage like this.
LOOP AT T_DATA.
IF T_DATA-FLD+1(1) = '3'.
w_data-zmardesc = T_DATA-FLD+359(80).
Vasanth
2007 Jun 19 10:15 AM
You are not using two fields at all to concatenate? If you want just one field, do a move and not a concatenate.
2007 Jun 19 10:16 AM
Hi,
When u use concatenate statemate the variable u are using has to be character type.
In ur case it is not so.
So, before concatenating move ur data to other variable of character type and then use it with the concatenate statement.
It solves the problem.
Cheers,
Simha.
Reward all the helpful answers..
2007 Jun 19 10:16 AM
Hello sireesha,
Check the definition of T_DATA-FLD/ w_data-zmardesc. Are both Character fields ??
BY chris
2007 Jun 19 10:16 AM
Hi,
You don't have to concatenate the fields...
Move the six to a structure where you have those 6 fields only..
Example..
DATA: BEGIN OF WA,
MATNR TYPE MATNR,
NUMC(10) TYPE N,
END OF WA.
lOOP AT ITAB.
WA-MATNR = ITAB-MATNR.
WA-NUMC = ITAB-NUMC.
NOW THE WORK AREA WA HAS THE CONCATENATE VALUE OF MATNR AND NUMC..
ENDLOOP.
Regards
2007 Jun 19 10:17 AM
Hi,
concatenate 'join' two or more character type fields in one character field. In your command there is only one field which you should use on e of the below statements.
write T_DATA-FLD+359(80) to w_data-zmardesc.
or
w_data-zmardesc = T_DATA-FLD+359(80)
Unless you wanted to write something like this.
concatenate T_DATA-FLD+359(80) w_data-zmardesc into w_data-zmardesc
separated by space.
Kostas
2007 Jun 19 10:18 AM
Hello,
When u r using concatenate then the fields used in statement should be of CHAR variable.
But in ur case I tnink there is no need of concatennate.
make th chnage like this.
LOOP AT T_DATA.
IF T_DATA-FLD+1(1) = '3'.
w_data-zmardesc = T_DATA-FLD+359(80).
Vasanth
2007 Jun 19 10:24 AM
thanks to all.
but T_DATA-FLD+359(80) this particular text is there in multiple records which has to be concatenated into field zmardesc.
if i write W_DATA-ZMARDESC = T_DATA-FLD+359(80).
like this is it ok?
regards,
siri.
2007 Jun 19 10:26 AM
Hi,
you have to use concatenate
Concatenate W_DATA-ZMARDESC T_DATA-FLD+359(80) into W_DATA-ZMARDESC
separated by space.
Kostas
2007 Jun 19 10:28 AM
Hello,
Then do like this:
Concatenate W_DATA-ZMARDESC T_DATA-FLD+359(80) into W_DATA-ZMARDESC
separated by space.
" Check if both W_DATA-ZMARDESC and T_DATA-FLD are character fields.
VAsanth
2007 Jun 19 10:35 AM
thanks kostas,
why should we write like this.
actually we r moving T_DATA-FLD+359(80) to W_DATA-ZMARDESC .
then why we have to use like this concatenating both W_DATA-ZMARDESC T_DATA-FLD+359(80) into W_DATA-ZMARDESC .
Concatenate W_DATA-ZMARDESC T_DATA-FLD+359(80) into W_DATA-ZMARDESC
separated by space.
regards,
siri.
2007 Jun 19 11:15 AM
Hi siri,
concatenate actually merges 2 or more character fields into one character field.
e.g
concatenate <source_text1> <source_text2> ... into <target_text3>.
or
concatenate <target_text1> <source_text2> .... into <target_text1>.
so as you see you must declare which texts you are "merging" into your target, that's why you have to use W_DATA-ZMARDESC twice in your statement (in your case W_DATA-ZMARDESC is both your target and source text).
Hope this made it more clear to you.
Kostas
2007 Jun 19 11:23 AM
thanks Kostas,
its working.
if any problem will let you know.
regards,
siri.
2007 Jun 19 10:33 AM
Hi,
U r not concatenating two fields. If ur purpose is to simply assign the value, use move statement.
ie. move T_DATA-FLD+359(80) to w_data-zmardesc
Or
if u have multiple values for t_data-fld , use concatenate like
concatenate w_data-zmardesc T_DATA-FLD+359(80) into w_data-zmardesc separated by space.
2007 Jun 19 10:36 AM
data : begin of T_DATA occurs 0 ,
FLD(370) type c,
end of T_DATA .
data : begin of T_DATA1 occurs 0 ,
FLD like SY-DATUM ,
end of T_DATA1 .
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON.
T_DATA-FLD = FROMDATE .
append T_DATA .
LOOP AT T_DATA.
IF T_DATA-FLD+1(1) = '3'.
concatenate T_DATA-FLD T_DATA-FLD+359(10) into T_DATA-FLD
separated by space.
endif.
endloop.reward points if it is usefull ...
Girish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |