Skip to Content
0
Former Member
Jun 24, 2010 at 08:17 AM

FM Extraction help.

16 Views

Hi All,

I got a requirement to create a generic data source based on FM.So for this i have defined a structure on it am building my Data source. Now i need to write a FM for this i have referred some fo the document in here and i got some idea.

So here is the some sample code

OPEN CURSOR WITH HOLD S_CURSOR FOR SELECT VBAKVBELN VBAKAUDAT VBAKAUGRU VBAKKUNNR VBAK~VKBUR

VBAKAWAHR VBAKKVGR1 VBAKKVGR2 VBAKKVGR3

VBAPVBELN VBAPPOSNR VBAPMATNR VBAPKWMENG

VBAPVRKME VBAPNETWR VBAP~WAERK

FROM VBAK

INNER JOIN VBAP ON VBAPVBELN = VBAKVBELN WHERE VBAKVBELN IN L_R_VBELN AND VBAPPOSNR IN L_R_POSNR.

FETCH NEXT CURSOR S_CURSOR APPENDING CORRESPONDING FIELDS OF TABLE E_T_DATA PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0. CLOSE CURSOR S_CURSOR. RAISE NO_MORE_DATA. ENDIF.

SY-SUBRC = 0 At least one line was extracted.

= 4 No line was extracted from the resulting set.

Now i want to know where exactly the fetched vale got stored. My requirement is like that after fetching the required data from the tables i need to do some calculations on one particular field based on the fetched data.Here am not sure how to proceed.

{my requirement is to first fetch values from the database table and the do some calculation and fill the other field.}

Could anyone help me on this.

Regards,

Ravi