Skip to Content

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

Dynamic Perform not calling

Hello all

There is something interesting i like to share with you all and get your ideas!!

this is about calling a perform dynmaically, its used very wide in SAP

here is a common form of use.

lets  say we have two reports: y_main and another report y_caller

inside y_main there is a form

report y_main.

form trigger.

break-point.

endform.

and inside the y_caller

report y_caller.

**Standard use!

perform trigger in program y_main if found.

this will work for sure!!

but what we want is dynamic call!!

DATA: lv_form_name type tnapr-ronam value 'TRIGGER',

           lv_prog_name type tnapr-pgnam value 'Y_MAIN'.

perform (lv_form_name) in PROGRAM lv_prog_name IF FOUND.

this code above will not work very interestingly!!!

but the code below works

DATA: ls_tnapr type tnapr.

ls_tnapr-ronam = lv_form_name.

ls_tnapr-pgnam = lv_prog_name.

perform(ls_tnapr-ronam) IN PROGRAM (ls_tnapr-pgnam) IF FOUND.

how come??

when you call with type of a structure the dynamic call works otherwise it wont!!

Did anyone see this before?

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