Skip to Content
author's profile photo Former Member
Former Member

Dynamic object assignment

Hello experts,

Please let me know how i can achieve this dynamically

Data:go_pdfmail TYPE REF TO if_inbound_exit_bcs.

go_pdfmail = Zxxx=>if_inbound_exit_bcs~create_instance( ).

as you can see above Zxxx is the class ,now above code i need to make dynamic such that

class name will be determined at run time ,method will be constant(if_inbound_exit_bcs~create_instance( ))

How can i achieve this.

Best Regards,

Sanju

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 04, 2009 at 11:57 AM

    Hi,

    Dynamic call to a class is possible as follows:-

    data : file type string.
    DATA : classname TYPE SEOCLSNAME.
    classname = 'CL_GUI_FRONTEND_SERVICES'.
    CALL METHOD (classname)=>directory_browse
      CHANGING
        selected_folder      =  file
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        others               = 4
    IF sy-subrc <> 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    regards,

    Ankur Parab

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.