on 01-28-2009 12:53 AM
Hi ,
I have a problem .I am working in 6.0.
I have a structture with a couple of fields.How can I move all the field values , along with the spaces , into a string.
Ex:
data : string type char240.
wa-matnr = 'M12345'.
wa-werks = 'US20'.
if I say move it into a string..
string = wa.----->this is throwing an error 'not type compatible'
how can I move these values into the same variables , without changing their types.
the result should be like this ...
string = 'M12345 US20'.
Anyone please help me with the syntax.
Thanks in advance
Edited by: ramana peddu on Jan 28, 2009 1:53 AM
Edited by: ramana peddu on Jan 28, 2009 2:43 AM
Hi,
Use this FM HR_99S_COPY_STRUC1_STRUC2 which is used to copy the structure of different types.
Pass the WA to exporting parameters and receive the values in string as Import parameters.
This will solve the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the FM HR_99S_COPY_STRUC1_STRUC2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use like this
Concatenate wa-matnr wa-werks into string seperated by ' '.
кu03B1ятu03B9к
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
concatenate wa-matnr wa-werks into lv_string separated by space.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Rich , I don't want a single space in between both the values infact I want the original length of every field occupied.
I mean like below
M12345 and US20 combined together with 13 spaces in between.
That's because length of Matnr is 18 .Please let me know , if I am able to explain the issue.
Hi, if u have not condensed matnr, i think it shud have spaces but leading spaces, so if u want trailing spaces, may be u can try like this.
condense wa-matnr.
i = strlen(wa-matnr).
i = 18 - i.
do i times.
concatenate wa-matnr '$' to wa-matnr.
enddo.
REPLACE ALL OCCURRENCES OF '$' IN wa-matnr WITH ` `.
"now u can concatenate like
concatenate wa-matnr wa-werks.
кu03B1ятu03B9к
Edited by: kartik tarla on Jan 28, 2009 9:20 AM
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.