Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with Internal Table Entry

Former Member
0 Likes
711

Hi Experts

I have the following SELECT Query.

Before change, in the WHERE Clause itself, I had the comparison for Date Range (see the commented lines). Now, I tried to separate the Date comparison and make to delete unnecessary entries in that date range outside the SELECT Query!

But the error shown is:No component exists in t_vbap with the name "ERDAT". But in query, I fetched that field also into t_vbap (see w~erdat).

select    w~mandt
                w~vbeln  w~posnr  w~meins w~matnr w~werks  w~netwr
                w~kwmeng w~vrkme  w~matwa  w~charg w~pstyv
                w~posar  w~prodh  w~grkor  w~antlf  w~kztlf w~lprio
                w~vstel  w~route  w~umvkz  w~umvkn  w~abgru w~untto
                w~awahr  w~erdat  w~erzet  w~fixmg  w~prctr  w~vpmat
                w~vpwrk  w~mvgr1  w~mvgr2  w~mvgr3  w~mvgr4  w~mvgr5
                                           w~bedae w~cuobj w~mtvfp
                x~etenr x~wmeng x~bmeng   x~ettyp  x~wepos  x~abart
                                                            x~edatu
                x~tddat x~mbdat   x~lddat  x~wadat  x~abruf x~etart
                x~ezeit
                into table t_vbap
               from  vbap as w
                       inner join vbep as x on x~vbeln = w~vbeln and
                                               x~posnr = w~posnr and
                                               x~mandt = w~mandt
         for all entries in t_vbak1
         where
                       w~vbeln = t_vbak1-vbeln and
*            ( ( ( erdat > pre_dat  and  erdat < p_syndt ) or
*            ( erdat = p_syndt and erzet <= p_syntm ) ) ) and
                       w~matnr in s_matnr and
                       w~pstyv in s_itmcat and
                       w~lfrel in s_lfrel and
                       w~abgru = '  ' and
                       w~mtvfp in w_mtvfp  and
                       x~ettyp in w_ettyp  and
                       x~bdart in s_req_tp and
                       x~plart in s_pln_tp and
                       x~etart in s_etart and
                       x~abart in s_abart and
                       ( ( x~lifsp in s_lifsp ) or ( x~lifsp = ' ' ) ).

DELETE t_vbap where ( ( erdat LE pre_dat and erdat GE p_syndt ) or ( erdat NE
p_syndt and erzet GT p_syntm ) ).

Plz suggest!

Santo

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
465

hi,

if you have not defined ERDAT in t_vbap, then it will show an error. add erdat in the internal table definition.

regards,

madhumitha

2 REPLIES 2
Read only

Former Member
0 Likes
465

Hi,

I don´t know how you t_vbap is defined but try it with:

DELETE t_vbap where ( ( werdat LE pre_dat and werdat GE p_syndt ) or ( w~erdat NE

p_syndt and erzet GT p_syntm ) ).

regards

Nicole

Read only

Former Member
0 Likes
466

hi,

if you have not defined ERDAT in t_vbap, then it will show an error. add erdat in the internal table definition.

regards,

madhumitha