‎2006 Aug 04 11:29 AM
Hello,
in my program i can't fill and send contents of my internal table. my code looks like this:
...
TABLES:
MKPF,
MSEG.
TYPES: BEGIN OF ST_2,
F_1 LIKE MKPF-MANDT, " For MKPF~MANDT,
F_2 LIKE MKPF-MBLNR, " For MKPF~MBLNR,
etc
F_18 LIKE MSEG-ZEILE, " For MSEG~ZEILE,
F_19 LIKE MSEG-LINE_ID, " For MSEG~LINE_ID,
etc
END OF ST_2.
DATA: it_1 TYPE TABLE OF ST_2,
wa_it LIKE LINE OF it_1.
FORM get_data.
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
INTO wa_it
FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
ENDSELECT.
so, where should i put:
INSERT wa_it INTO TABLE it_1.
CLEAR wa_it.
to append my internal table with data?
please help me!!!!
‎2006 Aug 04 11:30 AM
only help to put that data to my internal table, later i'll figure how to send data...
pls!
hlp!
‎2006 Aug 04 11:31 AM
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
<b>INTO corresponding fields of table itaB</b>
FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPF~MANDT = MSEG~MANDT AND
MKPF~MBLNR = MSEG~MBLNR AND
MKPF~MJAHR = MSEG~MJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').so ITAB contains all the which meets the requiment.
regards
prabhu
‎2006 Aug 04 11:32 AM
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
INTO<b> table it_1</b>
FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
Regards,
Naimesh
‎2006 Aug 04 11:33 AM
Hi,
i`ve made the necessary changes to your code :
SELECT MKPFMANDT MKPFMBLNR MSEGZEILE MSEGLINE_ID
INTO wa_it FROM MKPF AS MKPF INNER JOIN MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
<b>
append wa_it to it_it.
clear wa_it.</b>
ENDSELECT.
reward points if helpful.
Regards
‎2006 Aug 04 11:34 AM
Hi Maja,
Just put append itab from wa inbetween Select and Endselect statement.
No need of of Insert statement.
This would work.
Regards,
Prashanth
‎2006 Aug 04 11:41 AM
o.k.
1. try - when i put append between select and endselect nothing happens when i go to debugg mode...
my Table it_1 is Table[Initial]
2. try - when i put my it_table after INTO statement i get this error:
it_1 cannot be a table, a reference, a string, or contain any of these objects...
please help!
‎2006 Aug 04 11:34 AM
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
INTO wa_it
FROM MKPF INNER JOIN MSEG
<b>into table it_1</b>
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
‎2006 Aug 04 11:35 AM
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
<b>*INTO wa_it <--not required
into TABLE <ITAB_NAME> <-This will be added</b>
FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
<b>* ENDSELECT. <-- NOT REQURIED if you use INTO TABLE.</b>
‎2006 Aug 04 11:35 AM
Hi
Do it like this way
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
INTO table IT1
FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
‎2006 Aug 04 11:42 AM
SELECT
MKPF~MANDT
MKPF~MBLNR
*etc
MSEG~ZEILE
MSEG~LINE_ID
*etc
<b>*INTO wa_it <--THIS IS NOT REQUIRED
INTO TABLE <ITAB_NAME> <--ADD THIS</b>FROM
MKPF AS MKPF
INNER JOIN
MSEG AS MSEG
ON MKPFMANDT = MSEGMANDT AND
MKPFMBLNR = MSEGMBLNR AND
MKPFMJAHR = MSEGMJAHR
WHERE
MKPF~CPUDT >= '20060301' AND
MSEG~BUKRS = 'M' AND
MSEG~BWART IN ('601', '602').
<b>*ENDSELECT. <--this is not required if you use INTO TABLE</b>
‎2006 Aug 04 11:52 AM
o.k. i've done it like this:
INTO wa_it
*etc
*ENDSELECT
but in debugging, my table is first Initial and then it accepts good fields but still no data...
when i previously putted it into wa_it that one was filled with some acctual data..
pls help
‎2006 Aug 04 11:53 AM
hi,
i have my perform statement, code is too big to post it all... so.
‎2006 Aug 04 11:55 AM
hey,
if you use JUST WA_IT , then you should use ENDSELECT & BEFORE THAT USE append WA_IT into ITAB.
select...
into WA_IT
...
WHERE ....
APPEND WA_IT INTO ITAB.
ENDSELECT.
Regards
srikanth
‎2006 Aug 04 11:45 AM
hi,
i found two points in your code,
1. where is the perform statement, without perform statement the form..will not work,use perform get_data.
2. check the data in the table,using sy-dbcnt,
if sy-dbcnt is initial.
message i121(zxxx).
endif.
regards,
kcc