on 09-21-2010 9:41 AM
Hi Gurus,
I have an ABAP program which picks up data from Rate and Finance application performs different calculations and the calculated data is held in an a Variable.
How can i insert this value into the Finance (BPC) Cube using the ABAP program.
I tried to work out with the F fact table name and then Dim names then the SID's and then the masterdata tables but it becomming more complex then my actual code.
Thanks in advance
Sravan
Edited by: bpc_newb on Sep 21, 2010 4:10 PM
Hi Sravan,
It is not a good idea to write directly to a Fact table because of locking, security and many other reasons.
Better idea is to use BPC UJD and UJK frameworks to populate Applications.
BPC usually uses Method WRITE_BACK_INT of Class CL_UJR_WRITE_BACK to write data back to an Application, but you have to set current context with cl_uj_context=>set_cur_context, create instance, etc before you call that Method.
Hope this helps,
Gersh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can take a look in Class CL_UJK_RUN_LOGIC Method CALL_WB or Class CL_UJK_WHEN_ENDWHEN Method WB or Class CL_UJP_ALLOCATION Method WRITE_TRANS_DATA. If you implemented How To Guide for Destination App than you should see it in Class ZCL_BPC_SL_PVFP_HCM_DAPP Method IF_UJ_CUSTOM_LOGIC~EXECUTE.
I just prefer not to provide code that I haven't written myself even though it's an Open source:).
Let me know if you still have issues using that method.
Regards,
Gersh
Hi Gersh,
My problem is I am not an ABAPer. I am a BI/BPC consultant. we do not have an ABAP consultant so I am trying to write the code by my self. I managed to do all the calculations with the help of people like you on this forum.
Now i need write the data into the BPC cube. thats where i am struck
Thanks for the help
Sravan
Hi Sravan,
In absence of a good ABAP resource why wouldn't you try BPC script: it's much easier for a fresh person and usually code is much smaller.
Can you please explain what problem you are trying to solve and may be we can find a way to do it in script without ABAP; or if you already posted that problem on SDN can you just refer to that thread?.
Regards,
Gersh
Hi Gersh,
I used the API / FM'UJQ_RUN_RSDRI_QUERY' to get the data from both the required applications (RATE AND ACCRUALS).
then used few more few other FMs like 'CONVERSION_EXIT_IDATE_INPUT' to do different calculations and stores the data in a
program variable. Till this part i was successful that too with perfect answer.
Now i need to write this data into a diffrent account (Parking_rate) into the accrual application.
I am trying to use another FM 'RSDRI_CUBE_WRITE_PACKAGE' to perform this task.
CALL FUNCTION 'RSDRI_CUBE_WRITE_PACKAGE'
EXPORTING
I_INFOCUBE = '/CPMB/P6IRG0R' "only technical name is been understood by the system.
* I_CURR_CONVERSION = RS_C_TRUE
* I_NCUM_INIT = RS_C_FALSE
* I_MDATA_CHECK = RS_C_FALSE
* I_DELTA = RS_C_FALSE
* IMPORTING
* E_REQUID =
* E_RECORDS =
* E_TS_MSG =
CHANGING
C_T_DATA = GT_FINALbut i am getting a short dump . Type conflict when calling function module "RSDRI_CUBE_WRITE_PACKAGE".
dont know why i just cant understand how to pass ITAB to C_T_DATA
Defined GT_FINAL as below
DATA: BEGIN OF GT_FINAL OCCURS 0,
AIRCRAFT(20) TYPE C,
CATEGORY(20) TYPE C,
DAYSMITH(20) TYPE C,
FLIGHTNO(20) TYPE C,
MATERIAL(20) TYPE C,
P_DATASRC(20) TYPE C,
RPTCURRENCY(20) TYPE C,
SECTOR(20) TYPE C,
STATION(20) TYPE C,
TAILNO(20) TYPE C,
TIME(20) TYPE C,
SIGNEDDATA(11) TYPE P,
END OF GT_FINAL.Thanks
Sravan
Hi Sravan,
This is still not description of the problem you solving, this is description of problem you got into while trying to solve your problem using ABAP.
FM RSDRI_CUBE_WRITE_PACKAGE is called from Methods I listed above, so it's just a much lower level tool of writing data into an Application. I hope you recognize that Cube name most probably will be different when your Application is transported as well as when its Fully Optimized or Structure of your Application changes.
If nevertheless you still want to continue that with that path of development, I think C_T_DATA is incompatible with GT_FINAL because first is defined Without Header Line while the second uses old style table definition With Header Line. You can try changing definition of GT_FINAL by defining first a Structure with "begin of ... end of" and than define GT_FINAL as STANDARD TABLE OF that structure. I think ABAP dump you are getting should say which parameter is not compatible.
Regards,
Gersh
Hello never mind i managed to solve it myself.
Just have to turn WRITE = ON in the script logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I'm an ABAP Cons. and I am new to BPC. I need a little help here as well.
the problem about the dump in RSDRI_CUBE_WRITE_PACKAGE FM is this:
When this program is running, your infocube is generating a program inside this FM, thus, one subroutine inside it has type compatible with FORM convert_v2_dtp
*****
FIELD-SYMBOLS:
<l_t_cubecha> TYPE g_t_cubecha,
<l_t_data> TYPE STANDARD TABLE,
<l_s_data> TYPE /B28/VU7IS2FQ2. =====> This is the problem coz its pointing to an aggregate instead of Basic cube
*
-
*
LOOP AT <l_t_data> ASSIGNING <l_s_data>. ===> This is the part that is giving the short dump.
MOVE-CORRESPONDING <l_s_data> TO l_s_cubecha.
MOVE <l_s_data>-0CHNGID TO l_s_cubecha-CHNGID.
*----
I have tried several options to do the cube_write but it seems not quite favorable to me as of the moment.
The class CL_UJP_ALLOCATION method write_trans_data does not work inside BADI_UJ_CUSTOM_LOGIC as it is attribs is Private adn as well as method call_wb in class cl_ujk_run_logic. Im doing all these codes and cube updates in BADI due to run time issue and script logic may not be an option.
How did you manage to get things right for this? Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is so funny I have to get back on the OLD post again just to revisit solution I have done before. Anyway, to document what I did to my OWN query:
CALL FUNCTION 'RSDRI_CUBE_WRITE_PACKAGE'
EXPORTING
i_infocube = lv_cubnam" '/CPMB/U7IKPSK' => This Infocube must be the tech name
i_mdata_check = rs_c_true
CHANGING
c_t_data = <lt_v2> => while this is the V2 view of the infocube
EXCEPTIONS
infocube_not_found = 1
illegal_input = 2
rollback_error = 3
duplicate_records = 4
request_locked = 5
not_transactional = 6
inherited_error = 7
OTHERS = 8.
Assign dynamically the field from infocube to V2 view.
You can check by making use of the FMs inside the write cube FM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.