on 10-31-2012 6:27 AM
hi All,
Is there anyway by which i can pass blank spaces to a variable.
Thanks & Regards,
Durgesh.
Moderator message: very basic -> question status removed.
Message was edited by: Thomas Zloch
Hi All,
I have found the solution.
Just populate the final variable with the commas before as here we know that what is the field length.
and suppose if a variable is initial then we need not pass any value or spaces in place of that variable. Thus the spaces are incorporated in the final variable.
Thank you all for the suggestions and being patient with me.
Regards,
Durgesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would need to know more about these requirements.
Your field of 4 spaces would be respected if it were in a structure. Example is when you create an output file. You can your structure fields the necessary sizes to respect the required column positions.
Another way to repsect spacing would be to delimit with characters:
X X
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Philip,
My requirement is like i need to pass spaces in a variable and then that variable is concatenated with other variables. And the final variable is passed on to some third party system.
Other scenario is like just pass the space value to a variable directly. i have tried the above specified options but was not successful.
Regards,
Durgesh
Well Durgesh,
This third party must have given you a spec for the structure. Say:
Company char 15
Address char 30
City char 10
This is your structure:
data:
begin of out_file,
company(15) type c,
address(30) type c,
city(10) type c,
end of out_file.
So if you fill company and city but not address, you will have address empty. The data will be at all the right places for third party to find it.
This is the most common scenario used in all extractor programs usually.
But for me i need to say concatenate all three separated by comma and if address is empty than i need to pass 30 blank spaces for it. these all data is stored in a changing parameter of the user exit which i am using. The third party system needs that if address is initial it should have that much number of spaces.
Regards,
Durgesh.
Sound funny. Usually if you have a csv file (comma separated values) if the field is empty you have two commas touching, example:
Disney;;Burbank
your understanding is they want (I'm not counting the spaces):
Disney; ;Burbank
usually you have either a csv file or a fixed position file (or whatever its called)
But, OK, then you structure should be:
data:
begin of out_file,
company(15) type c,
sep1 type c value ',',
address(30) type c,
sep2 type c value ',',
city(10) type c,
end of out_file.
This should give you:
Disney; ;Burbank
If I understood...
You complicate your life that way!
Use the structure approach!
You do something like this:
data:
company(15) type c,
address(30) type c,
city(10) type c,
big_field(200).
concatenate company address city into big_field separated by ','.
(but the empty field is shortened to nothing)
instead use a structure:
out_file-company = 'Disney'.
out_file-address = space.
out_file-city = 'Burbank'.
big_field = out_file.
transfer big_field to file.
you will be transferring this:
Disney; | ;Burbank |
I mean try it and see!
It depends on the variable type, is is a CHAR a STRING or another type, try a MOVE ` ` TO STRING (backquotes), MOVE SPACE or CLEAR to a CHAR type.
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just Pass keyword GV_FLAG = SPACE.
What variable did you declared and what is the Type associated with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When u pass SPACE to a CHAR4 Vaiable it will be only one SPACE thats it.
When u want to pass 4 Blank SPACEs also System will take it as one SPACE thats it.
Example LV_FLAG TYPE CHAR4.
1. LV_FLAG = SPACE.
2. LV_FLAG+0(1) = SPACE.
LV_FLAG+1(2) = SPACE.
LV_FLAG+2(3) = SPACE.
LV_FLAG+3(4) = SPACE.
Now from point 1 and 2 system will take the as SPACE thats it. LV_FLAG will be a Blank Value.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.