SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Модификация внутренней таблицы



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
z01
Специалист
Специалист



Joined: 18 Jan 2008
Posts: 59

PostPosted: Mon Feb 18, 2008 4:32 pm    Post subject: Модификация внутренней таблицы Reply with quote

Здравствуйте.
Посмотрите, пожалуйста, почему не работает оператор MODIFY для внутренней таблицы?


Code:
DATA: BEGIN OF wa_table,
  vstel TYPE likp-vstel,
  route TYPE likp-route,
  vsbed TYPE likp-vsbed,
  inco1 TYPE likp-inco1,
  kunnr TYPE likp-kunnr,
  kunag TYPE likp-kunag,
  vbeln TYPE lips-vbeln,
  posnr TYPE lips-posnr,
  matnr TYPE lips-matnr,
  meins TYPE lips-meins,
  brgew TYPE lips-brgew,
  lgmng TYPE lips-lgmng,
  vgbel TYPE lips-vgbel,
  vgpos TYPE lips-vgpos,
      END OF wa_table.
DATA: it_table LIKE TABLE OF wa_table.
DATA: l_adrnr TYPE vbpa-adrnr.

SELECT
  k~vstel k~route k~vsbed k~inco1 k~kunnr k~kunag
  p~vbeln p~posnr p~matnr p~meins p~brgew p~lgmng
  p~vgbel p~vgpos
  INTO CORRESPONDING FIELDS OF TABLE it_table
  FROM likp AS k
  INNER JOIN lips AS p ON p~vbeln = k~vbeln
  WHERE k~vstel IN s_vstel
    AND k~wadat_ist IN s_wadat
    AND p~mtart IN s_mtart
    .

LOOP AT it_table INTO wa_table.
  SELECT SINGLE adrnr FROM vbpa INTO l_adrnr
    WHERE vbeln = wa_table-vgbel
      AND parvw = 'WE'.

  SELECT city1 region post_code1 INTO CORRESPONDING FIELDS OF wa_table
    FROM adrc WHERE
      addrnumber = l_adrnr.
  ENDSELECT.

  MODIFY TABLE it_table FROM wa_table.
ENDLOOP.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Mon Feb 18, 2008 4:38 pm    Post subject: Reply with quote

В wa_table нет нижеуказанных полей:
Code:
  SELECT city1 region post_code1 INTO CORRESPONDING FIELDS OF wa_table
    FROM adrc WHERE
      addrnumber = l_adrnr.
  ENDSELECT.
Back to top
View user's profile Send private message Blog
Lord
Профессионал
Профессионал



Joined: 10 Sep 2007
Posts: 168

PostPosted: Mon Feb 18, 2008 8:34 pm    Post subject: Re: Модификация внутренней таблицы Reply with quote

z01 wrote:
Code:
DATA: l_tabix TYPE sy-tabix.

LOOP AT it_table INTO wa_table.
  SELECT SINGLE adrnr FROM vbpa INTO l_adrnr
    WHERE vbeln = wa_table-vgbel
      AND parvw = 'WE'.
  l_tabix = sy-tabix

  SELECT city1 region post_code1 INTO CORRESPONDING FIELDS OF wa_table
    FROM adrc WHERE
      addrnumber = l_adrnr.
  ENDSELECT.

  MODIFY TABLE it_table FROM wa_table INDEX l_tabix.
ENDLOOP.


Похоже к тому, что сказал John Doe, нужно сохранять sy-tabix.
Back to top
View user's profile Send private message
dr.killer
Участник
Участник



Joined: 31 Oct 2007
Posts: 24
Location: 4.7, ECC 6.0

PostPosted: Tue Feb 19, 2008 12:20 am    Post subject: Reply with quote

z01, попробуй оптимизировать свою конструкцию.
Почитай про "FOR ALL ENTRIES IN" и "MODIFY itab FROM TABLE"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.