interne Tabelle von 13 DB Tabellen auslesen


Getting started ... Alles für einen gelungenen Start.

Moderatoren: Jan, Steff

interne Tabelle von 13 DB Tabellen auslesen

Beitragvon oyosh » 11.08.2012, 19:26

Hallo,
könnt ihr mir sagen, wie ich meine interne tabelle auslesen soll.
Ich habe die Struktur definiert aber weiss leider nicht wie es weiter gehen soll.

Ich würde mich über euren Antworten freuen .

Danke oyosh
__________________________________________________________________________________________
*&---------------------------------------------------------------------*
*& Report ZECATT_EXTRACTOR
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZECATT_EXTRACTOR.
TABLES: mara, marc, mard,mvke,mlgn,t002,makt,marm,mlan,mbew,mprp,mlgt,t134.

TYPES:BEGIN OF ty_generic_material,
variant(100) TYPE c,
description(100) TYPE c,

X_IMPORT type flag,
I_DATASET(3) TYPE c,
I_PSTAT like mara-pstat,

X_ENTRY_DATA type flag,
I_MATNR like mara-matnr,
I_MBRSH like mara-mbrsh,
I_MTART like mara-mtart,
*I_MTART LIKE t134-mtart,
I_REF_MATNR type ref_matnr,

X_ORG_DATA type flag,
I_WERKS like marc-werks,
I_LGORT like mard-lgort,
I_VKORG LIKE mvke-vkorg,
I_VTWEG LIKE mvke-vtweg,
I_LGNUM LIKE mlgn-lgnum,

X_BASIC_DATA_I type flag,
I_SPRAS_01 LIKE t002-laiso,
I_MAKTX_01 LIKE makt-maktx,
I_MEINS LIKE mara-meins,
I_MATKL LIKE mara-matkl,
I_PRDHA LIKE mara-prdha,
I_LABOR LIKE mara-labor,
I_BRGEW LIKE mara-brgew,
I_SPART LIKE mara-spart,
I_EXTWG like mara-extwg,
I_NTGEW LIKE mara-ntgew,
I_GEWEI LIKE mara-gewei,
I_VOLUM LIKE mara-volum,
I_VOLEH LIKE Mara-voleh,
I_MTPOS_MARA LIKE mara-mtpos_mara,
I_MTPOS like MVKE-mtpos,
I_GROES LIKE mara-groes,
I_MAGRV LIKE mara-magrv,
I_NUMTP LIKE mara-numtp,
I_EAN11 LIKE mara-ean11,
I_MSTAE LIKE mara-mstae,
I_BISMT LIKE mara-bismt,
I_RMATP LIKE mara-rmatp,

X_BASIC_DATA_II type flag,
I_KZKFG LIKE mara-kzkfg,

X_ADD_DATA type flag,
I_SPRAS_02 LIKE t002-laiso,
I_MAKTX_02 LIKE makt-maktx,
I_SPRAS_03 LIKE t002-laiso,
I_MAKTX_03 LIKE makt-maktx,
I_LAENG_01 like mara-laeng,
I_BREIT_01 like mara-breit,
I_HOEHE_01 LIKE mara-hoehe,
I_MEABM_01 like mara-meabm,
I_MEINH_02 LIKE marm-meinh,
I_UMREN_02 LIKE marm-umren,
I_UMREZ_02 LIKE marm-umrez,
I_EAN11_02 LIKE mara-ean11,
I_NUMTP_02 like mara-numtp,
I_LAENG_02 LIKE mara-laeng,
I_BREIT_02 LIKE mara-breit,
I_HOEHE_02 LIKE mara-hoehe,
I_MEABM_02 LIKE mara-meabm,
I_VOLEH_02 LIKE mara-voleh,
I_VOLUM_02 like mara-volum,
I_BRGEW_02 LIKE mara-brgew,
I_NTGEW_02 LIKE mara-ntgew,
I_GEWEI_02 LIKE mara-gewei,
I_MEINH_03 LIKE marm-meinh,
I_UMREN_03 LIKE marm-umren,
I_UMREZ_03 LIKE marm-umrez,
I_EAN11_03 LIKE mara-ean11,
I_NUMTP_03 LIKE mara-numtp,
I_LAENG_03 LIKE mara-laeng,
I_BREIT_03 LIKE mara-breit,
I_HOEHE_03 LIKE mara-hoehe,
I_MEABM_03 LIKE mara-meabm,
I_VOLUM_03 LIKE mara-volum,
I_VOLEH_03 LIKE mara-voleh,
I_BRGEW_03 LIKE mara-brgew,
I_NTGEW_03 LIKE mara-ntgew,
I_GEWEI_03 LIKE mara-gewei,
I_MEINH_04 LIKE marm-meinh,
I_UMREN_04 LIKE marm-umren,
I_UMREZ_04 LIKE marm-umrez,
I_EAN11_04 LIKE mara-ean11,
I_NUMTP_04 LIKE mara-numtp,
I_LAENG_04 LIKE mara-laeng,
I_BREIT_04 LIKE mara-breit,
I_HOEHE_04 LIKE mara-hoehe,
I_MEABM_04 LIKE mara-meabm,
I_VOLUM_04 LIKE mara-volum,
I_VOLEH_04 LIKE mara-voleh,
I_BRGEW_04 LIKE mara-brgew,
I_NTGEW_04 LIKE mara-ntgew,
I_GEWEI_04 LIKE mara-gewei,
I_MEINH_05 LIKE marm-meinh,
I_UMREN_05 LIKE marm-umren,
I_UMREZ_05 LIKE marm-umrez,
I_EAN11_05 LIKE mara-ean11,
I_NUMTP_05 LIKE mara-numtp,
I_LAENG_05 LIKE mara-laeng,
I_BREIT_05 LIKE mara-breit,
I_HOEHE_05 LIKE mara-hoehe,
I_MEABM_05 like mara-meabm,
I_VOLUM_05 like mara-volum,
I_VOLEH_05 like mara-voleh,
I_BRGEW_05 like mara-brgew,
I_NTGEW_05 like mara-ntgew,
I_GEWEI_05 like mara-gewei,

