2008 Jun 12 4:00 PM
CAN ANY ONE TELL ME THIS SIMPLE SELECT STATEMENT NOT WORKING PLEASE
DATA IS NOT COMING
TYPES: BEGIN OF TY_ITAB,
F(3) TYPE C,
F1(8) TYPE N,
F2(8) TYPE N,
F3(10) TYPE C,
F4(2) TYPE C,
F5(5) TYPE C,
F6 TYPE zvbill-RATEMULTIPLE,
F7 TYPE zvbill-RATEDIVISOR,
F8(22) TYPE C,
F9(30) TYPE C,
F10 TYPE zvbill-BILLAMOUNT,
F11(30) TYPE C,
F12 TYPE D,
F13(5) TYPE C,
F14(15) TYPE C,
F15(4) TYPE C,
F16(4) TYPE C,
F17 TYPE C,
F18 TYPE D,
END OF TY_ITAB.
DATA: IT_ITAB1 TYPE TY_ITAB OCCURS 1 WITH HEADER LINE.
START-OF-SELECTION.
select SINGLE KUNNR from KNA1 into it_itab1 where KUNNR = '0000020001'.
write:/ it_itab1-f3.
-
in kna1 table 20001 data is there
Edited by: SRI ABAPER on Jun 12, 2008 5:00 PM
2008 Jun 12 4:01 PM
declare your internal table as
TYPES: BEGIN OF TY_ITAB,
KUNNR like KNA1-KUNNR,
F(3) TYPE C,
F1(8) TYPE N,
F2(8) TYPE N,
F3(10) TYPE C,
F4(2) TYPE C,
F5(5) TYPE C,
F6 TYPE zvbill-RATEMULTIPLE,
F7 TYPE zvbill-RATEDIVISOR,
F8(22) TYPE C,
F9(30) TYPE C,
F10 TYPE zvbill-BILLAMOUNT,
F11(30) TYPE C,
F12 TYPE D,
F13(5) TYPE C,
F14(15) TYPE C,
F15(4) TYPE C,
F16(4) TYPE C,
F17 TYPE C,
F18 TYPE D,
END OF TY_ITAB.
2008 Jun 12 4:01 PM
declare your internal table as
TYPES: BEGIN OF TY_ITAB,
KUNNR like KNA1-KUNNR,
F(3) TYPE C,
F1(8) TYPE N,
F2(8) TYPE N,
F3(10) TYPE C,
F4(2) TYPE C,
F5(5) TYPE C,
F6 TYPE zvbill-RATEMULTIPLE,
F7 TYPE zvbill-RATEDIVISOR,
F8(22) TYPE C,
F9(30) TYPE C,
F10 TYPE zvbill-BILLAMOUNT,
F11(30) TYPE C,
F12 TYPE D,
F13(5) TYPE C,
F14(15) TYPE C,
F15(4) TYPE C,
F16(4) TYPE C,
F17 TYPE C,
F18 TYPE D,
END OF TY_ITAB.
2008 Jun 12 4:02 PM
Hello.
Insert kunnr in your type definition, and use a work area:
DATA: ti_itab TYPE STABDARD TABLE OF ty_itab,
wa_itab TYPE ty_itab.
START-OF-SELECTION.
SELECT SINGLE kunnr FROM kna1
INTO wa_itab-kunnr
WHERE kunnr = '0000020001'.
Regards.
Valter Oliveira.
2008 Jun 12 4:03 PM
Because your select is taking only one field, (KUNNR) and as you have it written, it will try to put it in your first field which is defined as Character for a length of 3. KUNNR is 10
2008 Jun 12 4:04 PM
haha that made me laugh
First you are selecting a single field, and using select single, the best way to do that is just use a variable of the same type kna1-kunnr.
I don't know what that select might do, it probably goes to the fields f and f1 of the header line because kunnr is large.
Then, you are trying to write f3, that is obviously empty
2008 Jun 12 4:09 PM
hi experts
i want to fill the internal table data to one ztable
z table structure is same like the internal table
thats why i declared like that
2008 Jun 12 4:14 PM
Are you new into abap?
I have seen your questions and sorry but you have it all wrong. And that style of programing you use can be really dangerous.
If you are working in a real requirement my advice is that you need to find real life help
2008 Jun 12 4:16 PM
no i am just trying
i have deleted some lines and only important things i have mentioned
2008 Jun 12 4:13 PM
Hi,
TYPES: BEGIN OF TY_ITAB,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
END OF TY_ITAB.
DATA:
IT_ITAB1 TYPE TY_ITAB OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SELECT SINGLE *
FROM KNA1
INTO CORRESPONDING FIELDS OF IT_ITAB1
WHERE KUNNR = '0000020001'.
WRITE:/ IT_ITAB1.Regards
Adil