‎2008 Jun 21 1:19 PM
Hi,
I am facing one problem,can u please tell me the solution.
I am passing data from internal table to a character field in Uni Code system,but it is showing the error like both the objects are not mutually convertable in unicode system.
But I have a solution by maintaining the offsets like :
TEMP_TEXT+0(1) = RETAINAGE_TEXT-DQ1.
TEMP_TEXT+1(1) = RETAINAGE_TEXT-HEX.
TEMP_TEXT+2(20) = RETAINAGE_TEXT-FILLER1.
TEMP_TEXT+22(15) = RETAINAGE_TEXT-AMT_DUE.
TEMP_TEXT+37(8) = RETAINAGE_TEXT-TEXT.
TEMP_TEXT+45(10) = RETAINAGE_TEXT-DUE_DATE.
TEMP_TEXT+55(1) = RETAINAGE_TEXT-DQ2.
But the has 140 fields.It is some what difficult to maintain offsets.
Please give me the suitable answer.
Thanks & Regards,
Pratap G.
‎2008 Jun 21 1:27 PM
Hi,
You can concatenate all fields within a LOOP on your internal table into the TEMP_TEXT string.
Sample code:
FIELD-SYMBOLS: <fs>.
DATA: temp_text TYPE string.
LOOP AT itab INTO wa.
DO 5 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE wa TO <fs>.
CONCATENATE temp_text <fs> INTO temp_text IN CHARACTER MODE.
UNASSIGN <fs>.
ENDDO.
ENDLOOP.
Cheers,
Aditya
Edited by: Aditya Laud on Jun 21, 2008 8:27 AM
Edited by: Aditya Laud on Jun 21, 2008 8:32 AM
‎2008 Jun 23 5:38 AM
Hello Kumar
If you want to transfer your itab data 1:1 into the string there is a simple solution available:
use static method FILL_CONTAINER_C of class CL_ABAP_CONTAINER_UTILITIES.
Regards
Uwe