X_SALES_I type flag,
I_DWERK like mvke-dwerk,
I_TAXM1 like mlan-taxm1,
I_TAXM2 like mlan-taxm2,
I_TAXM3 like mlan-taxm3,
I_TAXM4 like mlan-taxm4,
I_TAXM5 like mlan-taxm5,
I_TAXM6 like mlan-taxm6,
I_VRKME like mvke-vrkme,
I_SKTOF like mvke-sktof,
I_MSTAV like mara-mstav,
I_VMSTA like mvke-vmsta,
I_SCMNG like mvke-scmng,
I_MSTDV like mara-mstdv,
I_VMSTD like mvke-vmstd,

X_SALES_II type flag,
I_KTGRM like mvke-ktgrm,
I_VERSG like mvke-versg,
I_KONDM like mvke-kondm,
I_BONUS like mvke-bonus,
I_PRODH like mvke-prodh,
I_PROVG like mvke-provg,
I_PMATN like mvke-pmatn,

X_SALES_GEN Type flag,
I_MTVFP like marc-mtvfp,
I_XGCHP like mara-xgchp,
I_TRAGR like mara-tragr,
I_LADGR like marc-ladgr,
I_VHART like mara-vhart,
I_ERGEW like mara-ergew,
I_ERGEI like mara-ergei,
I_ERVOL like mara-ervol,
I_ERVOE like mara-ervoe,

X_FOREIGN_TRADE Type FLAG,
I_STAWN like marc-stawn,
I_HERKR like marc-herkr,
I_HERKL like marc-herkl,
I_MTVER like marc-mtver,

X_CLASSIFICATION Type flag,
I_KLART type klassenart,
I_CLASS type klasse_d,
I_KLART_ALT type klassenart,

X_PURCHASING type flag,
I_EKGRP like marc-ekgrp,
I_MMSTA like marc-mmsta,
I_MMSTD like marc-mmstd,
I_TAXIM like mlan-taxim,
I_NRFHG like mara-nrfhg,
I_MFRGR like mara-mfrgr,
I_KAUTB like marc-kautb,
I_XCHPF like marc-xchpf,
I_EKWSL like mara-ekwsl,
I_WEBAZ like marc-webaz,
I_INSMK like marc-insmk,
I_KZKRI like marc-kzkri,
I_USEQU like marc-usequ,
I_KORDB like marc-kordb,
I_FABKZ like marc-fabkz,
I_BSTME like mara-bstme,
I_VABME like mara-vabme,

X_PURCH_DIMP type flag,
I_MPROF like mara-mprof,
I_MFRPN like mara-mfrpn,
I_MFRNR like mara-mfrnr,

