Posted: Wed Feb 20, 2008 2:48 pm Post subject: Как прочитать данные из Append-структуры
У меня к таблице KNMT подвешен Append с несколькими полями.
Я в программе ищу записи по JOIN с табл. MARA, в кторой тоже есть Append с полем ZZPLUTAR.
Создал структуру:
Code:
TYPES: BEGIN OF wa_struct,
matnr TYPE knmt-matnr,
kunnr TYPE knmt-kunnr,
kdplu TYPE knmt-zzkdplu,
etknr TYPE knmt-zzkdetnr,
mhd TYPE knmt-zzkdmhd,
tar TYPE mara-zzplutar,
END OF wa_struct.
DATA: wa_tab TYPE STANDARD TABLE OF wa_struct.
DATA: wa TYPE wa_struct.
Потом я делаю SELECT и вывожу таблицу на экран:
Code:
SELECT DISTINCT
knmt~matnr knmt~kunnr knmt~zzkdplu knmt~zzkdetnr knmt~zzkdmhd mara~zzzplutar
INTO CORRESPONDING FIELDS OF TABLE wa_tab
FROM knmt INNER JOIN mara ON knmt~matnr = mara~matnr
WHERE knmt~kunnr IN sl_kunnr
AND knmt~matnr IN sl_matnr
AND knmt~vkorg = p_vkorg
AND knmt~vtweg = p_vtweg.
Но все поля, которые принадлежат Append пустые (данные есть - это проверено). Как мне получить данные?
Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Wed Feb 20, 2008 3:11 pm Post subject:
Либо переименуйте в своей структурке tar в zzplutar, либо:
Code:
SELECT DISTINCT
knmt~matnr knmt~kunnr knmt~zzkdplu knmt~zzkdetnr knmt~zzkdmhd mara~zzplutar as tar
INTO CORRESPONDING FIELDS OF TABLE wa_tab
FROM knmt INNER JOIN mara ON knmt~matnr = mara~matnr
WHERE knmt~kunnr IN sl_kunnr
AND knmt~matnr IN sl_matnr
AND knmt~vkorg = p_vkorg
AND knmt~vtweg = p_vtweg.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.