Skip to Content
0
Former Member
Nov 24, 2009 at 10:00 AM

Function Module creation - Not getting data in ITAB

96 Views

Hi ALL,

I have created a function module to get the all the Production Order "AUFK-AUFNR" and Description "AUFK-KTEXT".

Here are the source code of the function module :

*************************************************************************************************************

FUNCTION Z_BAPI4 .

*"----


""Local Interface:

*" EXPORTING

*" VALUE(ITAB) TYPE BAPIRETURN

*"----


data: BEGIN OF itab1 occurs 100,

aufnr TYPE aufk-aufnr,

ktext TYPE aufk-ktext,

END OF itab1.

Select AUFNR KTEXT from AUFK INTO table itab1.

Loop at itab1.

  • itab1 = itab1

move-corresponding itab1 to itab.

write:/ itab1-aufnr,

10 itab1-ktext.

endloop.

ENDFUNCTION.

****************************************************************************************

Export parameters are :

Parameter Name : ITAB

Type Spec : TYPE

Associated Type : BAPIRETURN

Pass value : Selected ( Tick)

**************************************************************************************

I do get the all data into ITAB1 but while using move-corresponding i used to get the only one record.

My scenario is to get all the data from R3 to webpage using JCO connector.

Please help me out.

Thanks

Edited by: Shyamal Kumar on Nov 24, 2009 11:01 AM