X_MRP_I type flag,
I_MAABC like marc-maabc,
I_DISGR like marc-disgr,
I_DISMM like marc-dismm,
I_MINBE like marc-minbe,
I_FXHOR like marc-fxhor,
I_LFRHY like marc-lfrhy,
I_DISLS like marc-disls,
I_DISPO like marc-dispo,
I_BSTMI like marc-bstmi,
I_BSTMA like marc-bstma,
I_BSTFE like marc-bstfe,
I_MABST like marc-mabst,
I_LAGPR like marc-lagpr,
I_TAKZT like marc-takzt,
I_RDPRF like marc-rdprf,
I_BSTRF like marc-bstrf,
I_AUSSS like marc-ausss,

X_MRP_II type flag,
I_BESKZ like marc-beskz,
I_SCHGT like marc-schgt,
I_KZECH like marc-kzech,
I_KZKUP like marc-kzkup,
I_SOBSL like marc-sobsl,
I_DZEIT like marc-dzeit,
I_RGEKZ like marc-rgekz,
I_PLIFZ like marc-plifz,
I_MRPPP like marc-mrppp,
I_FHORI like marc-fhori,
I_EISBE like marc-eisbe,
I_LGRAD like marc-lgrad,
I_RWPRO like marc-rwpro,
I_SHFLG like marc-shflg,
I_SHZET like marc-shzet,
I_SHPRO like marc-shpro,
I_LGFSB like marc-lgfsb,

X_MRP_III type flag,
I_PERKZ like marc-perkz,
I_PERIV like marc-periv,
I_STRGR like marc-strgr,
I_AUFTL like marc-auftl,
I_VINT1 like marc-vint1,
I_VRMOD like marc-vrmod,
I_VINT2 like marc-vint2,
I_MISKZ like marc-miskz,
I_PRGRP like mvgd-prgrp,
I_PRWRK like mvgd-prwrk,
I_WZEIT like marc-wzeit,

X_MRP_IV type flag,
I_SBDKZ like marc-sbdkz,
I_ALTSL like marc-altsl,
I_PPC_PROFILE_NAME type profil,
I_LGPRO like marc-lgpro,
I_LOSFX like marc-losfx,
I_MDACH like marc-mdach,
I_SAUFT like marc-sauft,
I_SFEPR like marc-sfepr,
I_KAUSF like marc-kausf,
I_DISKZ like mard-diskz,

X_WORK_SCHED type flag,
I_FRTME like marc-frtme,
I_RUEZT like marc-ruezt,
I_BEARZ like marc-bearz,
I_TRANZ like marc-tranz,
I_AUSME like marc-ausme,
I_BASMG like marc-basmg,
I_CO_PRODPRF like marc-sfcpf,
I_FEVOR like marc-fevor,
I_UEETK like marc-ueetk,
I_VERKZ like marc-verkz,
I_UNETO like marc-uneto,
I_MATGR like marc-matgr,
I_OCMPF like marc-ocmpf,
I_UEETO like marc-ueeto,

X_QM type flag,
I_RBNRM type rbnr,
I_QMPUR type qmpur,
I_SSQSS type ssqss,
I_QZGTP type qzgtyp,

X_ACCOUNTING_I type flag,
I_BWTTY like mbew-bwtty,
I_BKLAS like mbew-bklas,
I_VPRSV like mbew-vprsv,
I_PEINH like mbew-peinh,
I_VERPR like mbew-verpr,
I_STPRS like mbew-stprs,

X_ACCOUNTING_II type flag,
X_COSTING type flag,
I_NCOST like marc-ncost,
I_EKALR like mbew-ekalr,
I_HKMAT like mbew-hkmat,
I_LOSGR like marc-losgr,
I_AWSLS like marc-awsls,
I_FXPRU like marc-fxpru,
I_KOSGR like mbew-kosgr,
I_HRKFT like mbew-hrkft,
I_SOBSK like marc-sobsk,
I_EKLAS like mbew-eklas,

X_FORECAST type flag,
I_PROPR like mprp-propr,
I_PRMOD like mprp-prmod,
I_AUTRU like marc-autru,
I_MODAW like mprp-modaw,
I_PERAN like mprp-peran,
I_ANZPR like mprp-anzpr,
I_PERIN like mprp-perin,
I_FIMON like mprp-fimon,
I_MODAV like mprp-modav,
I_SIGGR like mprp-siggr,

