09-06-2013 7:09 PM
l_test3 type string.
wa_final-durat = wa_/sapapo/trm-durat.
in my wa_final-durat we got value 10203456
we need output l_text3 = 102:03.
i wrote below logic but it not working.
CONCATENATE wa_final-durat+0(3) ':' wa_final-durat+3(2) INTO l_text3.
could any one help me for alternative solution.
09-06-2013 8:22 PM
This logic should work for you. I don't know if you miss typed the variables name, but you have l_test3 type string but is using l_text3 in the concatenate statement.
Can you paste your full code?
09-07-2013 12:49 AM
Hi,
Try doing should work
CONCATENATE wa_final-durat(3) ':' wa_final-durat+3(2) INTO l_text3.
Cheers,
Arindam
09-07-2013 4:02 AM
Hi Siba Nayak,
You are maintaining l_test3 and l_text3 S instead of X
Maintain wa_final-durat as string
l_test3 type string.
CONCATENATE wa_final-durat+0(3) ':' wa_final-durat+3(2) INTO l_text3.
try like this
data : l_text3 type string,
wa_final_durat type string.
wa_final_durat = '10203456'.
CONCATENATE wa_final_durat+0(3) ':' wa_final_durat+3(2) INTO l_text3.
write : / l_text3.
or
data : l_text3 type string,
wa_final_durat type string.
wa_final_durat = '10203456'.
CONCATENATE wa_final_durat(3) ':' wa_final_durat+3(2) INTO l_text3.
write : / l_text3.
09-07-2013 6:45 AM
Hi siba nayak,
You should be getting short dump due to this code as domain 'DURAT' length is 4 and you cannot do the concatenation through above code. Firstly, check the length of the domain and then find whether this value '10203456' is populated in wa_final-durat.
If you are wa_/sapapo/trm-durat contains '10203456' then try passing to a temporary string variable and then concatenate it.
cheers,
Dineshwar
09-07-2013 6:58 AM
Hi Siba,
The output you are getting has a conversion routine and not the exact value.
It is the time duration I suppose and will be having a time stamp value
Use the FM CONVERSION_EXIT_TSTRN_OUTPUT it will help.
The value you get from this FM manipulate that value with offset to get the desired value
Regards
09-07-2013 7:57 AM
Hi,
Field type I cannot be used in concatenate statement. So first convert it to char type ( C, N, String, Etc).
declare two variables - DATA : LV_TEMP TYPE N LENGTH 10,
LV_TEXT3 TYPE STRING.
Now,
use the following statement to convert I type to N type,
WRITE WA_FINAL-DURAT TO LV_TEMP.
Now perform concatenate on LV_TEMP.
CONCATENATE LV_TEMP(3) ':' LV_TEMP+4(3) INTO LV_TEXT3.
I have used LV_TEMP+4 for the value after ':' because SAP system places a separator according to your number format which is 123,456 for my system.
So to read the required digits I have to bypass ',' symbol so +4 instead of +3.
Now, for example if your durat field has value 12345678, LV_TEXT3 will have value '123:456'
Regards,
Ashish Rawat
09-09-2013 1:04 PM
Your logic its correctly you can send print of debug screen with result error?
Thanks.