2008 Sep 16 5:50 PM
Hi in this program i need to move data from type P to Char field.
Please suggest me how to handle this logic in ECC.
data: begin of itab
a(1) type c,
b(2) type c,
c type i,
end of itab.
data: d(13) TYPE c .
itab-a = 'a'.
itab-b = 'b'.
itab-c = '123456789'.
d = itab.
write:/ d.
Regards
Bhaskar
Hi in this program i need to move data from type P to Char field.
Please suggest me how to handle this logic in ECC.
data: begin of itab
a(1) type c,
b(2) type c,
c type i,
end of itab.
data: d(13) TYPE c .
itab-a = 'a'.
itab-b = 'b'.
itab-c = '123456789'.
d = itab.
write:/ d.
Regards
Bhaskar
2008 Sep 16 5:53 PM
Hi Bhaskar,
instead of
d = itab.
use
data: c type string.
c = itab-c.
concatenate itab-a itab-b c into d.
write: / d.
so the final code is:
data: begin of itab
a(1) type c,
b(2) type c,
c type i,
end of itab.
data: c type string.
data: d(13) TYPE c .
itab-a = 'a'.
itab-b = 'b'.
itab-c = '123456789'.
c = itab-c.
concatenate itab-a itab-b c into d.
write: / d.
Regards,
Karol
2008 Sep 17 7:51 AM
I don't see any type P in your coding. If you have a packed decimal field, declare it as type P.
Then you can use the MOVE command to send it to a character field (and you will get a decimal point), or a WRITE ... TO command and you will get a dot or a comma comma as decimal point, depending on your profile.
You have also special FM like CURRENCY_AMOUNT_SAP_TO_IDOC or CURRENCY_AMOUNT_SAP_TO_BAPI.