Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

open dataset???

Hi all,

what is the use of statement open data set

can u explain this code & its significance:-

OPEN CURSOR WITH HOLD G_CURSOR FOR

SELECT VBAK~VBELN

VBAP~POSNR

FROM VBAK

INNER JOIN VBUK

ON VBUKVBELN = VBAKVBELN

INNER JOIN VBAP

ON VBAPVBELN = VBAKVBELN

INNER JOIN VBUP

ON VBUPVBELN = VBAPVBELN

AND VBUPPOSNR = VBAPPOSNR

INNER JOIN VBEP

ON VBEPVBELN = VBAPVBELN

AND VBEPPOSNR = VBAPPOSNR

WHERE VBAK~VBELN IN S_VBELN

AND VBAK~AUART IN S_AUART

AND VBAP~MATNR IN S_MATNR

AND VBAP~WERKS IN S_WERKS

AND VBAP~MATKL IN S_MATKL

AND VBAP~ABGRU EQ SPACE

AND VBEP~MBDAT IN S_MBDAT

AND VBUK~LFSTK <> 'C'

AND VBUP~LFSTA <> 'C'.

DO.

FETCH NEXT CURSOR G_CURSOR

INTO TABLE LT_DATA PACKAGE SIZE P_PACK.

IF SY-SUBRC <> 0.

  • nothing found anymore => EXIT

CLOSE CURSOR G_CURSOR.

EXIT.

ELSE.

SORT LT_DATA BY VBELN POSNR.

APPEND LINES OF LT_DATA TO LT_DATA1.

.

CLEAR : LT_DATA, LT_DATA[].

ENDIF.

ENDDO.

Regards

Deepak

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question