‎2009 Apr 09 9:54 AM
Hi guys,
With the following code:
*Types
TYPES: BEGIN OF ty_zinfo,
string TYPE string,
END OF ty_zinfo.
TYPES:
BEGIN OF ty_zklant,
mandt TYPE mandt,
partner TYPE zpartner,
date TYPE zerdat,
desc TYPE zdescription,
END OF ty_zklant,
*Work area's
DATA: wa_info TYPE ty_zinfo,
wa_klant TYPE ty_zklant.
*Internal tables
DATA: it_klant TYPE TABLE OF ty_zklant WITH HEADER LINE,
it_info TYPE TABLE OF ty_zinfo WITH HEADER LINE,
*loop
LOOP AT it_info INTO wa_info.
SPLIT wa_info AT ',' INTO
wa_klant-mandt
wa_klant-partner
wa_klant-date
wa_klant-desc
APPEND wa_klant TO it_klant.
WRITE it_klant.
ENDLOOP.
Why am I getting the following error?:
"WA_INFO" must be a character-type data object (data type C, N, D, T or
STRING). field string).
When I change the work area to TYPE string it gives the following error:
+"WA_INFO" cannot be converted to the line type of "IT_INFO". +
What's happening?
‎2009 Apr 09 10:03 AM
Hi
U need to indicate the field of the structure IT_INFO
LOOP AT it_info INTO wa_info.
* SPLIT wa_info AT ',' INTO
SPLIT wa_info-string AT ',' INTO
wa_klant-mandt
wa_klant-partner
wa_klant-date
wa_klant-desc.
APPEND wa_klant TO it_klant.
ENDLOOP.Max
‎2009 Apr 09 10:01 AM
hi,
DATA : it_info TYPE TABLE OF string, "---declare ur it_info as table of string
wa_info TYPE string,hope it solves ur issue
Thanks & Regards
‎2009 Apr 09 10:03 AM
Hi
U need to indicate the field of the structure IT_INFO
LOOP AT it_info INTO wa_info.
* SPLIT wa_info AT ',' INTO
SPLIT wa_info-string AT ',' INTO
wa_klant-mandt
wa_klant-partner
wa_klant-date
wa_klant-desc.
APPEND wa_klant TO it_klant.
ENDLOOP.Max
‎2009 Apr 09 10:06 AM
Hi Jeffrey,
Try below
*Types
TYPES: BEGIN OF ty_zinfo,
string TYPE string,
END OF ty_zinfo.
TYPES:
BEGIN OF ty_zklant,
mandt TYPE mandt,
partner TYPE zpartner,
date TYPE zerdat,
desc TYPE zdescription,
END OF ty_zklant,
data: it_zinfo type table of ty_zinfo,
DATA: wa_info like line of it_zinfo, "look thisit works
‎2009 Apr 09 10:08 AM