X_STORAGE_I type flag,
I_LGPBE like mard-lgpbe,
I_LWMKB like mard-lwmkb,
I_TEMPB like mara-tempb,
I_RAUBE like mara-raube,
I_BEHVO like mara-behvo,
I_STOFF like mara-stoff,
I_ABCIN like marc-abcin,
I_WESCH like mara-wesch,
I_ETIAR like mara-etiar,
I_ETIFO like mara-etifo,
I_MAXLZ like marc-maxlz,
I_LZEIH like marc-lzeih,
I_MHDRZ like mara-mhdrz,
I_MHDHB like mara-mhdhb,
I_IPRKZ like mara-iprkz,
I_RDMHD like mara-rdmhd,
I_MHDLP like mara-mhdlp,
I_UCHKZ like marc-uchkz,
I_UCMAT like marc-ucmat,

X_STORAGE_II type flag,
I_LOGGR like marc-loggr,
I_SERNP like marc-sernp,
I_SERLV like mara-serlv,
I_FPRFM like marc-fprfm,
I_PRCTR like marc-prctr,
I_EPRIO like marc-eprio,

X_WAREHOUSE type flag,
I_LGTYP like mlgt-lgtyp,
I_LTKZA like mlgn-ltkza,
I_LTKZE like mlgn-ltkze,
I_LGBKZ like mlgn-lgbkz,
I_L2SKR like mlgn-l2skr,
I_BLOCK like mlgn-block,
I_BSSKZ like mlgn-bsskz,
I_VOMEM like mlgn-vomem,
I_PLKPT like mlgn-plkpt,
I_MKAPV like mlgn-mkapv,
I_LVSME like mlgn-lvsme,
I_KZZUL like mlgn-kzzul,
I_KZMBF like mlgn-kzmbf,
I_BEZME like mlgn-bezme,
I_LHMG1 like mlgn-lhmg1,
I_LHME1 like mlgn-lhme1,
I_LETY1 like mlgn-lety1,
I_LHMG2 like mlgn-lhmg2,
I_LHME2 like mlgn-lhme2,
I_LETY2 like mlgn-lety2,
I_LHME3 like mlgn-lhme3,
I_LHMG3 like mlgn-lhmg3,
I_LETY3 like mlgn-lety3,

X_LOCAL type flag,
V_MAKTX like makt-maktx,
V_TAX_COUNT(2) type i,
V_ADD_WERKS type flag,
V_ERNAM like mara-ernam,
V_MATNR like mara-matnr,
V_PSTAT like mara-pstat,
V_DIMP type flag,
V_ECC_DIMP type flag,
V_COMPONENT type dlvunit,
V_LANGUAGE(2) type c,
V_FDPOS type mara-pstat,
V_VIEW_TEXT(50) type c,
V_MTPOS like mvke-mtpos,
V_SUBRC type subrc,
V_ERP_DIMP type flag,
V_PSTAT_MM02 like mara-pstat,
V_FLG_SALES type flag,
V_FLG_WM type flag,
V_FLG_QM type flag,
V_FLG_STORAGE type flag,
V_FLG_BASIC type flag,
V_FLG_COSTING type flag,
V_FLG_PROD_RES type flag,
V_FLG_FORECAST type flag,
V_FLG_PURCH type flag,
V_FLG_MRP type flag,
V_FLG_CLASS type flag,
V_FLG_ACCOUNTING type flag,
V_FLG_WORK_SCHED type flag,
V_MARD_PSTAT like mard-pstat,
V_MAT_EXISTS type flag,
V_FLG_SALES_MM02 type flag,
V_FLG_WM_MM02 type flag,
V_FLG_QM_MM02 type flag,
V_FLG_STORAGE_MM02 type flag,
V_FLG_BASIC_MM02 type flag,
V_FLG_COSTING_MM02 type flag,
V_FLG_PROD_RES_MM02 type flag,
V_FLG_FORECAST_MM02 type flag,
V_FLG_PURCH_MM02 type flag,
V_FLG_MRP_MM02 type flag,
V_FLG_CLASS_MM02 type flag,
V_FLG_ACCOUNTING_MM02 type flag,
V_FLG_WORK_SCHED_MM02 type flag,
V_MHDHB like mara-mhdhb,
V_MHDRZ like mara-mhdrz,
V_MTART like mara-mtart,
V_XCHPF like mara-xchpf,
V_QMPUR like mara-qmpur,
V_HERKL like mara-herkl,
V_HERKR like marc-herkr,
V_MTVFP like marc-mtvfp,
V_LADGR like marc-ladgr,
V_TRAGR like mara-tragr,
V_TAXKM type taxkm,
V_FLREF like t134-flref,
V_MBRSH like mara-mbrsh,

