10-07-2009 1:14 PM
Hi,
I have found the following SAP Help page ([Naming Subroutines|http://help.sap.com/saphelp_nw2004s/helpdata/EN/9f/db978335c111d1829f0000e829fbfe/content.htm]) regarding the dynamic subroutine call. But I wonder why the following code could not work.
PROGRAM zpld_test_goh.
DATA: subrname TYPE c LENGTH 4 VALUE 'test',
programname type c LENGTH 20 value 'zpld_test_goh'.
PERFORM (subrname) IN PROGRAM (programname) IF FOUND.
FORM test.
WRITE 'hello'.
ENDFORM.
Could anyone please enlighten me on this issue?
Thanks in advance.
Regards,
Joon Meng
10-07-2009 1:19 PM
Hello,
PROGRAM ZTEST01335.
DATA: SUBRNAME TYPE C LENGTH 4 VALUE 'TEST',
PROGRAMNAME TYPE C LENGTH 20 VALUE 'ZTEST01335'.
PERFORM (SUBRNAME) IN PROGRAM (PROGRAMNAME) IF FOUND.
*&---------------------------------------------------------------------*
*& Form test
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM TEST.
WRITE 'hello'.
ENDFORM. "test
I think it is so because you have given the names in small case.
BR,
Suhas
10-07-2009 1:19 PM
Hello,
PROGRAM ZTEST01335.
DATA: SUBRNAME TYPE C LENGTH 4 VALUE 'TEST',
PROGRAMNAME TYPE C LENGTH 20 VALUE 'ZTEST01335'.
PERFORM (SUBRNAME) IN PROGRAM (PROGRAMNAME) IF FOUND.
*&---------------------------------------------------------------------*
*& Form test
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM TEST.
WRITE 'hello'.
ENDFORM. "test
I think it is so because you have given the names in small case.
BR,
Suhas
10-07-2009 1:21 PM
Hi Suhas,
Thanks for the quick reply. It is solved now! Full points awarded.
Thanks again.
Regards,
Joon Meng