Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Method to call a FORM dynamicly

Former Member
0 Likes
961

Hi,

Is there a method to call a form dynamicly? I need something to replace "PERFORM FORM1" to "PERFORM variable".

Thanks

Lilan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
942

Hi Lilan,

You can use PERFORM ( variable1 ) . Inside the paranthesis you can use variables, this variable can hold the subroutine name(form name)

Hope this will help you

Regards

Rengaraj

9 REPLIES 9
Read only

Former Member
0 Likes
943

Hi Lilan,

You can use PERFORM ( variable1 ) . Inside the paranthesis you can use variables, this variable can hold the subroutine name(form name)

Hope this will help you

Regards

Rengaraj

Read only

0 Likes
942

hi,

I used it like this.

PERFORM ( zcplus_ctat1-za_uext ).

but when i try to activate, I get the below error.

Unable to interpret "ZCPLUS_CTAT1-ZA_UEXT". Possible causes of error:

Lilan

Read only

0 Likes
942

hii

move this value to some temp variable and then try like

tmp = zcplus_ctat1-za_uext.

then perform (tmp)

Read only

0 Likes
942

no luck.

error

Unable to interpret "tmp". Possible causes of error: Incorrect spelling

Read only

0 Likes
942

Try jst :

perform (formname) IN PROGRAM (progname)

Read only

Former Member
0 Likes
942

THe dynamic calls to subroutines are made using the following

PERFORM ( <var> ).

where <var> is the variable that is used to hold the form name

Read only

Former Member
0 Likes
942

Hi Lilan

I think its useful for u.

DATA : BEGIN OF itab OCCURS 0,

objid TYPE i,

endda TYPE d,

END OF itab.

FIELD-SYMBOLS : <ttext>.

itab-objid = 1.itab-endda = sy-datum.

APPEND itab.

itab-objid = 2.itab-endda = sy-datum.

APPEND itab.

itab-objid = 3.itab-endda = sy-datum.

APPEND itab.

itab-objid = 0.itab-endda = sy-datum.

APPEND itab.

itab-objid = 4.itab-endda = '20041212'.

APPEND itab.

itab-objid = 5.itab-endda = '99991212'.

APPEND itab.

itab-objid = 0.itab-endda = '99991212'.

APPEND itab.

CLEAR itab.

LOOP AT itab.

WRITE : / itab-objid , itab-endda.

ENDLOOP.

WRITE :/.

DELETE itab WHERE endda+0(4) NE '9999' AND objid IS INITIAL.

ASSIGN 'PRINT' TO <ttext>.

PERFORM <ttext>.

&----


*& Form <ttext>

&----


FORM <ttext>.

LOOP AT itab.

WRITE : / itab-objid , itab-endda.

ENDLOOP.

ENDFORM. " <ttext>

Reward all the helpful answers..

With Regards

Navin Khedikar

Read only

0 Likes
942

Hi,

In my code, the variable "zcplus_ctat1-za_uext" holds the name of the form that i need to call. so if I give it as PERFORM <zcplus_ctat1-za_uext>, it looks for a form with the name <zcplus_ctat1-za_uext>, which is not what i wanted.

as an example, i have a form call "create1". so

zcplus_ctat1-za_uext = 'create1'.

I need a way to call "CREATE1" using the variable.

I tried both,

PERFORM <zcplus_ctat1-za_uext> & PERFORM ( zcplus_ctat1-za_uext ). Nither works.

Lilan

Read only

Former Member
0 Likes
942

Check this :

PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING ... <pi>... ]

[CHANGING... <pi>... ]

[IF FOUND].