Skip to Content
0
Former Member
Sep 06, 2006 at 02:13 PM

Select Statement

26 Views

Hello

iam using a select statement in my report and its taking a long time to fetch the data and thus ending up giving a short dump..The code is as below..Could you please help with solving this problem..

<b>SELECT VBELV VBTYP_V INTO (ITAB_VBAK-VBELV, ITAB_VBAK-VBTYP_V)

FROM VBFA UP TO 1 ROWS

WHERE VBELN = ITAB_OPEN-DOCNO.

IF ITAB_VBAK-VBTYP_V <> 'C'.

SELECT SINGLE VBELV INTO (ITAB_VBAK-VBELV)

FROM VBFA "UP TO 1 ROWS

WHERE VBELN = ITAB_VBAK-VBELV.

  • ENDSELECT. "select VBFA

ENDIF. "IF itab

SELECT VBELN BSTNK KUNNR INTO (ITAB_VBAK-VBELN, ITAB_VBAK-BSTNK,

ITAB_VBAK-SOLDTO)

FROM VBAK UP TO 1 ROWS

WHERE VBELN = ITAB_VBAK-VBELV.

IF SY-SUBRC = '0'.

MOVE ITAB_VBAK-VBELN TO ITAB_OPEN-ORDNO. "Order Number

MOVE ITAB_VBAK-BSTNK TO ITAB_OPEN-BSTNK. "Purchase Order

MOVE ITAB_VBAK-SOLDTO TO ITAB_OPEN-SOLDTO. "SoldTo

  • Load first Benteler Material Number - PBE

MOVE ' ' TO ITAB_OPEN-MATNR.

SELECT MATNR INTO (ITAB_OPEN-MATNR)

FROM VBRP UP TO 1 ROWS

  • where vbeln = itab_vbak-vbelv.

WHERE VBELN = ITAB_OPEN-DOCNO.

ENDSELECT.

PERFORM TEXT_RETRIEVAL."Get first line PO Text

IF SY-SUBRC = '0'.

LOOP AT ITAB.

MOVE ITAB-TDLINE TO ITAB_OPEN-TDLINE. "First Line of Text

EXIT.

ENDLOOP. "Loop at ITAB

ENDIF. "IF sy-subrc

ENDIF. "IF sy-subrc

ENDSELECT. "select VBAK

ENDSELECT. "select VBFA</b>

Thanks

Vicky