‎2007 May 11 8:58 AM
Hi friends,
i have a problem and it seems i need some conversion functionality to it but i do not know what to use for that:
i have a String like "4-1-2" and i do split it into itab at "-" so my itab now contains
4
1
2
in the next step i want to use this value from itab within a read index statement...but here it dumps.
READ t_tab INTO ... INDEX itab.
So it seems that i have to convert the value from itab into i before - but how to achieve that ?
thanks for your help - points will be awarded surely!
‎2007 May 11 9:02 AM
Hello,
WHen reading the table t_tab make this change
data: l_tabix like sy-tabix.
loop at itab.
l_tabix = itab-index. " Say Index is the field of itab.
READ t_tab INTO ... INDEX l_tabix..
endloop.Regards,
Vasanth
‎2007 May 11 9:02 AM
Hello,
WHen reading the table t_tab make this change
data: l_tabix like sy-tabix.
loop at itab.
l_tabix = itab-index. " Say Index is the field of itab.
READ t_tab INTO ... INDEX l_tabix..
endloop.Regards,
Vasanth
‎2007 May 11 9:03 AM
Hi,
you can convert it, if you work with WRITE TO.
CHAR write to INT.
Regards
Nicole
‎2007 May 11 9:03 AM
Hi,
Check the code below:
Reading the file internal table to get Supplier Number.
READ TABLE gt_dummy INTO gs_dummy INDEX gc_one_num.
IF sy-subrc EQ gc_zero_num.
CLEAR:gs_wa,gv_str1,gv_str2.
SPLIT gs_dummy AT gc_y INTO: gv_str1 gv_str2, TABLE gt_itab.
ENDIF.
Reading the second string to get the supplier number.
READ TABLE gt_itab INTO gs_wa INDEX gc_two_num.
IF sy-subrc EQ gc_zero_num.
gs_header-lifnr = gs_wa.
ENDIF.
Conversion for Supplier Number.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_header-lifnr
IMPORTING
output = gs_header-lifnr.
APPEND gs_header TO gt_header.
CLEAR: gs_header,gt_itab[].
Regards
Kannaiah
‎2007 May 11 9:03 AM
chk this
REPORT ABC MESSAGE-ID ZZ.
DATA : V_STR(10) VALUE '4-2-1'.
DATA : BEGIN OF ITAB OCCURS 0,
F1(5),
END OF ITAB.
DATA : BEGIN OF ITAB1 OCCURS 0,
F2 TYPE I,
END OF ITAB1.
DATA : BEGIN OF ITAB3 OCCURS 0,
F3 TYPE I,
END OF ITAB3.
SPLIT V_STR AT '-' INTO TABLE ITAB.
LOOP AT ITAB.
ITAB1-F2 = ITAB-F1.
APPEND ITAB1.
CLEAR ITAB1.
ENDLOOP.
LOOP AT ITAB1.
READ TABLE ITAB3 INDEX ITAB1-F2.
ENDLOOP.
‎2007 May 11 9:03 AM
‎2007 May 11 9:06 AM
move itab-field to <b>integer_variable.</b>
READ t_tab INTO ... INDEX <b>integer_variable</b>.
Regards,
Sooness.
‎2007 May 11 9:10 AM
Hi,
The following code does not dump.
DATA itab TYPE TABLE OF n WITH HEADER LINE.
SPLIT '4-1-2' AT '-' INTO TABLE itab.
DATA : sflight TYPE STANDARD TABLE OF sflight.
SELECT * FROM sflight INTO TABLE sflight.
LOOP at itab.
READ TABLE sflight INDEX itab TRANSPORTING NO FIELDS.
ENDLOOP.
Hope this helps.
You just need to make your internal table of TYPE N.
Message was edited by:
Shailesh Velaparambil
‎2007 May 11 9:12 AM
Hi celmens,
Presently it is giving dump bcoz u r give INDEX itab. here u have to give sy-index like field.
secondly, u can conver char to i using :
1. write char_var to int_var.
2. int_var = char_var.
Jogdand M B