Code: Alles auswählen.
REPORT ZZAWTEST16.
data: gv_form(30) value 'TEST'.
perform (gv_form) in PROGRAM ZZAWTEST16.
form test.
endform.
Code: Alles auswählen.
DATA: gv_form(30) VALUE 'TEST'. "Name der Form-Routine im Smartform
DATA: p_object_name TYPE seu_objkey.
DATA: p_request TYPE REF TO cl_wb_request.
DATA fm_name TYPE rs38l_fnam.
DATA pg_name TYPE rs38l_fnam.
*Ermitteln des FBs zum Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_TEST' "Smartform Name
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
*Ermitteln des Rahmenprogramms
SELECT SINGLE pname FROM tfdir INTO pg_name
WHERE funcname = fm_name.
IF sy-subrc = 0.
CLEAR p_object_name.
p_object_name = pg_name.
CREATE OBJECT p_request
EXPORTING
p_object_type = swbm_c_type_prg_source
p_object_name = p_object_name
p_operation = swbm_c_op_disp_or_edit.
pg_name = p_object_name.
ENDIF.
*Aufruf der Routine
PERFORM (gv_form) IN PROGRAMM (pg_name).
Folgende Benutzer bedankten sich beim Autor mcdelta0six für den Beitrag:
Pyro
Code: Alles auswählen.
*Dies ist die Form "TEST", die innerhalb des Smartforms steht
FORM test.
DATA: variable(30). "Variable gleich definiert wie im Aufrufenden Programm
DATA: report_und_variable TYPE string VALUE '(Z_FORMS_TEST)GV_FORM'.
FIELD-SYMBOLS: <rep_und_var> TYPE char30. "Das Feldsymbol, also der Zeiger auf die Variable
ASSIGN (report_und_variable) TO <rep_und_var>. "Feldsymbol zuweisen. Die Variable in Klammern bedeutet, dass nicht die Variable selber, sondern der Text, der in der Variablen steht selber als Variable interpretiert und zugeordnet wird.
variable = <rep_und_var>.
ENDFORM.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report Z_FORMS_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_forms_test.
DATA: gv_form(30) VALUE 'TEST'. "Name der Form-Routine im Smartform
DATA: p_object_name TYPE seu_objkey.
DATA: p_request TYPE REF TO cl_wb_request.
DATA fm_name TYPE rs38l_fnam.
DATA pg_name TYPE rs38l_fnam.
*Ermitteln des FBs zum Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_TEST' "Smartform Name
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
*Ermitteln des Rahmenprogramms
SELECT SINGLE pname FROM tfdir INTO pg_name
WHERE funcname = fm_name.
IF sy-subrc = 0.
CLEAR p_object_name.
p_object_name = pg_name.
CREATE OBJECT p_request
EXPORTING
p_object_type = swbm_c_type_prg_source
p_object_name = p_object_name
p_operation = swbm_c_op_disp_or_edit.
pg_name = p_object_name.
ENDIF.
*aufruf der routine
PERFORM (gv_form) IN PROGRAM (pg_name).