on 11-27-2007 11:11 PM
Hello all,
I need some help. Below is my code and I keep getting X_Message = 11 exception. I cannot see what's wrong with it. As you can see, I want to extract the amount value on the specific project in the cube. Does anybody know what I am doing wrong below? I will reward points for any useful answers.
TYPE-POOLS: rs, rsdrc.
TYPES:
BEGIN OF gt_s_data,
0PROJECT TYPE /BI0/OIPROJECT,
0COSTELMNT TYPE /BI0/OICOSTELMNT,
0FISCYEAR TYPE /BI0/OIFISCYEAR,
0CURRENCY TYPE /BI0/OICURRENCY,
0CURTYPE TYPE /BI0/OICURTYPE,
END OF gt_s_data.
DATA:
g_s_data TYPE gt_s_data,
g_t_data TYPE STANDARD TABLE OF gt_s_data
WITH DEFAULT KEY INITIAL SIZE 10,
g_s_sfc TYPE rsdri_s_sfc,
g_th_sfc TYPE rsdri_th_sfc,
g_s_sfk TYPE rsdri_s_sfk,
g_th_sfk TYPE rsdri_th_sfk,
g_s_range TYPE rsdri_s_range,
g_t_range TYPE rsdri_t_range.
DATA: plnyr4(4).
CLEAR g_th_sfc.
CLEAR g_s_sfc.
g_s_sfc-CHANM = '0PROJECT'.
g_s_sfc-CHAALIAS = '0PROJECT'.
g_s_sfc-ORDERBY = 0.
INSERT g_s_sfc INTO TABLE g_th_sfc.
g_s_sfc-CHANM = '0COSTELMNT'.
g_s_sfc-CHAALIAS = '0COSTELMNT'.
g_s_sfc-ORDERBY = 0.
INSERT g_s_sfc INTO TABLE g_th_sfc.
g_s_sfc-CHANM = '0FISCYEAR'.
g_s_sfc-CHAALIAS = '0FISCYEAR'.
g_s_sfc-ORDERBY = 0.
INSERT g_s_sfc INTO TABLE g_th_sfc.
g_s_sfc-CHANM = '0CURRENCY'.
g_s_sfc-CHAALIAS = '0CURRENCY'.
g_s_sfc-ORDERBY = 0.
INSERT g_s_sfc INTO TABLE g_th_sfc.
g_s_sfc-CHANM = '0CURTYPE'.
g_s_sfc-CHAALIAS = '0CURTYPE'.
g_s_sfc-ORDERBY = 0.
INSERT g_s_sfc INTO TABLE g_th_sfc.
WHAT KEY FIGURES YOU WANT RETURNED
CLEAR g_th_sfk.
g_s_SFK-KYFNM = '0AMOUNT'.
g_s_SFK-KYFALIAS = '0AMOUNT'.
g_s_sfk-aggr = 'SUM'.
INSERT g_s_sfk INTO TABLE g_th_sfk.
WHERE YOU SET THE PARAMETERS/FILTERS.
CLEAR g_t_range.
CLEAR g_s_range.
g_s_RANGE-CHANM = '0PROJECT'.
g_s_RANGE-SIGN = 'I'.
g_s_RANGE-COMPOP = 'EQ'.
g_s_RANGE-LOW = 'PROJ05-IS002'.
APPEND g_s_range TO g_t_range.
CLEAR g_s_range.
g_s_RANGE-CHANM = '0COSTELMNT'.
g_s_RANGE-SIGN = 'I'.
g_s_RANGE-COMPOP = 'EQ'.
g_s_RANGE-LOW = '0000416951'.
APPEND g_s_range TO g_t_range.
*
plnyr4 = SY-datum(4) + 1.
*
CLEAR g_s_range.
g_s_RANGE-CHANM = '0FISCYEAR'.
g_s_RANGE-SIGN = 'I'.
g_s_RANGE-COMPOP = 'EQ'.
g_s_RANGE-LOW = plnyr4.
APPEND g_s_range TO g_t_range.
CLEAR g_s_range.
g_s_RANGE-CHANM = '0CURRENCY'.
g_s_RANGE-SIGN = 'I'.
g_s_RANGE-COMPOP = 'EQ'.
g_s_RANGE-LOW = 'USD'.
APPEND g_s_range TO g_t_range.
*
CLEAR g_s_range.
g_s_RANGE-CHANM = '0CURTYPE'.
g_s_RANGE-SIGN = 'I'.
g_s_RANGE-COMPOP = 'EQ'.
g_s_RANGE-LOW = '10'.
APPEND g_s_range TO g_t_range.
*
DATA: LIN_COUNT TYPE I.
DATA: g_first_call TYPE rs_bool.
*g_end_of_data TYPE rs_bool.
--- this variable will be set to TRUE when the last data
package is read
*g_end_of_data = rs_c_false.
--- this variable indicates whether this is an initial
call to the reading module or a follow-up call (which
simply retrieves already selected data)
g_first_call = rs_c_true.
clear e_subrc.
CALL FUNCTION 'RSDRI_INFOPROV_READ'
EXPORTING
I_INFOPROV = 'ZSEMCUBE01'
I_TH_SFC = g_th_sfc
I_TH_SFK = g_th_sfk
I_T_RANGE = g_t_range
I_TH_TABLESEL =
I_T_RTIME =
I_REFERENCE_DATE = SY-DATUM
I_ROLLUP_ONLY = RS_C_TRUE
I_T_REQUID =
I_SAVE_IN_TABLE = rs_c_false
I_TABLENAME = rs_c_false
I_SAVE_IN_FILE = ' '
I_FILENAME =
I_PACKAGESIZE = 10
I_MAXROWS = 1
I_AUTHORITY_CHECK = RSDRC_C_AUTHCHK-READ
I_CURRENCY_CONVERSION = 'X'
I_USE_DB_AGGREGATION = RS_C_TRUE
I_USE_AGGREGATES = RS_C_TRUE
I_READ_ODS_DELTA = RS_C_FALSE
I_CALLER = RSDRS_C_CALLER-RSDRI
I_DEBUG = RS_C_FALSE
I_CLEAR = RS_C_FALSE
IMPORTING
E_T_DATA = g_t_data
E_END_OF_DATA = g_end_of_data
E_AGGREGATE =
E_SPLIT_OCCURRED =
E_T_MSG =
CHANGING
C_FIRST_CALL = g_FIRST_CALL
EXCEPTIONS
ILLEGAL_INPUT = 1
ILLEGAL_INPUT_SFC = 2
ILLEGAL_INPUT_SFK = 3
ILLEGAL_INPUT_RANGE = 4
ILLEGAL_INPUT_TABLESEL = 5
NO_AUTHORIZATION = 6
ILLEGAL_DOWNLOAD = 7
ILLEGAL_TABLENAME = 8
TRANS_NO_WRITE_MODE = 9
INHERITED_ERROR = 10
X_MESSAGE = 11
OTHERS = 12.
e_subrc = sy-subrc.
DESCRIBE TABLE g_t_data LINES LIN_COUNT.
WRITE : LIN_COUNT.
Hi Cory,
Hi Corry could you go to tcode st22 ?
Could you get the message e.g. msgid/something there ?
Tks.
Regards,
Niel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have resolved the x_message error. I simply added the code below in bold in the beginning of the FM.
BEGIN OF gt_s_data,
0PROJECT TYPE /BI0/OIPROJECT,
0COSTELMNT TYPE /BI0/OICOSTELMNT,
0FISCYEAR TYPE /BI0/OIFISCYEAR,
0CURRENCY TYPE /BI0/OICURRENCY,
0CURTYPE TYPE /BI0/OICURTYPE,
<b>0AMOUNT TYPE /BI0/OIAMOUNT,</b>
END OF gt_s_data.
Now the FM module executed successfully but the result returned the value zero which it should have returned the amount in dollars. On the bright side, the G_END_OF_DATA has returned the value 'X' which means the FM extracted the value successfully but it's blank. Any ideas?
Thanks!
Hi Cory,
If you check that attribute, the function will give an error. It's due to if you check that attribute, it means, that info-object only can be display attribute (not a navigation).
And actually, that attribute doesn't belong to that info-provider (like virtual).
So when the function is running to read, it will display error, that one of the info-object is missing.
It relate to OSS : 979660.
Hopefully it can help you to enlarge the scope knowledge your bw.
Regards,
Niel
Thanks a lot for any points you choose to assign.
This questions has been answered by adding the key figure into the structure. Now I was able to read the values from the cube. Thanks a lot for help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.