on 02-03-2012 10:55 AM
Hi experts,
I am currently working on an SAP TDMS project which requires me to develop some event-related scrambling rules. As this type of rule doesn't have parameters I'm having trouble understanding how to access the data. I tried to find an example in the forums and searching the internet but I wasn't successful.
Any help will be much appreciated.
Thank you.
Kindest regards,
Bruno Esperança
Edited by: Rob Burbank on Feb 3, 2012 9:37 AM
Event related rules are to be used for entire record in a table and not for individual fields.
For your need you may want to use domain/field related rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bruno,
First of all, let me get it clear that you are trying to use scrambling in TDMS 3.0?
You can apply Event related rule for more than one field at a time.
It applies at the record level and you can change the contents of a complete record using a single rule.
As it does not involve any specific field, you cannot add parameters for an event related rule.
In case you need more help, please open an OSS message.
Our support team would be able to help you.
Thanks and Regards.,
Rupam
Hi Rupam!
Yes, I am using TDMS 3.0.
Thank you very much for your e-mail.
I did not find standard package TDSAD. However, I did find include CNV_MBT_TDSAD_ADDR_SCRAM1 which has the code example for an event-related rule.
Nonetheless, I do have a small concern. This rule was designed to be used by more than one table. Thus, there is a piece of code in the beginning which determines the object (table) that is currently being converted.
IF g_wa_name IS INITIAL.
* get receiver structure name of the current conv. obj.:
* CONCATENATE g_dmc_cobj_guid ' = ''' g_dmc_cobj_guid_val
* '''' INTO g_where_clause_dmc_cobj.
CONCATENATE g_dmc_cobj_guid ' = ''' _GUID_COBJ
'''' INTO g_where_clause_dmc_cobj.
SELECT SINGLE (g_dmc_cobj_rcontainer) FROM (g_dmc_cobj_tabname)
INTO g_dmc_cobj_rcontainer_into WHERE (g_where_clause_dmc_cobj).
CONCATENATE g_dmc_stree_container ' = '''
g_dmc_cobj_rcontainer_into''''
' AND' g_dmc_stree_seqnum ' = ''' g_dmc_stree_seqnum_val''''
' AND' g_dmc_stree_struclevel ' = ''' g_dmc_stree_struclevel_val
'''' INTO g_where_clause_dmc_stree.
SELECT SINGLE (g_dmc_stree_guid) FROM (g_dmc_stree_tabname)
INTO g_dmc_stree_guid_into WHERE (g_where_clause_dmc_stree).
CONCATENATE g_dmc_struct_stree ' = ''' g_dmc_stree_guid_into
'''' INTO g_where_clause.
SELECT SINGLE (g_dmc_struct_ident) FROM (g_dmc_struct_tabname)
INTO g_structname WHERE (g_where_clause).
* select single ident from dmc_struct into g_structname
* where stree = ( select GUID FROM dmc_stree WHERE container =
* ( select RCONTAINER FROM dmc_cobj WHERE guid = _guid_cobj )
* AND seqnum = '0001' AND struclevel = '01' ).
CONCATENATE '_WA_' g_structname INTO g_wa_name.
ASSIGN (g_wa_name) TO <g_wa_name>.
ENDIF.
As you can see this has some selects in it, and I'm affraid these selects might be executed for each record of each table. So, in a performance point of view, this might not be so good...
Is there a reason why I shouldn't use one rule per table, and therefore disregard this piece of code?
Thank you very much!
Bruno
EDIT:
From what I understood from the code, this is a code example if I assume I'm scrambling table ADRC:
ASSIGN ('_WA_R_ADRC') TO <g_wa_name>.
ASSIGN COMPONENT 'NAME1' OF STRUCTURE <g_wa_name> TO <g_name1>.
Does this make sense to you?
Thanks.
Hi experts and Bruno:
I'm also working on event related rules and still not figuring out the followings:
It would be very nice if you can share your experience, thanks
Leon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leon!
What version of TDMS are you using? In my version (3.0) I have the following include available CNV_MBT_TDSAD_ADDR_SCRAM1
Please go into TX SE38 in your system and try viewing this include. This is SAP's standard example.
If you are scrambling only one table per scrambling rule the following code works perfectly:
DATA: LV_ALPHA(255).
FIELD-SYMBOLS:
<LF_MAKT>,
<LF_MAKTX>,
<LF_MAKTG>.
ASSIGN ('_WA_R_MAKT') TO <LF_MAKT>.
CHECK <LF_MAKT> IS ASSIGNED.
ASSIGN COMPONENT 'MAKTX' OF STRUCTURE <LF_MAKT> TO <LF_MAKTX>.
ASSIGN COMPONENT 'MAKTG' OF STRUCTURE <LF_MAKT> TO <LF_MAKTG>.
IF <LF_MAKTX> IS ASSIGNED
AND <LF_MAKTX> IS NOT INITIAL.
CALL METHOD ZCL_SCRAMBLE=>RND_ALPHA_DOM
EXPORTING I_DOMNAME = 'TEXT40'
IMPORTING E_ALPHA = LV_ALPHA.
<LF_MAKTX> = LV_ALPHA.
ENDIF.
IF <LF_MAKTG> IS ASSIGNED
AND <LF_MAKTG> IS NOT INITIAL.
CALL METHOD ZCL_SCRAMBLE=>RND_ALPHA_DOM
EXPORTING I_DOMNAME = 'CHAR40'
IMPORTING E_ALPHA = LV_ALPHA.
<LF_MAKTG> = LV_ALPHA.
ENDIF.
Good luck.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.