Transformation inversion
hello BW Experts,
What is inversion in the context of transformation. What scenario is it useful in our data loading process.
Thanks in advance.
BWer
Hi,
Take a look at these -
http://help.sap.com/saphelp_nw04s/helpdata/en/e6/f404475a758547b05bf8f86894b150/content.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/67efb9bb-0601-0010-f7a2-b582e94bcf8a - this doc gives you the inversion in detailed!
Hope this helps,
Bye...
Similar Messages
-
Créer une variable partagée de type chemin de fichier
bonjour
est-ce que quelqu'un sait comment créer une variable partagée de type chemin de fichier.
merci de votre réponse=)
Résolu !
Accéder à la solution.Salut,
Je crois pas que ce type de variable existe. Cependant tu peux transformer ton chemin de fichiers en chaine de caractère et faire transiter cette donnée via une variable partagée... puis faire la transformation inverse côté cible (ou PC c'est selon).
Regarde du côté des VIs de chaîne de caractère dans la palette de fonction : Programmation > Chaîne > Conversions chaîne/tableau/chemin > Chemin en chaîne (ou Chaîne en chemin).
@ + -
Question for inverse routine in the transformation for a virtual infocube
Hello,
I have a virtual infocube with it transformation and i want to know if there is a way to know in the inverse routine or in the start routine if in the query the user is selecting a filter value.
When the user want to select one value for a characteristic the transformation is executed in order to obtain the infoprovider values. In this moment the inverse routine is executed and i want to know if there is a way to identify when the user is making a drilldown or a filter.
In the start routine of the transformation i have an abap code with a very expensive time of execution to obtain some key figures values but i dont want that this abap code will be executed when the system executed the transformation to obtain the values for one characteristic in order to make a filter.
Thanks in advance for your help.
Best regards.
IgnacioHi Ashish,
Your document is very useful, in fact I used it to write my abap code, now Iu2019m getting the values of the query selection conditions, but what I need is after the report is showed in the first time.
When data in report is showed, user has the possibility to filter values for one characteristic. If the characteristic has the option for filter value selection during query execution equal to u201COnly Values in infoprovideru201D , the inverse routine is executed to obtain the values that are contained in the infoprovider and then the system show all the possible values. What I need is to identify this event, because in this case I donu2019t want to make some calculations in the transformation that are very expensive in time.
Thanks a lot for your information.
Best regards
Ignacio -
Inverse laplace transform.vi ?
I need to use an "Inverse laplace transform". As I find the "Laplace transform real.vi" , I just want to know if the "Inverse Laplace Transform.vi" exist and where i can find it.
At least it doesn't exist in my LV(6i). Anyway, when you want to search for a function or control use the search feature of the palette.
Maybe you can workaround your problem with the discrete Laplace transform based on the Fractional Fast Fourier Transform (take a look in the help)
Good luck! -
Question on the result of using Wavelet transform on sine wave
Dear all,
I have apply the Wavelet transform on a 50Hz sine wave. The result is shown below. But I don't understand the result of Wavelet transform. Anyone can help me? Thanks.
VictorYou seem to have something against the FFT, yet continually compare other transforms to the "sweet spot" for the FFT, ie. sinusoidal and periodic functions. Without trying to write a treatise on the subject (there are many fine books), a few observations.
The primary purpose of any transform pair is to perform a rotation in function space, for the FFT we are familiar with the time domain and frequency domain. The wavelet domain is not so simple. The FFT is very effective for sinusoidal and periodic functions, ie. those that have no localization in the time domain. If you have a sinusoidal input, the infinite signal in the time domain can be reduced to a pair of numbers (one if you take the power spectrum). That is very efficient, other periodic signals can usually be approximated by a small number of terms.
Wavelets on the other hand are chosen to be localized in both the time domain and the wavelet domain. If you look at a periodic signal like your sine wave, you see a mess, and to recreate the input signal you will need to keep an awful lot of the points around for the inverse transform. You may be able to set the last 1/3 to zero, but that's it. To see an effective application, you should be looking at localized functions, like an impulse. Put an impulse into the wavelet transform and you get something that is still a bit complex, but pretty simple. The FFT of an impulse contains components at all frequencies and the wavelet clearly wins in this case.
On paper, there is usually a clear choice, and the FFT almost always wins for spectral estimation. On the other hand, if you are trying to compress "real world" data, for instance an image, then there is a choice to be made. Standard JPEGs are FFT based, you take the FFT and try to keep just the largest frequency components. As you probably notice, edge contrast usually suffers, especially at higher compression. With wavelets, it is typical to have slightly better contrast leading to better preservation of details for a given compression.
In short, my opinion is that transforms are useful when they simplify the problem. Wavelets do not simplify the representation of a sine wave. -
Error in Routine while migrating standard Transformations from 3.5 to BI7.0
Hi Experts,
We are migrating the Standard trasformations, from old version to new BI 7.0 version. when trying to create the new transformation we are getting a routine error, and unable activate the transformation.
Trasformation Name: TRCS ZCO_OM_NAE_1 -> CUBE 0PS_C08
Routine Desc.: Conversion of Actual / Commitment / Plan to Resid.Order Plan
Source Fields: 0CURRENCY & 0FISCPER
Target Fields: 0AMOUNT & 0CURRENCY
Error Message: E:Field "COMM_STRUCTURE" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.
Routine:
PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
$$ end of rule type
TYPES:
BEGIN OF tys_TG_1_full,
InfoObject: 0CHNGID Change Run ID.
CHNGID TYPE /BI0/OICHNGID,
InfoObject: 0RECORDTP Record type.
RECORDTP TYPE /BI0/OIRECORDTP,
InfoObject: 0REQUID Request ID.
REQUID TYPE /BI0/OIREQUID,
InfoObject: 0FISCVARNT Fiscal year variant.
FISCVARNT TYPE /BI0/OIFISCVARNT,
InfoObject: 0FISCYEAR Fiscal year.
FISCYEAR TYPE /BI0/OIFISCYEAR,
InfoObject: 0CURRENCY Currency key.
CURRENCY TYPE /BI0/OICURRENCY,
InfoObject: 0CO_AREA Controlling area.
CO_AREA TYPE /BI0/OICO_AREA,
InfoObject: 0CURTYPE Currency Type.
CURTYPE TYPE /BI0/OICURTYPE,
InfoObject: 0METYPE Key Figure Type.
METYPE TYPE /BI0/OIMETYPE,
InfoObject: 0VALUATION Valuation View.
VALUATION TYPE /BI0/OIVALUATION,
InfoObject: 0VERSION Version.
VERSION TYPE /BI0/OIVERSION,
InfoObject: 0VTYPE Value Type for Reporting.
VTYPE TYPE /BI0/OIVTYPE,
InfoObject: 0WBS_ELEMT Work Breakdown Structure Element (WBS Elem
*ent).
WBS_ELEMT TYPE /BI0/OIWBS_ELEMT,
InfoObject: 0COORDER Order Number.
COORDER TYPE /BI0/OICOORDER,
InfoObject: 0PROJECT Project Definition.
PROJECT TYPE /BI0/OIPROJECT,
InfoObject: 0ACTIVITY Network Activity.
ACTIVITY TYPE /BI0/OIACTIVITY,
InfoObject: 0NETWORK Network.
NETWORK TYPE /BI0/OINETWORK,
InfoObject: 0PROFIT_CTR Profit Center.
PROFIT_CTR TYPE /BI0/OIPROFIT_CTR,
InfoObject: 0COMP_CODE Company code.
COMP_CODE TYPE /BI0/OICOMP_CODE,
InfoObject: 0BUS_AREA Business area.
BUS_AREA TYPE /BI0/OIBUS_AREA,
InfoObject: 0ACTY_ELEMT Network Activity Element.
ACTY_ELEMT TYPE /BI0/OIACTY_ELEMT,
InfoObject: 0STATUSSYS0 System Status.
STATUSSYS0 TYPE /BI0/OISTATUSSYS0,
InfoObject: 0PS_OBJ PS Object Type.
PS_OBJ TYPE /BI0/OIPS_OBJ,
InfoObject: 0VTSTAT Statistics indicator for value type.
VTSTAT TYPE /BI0/OIVTSTAT,
InfoObject: 0AMOUNT Amount.
AMOUNT TYPE /BI0/OIAMOUNT,
Field: RECORD Data record number.
RECORD TYPE RSARECORD,
END OF tys_TG_1_full.
Additional declaration for update rule interface
DATA:
MONITOR type standard table of rsmonitor WITH HEADER LINE,
MONITOR_RECNO type standard table of rsmonitors WITH HEADER LINE,
RECORD_NO LIKE SY-TABIX,
RECORD_ALL LIKE SY-TABIX,
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS.
global definitions from update rules
TABLES: ...
DATA: ...
FORM routine_0001
CHANGING
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
init variables
not supported
icube_values = g.
CLEAR result_table. REFRESH result_table.
type-pools: PSBW1.
data: l_psbw1_type_s_int1 type psbw1_type_s_int1.
data: lt_spread_values type PSBW1_TYPE_T_ACT_SPREAD.
field-symbols: .
füllen Rückgabetabelle !
move-corresponding to RESULT_TABLE.
check not RESULT_TABLE-amount is initial.
append RESULT_TABLE.
endloop.
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
ENDFORM. "routine_0001
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
*$*$ begin of routine - insert your code only below this line *-*
Data:
l_subrc type sy-tabix,
l_abort type sy-tabix,
ls_monitor TYPE rsmonitor,
ls_monitor_recno TYPE rsmonitors.
REFRESH:
MONITOR.
Runtime attributs
SOURCE_SYSTEM = p_r_request->get_logsys( ).
Migrated update rule call
Perform routine_0001
CHANGING
l_subrc
l_abort.
*-- Convert Messages in Transformation format
LOOP AT MONITOR INTO ls_monitor.
move-CORRESPONDING ls_monitor to MONITOR_REC.
append monitor_rec to MONITOR.
ENDLOOP.
IF l_subrc <> 0.
RAISE EXCEPTION TYPE cx_rsrout_skip_val.
ENDIF.
IF l_abort <> 0.
RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
ENDIF.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "compute_0AMOUNT
Method invert_0AMOUNT
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD invert_0AMOUNT.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "invert_0AMOUNT
ENDCLASS. "routine IMPLEMENTATION
Regards
Krishanu.Hi,
Go through the belowl link it may help you a lot
/message/7377688#7377688 [original link is broken]
Regards,
Marasa. -
Syntax error in Transformation routine
Hi Folks,
We are In SP 17.
I have migrated standard 0bpartner_attr transfer rules to a transformation with syntax errors.
I have a routine for a gender, Valid From and Valid To its giving the following erorr.
E:Field "TRAN_STRUCTURE-VALID_FROM" is unknown. It is neither in one of
the specified tables nor defined by a "DATA" statement. "DATA"
statement.
the following is the routine code for Gender.
PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
TYPES:
BEGIN OF tys_SC_1,
Field: XSEXM Male.
XSEXM TYPE C LENGTH 1,
Field: XSEXF Female.
XSEXF TYPE C LENGTH 1,
Field: XSEXU Unknown.
XSEXU TYPE C LENGTH 1,
Field: RECORD.
RECORD TYPE RSARECORD,
END OF tys_SC_1.
TYPES:
BEGIN OF tys_TG_1,
InfoObject: 0GENDER Gender.
GENDER TYPE /BI0/OIGENDER,
END OF tys_TG_1.
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
METHODS
compute_0GENDER
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS type tys_SC_1
EXPORTING
RESULT type tys_TG_1-GENDER
monitor type rstr_ty_t_monitor
RAISING
cx_rsrout_abort
cx_rsrout_skip_record
cx_rsrout_skip_val.
METHODS
invert_0GENDER
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
i_r_selset_outbound TYPE REF TO cl_rsmds_set
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO cl_rsmds_universe
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO cl_rsmds_set
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
$$ end of rule type
TYPES:
BEGIN OF tys_TG_1_full,
InfoObject: 0BPARTNER Business Partner.
BPARTNER TYPE /BI0/OIBPARTNER,
InfoObject: 0BP_ACTITL1 First Academic Title.
BP_ACTITL1 TYPE /BI0/OIBP_ACTITL1,
InfoObject: 0BP_ACTITL2 Second Academic Title.
BP_ACTITL2 TYPE /BI0/OIBP_ACTITL2,
InfoObject: 0BP_BTHNAME BP: Person's Name at Birth.
BP_BTHNAME TYPE /BI0/OIBP_BTHNAME,
InfoObject: 0BP_CAT Business Partner Category.
BP_CAT TYPE /BI0/OIBP_CAT,
InfoObject: 0BP_CONS Business Partner (Consolidated/Cleansing).
BP_CONS TYPE /BI0/OIBP_CONS,
InfoObject: 0BP_CONTACT BP: Contact Permission.
BP_CONTACT TYPE /BI0/OIBP_CONTACT,
InfoObject: 0BP_EXTERN BP Number in External System.
BP_EXTERN TYPE /BI0/OIBP_EXTERN,
InfoObject: 0BP_FSTNAME BP: Person's First Name.
BP_FSTNAME TYPE /BI0/OIBP_FSTNAME,
InfoObject: 0BP_GROUP Business Partner Grouping.
BP_GROUP TYPE /BI0/OIBP_GROUP,
InfoObject: 0BP_GRPNAM1 BP: Name 1 (Group).
BP_GRPNAM1 TYPE /BI0/OIBP_GRPNAM1,
InfoObject: 0BP_GRPNAM2 BP: Name 2 (Group).
BP_GRPNAM2 TYPE /BI0/OIBP_GRPNAM2,
InfoObject: 0BP_GRPTYPE BP: Group Type.
BP_GRPTYPE TYPE /BI0/OIBP_GRPTYPE,
InfoObject: 0BP_LSTNAME BP: Person's Surname.
BP_LSTNAME TYPE /BI0/OIBP_LSTNAME,
InfoObject: 0BP_MAR_STA BP: Marital Status.
BP_MAR_STA TYPE /BI0/OIBP_MAR_STA,
InfoObject: 0BP_MDLNAME BP: Person's Middle Name or Second First
*Name.
BP_MDLNAME TYPE /BI0/OIBP_MDLNAME,
InfoObject: 0BP_SECNAME BP: Person's Second Surname.
BP_SECNAME TYPE /BI0/OIBP_SECNAME,
InfoObject: 0CHANGEDBY Changed by.
CHANGEDBY TYPE /BI0/OICHANGEDBY,
InfoObject: 0CH_AT Time of Last Change.
CH_AT TYPE /BI0/OICH_AT,
InfoObject: 0CH_ON Last changed on.
CH_ON TYPE /BI0/OICH_ON,
InfoObject: 0CREATEDBY Name of person who created the object.
CREATEDBY TYPE /BI0/OICREATEDBY,
InfoObject: 0CREATEDON Date on which the record was created.
CREATEDON TYPE /BI0/OICREATEDON,
InfoObject: 0CREA_TIME Time Created.
CREA_TIME TYPE /BI0/OICREA_TIME,
InfoObject: 0GENDER Gender.
GENDER TYPE /BI0/OIGENDER,
InfoObject: 0LEGALFORM Legal Status of Organization.
LEGALFORM TYPE /BI0/OILEGALFORM,
InfoObject: 0NAME_ORG1 BP: Organization Name 1.
NAME_ORG1 TYPE /BI0/OINAME_ORG1,
InfoObject: 0NAME_ORG2 BP: Organization Name 2.
NAME_ORG2 TYPE /BI0/OINAME_ORG2,
InfoObject: 0NAME_ORG3 BP: Organization Name 3.
NAME_ORG3 TYPE /BI0/OINAME_ORG3,
InfoObject: 0NAME_ORG4 BP: Organization Name 4.
NAME_ORG4 TYPE /BI0/OINAME_ORG4,
InfoObject: 0NATION Nationality.
NATION TYPE /BI0/OINATION,
InfoObject: 0TITLE_SPPL Name Supplement, for example, Noble Title
TITLE_SPPL TYPE /BI0/OITITLE_SPPL,
InfoObject: 0BP_TYPE Partner:Partner Type.
BP_TYPE TYPE /BI0/OIBP_TYPE,
InfoObject: 0GN_PAR_SSY Source System of a Partner.
GN_PAR_SSY TYPE /BI0/OIGN_PAR_SSY,
InfoObject: 0LOGSYS Source System.
LOGSYS TYPE RSDLOGSYS,
InfoObject: 0RECORDMODE BW Delta Process: Record Mode.
RECORDMODE TYPE RODMUPDMOD,
InfoObject: 0BP_GUID GUID of Business Partner.
BP_GUID TYPE /BI0/OIBP_GUID,
InfoObject: 0BPDATEFROM GP Attributes Valid from.
BPDATEFROM TYPE /BI0/OIBPDATEFROM,
InfoObject: 0BPDATETO GP Attributes Valid to.
BPDATETO TYPE /BI0/OIBPDATETO,
Field: RECORD Data record number.
RECORD TYPE RSARECORD,
END OF tys_TG_1_full.
Additional declaration for transfer rule interface
DATA:
g_t_errorlog TYPE rssm_t_errorlog_int,
RECORD_ALL LIKE SY-TABIX.
global definitions from transfer rules
DATA: gs_cob_pro TYPE rsd_s_cob_pro,
gt_viobj TYPE rsd_t_viobj,
gs_viobj TYPE rsd_s_viobj.
DATA: l_s_errorlog TYPE rssm_s_errorlog_int,
l_text TYPE string.
FORM compute_BPDATEFROM
CHANGING
RESULT TYPE tys_TG_1_full-BPDATEFROM
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
INCLUDE rs_bct_bupa_form_valid_from.
ENDFORM. "BPDATEFROM
FORM compute_BPDATETO
CHANGING
RESULT TYPE tys_TG_1_full-BPDATETO
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
INCLUDE rs_bct_bupa_form_valid_to.
ENDFORM. "BPDATETO
FORM compute_GENDER
CHANGING
RESULT TYPE tys_TG_1_full-GENDER
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
INCLUDE rs_bct_bupa_form_gender.
ENDFORM. "GENDER
FORM compute_GN_PAR_SSY
CHANGING
RESULT TYPE tys_TG_1_full-GN_PAR_SSY
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
INCLUDE rs_bct_bupa_form_gn_par_ssy.
ENDFORM. "GN_PAR_SSY
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
METHOD compute_0GENDER.
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS-XSEXM TYPE C LENGTH 000001
SOURCE_FIELDS-XSEXF TYPE C LENGTH 000001
SOURCE_FIELDS-XSEXU TYPE C LENGTH 000001
EXPORTING
RESULT type tys_TG_1-GENDER
DATA:
MONITOR_REC TYPE rsmonitor.
*$*$ begin of routine - insert your code only below this line *-*
Data:
l_s_error_log type rssm_s_errorlog_int,
l_subrc type sy-tabix,
l_abort type sy-tabix,
ls_monitor TYPE rsmonitor,
ls_monitor_recno TYPE rsmonitors.
REFRESH:
monitor,
monitor_recno.
Migrated transfer rule call
Perform compute_GENDER
CHANGING
RESULT
l_subrc
l_abort.
*-- Convert Messages in Transformation format
LOOP AT G_T_ERRORLOG INTO l_s_error_log.
move-CORRESPONDING l_s_error_log to MONITOR_REC.
append monitor_rec to MONITOR.
ENDLOOP.
IF l_subrc <> 0.
RAISE EXCEPTION TYPE cx_rsrout_skip_val.
ENDIF.
IF l_abort <> 0.
RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
ENDIF.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "compute_0GENDER
Method invert_0GENDER
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD invert_0GENDER.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "invert_0GENDER
ENDCLASS. "routine IMPLEMENTATION
let me know how to correct the above code.
thanksHi,
the field tran_structure is no more available. The name changed to source_fields. Additionally there is no datapak available. It is now source_fields_table. You might need to use field symbols to access the fields.
regards
Siggi -
Need to create a transformation based on Update Rules Logic
Hi,
I have an existing complex Update Rule. I need to manually create a Transformation based on this Update Rule logic. The Start Routine of the Update Rule comprises of:
1) All data declarations in the Global Area
2) The local coding area consists of various select statements from various r/3 tables used later for mapping. It also calculates and stores values in the Data Package final internal table for few infoobjects that are not present in the Source object but and are used to populated data in the target.
3) then we have the various one to one individual Infoobject mappings/constants and many individual infoobject routines that pick result from the comm_structure
I am not very clear as to where each of the above coding logic should be put in the transformation coding area...... I can see four main coding areas in the transformation....global area, 2nd Global Area, Method Start_Routine and Method Inverse_Start_Routine........... I think the global data declarations(point 1 above) should be put in the Global declaration area of the start routine. The local area of the update rule logic (point 2 above) that contains select statements should be put in 2nd Global part or should it be put in Method Start_routine????? Point 3 above for individual filed mappings will be done through Rule groups. Also can anyone let me know what is the methos inverse_start_routine used for?????
Thanks.Hi,
Point 1 you mentioned should be put under2nd Global declaration part of start routine.
Point 2 should be put under Method Start_routine.
Point 3 as you only mentioned can be done by individual field rule mappings.
Method inverse_start_routine
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through)
Not very clear though about Inverse routine. But definetly not being used for the case you mentioned.
Hope it helps. -
How to write an inverse routine for an info object at field level.
Hi All,
Our requirement is as follows:
Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs). The point of the inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT. That way, the field types match and finding the data in APO is much quicker.
Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
*****Code to convert from 40 chars to 18******
*In APO if the material contains all integers values the material will
* come over as a 40 byte field. It needs to be shortened.
IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
*In APO if the material contains any character fields the material will
* not be zero filled and will be left alligned. Take the 1st 18 bytes.
ELSE.
short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
ENDIF.
*add leading zeros to numeric only value
IF short_material CO '0123456789 '.
w_num18 = short_material.
short_material = w_num18.
ENDIF.
RESULT = short_material.
*$*$ end of routine -
***********here the iverse routine need to write************
* Method invert_0MATERIAL
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
METHOD invert_0MATERIAL.
*$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
Here you would write logic in 0MAT_PLANT to do the opposite of the above,
convert 18 back to 40 characters.
*$*$ end of inverse routine - insert your code only before this line *-*
The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
Could anybody please help me or let me know any idea related to this.Hi All,
Our requirement is as follows:
Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs). The point of the inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT. That way, the field types match and finding the data in APO is much quicker.
Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
*****Code to convert from 40 chars to 18******
*In APO if the material contains all integers values the material will
* come over as a 40 byte field. It needs to be shortened.
IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
*In APO if the material contains any character fields the material will
* not be zero filled and will be left alligned. Take the 1st 18 bytes.
ELSE.
short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
ENDIF.
*add leading zeros to numeric only value
IF short_material CO '0123456789 '.
w_num18 = short_material.
short_material = w_num18.
ENDIF.
RESULT = short_material.
*$*$ end of routine -
***********here the iverse routine need to write************
* Method invert_0MATERIAL
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
METHOD invert_0MATERIAL.
*$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
Here you would write logic in 0MAT_PLANT to do the opposite of the above,
convert 18 back to 40 characters.
*$*$ end of inverse routine - insert your code only before this line *-*
The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
Could anybody please help me or let me know any idea related to this. -
Frequency Response Function & FFT & Inverse FFT (problem of unit Volts-RMS)
Hello everyone,
I am currently working on a VI in order to compare two analog signals : the first one corresponds to the output signal (my reference) which is sent by my data acquisition card to a shaker and the second one corresponds to the input signal recorded by an accelerometer fixed on the same shaker. The final goal of the VI is to correct the analog output signal by using the analog input recorded signal in order to have the vibrations on the shaker which corresponds to what we really want.
To summary, I have a problem of unit with the Volts-RMS...
So this is my method for the VI :
First, I have to calculate the Frequency Response Function between the two analog signals (output and input). For it, I use the " Frequency Response Function (Real-Im).vi " which returns the complex values of the FRF in Volts-RMS (but I don't want to use this unit).
Then, I want to calculate the FFT of the analog output signal (my reference). There are two different blocs which can be used : " FFT Spectrum (Real-Im).vi " and " FFT.vi ".
The " FFT Spectrum (Real-Im).vi " returns the FFT complex values of the signal in Volts-RMS and the " FFT.vi " returns the FFT complex values in Volts (or say me if I am wrong, thank you). I really would like to use the second one because of the unit.
Then, I divide the FFT just calculated with the Frequency Response Function calculated just before.
For the end, I calculate the inverse FFT of that with the " Inverse FFT.vi " which use the complex values with the same unit than for the " FFT.vi ".
I don't want to use the Volts-RMS unit because I absolutly want to use the blocs " FFT.vi " and " Inverse FFT.vi ".
The problem is that I don't find a bloc which use the same unit for the Frequency Response Function. The " Frequency Response Function (Real-Im).vi " returns only the complex values in Volts-RMS unit. Maybe it is possible to convert it correctly? Or maybe there is an other bloc which can be used in order to calculate the Frequency Response Function with the same init than for the FFT and Inverse FFT ? Because I can't mix everything for the moment...
Thank you for your help,
Best regards,
SebastienHello Preston,
No, I have not use the Sound and Vibration toolkit. I have only used the signal processing toolkit with the two toolboxes " Waveform measurement " and " Transforms ".
But I think that what I have done for the moment in my VI is correct (I have finished the complete VI). But I am not sure of the units (Volts, Volts-RMS...) and I would like to understand.
I have tried with the Sound and Vibration toolkit for the frequency response function (because you say me that it deals with all the unit conversion) and I can obtain the same results than with the " Frequency Response Function.vi " of the toolbox " Waveform measurement ".
But I would like to understand the units (see my previous post please). For example, for the FFT (the result is a complex), why sometimes it is in Volts, sometimes it is in Volts-RMS ? Is it possible to convert it ? How ?
If you want, I can attach on the forum my VI and that will maybe help you to explain me. Maybe it will help other people interested.
And if someone else can give me other precisions or advices about it, do not hesitate.
Thank you for your help,
Sebastien -
I am using Fourier Transforms to filter a signal I have. I noticed that for one perticular waveform the waveform returned after the inverse transform was performed was messed up. In the course of finding the problem I step up the filter so it would not filter the signal at all. The waveform returned is still wrong. ie has real and imaginary part. I have used this program on a number of waveforms and never encountered this problem before. Anybody have similar experience?
You don't have to make your time data complex by adding an imaginary part that is zero, just use the Real FFT.vi. This VI takes your real time domain data and returns the complex spectrum. Likewise the Real IFFT.vi will take your complex spectrum in and return a real time signal that is equal your original signal.
The attached VI is doing this on a random input signal and it seems to work fine.
If you are using the Complex IFFT.vi the output data will be complex, but the imaginary part very small compared to your real data (typically a ratio of 1E-15 to 1E-16). Is this what your see?
Attachments:
FFT-IFFT_or_random_signal.vi 26 KB -
Simple transformation program debugging
hi ,
can any boby guide me how can we debug a simple transformation program which is used for xml to abap conversion .Hi,
have a look on this.
REPORT YMS_XMLTOSAP.
TYPE-POOLS: IXML.
TYPES: BEGIN OF T_XML_LINE,
DATA(256) TYPE X,
END OF T_XML_LINE.
DATA: L_IXML TYPE REF TO IF_IXML,
L_STREAMFACTORY TYPE REF TO IF_IXML_STREAM_FACTORY,
L_PARSER TYPE REF TO IF_IXML_PARSER,
L_ISTREAM TYPE REF TO IF_IXML_ISTREAM,
L_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
L_NODE TYPE REF TO IF_IXML_NODE,
L_XMLDATA TYPE STRING.
DATA: L_ELEM TYPE REF TO IF_IXML_ELEMENT,
L_ROOT_NODE TYPE REF TO IF_IXML_NODE,
L_NEXT_NODE TYPE REF TO IF_IXML_NODE,
L_NAME TYPE STRING,
L_ITERATOR TYPE REF TO IF_IXML_NODE_ITERATOR.
DATA: L_XML_TABLE TYPE TABLE OF T_XML_LINE,
L_XML_LINE TYPE T_XML_LINE,
L_XML_TABLE_SIZE TYPE I.
DATA: L_FILENAME TYPE STRING.
PARAMETERS: PA_FILE TYPE CHAR1024 DEFAULT 'c:\temp\orders_dtd.xml'.
* Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: PA_VAL TYPE CHAR1 AS CHECKBOX.
START-OF-SELECTION.
* Creating the main iXML factory
L_IXML = CL_IXML=>CREATE( ).
* Creating a stream factory
L_STREAMFACTORY = L_IXML->CREATE_STREAM_FACTORY( ).
PERFORM GET_XML_TABLE CHANGING L_XML_TABLE_SIZE L_XML_TABLE.
* wrap the table containing the file into a stream
L_ISTREAM = L_STREAMFACTORY->CREATE_ISTREAM_ITABLE( TABLE = L_XML_TABLE
SIZE = L_XML_TABLE_SIZE ).
* Creating a document
L_DOCUMENT = L_IXML->CREATE_DOCUMENT( ).
* Create a Parser
L_PARSER = L_IXML->CREATE_PARSER( STREAM_FACTORY = L_STREAMFACTORY
ISTREAM = L_ISTREAM
DOCUMENT = L_DOCUMENT ).
* Validate a document
IF PA_VAL EQ 'X'.
L_PARSER->SET_VALIDATING( MODE = IF_IXML_PARSER=>CO_VALIDATE ).
ENDIF.
* Parse the stream
IF L_PARSER->PARSE( ) NE 0.
IF L_PARSER->NUM_ERRORS( ) NE 0.
DATA: PARSEERROR TYPE REF TO IF_IXML_PARSE_ERROR,
STR TYPE STRING,
I TYPE I,
COUNT TYPE I,
INDEX TYPE I.
COUNT = L_PARSER->NUM_ERRORS( ).
WRITE: COUNT, ' parse errors have occured:'.
INDEX = 0.
WHILE INDEX < COUNT.
PARSEERROR = L_PARSER->GET_ERROR( INDEX = INDEX ).
I = PARSEERROR->GET_LINE( ).
WRITE: 'line: ', I.
I = PARSEERROR->GET_COLUMN( ).
WRITE: 'column: ', I.
STR = PARSEERROR->GET_REASON( ).
WRITE: STR.
INDEX = INDEX + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF L_PARSER->IS_DOM_GENERATING( ) EQ 'X'.
PERFORM PROCESS_DOM USING L_DOCUMENT.
ENDIF.
*& Form get_xml_table
FORM GET_XML_TABLE CHANGING L_XML_TABLE_SIZE TYPE I
L_XML_TABLE TYPE STANDARD TABLE.
* Local variable declaration
DATA: L_LEN TYPE I,
L_LEN2 TYPE I,
L_TAB TYPE TSFIXML,
L_CONTENT TYPE STRING,
L_STR1 TYPE STRING,
C_CONV TYPE REF TO CL_ABAP_CONV_IN_CE,
L_ITAB TYPE TABLE OF STRING.
L_FILENAME = PA_FILE.
* upload a file from the client's workstation
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = L_FILENAME
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = L_XML_TABLE_SIZE
CHANGING
DATA_TAB = L_XML_TABLE
EXCEPTIONS
OTHERS = 19.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Writing the XML document to the screen
CLEAR L_STR1.
LOOP AT L_XML_TABLE INTO L_XML_LINE.
C_CONV = CL_ABAP_CONV_IN_CE=>CREATE( INPUT = L_XML_LINE-DATA REPLACEMENT = SPACE ).
C_CONV->READ( IMPORTING DATA = L_CONTENT LEN = L_LEN ).
CONCATENATE L_STR1 L_CONTENT INTO L_STR1.
ENDLOOP.
L_STR1 = L_STR1+0(L_XML_TABLE_SIZE).
SPLIT L_STR1 AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE L_ITAB.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT L_ITAB INTO L_STR1.
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB IN
L_STR1 WITH SPACE.
WRITE: / L_STR1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM PROCESS_DOM USING DOCUMENT TYPE REF TO IF_IXML_DOCUMENT.
DATA: NODE TYPE REF TO IF_IXML_NODE,
ITERATOR TYPE REF TO IF_IXML_NODE_ITERATOR,
NODEMAP TYPE REF TO IF_IXML_NAMED_NODE_MAP,
ATTR TYPE REF TO IF_IXML_NODE,
NAME TYPE STRING,
PREFIX TYPE STRING,
VALUE TYPE STRING,
INDENT TYPE I,
COUNT TYPE I,
INDEX TYPE I.
NODE ?= DOCUMENT.
CHECK NOT NODE IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF NODE IS INITIAL. EXIT. ENDIF.
* create a node iterator
ITERATOR = NODE->CREATE_ITERATOR( ).
* get current node
NODE = ITERATOR->GET_NEXT( ).
* loop over all nodes
WHILE NOT NODE IS INITIAL.
INDENT = NODE->GET_HEIGHT( ) * 2.
INDENT = INDENT + 20.
CASE NODE->GET_TYPE( ).
WHEN IF_IXML_NODE=>CO_NODE_ELEMENT.
* element node
NAME = NODE->GET_NAME( ).
NODEMAP = NODE->GET_ATTRIBUTES( ).
WRITE: / 'ELEMENT :'.
WRITE: AT INDENT NAME COLOR COL_POSITIVE INVERSE.
IF NOT NODEMAP IS INITIAL.
* attributes
COUNT = NODEMAP->GET_LENGTH( ).
DO COUNT TIMES.
INDEX = SY-INDEX - 1.
ATTR = NODEMAP->GET_ITEM( INDEX ).
NAME = ATTR->GET_NAME( ).
PREFIX = ATTR->GET_NAMESPACE_PREFIX( ).
VALUE = ATTR->GET_VALUE( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT INDENT NAME COLOR COL_HEADING INVERSE, '=',
VALUE COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN IF_IXML_NODE=>CO_NODE_TEXT OR
IF_IXML_NODE=>CO_NODE_CDATA_SECTION.
* text node
VALUE = NODE->GET_VALUE( ).
WRITE: / 'VALUE :'.
WRITE: AT INDENT VALUE COLOR COL_GROUP INVERSE.
ENDCASE.
* advance to next node
NODE = ITERATOR->GET_NEXT( ).
ENDWHILE.
ENDFORM. "process_dom
Thanks,
Sankar M -
Problem with Routine in Transformation
I have a routine that uses TIMECALC_DIFF to determine the difference between to date/times held in timestamp format.
All it generates is a duration of zero, no matter what the inputs are.
Value for YDATTIM is 20050812121821 and for YDATTIMF is 20050813121821 and the answer given is zero, when it should be 86400.
CONSTANTS: gc_timezone_system TYPE timezone VALUE 'MSTNO'.
DATA: t_first(14) TYPE c,
t_last(14) TYPE c,
/BIC/YDATTIM TYPE timestamp,
/BIC/YDATTIMF TYPE timestamp,
/BIC/YDATDUR TYPE i.
CALL FUNCTION 'TIMECALC_DIFF'
EXPORTING
timestamp1 = /BIC/YDATTIM
timestamp2 = /BIC/YDATTIMF
timezone = gc_timezone_system
IMPORTING
difference = /BIC/YDATDUR.
RESULT = /BIC/YDATDUR.
Thanks
SteveIn the transformation it generates the following code, and this doesn't seem to be editable;
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS-/BIC/YDATTIMF TYPE /BIC/OIYDATTIMF
SOURCE_FIELDS-/BIC/YDATTIM TYPE /BIC/OIYDATTIM
EXPORTING
RESULT type tys_TG_1-/BIC/YDATDUR**
DATA:
MONITOR_REC TYPE rsmonitor.
I have put all the code generated below
PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
TYPES:
BEGIN OF tys_SC_1,
InfoObject: YDATTIMF Finish date/time.
/BIC/YDATTIMF TYPE /BIC/OIYDATTIMF,
InfoObject: YDATTIM Start date/time.
/BIC/YDATTIM TYPE /BIC/OIYDATTIM,
Field: RECORD.
RECORD TYPE RSARECORD,
END OF tys_SC_1.
TYPES:
BEGIN OF tys_TG_1,
InfoObject: YDATDUR Duration.
/BIC/YDATDUR TYPE /BIC/OIYDATDUR,
END OF tys_TG_1.
$$ begin of global - insert your declaration only below this line -
$$ end of global - insert your declaration only before this line -
METHODS
compute_YDATDUR
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS type tys_SC_1
EXPORTING
RESULT type tys_TG_1-/BIC/YDATDUR
monitor type rstr_ty_t_monitor
RAISING
cx_rsrout_abort
cx_rsrout_skip_record
cx_rsrout_skip_val.
METHODS
invert_YDATDUR
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
i_r_selset_outbound TYPE REF TO cl_rsmds_set
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO cl_rsmds_universe
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO cl_rsmds_set
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
METHOD compute_YDATDUR.
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS-/BIC/YDATTIMF TYPE /BIC/OIYDATTIMF
SOURCE_FIELDS-/BIC/YDATTIM TYPE /BIC/OIYDATTIM
EXPORTING
RESULT type tys_TG_1-/BIC/YDATDUR
DATA:
MONITOR_REC TYPE rsmonitor.
$$ begin of routine - insert your code only below this line -
CONSTANTS: gc_timezone_system TYPE timezone VALUE 'GMTUK'.
DATA: t_first(14) TYPE c,
t_last(14) TYPE c,
/BIC/YDATTIM TYPE timestamp,
/BIC/YDATTIMF TYPE timestamp,
/BIC/YDATDUR TYPE i.
CALL FUNCTION 'ZZTIMEDIFF'
EXPORTING
/BIC/YDATTIM = /BIC/YDATTIM
/BIC/YDATTIMF = /BIC/YDATTIMF
timezone = gc_timezone_system
IMPORTING
difference = /BIC/YDATDUR.
RESULT = /BIC/YDATDUR.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "compute_YDATDUR
Method invert_YDATDUR
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD invert_YDATDUR.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "invert_YDATDUR
ENDCLASS. "routine IMPLEMENTATION
Thanks
Steve -
Create records for missing periods in transformation
I need to create some routine that creates fical periods missing with 0,00 as value in de key figure and the characteristics remain the same. It is possible to create in the transformation something like this? Should put it in the initial routine or in the end one?
Source
Company 1; Account 1; Fiscper 012009; KF 345 Eur
Company 1; Account 1; Fiscper 032009; KF 123 Eur
Company 1; Account 1; Fiscper 062009; KF 678 Eur
Company 1; Account 2; Fiscper 012009; KF 987 Eur
Final destination
Company 1; Account 1; Fiscper 01.2009; KF 345 Eur
Company 1; Account 1; Fiscper 02.2009; KF 0 Eur
Company 1; Account 1; Fiscper 03.2009; KF 123 Eur
Company 1; Account 1; Fiscper 04.2009; KF 0 Eur
Company 1; Account 1; Fiscper 05.2009; KF 0 Eur
Company 1; Account 1; Fiscper 06.2009; KF 678 Eur
Company 1; Account 1; Fiscper 07.2009; KF 0 Eur
Company 1; Account 2; Fiscper 01.2009; KF 987 Euryou are right, that's what I'm afraid of.
I already have a end routine:
PROGRAM trans_routine.
* CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
* Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
* Available information: Refer to methods of
* interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
* Rule specific types
TYPES:
BEGIN OF _ty_s_TG_1,
* InfoObject: ZIGCHENTI Magn_ci - Entity.
/BIC/ZIGCHENTI TYPE /BIC/OIZIGCHENTI,
* InfoObject: ZIGCHPART Magn_ci - Partner.
/BIC/ZIGCHPART TYPE /BIC/OIZIGCHPART,
* InfoObject: ZIGCHCTSH Magn_ci - CtShare.
/BIC/ZIGCHCTSH TYPE /BIC/OIZIGCHCTSH,
* InfoObject: ZIGCHCURR Magn_ci - Currency.
/BIC/ZIGCHCURR TYPE /BIC/OIZIGCHCURR,
* InfoObject: ZIGCHZONE Magn_ci - ZONE.
/BIC/ZIGCHZONE TYPE /BIC/OIZIGCHZONE,
* InfoObject: 0FISCPER Exercício / período.
FISCPER TYPE /BI0/OIFISCPER,
* InfoObject: 0FISCVARNT Variante de exercício.
FISCVARNT TYPE /BI0/OIFISCVARNT,
* InfoObject: ZIGKFCSAM Magnitude - Consolidated Amount.
/BIC/ZIGKFCSAM TYPE /BIC/OIZIGKFCSAM,
* InfoObject: 0CURRENCY Código da moeda.
CURRENCY TYPE /BI0/OICURRENCY,
* InfoObject: 0FISCYEAR Exercício.
FISCYEAR TYPE /BI0/OIFISCYEAR,
* InfoObject: 0FISCPER3 Período contábil.
FISCPER3 TYPE /BI0/OIFISCPER3,
* InfoObject: ZIGCHAINT Magn_ci - Audit ID.
/BIC/ZIGCHAINT TYPE /BIC/OIZIGCHAINT,
* InfoObject: ZIGCHFINT Magn_ci - Fluxo.
/BIC/ZIGCHFINT TYPE /BIC/OIZIGCHFINT,
* InfoObject: ZIGCHGLAC Magn_ci - Conta.
/BIC/ZIGCHGLAC TYPE /BIC/OIZIGCHGLAC,
* InfoObject: ZIGCHCINT Magn_ci - Categoria.
/BIC/ZIGCHCINT TYPE /BIC/OIZIGCHCINT,
* InfoObject: ZIGCHPINT Magnitude - Perímetro de Consolidação.
/BIC/ZIGCHPINT TYPE /BIC/OIZIGCHPINT,
* InfoObject: ZIGCHCCUR Magn_ci - Consolidation Currency.
/BIC/ZIGCHCCUR TYPE /BIC/OIZIGCHCCUR,
* InfoObject: ZIGCHVINT Magnitude - Versão de Consolidação.
/BIC/ZIGCHVINT TYPE /BIC/OIZIGCHVINT,
* InfoObject: ZIGCHPROD Magn_ci - PROD.
/BIC/ZIGCHPROD TYPE /BIC/OIZIGCHPROD,
* InfoObject: ZIGCHDEST Magn_ci - Dest.
/BIC/ZIGCHDEST TYPE /BIC/OIZIGCHDEST,
* InfoObject: ZIGKFCSAC Magn - Cons.Amount - CURR.
/BIC/ZIGKFCSAC TYPE /BIC/OIZIGKFCSAC,
* InfoObject: ZIGKFCAIP Magn - Cons.Amount - IVA - PMP.
/BIC/ZIGKFCAIP TYPE /BIC/OIZIGKFCAIP,
* InfoObject: ZIGKFCAIR Magn - Cons.Amount - IVA - PMR.
/BIC/ZIGKFCAIR TYPE /BIC/OIZIGKFCAIR,
* InfoObject: ZIGKFVLM Dados Magnitude - Valor Mensal.
/BIC/ZIGKFVLM TYPE /BIC/OIZIGKFVLM,
* Field: RECORD.
RECORD TYPE RSARECORD,
END OF _ty_s_TG_1.
TYPES:
_ty_t_TG_1 TYPE STANDARD TABLE OF _ty_s_TG_1
WITH NON-UNIQUE DEFAULT KEY.
*$*$ begin of global - insert your declaration only below this line *-*
... "insert your code here
*$*$ end of global - insert your declaration only before this line *-*
METHODS
end_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
RESULT_PACKAGE type _ty_t_TG_1
RAISING
cx_rsrout_abort.
METHODS
inverse_end_routine
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
i_r_selset_outbound TYPE REF TO cl_rsmds_set
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO cl_rsmds_universe
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO cl_rsmds_set
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
*$*$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
*$*$ end of 2nd part global - insert your code only before this line *
* CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
* Method end_routine
* Calculation of result package via end routine
* Note: Update of target fields depends on rule assignment in
* transformation editor. Only fields that have a rule assigned,
* are updated to the data target.
* <-> result package
METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE _ty_s_TG_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
DATA: wa_result_fim type _ty_s_TG_1.
DATA: l_tabix type sy-tabix.
CLEAR wa_result_fim.
l_tabix = 0.
SORT RESULT_PACKAGE BY /BIC/ZIGCHENTI /BIC/ZIGCHAINT /BIC/ZIGCHGLAC
/BIC/ZIGCHPINT
/BIC/ZIGCHVINT FISCPER.
LOOP AT RESULT_PACKAGE assigning <RESULT_FIELDS>.
IF sy-tabix = 1.
<RESULT_FIELDS>-/BIC/ZIGKFVLM = <RESULT_FIELDS>-/BIC/ZIGKFCSAM.
ELSE.
l_tabix = sy-tabix - 1.
READ TABLE RESULT_PACKAGE INDEX l_tabix INTO wa_result_fim.
IF sy-subrc EQ 0.
IF wa_result_fim-/BIC/ZIGCHENTI =
<RESULT_FIELDS>-/BIC/ZIGCHENTI
AND wa_result_fim-/BIC/ZIGCHAINT =
<RESULT_FIELDS>-/BIC/ZIGCHAINT
AND wa_result_fim-/BIC/ZIGCHGLAC =
<RESULT_FIELDS>-/BIC/ZIGCHGLAC
AND wa_result_fim-/BIC/ZIGCHPINT =
<RESULT_FIELDS>-/BIC/ZIGCHPINT
AND wa_result_fim-/BIC/ZIGCHVINT =
<RESULT_FIELDS>-/BIC/ZIGCHVINT
AND wa_result_fim-FISCYEAR = <RESULT_FIELDS>-FISCYEAR.
Before I do this calculation I want it to validate if exist the period if not should append it with 0,00 and them do the subtraction.
<RESULT_FIELDS>-/BIC/ZIGKFVLM =
<RESULT_FIELDS>-/BIC/ZIGKFCSAM -
wa_result_fim-/BIC/ZIGKFCSAM.
ELSE.
<RESULT_FIELDS>-/BIC/ZIGKFVLM =
<RESULT_FIELDS>-/BIC/ZIGKFCSAM.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "end_routine
* Method inverse_end_routine
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
METHOD inverse_end_routine.
*$*$ begin of inverse routine - insert your code only below this line*-*
... "insert your code here
*$*$ end of inverse routine - insert your code only before this line *-*
ENDMETHOD. "inverse_end_routine
Edited by: João Piçarra on Aug 13, 2009 12:18 PM -
Hi..
I have created an RRI. The BW Query goes back to a Transaction FB03 in R/3. FB03 takes single values as inputs for the fields 'Document Number', 'Company Code' and the 'Fiscal Year'.
This RRI uses an Infosource 0FI_GL_4, which has Transfer routine for the Field 0FISCYEAR (Fiscal Year). Below is the routine:
DATA: v_var(3) TYPE c.
v_var = TRAN_STRUCTURE-fiscper+4(3).
SHIFT v_var LEFT DELETING LEADING '0'.
IF TRAN_STRUCTURE-fiscvar = 'K4' AND
TRAN_STRUCTURE-fiscper LE 2004003 AND
v_var GE 4 AND v_var LE 12.
RESULT = TRAN_STRUCTURE-gjahr + 1.
ELSE.
RESULT = TRAN_STRUCTURE-gjahr.
ENDIF.
CLEAR v_var.
I want to transform the above Transfer routine to Inverse routine. Can anyone please help me out in this?
Or you could provide me any other Inversion routine you have written, so that I could build up the logic.
Thanks in advance,
Sai.Hi...
No one yet didn't write any inversion routine???
Please help. I would very much appreciate if anyone could send me an inversion routine code.
Thanks,
Sai.
Maybe you are looking for
-
Help! Need iPod GENIUS. iPods won't boot after some syncs except disk mode
Greetings all! Long time lurker, new member! I hate this kind of first post, but I am stuck. After years of having iPods myself (mostly 2nd gen Nanos) and playing with friends' flash and drive based iPods, I bought a 5.5 gen 30GB video iPod in mid Ju
-
Derby db named query causes parse error when using derby db MONTH function
Hi all! I'm trying to create an application using the persistance api and beans binding. I have created my database and entity classes. My problem is creating a named query that uses some of the functionality from the derby database (which is embedde
-
Scaling SWF in PDF (FlashVar)
I'm currently strucling with an exported SWF file from Indesign, which I want to import in an interactive pdf. The importing isn't the problem, but it appears the SWF file does not scale with the pdf, when for example putting the pdf in fullscreen (o
-
Hi folks, I have a requirement in ALV format where the workcenters should be displayed in the first row.. and the corresponding Procurement & setup should be displayed under that corresponding workcenter. WOrk Center
-
Dear All, For material 100, in UoM tab if multiple UoM are maintained then how do i load the same to BI. Is there specific DataSource available for it? Please help for the same ASAP. Regards, SS