Skip to Content
0
Nov 16, 2012 at 10:59 AM

SY-REPID IN SUBROUTINE.

139 Views

Hi Experts,

In this below program when I declare the function module under the subroutine it returns empty internal table but when I declare the function module without any subroutine it returns internal table with value. Now, My requirement is to declare it under subroutine.

REPORT ztesttt3221.

END-OF-SELECTION.
PERFORM test.
*&---------------------------------------------------------------------*
*& Form TEST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM test .
DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
DATA : pa0001 LIKE TABLE OF pa0001 WITH HEADER LINE.


CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = SY-REPID
fieldname = 'PA0001'
TABLES
components = cmp.
LOOP AT cmp.
WRITE :/ cmp-compname , cmp-type , cmp-olen.
ENDLOOP.
ENDFORM. " TEST