X_EXPORT type flag,
E_ERROR type flag,
E_MATNR like mara-matnr,

END OF ty_generic_material.
TYPES: ty_tab_generic_material TYPE TABLE OF ty_generic_material.


DATA: gt_tab_generic_material TYPE ty_tab_generic_material,
gs_generic_material TYPE ty_generic_material.


START-OF-SELECTION.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_tab_generic_material FROM ((((((((((
mara INNER JOIN marc on
marc~matnr = mara~matnr)
INNER JOIN mard on mard~matnr = marc~matnr
AND mard~werks = marc~werks)
INNER JOIN mvke on mvke~matnr = mard~matnr)
INNER JOIN mlan on mlan~matnr = mvke~matnr)
INNER JOIN marm on marm~matnr = mlan~matnr)
INNER JOIN mlgn on mlgn~matnr = marm~matnr)
INNER JOIN mbew on mbew~matnr = mlgn~matnr
AND mbew~bwkey = marc~werks)
INNER JOIN mlgt on mlgt~matnr = mbew~matnr)
INNER JOIN t134 on t134~mtart = mara~mtart)
INNER JOIN makt on makt~matnr = mlgt~matnr)
INNER JOIN t002 on t002~spras = makt~spras).

* WHERE mara~matnr = gs_generic_material-i_matnr.


CLEAR gt_tab_generic_material.
LOOP AT gt_tab_generic_material INTO gs_generic_material.
ENDLOOP.
oyosh
ForumUser
 
Beiträge: 2
Registriert: 11.08.2012, 19:22
Dank erhalten: 0 mal
Ich bin: Personalberater/in

Sponsor

Alte ABAP-Entwicklerweisheit: Weißt du weder aus noch ein, baust du einen BADI ein

Re: interne Tabelle von 13 DB Tabellen auslesen

Beitragvon a-dead-trousers » 13.08.2012, 08:17

oyosh hat geschrieben:könnt ihr mir sagen, wie ich meine interne tabelle auslesen soll.
Ich habe die Struktur definiert aber weiss leider nicht wie es weiter gehen soll.

Tja, ähm... hmm...
Leider kann dir hier, glaub ich, niemand sagen wie es weiter gehen soll, da wir die Aufgabenstellung die diesem Programm zugrunde liegt nicht kennen.
Du musst schon sagen was das Programm bewirken soll, damit wir dir helfen können.

Der Code den du bislang gepostest hast scheint syntaktisch in Ordnung zu sein, wobei ich aber vermute, dass du kein Ergebnis zurückbekommen wirst.
Bei INTO CORRESPONDING FIELDS müssen die Feldnamen der Struktur gleich lauten wie auf der Datenbank. Deine haben aber immer ein I_ vorangestellt und damit wird es wahrscheinlich nicht funktionieren.

lg ADT
Theory is when you know something, but it doesn't work.
Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.

ECC: 6.05
Basis: 7.02
a-dead-trousers
Top Expert
 
Beiträge: 1816
Registriert: 07.02.2011, 13:40
Dank erhalten: 362 mal
Ich bin: Entwickler/in


Zurück zu ABAP® für Anfänger

  Aktuelle Beiträge   
FUBA READ_TEXT
Gestern von ralf.wenzel 1 Antw.
gelöst Löschen aus interner Tabelle
Gestern von Beginner014 14 Antw.
gelöst Funktionstasten im ALV Grid
vor 2 Tagen von a-dead-trousers 1 Antw.
VPN-Verbindungsprobleme mit SAPGUI
Gestern von ewx 8 Antw.
F1-Hilfe funktioniert nicht
Gestern von Dele 5 Antw.

  Ähnliche Beiträge beta
Interne Tabelle mit eingeschränkter wa auslesen
05.06.2008, 11:26 von pohlmann-schwarza 4 Antw.
Interne Tabelle auslesen und als .txt abspeichern
09.08.2012, 09:58 von merk86 4 Antw.
Übergabe und Auslesen von Tabellen
04.12.2003, 17:39 von Azreal 4 Antw.
interne tabellen
30.07.2004, 09:50 von LordDeath 3 Antw.
Interne Tabellen mit Key
13.10.2004, 12:47 von Nicole 4 Antw.

 

Wer ist online?

Mitglieder in diesem Forum: Exabot [Bot]

Feedback ...?

Was können wir verbessern? Hinterlasse deine Kontaktdaten, wenn du eine direkte Antwort möchtest.

... Absenden!
cron