Application Development 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: 

Urgent, SELECT statement results in error

Former Member
0 Kudos

hi all, this is very urgent, could you guys have a look at my SELECT statement?


  SELECT vk~kunnr         "customer no
          vk~vbeln         "sales order no
          vk~audat         "date
          vk~vbtyp         "SD DOCUMENT CATEGORY
          vk~knumv         "lwk
          vp~kwmeng        "qty
          vp~matnr         "material no
          vp~posnr         "LINE ITEM
          vd~bstkd         "PURCHASE ORDER NO
*          kv~kwert         "lwk
          FROM  vbak AS vk
          INNER JOIN vbap AS vp
          ON vk~vbeln = vp~vbeln
          INNER JOIN vbkd AS vd
          ON vk~vbeln = vd~vbeln
*          INNER JOIN konv AS kv
*          ON kv~knumv = vk~knumv
          INTO CORRESPONDING FIELDS OF TABLE it_so
          WHERE vk~vkorg IN s_vkorg
          AND vk~audat IN s_date
          AND vk~kunnr IN s_kunnr
          AND vp~matnr IN s_matnr
          AND vd~bstkd IN s_bstkd
          AND vk~vbeln IN s_vbeln
*          AND kv~kschl = 'ZP00'
          AND vk~vbtyp = 'C'.

The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:


For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".

Is there a way i can go around it?

18 REPLIES 18

Former Member
0 Kudos

Hi,

For pooled tables, cluster tables, and project views,

JOIN is not allowed:

Select from that table and Use For all entries instead.

This is the only way to do it.

Regards,

GSR.

hymavathi_oruganti
Active Contributor
0 Kudos

u cant use join statements for pooled and cluster tables. instead split and use different selects

or use for all entries

abdul_hakim
Active Contributor
0 Kudos

Hi Loh,

You cannot use JOINs with cluster tables.

KONV is a cluster table.

Thanks,

Abdul Hakim

0 Kudos

Hi,

for your question answer is with you only..

regards

vijay

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try to use For All Entries instead of joins.

Former Member
0 Kudos

Hi bernad

For that you have to use Read Statement for getting data from the KNOV table.

<b>select * into table it_konv from konv.

sort it_konv by knumv.

loop at it_so.

read table it_knov with key knumv = it_so-knumv.

<get the contents of knumv>

endloop.</b>

regards

ksihore

0 Kudos

so how should i define it_konv?

since i have some conditions (KONV-KNUMV = IT_SO-KNUMV and KONV-KSCHL = 'ZP00'), where do i put them?

former_member188685
Active Contributor
0 Kudos

Hi Bernard,

Select the data from VBAK, VBAP using join, after that use for all entries and get the data from KONV, and KNUMV

finally loop the vbak, vbap and try to read the data which you got from KONV and KNUMV.

Regards

vijay

Former Member
0 Kudos

Hi , If u will use konv table in join it will give error as it is cluster table otherwise if will use transparent table it will work.

0 Kudos

Hi

this is the code

<b>select * into table it_konv from konv for all entries in it_sa where knumv = it_sa-knumv and KSCHL = 'ZP00'.

sort it_konv by knumv.

loop at it_so.

read table it_knov with key knumv = it_so-knumv.

<get the contents of knumv>

endloop.</b>

Message was edited by: Harikishore Sreenivasulu

0 Kudos

I've added the following statements and when i looked in debug mode, it looks like its working...the right values were retrieved...so how do i do a MOVE statement for the IT_KONV-KWERT values into IT_SO?


DATA: BEGIN OF IT_KONV OCCURS 0,
        KNUMV TYPE KONV-KNUMV,
        KWERT TYPE KONV-KWERT,
      END OF IT_KONV.

SELECT KNUMV KWERT
  FROM KONV
  INTO TABLE IT_KONV
  FOR ALL ENTRIES IN IT_SO
    WHERE KSCHL = 'ZP00' AND
          KNUMV = IT_SO-KNUMV.

  LOOP AT IT_SO.
    READ TABLE IT_KONV WITH TABLE KEY KNUMV = IT_SO-KNUMV.
  ENDLOOP.

0 Kudos

Hi bernard

LOOP AT IT_SO.

READ TABLE IT_KONV WITH TABLE KEY KNUMV = IT_SO-NUMV.

<b>*it_so-kwert = it_knov-kwert.

modify table it_so from it_knov transporting kwert.</b>

ENDLOOP.

regards

kishore

Message was edited by: Harikishore Sreenivasulu

0 Kudos

Hi,

LOOP AT IT_SO.

READ TABLE IT_KONV WITH TABLE KEY KNUMV =

IT_SO-KNUMV.

<b> if sy-subrc = 0.

it_so-KWERT = IT_KONV-KWERT.

modify it_so index sy-tabix.

endif.</b>

ENDLOOP.

0 Kudos

Hi,

data: l_tabix type sy-tabix.

 LOOP AT IT_SO.
<b>l_tabix = sy-tabix.</b>
    READ TABLE IT_KONV WITH TABLE KEY KNUMV = IT_SO-KNUMV. 
<b>if sy-subrc = 0.
move-corresponding it_konv to IT_SO.
modify it_so index l_tabix.
endif.</b>
 ENDLOOP.

Regards

vijay

0 Kudos

Thanks guys, i'm almost done now...when i checked through debug mode, its all working in order, but once i press F8, i did not go straight to my ALV list to display my results...instead it created a short dump and made a runtime error called "MESSAGE_TYPE_X"...any ideas?

0 Kudos

Hi,

look at this SAP note : 550043

Symptom

KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.

Other terms

KEPM MESSAGE_TYPE_X transform characteristic value

Reason and Prerequisites

This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising

during execution of planning method, for which is possible to define

transformation of characteristics values i.e. Copy, Forecast, Top-Down

distribution, Ratios and Customer Enhancement.

Dump is raising in case, if there was defined transformation of char.

values in parameter set definition for some characteristic. Later on,

this characteristic was removed from planning level definition but

characteristic wasn't removed from relevant customizing of transform

characteristic values before.

Solution

Please apply attached program correction.

Regards,

GSR.

0 Kudos

Hi,

can you show the parameters what you are passing , alomg with their declarations..

Regards

vijay

0 Kudos

it's ok...i just had to make some ammendments to the ALV coding part...