‎2007 Apr 10 8:07 PM
I have a structure credit_total and a corresponding itab i_credit_total. I move the string field v_row to the structure. Now I want to append the structure to the internal table. I have too many fields in the structure to do it individually. My code gives me errors at APPEND credit_detail TO i_credit_detail.
TYPES: BEGIN OF credit_total,
formattype(2) TYPE c,
groupclientnumber(4) TYPE n,
clientnumber(4) TYPE n,
juliandate(3) TYPE c,
hrextraction(2) TYPE c,
recordtype(2) TYPE n,
filler(7) TYPE n,
recordcnt(5) TYPE n,
totalamt(9) TYPE n,
futureuse(187) TYPE c,
END OF credit_total.
DATA: i_credit_total TYPE TABLE OF credit_total.
MOVE v_row TO credit_detail.
APPEND credit_detail TO i_credit_detail.
‎2007 Apr 10 8:13 PM
Hi,
Please try this.
TYPES: BEGIN OF credit_detail,
formattype(2) TYPE c,
groupclientnumber(4) TYPE n,
clientnumber(4) TYPE n,
juliandate(3) TYPE c,
hrextraction(2) TYPE c,
recordtype(2) TYPE n,
filler(7) TYPE n,
recordcnt(5) TYPE n,
totalamt(9) TYPE n,
futureuse(187) TYPE c,
END OF credit_detail.
DATA: v_row TYPE string.
DATA: i_credit_total TYPE TABLE OF credit_detail.
...
MOVE v_row(2) TO credit_detail-formattype.
MOVE v_row+2(4) TO credit_detail-groupclientnumber.
MOVE v_row+6(4) TO credit_detail-clientnumber.
MOVE v_row10(3) TO credit_detail-juliandate.
....
move-corresponding credit_detail to i_credit_total.
append i_credit_total.
Regards,
Ferry Lianto
‎2007 Apr 10 8:11 PM
credit_detail or credit_total?
change the code to
MOVE v_row TO credit_total.
APPEND credit_total TO i_credit_total.
~Suresh
‎2007 Apr 10 8:11 PM
In unicode systems u cannot pass the String variables data into a field string (work area) of different fields.. U need to pass the data from this string variable to the individual fields of work area (not directly) and then onli u can append it.
<b>in the attributes
GOTO --> Attributes..</b>
of your program just uncheck the check box Unicode .. then your code will not have any problem .. it will be error free..
Or if u want your program to be Unicode enabled and u can solve this problem by using the field-symbols... without using all the fields..
u can use
<b>LOOP AT
ASSIGNING COMPONENT SY-INDEX OF STRUCTURE FS_WA TO <FS>.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
ENDLOOP.</b>
regards,
sai ramesh
‎2007 Apr 10 8:13 PM
Hi,
Please try this.
TYPES: BEGIN OF credit_detail,
formattype(2) TYPE c,
groupclientnumber(4) TYPE n,
clientnumber(4) TYPE n,
juliandate(3) TYPE c,
hrextraction(2) TYPE c,
recordtype(2) TYPE n,
filler(7) TYPE n,
recordcnt(5) TYPE n,
totalamt(9) TYPE n,
futureuse(187) TYPE c,
END OF credit_detail.
DATA: v_row TYPE string.
DATA: i_credit_total TYPE TABLE OF credit_detail.
...
MOVE v_row(2) TO credit_detail-formattype.
MOVE v_row+2(4) TO credit_detail-groupclientnumber.
MOVE v_row+6(4) TO credit_detail-clientnumber.
MOVE v_row10(3) TO credit_detail-juliandate.
....
move-corresponding credit_detail to i_credit_total.
append i_credit_total.
Regards,
Ferry Lianto