FuBa: GET_DYNP_VALUE und andere können das.sapdepp hat geschrieben:Ich bilde mir ein, so etwas schon mal irgendwo gesehen zu haben, nur Google findet nix ...
Code: Alles auswählen.
data:
lr_cordpos type ref to cl_ishmed_cordpos.
try.
lr_cordpos ?= ir_object.
catch cx_root.
endtry.
if lr_cordpos is bound.
*... Verarbeitung
endif.
Code: Alles auswählen.
DATA: gr_cordpos TYPE REF TO cl_ishmed_prereg,
i_posnr type N1VKG-posnr,
e_estat type tj30-estat.
...
CALL METHOD cr_corder->GET_CORDPOS_BY_POSNR
EXPORTING
I_POSNR = i_posnr
* IR_ENVIRONMENT = gr_env
IMPORTING
ER_CORDPOS = gr_cordpos
E_RC = e_rc
CHANGING
CR_ERRORHANDLER = cr_errorhandler.
i_estat = 'E0001'.
CALL METHOD gr_cordpos->SET_STATUS
EXPORTING
I_ESTAT = i_estat
* IR_ESTAT =
IMPORTING
E_RC = e_rc
CHANGING
CR_ERRORHANDLER = cr_errorhandler.
...
Code: Alles auswählen.
* Get the cordtitle.
CALL METHOD cr_corder->get_data
IMPORTING
es_n1corder = ls_n1corder
e_rc = e_rc
CHANGING
cr_errorhandler = cr_errorhandler.
CHECK e_rc = 0.
* Warum sieht die CORDERID so komisch aus?
CALL METHOD cr_corder->GET_CORDERID
RECEIVING
R_CORDERID = lv_CORDERID.
* korrekte CORDERID besorgen
select SINGLE corderid
from n1corder
into lv_corderid
where reftyp eq ls_n1corder-reftyp
and patnr eq ls_n1corder-patnr
* and papid eq ls_n1corder-papid
and etroe eq ls_n1corder-etroe
and orddep eq ls_n1corder-orddep
and cordtitle eq ls_n1corder-cordtitle
* and prgnr eq ls_n1corder-prgnr
.