on 2013 Jun 17 9:19 AM
Hello experts,
I am trying to check the value of a characteristic when I save a document in CV01N/CV02N.
I am using IF_EX_DOCUMENT_MAIN01~BEFORE_SAVE but I have no access to classification information.
I have seen that in the same implementation there is a method call BEFORE_SEARCH_DATA that has the classification data.
How can I acces that information??
Thanks in advance.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
here is my piece of code
may be it will help You
I use badi DOCUMENT_MAIN01 and its method ADD_ADDITIONAL_CLASSES
I need to check authorizations for Company Code characteristic from Classification Tab of DMS document in CV02N
data ls_ausp type rmclausp.
data lt_ausp_tab type standard table of rmclausp.
data lv_object type kssk-objek.
data: ls_doc_key type dms_doc_key.
move-corresponding ls_draw to ls_doc_key.
lv_object = ls_doc_key.
call function 'CLAP_DDB_GET_BUFFER_PARAMS'
exporting
object = lv_object
classtype = '017'
obtab = 'DRAW'
* OBJ_EQ_CLASS = ' '
* IMPORTING
* E_OBJ_IN_BUFFER =
* E_CHANGE_OBJ =
* E_CHANGE_ANY =
* E_CHANGENO_USED =
* E_DATE_USED =
tables
* E_KSSK_TAB =
e_ausp_tab = lt_ausp_tab
* E_DELCL_TAB =
* E_DELOB_TAB =
.
loop at lt_ausp_tab into ls_ausp
where atinn = '0000000013'.
exit.
endloop.
if sy-subrc = 0.
authority-check object 'F_BKPF_BUK'
id 'BUKRS' field ls_ausp-atwrt
id 'ACTVT' field '01'.
if sy-subrc <> 0.
call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
exporting
i_msgid = 'ZPAY_1149'
i_msgty = 'E'
i_msgno = '002'
i_msgv1 = text-001
i_msgv2 = ls_ausp-atwrt.
message e001(zpay_1149).
endif.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vasily,
This code seems to work perfect!!!
Now my problem is that in DOCUMENT_MAIN01 I am trying to acces drad info in method BEFORE_SAVE and I am having some problems.
Although I hace define a private structure (i_drad) and I update it with the infor, in DOCUMENT_MAIN01 th structure is empty.
Do you know if it is possible??
Regards.
at the very beginning
I read db table drad
if gv_start = space.
gv_start = 'X'.
select * into table gt_drad
from drad
where dokar = draw-dokar
and doknr = draw-doknr
and dokvr = draw-dokvr
and doktl = draw-doktl
and dokob = 'IFLOT'.
endif.
gt_drad and gv_start declared in program ZXCV110TOP
data gt_drad type standard table of drad with header line.
data gv_start.
later in program ZXCV110U02
I fill gt_drad with my new values
clear gt_drad.
gt_drad-mandt = sy-mandt.
gt_drad-dokar = draw-dokar.
gt_drad-doknr = draw-doknr.
gt_drad-dokvr = draw-dokvr.
gt_drad-doktl = draw-doktl.
gt_drad-dokob = 'IFLOT'.
gt_drad-obzae = '0000'.
gt_drad- objky = my_key.
read table gt_drad from gt_drad.
if sy-subrc <> 0.
append gt_drad.
endif.
pt_drad[] = gt_drad[].
when I save current DMS document all my changes update db table drad
With best regards, Vasil

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.