Если решения не найдется, то придется этой транзакции давать.
У нас внутренний контроль требует, что авторизация проверялась по имени запущенной транзакции, видимо так гибче настраивать. Иначе придется объяснять.
Last edited by Сергей on Fri Dec 28, 2007 2:36 pm; edited 1 time in total
Age: 46 Joined: 05 Nov 2007 Posts: 725 Location: КраснАдар
Posted: Fri Dec 28, 2007 3:30 pm Post subject:
Code:
function rs_parameter_transaction_get.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(P_CALLED_TRANSACTION) TYPE TCODE OPTIONAL
*" REFERENCE(P_PARAMETERS) TYPE S_PARAM OPTIONAL
*" EXPORTING
*" REFERENCE(P_TRANSACTIONS) TYPE S_TCODES
*" EXCEPTIONS
*" NO_SPECIFICATION
*" NOT_FOUND
*"----------------------------------------------------------------------
data: l_param type tcdparam,
l_tstcp type table of tstcp,
l_h_tstcp type tstcp,
l_h_parameters type rsparam,
l_tstc type table of tstc,
l_h_tstc type tstc,
l_pvs type s_param,
l_h_pvs type rsparam,
l_called_tcode type tcode,
l_error.
* Vorselektion
if not p_called_transaction is initial.
* gerufene Transaktion bekannt
concatenate '%' p_called_transaction '%' into l_param.
else.
read table p_parameters index 1 into l_h_parameters.
if sy-subrc ne 0. raise no_specification. endif.
* Parametername bekannt
if not l_h_parameters-field is initial.
concatenate '%' l_h_parameters-field '%' into l_param.
elseif not l_h_parameters-value is initial.
* Parameterinhalt bekannt
concatenate '%' l_h_parameters-value '%' into l_param.
else.
raise no_specification.
endif.
endif.
select * from tstcp into table l_tstcp
where param like l_param.
if sy-subrc ne 0. raise not_found. endif.
*
* Prufung: Sind gefundene Transaktionen Parametertransaktionen? /
* Feinselektion
select * from tstc into table l_tstc
for all entries in l_tstcp
where tcode = l_tstcp-tcode.
sort l_tstc by tcode.
loop at l_tstcp into l_h_tstcp.
read table l_tstc into l_h_tstc
with key tcode = l_h_tstcp-tcode
binary search.
if sy-subrc ne 0. continue. endif.
if not l_h_tstc-cinfo o hex_par. continue. endif.
* Zerlege String
perform split_parameters_internal using l_h_tstcp-param
changing l_called_tcode l_pvs.
* Prufe gegen Eingaben
* Transaktionscode
if not p_called_transaction is initial and
l_called_tcode ne p_called_transaction.
continue.
endif.
* Parameterwerte
l_error = c_false.
loop at p_parameters into l_h_parameters.
if not l_h_parameters-field is initial.
read table l_pvs with key field = l_h_parameters-field
into l_h_pvs.
if sy-subrc ne 0. l_error = c_true. continue. endif.
if not l_h_parameters-value is initial and
l_h_parameters-value ne l_h_pvs-value.
l_error = c_true.
continue.
endif.
elseif not l_h_parameters-value is initial.
read table l_pvs with key value = l_h_parameters-value
into l_h_pvs.
if sy-subrc ne 0. l_error = c_true. continue. endif.
if l_h_pvs-value ne l_h_parameters-value.
l_error = c_true.
continue.
endif.
endif.
endloop.
* Parametertransaktion entspricht den geforderten Werten
if l_error = c_false.
append l_h_tstcp-tcode to p_transactions.
endif.
endloop.
endfunction.
form split_parameters_internal using value(p_string) type tcdparam
changing p_called_tcode type tcode
p_param type s_param.
field-symbols <f>.
data: param_beg type i,
h_param type rsparam.
clear p_param.
if p_string(1) = '\'. " OO-Transaktion ohne FR
exit.
elseif p_string(1) = '@'. " Transaktionsvariante
exit.
elseif p_string(1) = '/'.
if p_string ca ' '. endif.
param_beg = sy-fdpos + 1.
subtract 2 from sy-fdpos.
if sy-fdpos gt 0.
p_called_tcode = p_string+2(sy-fdpos).
endif.
shift p_string by param_beg places.
endif.
do 254 times.
if p_string = space. exit. endif.
clear h_param.
condense p_string no-gaps.
if p_string ca '='.
check sy-fdpos ne 0.
assign p_string(sy-fdpos) to <f>.
h_param-field = <f>.
if h_param-field(1) = space. shift h_param-field. endif.
sy-fdpos = sy-fdpos + 1.
shift p_string by sy-fdpos places.
if p_string ca ';'.
if sy-fdpos ne 0.
assign p_string(sy-fdpos) to <f>.
h_param-value = <f>.
if h_param-value(1) = space. shift h_param-value. endif.
endif.
sy-fdpos = sy-fdpos + 1.
shift p_string by sy-fdpos places.
append h_param to p_param.
elseif p_string ca ' '. " Da _____; moglich
check sy-fdpos ne 0.
assign p_string(sy-fdpos) to <f>.
h_param-value = <f>.
if h_param-value(1) = space. shift h_param-value. endif.
sy-fdpos = sy-fdpos + 1.
shift p_string by sy-fdpos places.
append h_param to p_param.
endif.
endif.
enddo.
endform. " SPLIT_PARAMETERS
* get current tcode (if any)
DATA: l_tcode TYPE tstcp-tcode,
l_param TYPE tstcp-param VALUE '/*%1 P1000-OBJID=%2;'.
l_tcode = sy-tcode.
REPLACE '%1' WITH sy-tcode INTO l_param.
REPLACE '%2' WITH ls_i1218-ext_objid INTO l_param.
CONDENSE l_param.
SELECT SINGLE tcode FROM tstcp INTO l_tcode
WHERE param LIKE l_param.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.