cancel
Showing results for 
Search instead for 
Did you mean: 

FM Extraction help.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

The fetched data is stored in E_T_DATA table. Any change or manipulation you want to make into it, you would be required to make more internal tables. Fetch data into them from corresponding database tables using your selection conditions and then based on the data in these tables, you can fill required fields in E_T_DATA.

Answers (0)