‎2008 Feb 04 11:41 PM
Hi,
In the work area Wa_index name= store storeno=3997 first 3 characters are not comming properly, it is comming as
field1 name = re 399 - this has to be 'store'
field2 storeno = 7 sup - this has to be '3997'
field3 name_2 = er center - this has to be 'super center'
First 3 characters of field2 is attaching at the end of field1 and so on. Please help me to solve this.
DESCRIBE TABLE itab_output LINES lv_cnt.
DO lv_cnt TIMES.
lv_index = sy-index.
READ LINE lv_index FIELD VALUE chk.
IF chk = 'X'.
READ TABLE itab_output INTO wa_index INDEX sy-index.
IF sy-subrc EQ 0.
wa_index-index = sy-index.
APPEND wa_index TO itab_output2.
CLEAR wa_index.
ENDIF.
ENDIF.
CLEAR chk.
ENDDO.
Thanks,
Veni.
‎2008 Feb 04 11:45 PM
Hi Veni
check the select statement which is populating itab_output.. the is a miss match in the order in the decleration of itab_output and order of field in the select statement..
or you can do a select f1 f2 f3
into corresponding fields of table itab_output
where....
but this will be a issue on performance...
‎2008 Feb 04 11:45 PM
Hi Veni
check the select statement which is populating itab_output.. the is a miss match in the order in the decleration of itab_output and order of field in the select statement..
or you can do a select f1 f2 f3
into corresponding fields of table itab_output
where....
but this will be a issue on performance...
‎2008 Feb 05 12:07 AM
Hi Jay,
Itab_output is comming properly, I am getting the checked row information into itab_output2. Both table fields are same.
Thanks,
Veni.
TYPES: BEGIN OF ty_zoutput,
chk TYPE C,
name(17) TYPE C,
storeno(9) TYPE C,
name_2(35) TYPE C,
name_3 LIKE e1bpad1vl-name_3,
name_4(15) TYPE C,
city LIKE e1bpad1vl-city,
city_no LIKE e1bpad1vl-city_no,
postl_cod1 LIKE e1bpad1vl-postl_cod1,
transpzone LIKE e1bpad1vl-transpzone,
street LIKE e1bpad1vl-street,
str_suppl1 LIKE e1bpad1vl-str_suppl1,
country LIKE e1bpad1vl-country,
extens_1 LIKE e1bpad1vl-extens_1,
END OF ty_zoutput.
TYPES: BEGIN OF ty_zsindex,
index TYPE sy-index,
name(17) TYPE C,
storeno(9) TYPE C,
name_2(35) TYPE C,
name_3 LIKE e1bpad1vl-name_3,
name_4(15) TYPE C,
city LIKE e1bpad1vl-city,
city_no LIKE e1bpad1vl-city_no,
postl_cod1 LIKE e1bpad1vl-postl_cod1,
transpzone LIKE e1bpad1vl-transpzone,
street LIKE e1bpad1vl-street,
str_suppl1 LIKE e1bpad1vl-str_suppl1,
country LIKE e1bpad1vl-country,
extens_1 LIKE e1bpad1vl-extens_1,
END OF ty_zsindex.
DATA: BEGIN OF itab_e1bpad1vl.
INCLUDE STRUCTURE e1bpad1vl.
DATA: END OF itab_e1bpad1vl.
DATA: wa TYPE ty_zoutput,
wa2 TYPE ty_zoutput,
wa_index TYPE ty_zsindex,
itab_output TYPE TABLE OF ty_zoutput WITH HEADER LINE,
itab_output2 TYPE TABLE OF ty_zsindex WITH HEADER LINE.
at user-command.
case sy-ucomm.
when 'SELE'.
set pf-status 'NORM'.
LOOP AT itab_output INTO wa.
if wa-chk = 'X'.
wa-chk = ' '.
elseif wa-chk = ' '.
wa-chk = 'X'.
endif.
MODIFY itab_output FROM wa INDEX sy-tabix.
CLEAR wa.
ENDLOOP.
perform output.
when 'UPDATE'.
DESCRIBE TABLE itab_output LINES lv_cnt.
DO lv_cnt TIMES.
lv_index = sy-index.
READ LINE lv_index FIELD VALUE chk.
IF chk = 'X'.
READ TABLE itab_output INTO wa_index INDEX sy-index.
IF sy-subrc EQ 0.
wa_index-index = sy-index.
APPEND wa_index TO itab_output2.
CLEAR wa_index.
ENDIF.
ENDIF.
CLEAR chk.
ENDDO.
‎2008 Feb 05 12:32 AM
Hi Veni
As per your code, both internal tables are not same.
First field in first internal table is of data type char and length 1, whereas your second internal table the first field is Index and both differ in lengths.
So when moving data, move data explicitly or with addition corresponding from one work area to another.
Regards
Eswar
‎2008 Feb 05 12:37 AM
Thank you Jay and Eswar.
I changed CHK and INDEX to the end and it worked, now I have itab_output and itab_output2 has same values.
Regards,
Veni.
‎2008 Feb 05 12:38 AM