2008 Mar 24 6:52 AM
hi
I created a zee table with some fields from vbak, some fields from vbap and somr fields from kna1.
how to get the data to that zee table?
hi
I created a zee table with some fields from vbak, some fields from vbap and somr fields from kna1.
how to get the data to that zee table?
2008 Mar 24 7:00 AM
Hi Jyotsna,
Populate the data for all fields in to an internal table using select queries and use *INSERT/MODIFY statement to insert the data in to the table.
DATA: i_ztab TYPE STANDARD TABLE OF ztable,
wa_ztable TYPE ztable.
U acn use either joins or individual selects to get the data from the tables.
SELECT ....FROM VBAK WHERE....
SELECT...FROM VBAP WHERE....
SELECT .... FROM KNA1 WHERE....
LOOP AT VBAP.
Populoate i_ztable internal table.
ENDLOOP.
SORT i_ztable BY key fields(SPECIFY KEY FIELDS).
DELETE ADJACENT DUPLICATES FROM i_ztable COMPARING give key fields here.
CHECK NOT i_ztable[] IS INITIAL.
INSERT/MODIFY ztable FROM TABLE i_ztable.
CHECK sy-subrc IS INITIAL.
COMMIT WORK AND WAIT.
Thanks,
Vinod.
2008 Mar 24 7:07 AM
Hi,
You need to create the Table Maintainance Generator to create the entries in to your Z Table.
other wise choose the option ' Maintainance allowed ' under 'Delivery and Maintainance ' tab.
and then go to 'Utilities -> Table Contents -> Create entries'.
Kind Regards,
Ravi Sankar.Z
2008 Mar 24 7:19 AM
*********I am taking three tables .
data : itab type table of ztable,
wa like line of ztable.
SELECT ccarrname pconnid f~fldate
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( scarr AS c
INNER JOIN spfli AS p ON pcarrid = ccarrid
AND p~cityfrom = p_cityfr
AND p~cityto = p_cityto )
INNER JOIN sflight AS f ON fcarrid = pcarrid
AND fconnid = pconnid ).
loop at itab into wa.
insert INTO ztable values wa.
endloop.
**********You use VBAK , VBAP and KNA! instead of SCARR , SFLIGHT , SPFLI tables.