Unit605 hat geschrieben:Mein POSTING war im falschen Thread... Jetzt verstanden?
Unit605 hatte etwas gepostet, aber danach gleich wieder gelöscht als er seinen Fehler bemerkt hat.sapdepp hat geschrieben:Nein, nicht verstanden. Welches Posting?
So wie ich den "Arbeitsvorrat" verstanden habe, werden da nur die Dinge angezeigt die noch zu planen sind. Sprich die Plantafel wird mit X zu planenden Terminen aufgerufen und diese X Termine können dann verplant werden. Meines Erachtens müsstest du da im aufrufenden Programm ansetzen und dort die notwendigen zu planenden Objekte übergeben.sapdepp hat geschrieben:...will ja nur eine Antwort auf mein OO-Problem.
Code: Alles auswählen.
METHOD access_scheduler.
* Aufrufparameter sind ID_PATNR und IS_NBEW
DATA:
lr_environment TYPE REF TO cl_ish_environment,
lr_errorhandler TYPE REF TO cl_ishmed_errorhandling,
ls_n1apcn TYPE n1apcn,
ld_rc TYPE ish_method_rc,
lt_messages TYPE bapirettab,
lr_app_constr TYPE REF TO cl_ish_app_constraint,
lr_planning_med TYPE REF TO cl_ishmed_prc_planning_func,
lr_planning_ish TYPE REF TO cl_ish_prc_planning_func,
lr_patient TYPE REF TO cl_ishmed_none_oo_npat,
lt_workpool TYPE ishmed_t_pg_workpool.
FIELD-SYMBOLS:
<ls_workpool> TYPE rn1_pg_workpool.
CLEAR ld_rc.
cl_ish_fac_environment=>create( EXPORTING i_program_name = '...'
IMPORTING e_instance = lr_environment
e_rc = ld_rc ).
IF ld_rc NE 0.
EXIT.
ENDIF.
* create appointment constraint with treatment OE
ls_n1apcn-mandt = sy-mandt.
ls_n1apcn-einri = is_nbew-einri.
* ls_n1apcn-trtoe = g_trtoe.
cl_ish_app_constraint=>create( EXPORTING is_n1apcn = ls_n1apcn
ir_environment = lr_environment
IMPORTING er_instance = lr_app_constr
e_rc = ld_rc
CHANGING cr_errorhandler = lr_errorhandler ).
IF ld_rc NE 0.
lr_errorhandler->get_messages( IMPORTING t_messages = lt_messages ).
IF lr_environment IS BOUND.
cl_ish_utl_base=>destroy_env( CHANGING cr_environment = lr_environment ).
ENDIF.
CLEAR lr_environment.
RETURN.
ENDIF.
cl_ish_fac_prc_planning_func=>create( IMPORTING er_instance = lr_planning_ish
e_rc = ld_rc
CHANGING cr_errorhandler = lr_errorhandler ).
TRY.
lr_planning_med ?= lr_planning_ish.
CATCH cx_root.
lr_errorhandler->get_messages( IMPORTING t_messages = lt_messages ).
IF lr_environment IS BOUND.
cl_ish_utl_base=>destroy_env( CHANGING cr_environment = lr_environment ).
ENDIF.
CLEAR lr_environment.
RETURN.
ENDTRY.
IF id_patnr IS NOT INITIAL.
cl_ishmed_none_oo_npat=>load( EXPORTING i_mandt = sy-mandt
i_einri = is_nbew-einri
i_patnr = id_patnr
IMPORTING e_instance = lr_patient
e_rc = ld_rc
CHANGING c_errorhandler = lr_errorhandler ).
IF ld_rc NE 0.
lr_errorhandler->get_messages( IMPORTING t_messages = lt_messages ).
IF lr_environment IS BOUND.
cl_ish_utl_base=>destroy_env( CHANGING cr_environment = lr_environment ).
ENDIF.
CLEAR lr_environment.
RETURN.
ENDIF.
APPEND INITIAL LINE TO lt_workpool ASSIGNING <ls_workpool>.
<ls_workpool>-none_oo_data = lr_patient.
ENDIF.
lr_planning_med->set_planning_ou( i_planoe = is_nbew-orgpf ).
lr_planning_med->planning_with_search( EXPORTING i_with_dialog = abap_true
i_einri = is_nbew-einri
i_caller = '...'
i_usage = if_ish_pl_usage_constants=>co_usage_general
i_save = abap_true
it_workpool = lt_workpool
ir_environment = lr_environment
IMPORTING e_rc = ld_rc
CHANGING cr_app_constr = lr_app_constr
cr_errorhandler = lr_errorhandler ).
IF ld_rc NE 0.
lr_errorhandler->get_messages( IMPORTING t_messages = lt_messages ).
IF lr_environment IS BOUND.
cl_ish_utl_base=>destroy_env( CHANGING cr_environment = lr_environment ).
ENDIF.
CLEAR lr_environment.
RETURN.
ENDIF.
IF lr_app_constr IS BOUND.
CLEAR lr_app_constr.
ENDIF.
IF lr_environment IS BOUND.
cl_ish_utl_base=>destroy_env( CHANGING cr_environment = lr_environment ).
ENDIF.
CLEAR lr_environment.
ENDMETHOD.