Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

dynamic 'subr_identifier' in PERFORM

Dear SAP friends,

Is there a way to build 'subr_identifier' dynamically in the PERFORM statement:

PERFORM <subr_identifier>

I tried this:

 METHOD  handle_pushbutton_click.

FIELD-SYMBOLS <PT> TYPE ANY.
DATA: fs_value TYPE c.
    CASE fcode.
      WHEN 'CHECK'.
          CONCATENATE 'check_'
                                   wa-ptype
                 INTO   fs_value.          
            ASSIGN fs_value TO <PT>.
            PERFORM <PT>.
    ENDCASE.
  ENDMETHOD.                           "handle_pushbutton_clicked

But I am getting a compile error "the form <PT> does not exist".

Any thoughts?

Thank you

Tatyana

Tags:
Former Member
replied

Hello Tatyana,

Try this way..

<b>REPORT ZTEST_NP.</b>

data: l_form(30) type c.

l_form = 'WRITE_DATA'.

start-of-selection.

perform (l_form) <b> in program ztest_np if found.</b>

form write_data.

write: ' I was executed...!'.

endform.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question