‎2008 Apr 08 10:02 AM
Hi
I have a work area which i have declared like a table.
One filed in the work area is of type CHAR and length 12.
I am adding a value to this workarea of type CHAR.
But the length is more than 12. So the variable name gets truncated.
Can someone please help me.
data: wa_prof type profile.
wa_prof- profilename = 'ABAPDEVELOPER'
But when i execute only the first twelve letters get displayed.
what can be done ?
thanks in advance.
‎2008 Apr 08 10:06 AM
Hi,
Declare that workarea field type string,so that you can store up to 255 char and that value will not be truncated.
Reward if useful.
‎2008 Apr 08 10:10 AM
How do i declare workarea to be string?
I want it to have structure as in the table.
‎2008 Apr 08 10:14 AM
When i declare the work area field name aas string.,
It says " fieldname already declared"
‎2008 Apr 08 10:16 AM
Declare that particular filed as type string.
or decalre types with req fields and declaring that particular field as string or increase the length. then declare the work area refering to that types.
types:begin of ty_mara,
matnr type matnr,
normt type string,
matkl type matkl,
end of ty_mara.
data:wa_mara type ty_mara.
‎2008 Apr 08 10:21 AM
this is my code.
data : l_wa_prof like bapiprof, -->declaring the workarea
l_t_prof like bapiprof occurs 0 with header line, --->declaring internal table
l_wa_prof-bapiprof = 'SAP_BI-WHM_RFC'. --->Adding value to workarea
l_t_prof = l_wa_prof.
append l_t_prof. -
>appending it to internal table
clear l_t_prof.
How to change in this ?
‎2008 Apr 08 10:10 AM
‎2008 Apr 08 10:11 AM
Increasing lenght of variable . how ?
I tried declaring as wa_prof-profile name type char(20)
it doesnt work
‎2008 Apr 08 10:13 AM
Hi,
It is obvious that if the value which you are passing is more than 12 then it will get truncated. You need to change the length of your workarea in that case.
But if the value is with leading space then you can do one thing is use CONDENSE statement before passing the value to the workarea.
Regards
Sourabh
‎2008 Apr 08 10:15 AM
How do i change the length of the workarea.
It is declared as a standard table type.
‎2008 Apr 08 10:23 AM
Its ok u can do 1 thng
Declare a wa type any or string
move your workarea into the new workarea
i think this should work
Regards