2007 May 02 5:39 AM
HI guys,
Need some help in concatenation
VarA = Left (location+' '),4) + right (order,8)..
Please solve the above
Example: "Location = 09 & order = 99912365478
Then
(location + 2 space) = (09 ) .i.e. 4 characters leftmost of (location + 2 space) = (09 )
8 digits (rightmost) from order number = 12365478
So,
VarA =4 characters leftmost of (location + 2 space) + 8 digits (rightmost) from order number
=> VarA = = (09 ) + 12365478
=> VarA = = 09 12365478..
Incase location is 09AA, then
Then (location + 2 space) = (09AA ) .i.e. 4 characters leftmost of (location + 2 space) = 09AA
VarA = 09AA12365478
I need to get this output remember two spaces in between..
regards,
nazeer
2007 May 02 5:51 AM
DATA: temp(4) type c,
output(12) type c,
location(4) type c value 'AB',
order(12) type c value 'abcd12345678'.
move location to temp.
if temp+2(1) cs sy-abcde.
concatenate location0(4) order3(8) into output.
else.
concatenate location0(2) order3(8) into output separated by ' '.
endif.
write 😕 output.
HI guys,
Need some help in concatenation
VarA = Left (location+' '),4) + right (order,8)..
Please solve the above
Example: "Location = 09 & order = 99912365478
Then
(location + 2 space) = (09 ) .i.e. 4 characters leftmost of (location + 2 space) = (09 )
8 digits (rightmost) from order number = 12365478
So,
VarA =4 characters leftmost of (location + 2 space) + 8 digits (rightmost) from order number
=> VarA = = (09 ) + 12365478
=> VarA = = 09 12365478..
Incase location is 09AA, then
Then (location + 2 space) = (09AA ) .i.e. 4 characters leftmost of (location + 2 space) = 09AA
VarA = 09AA12365478
I need to get this output remember two spaces in between..
regards,
nazeer
2007 May 02 5:41 AM
HI,
DATA: temp(4) type c,
output(12) type c.
move location to temp.
concatenate location0(4) order3(8) into output.
Best regards,
Prashant
2007 May 02 5:45 AM
HI prasanth..
Please go through the thread properly..
I need spaces inbetween the VarA if location is just 2 of length..
for your answer the output will be 0912345678 not
(09 12345678)..
regards,
nazeer
Message was edited by:
nazeer shaik
2007 May 02 5:51 AM
Hi Nazeer,
use this code inur program.
Data: temp(12).
concatenate (location0(4)) (order3(8)) into temp.
Reward points if helpful.
Regards,
Hemant
2007 May 02 5:51 AM
DATA: temp(4) type c,
output(12) type c,
location(4) type c value 'AB',
order(12) type c value 'abcd12345678'.
move location to temp.
if temp+2(1) cs sy-abcde.
concatenate location0(4) order3(8) into output.
else.
concatenate location0(2) order3(8) into output separated by ' '.
endif.
write 😕 output.
2007 May 02 5:53 AM
nazeer,
Location = 09
order = 99912365478
If you want 2 more spaces in location
concatenate location ' ' ' ' into location.
then
concatenate location order+3(8) into VarA .
Don't forget to reward if useful...
2007 May 02 5:58 AM
2007 May 02 7:32 AM
Hi...
<b>I have tried this code..it is meeting ur requirements..</b>
<b>it checks if the third and fourth digit of location is empty and then processes..</b>i changed the value of location and ran it again...working fine.
data:order(11).
data:location(4) type c value '90AA',
temp(12).
order = '99912345678'.
if location+2(2) ne ''.
concatenate location order+3(8) into temp.
write : temp.
else.
concatenate location0(2) order3(8) into temp separated by ' '. " two spaces here
write : temp.
endif.
Reward if useful!!
Message was edited by:
shweta soni
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |