Skip to Content

Select query with multiple material in select option error out

Hi Team,

I have a Program which calls the HANA Sidecar, when material is entered in Multiple option it error out.

It works fine when its given in Range or just single value.

I have attached the selection screen and the error screen.

It always throws this error only when multiple material document is passed.

I have also attached the select query which throws the error.

Please let me know if you need any details.

OPEN CURSOR dbcursor FOR " Note - 'with hold' not allowed

SELECT mkpf~mblnr

mkpf~budat

mkpf~cpudt

mkpf~xabln

mkpf~xblnr

mkpf~bldat

mkpf~cputm

mkpf~usnam

mkpf~bktxt

mkpf~frbnr

mkpf~exnum

mseg~matnr

mseg~bukrs

mseg~werks

mseg~zeile

mseg~lgort

mseg~kunnr

mseg~kdauf

mseg~bprme

mseg~aufnr

mseg~bwart

mseg~meins

mseg~waers

mseg~umwrk

mseg~ablad

mseg~ematn

mseg~prctr

mseg~lgtyp

mseg~umlgo

mseg~kostl

mseg~sgtxt

mseg~ebeln

mseg~ebelp

mseg~erfmg

mseg~erfme

mseg~charg

mseg~insmk

mseg~sobkz

mseg~lifnr

mseg~menge

mseg~shkzg

mseg~dmbtr

mseg~mjahr

mseg~mat_kdauf

mseg~mat_kdpos

mseg~lgpla

mseg~lfbnr

mseg~grund

mara~lvorm

mara~mtart

mara~mbrsh

mara~matkl

marc~maabc

marc~shflg

marc~shzet

marc~schgt

marc~kausf

marc~kzkri

marc~ekgrp

marc~dispr

marc~dismm

marc~dispo

marc~plifz

marc~webaz

marc~ausss

marc~disls

marc~beskz

marc~sobsl

marc~minbe

marc~eisbe

marc~bstmi

marc~bstma

marc~bstfe

marc~bstrf

marc~mabst

marc~umlmc

makt~maktx

makt~spras

mbew~bwtar

mbew~zpld2

mbew~zplp2

mbew~stprs

mbew~peinh

mbew~zplp1

mbew~zplp3

mbew~zpld1

mbew~zpld3

mbew~bwkey

lfa1~name1

ekko~ekorg

ekpo~infnr

ekpo~netpr

ekpo~peinh

ekpo~netwr

ekpo~pstyp

FROM ( mkpf

INNER JOIN mseg

ON mseg~mandt = mkpf~mandt

AND mseg~mblnr = mkpf~mblnr

AND mseg~mjahr = mkpf~mjahr

INNER JOIN mara

ON mara~mandt = mseg~mandt

AND mara~matnr = mseg~matnr

INNER JOIN marc

ON marc~mandt = mseg~mandt

AND marc~matnr = mseg~matnr

AND marc~werks = mseg~werks

INNER JOIN makt

ON makt~mandt = mara~mandt

AND makt~matnr = mara~matnr

AND makt~spras = sy-langu

INNER JOIN mbew

ON mbew~mandt = marc~mandt

AND mbew~matnr = marc~matnr

AND mbew~bwkey = marc~werks

LEFT OUTER JOIN lfa1

ON lfa1~mandt = mseg~mandt

AND lfa1~lifnr = mseg~lifnr

LEFT OUTER JOIN ekko

ON ekko~mandt = mseg~mandt

AND ekko~ebeln = mseg~ebeln

LEFT OUTER JOIN ekpo

ON ekpo~mandt = mseg~mandt

AND ekpo~ebeln = mseg~ebeln

AND ekpo~ebelp = mseg~ebelp )

CONNECTION (v_conn)

WHERE mkpf~mblnr IN so_mblnr

AND mkpf~budat IN so_budat

AND mkpf~cpudt IN so_cpudt

AND mkpf~cputm IN so_cputm

AND mkpf~usnam IN so_uname

AND mkpf~bktxt IN so_bktxt

AND mkpf~xblnr IN so_xblnr

AND mseg~matnr IN so_matnr

AND mseg~werks IN so_werks

AND mseg~bwart IN so_bwart

AND mseg~lgort IN so_lgort

AND mseg~ebeln IN so_ebeln

AND mseg~kdauf IN so_kdauf

AND mseg~lifnr IN so_lifnr

AND mseg~sobkz IN so_sobkz

AND mara~matkl IN so_matkl

AND mara~mtart IN so_mtart

AND mara~lvorm = p_lvoma

AND marc~lvorm = p_lvowk

AND makt~maktx IN so_maktx

AND makt~spras = sy-langu

AND marc~prctr IN so_prctr

AND mseg~mjahr IN so_mjahr.

IF dbcursor IS INITIAL.

RAISE EXCEPTION TYPE lcx_cursor_not_open.

ENDIF.

WHILE l_no_further_fetch = space.

FETCH NEXT CURSOR dbcursor

INTO s_movements2.


Thanks,

Gokul

Material.jpg (73.7 kB)
Error Screen.jpg (133.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 22, 2016 at 04:16 PM

    For better exception handling why dont you use ADBC...

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.