Eto_charsel (bw 3.5)
Hi Guys,
I have a problem with the eto_charsel table. In my logic in some cases this table
finish empty when a user has no access to a some information and then the next message error is raised "Text ZDU00001ZDUNREAL ID PLPA language ES doesn't exist".
Is there any way to control this?. Also, how can I debbug the logic ibecause the break-point doesn't work.
logic
when 'ZDUIND1' or 'ZDUIND2'.
data t4 like /BIC/AZDU_O0400 occurs 0 with header line.
data t5 like /BIC/AZDU_O0500 occurs 0 with header line.
data l_source_vtip TYPE upc_y_variable VALUE 'ZDUVTIP'.
data l_typ type /BI0/OIVTYPE.
if i_variable eq 'ZDUIND1'.
l_typ = '010'.
elseif i_variable eq 'ZDUIND2'.
l_typ = '020'.
endif.
refresh t4.
select * into table t4
from /BIC/AZDU_O0400
where TCTUSERNM eq sy-uname.
if sy-subrc eq 0.
loop at t4.
refresh t5.
select * into table t5
from /BIC/AZDU_O0500
where /BIC/ZDU_GIND eq t4-/BIC/ZDU_GIND
and vtype eq l_typ.
if sy-subrc eq 0.
loop at t5.
select single /BIC/ZDU_ORIG into l_origen
from /BIC/PZDU_INDI
where /BIC/ZDU_INDI eq t5-/BIC/ZDU_INDI
and /BIC/ZDU_NIVE eq '0'.
and /BIC/ZDU_SUPT eq l_supt.
if sy-subrc eq 0 and l_origen eq '2'.
CLEAR ls_charsel.
ls_charsel-CHANM = I_CHANM.
ls_charsel-SEQNO = i.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'EQ'.
ls_charsel-low = t5-/BIC/ZDU_INDI.
INSERT ls_charsel INTO TABLE eto_charsel.
add 1 to i.
MESSAGE 'HOLA' type 'I'.
endif.
endloop.
endif.
endloop.
endif.
Regards,
Iván.
hi Kevin,
think application component hierarchy for bw myself not transfered yet, try rsa9 (transfer application hierarchy component) ?
Similar Messages
-
Hi Gurus:
I have a layout for planning, where I can plan for 5 days of the week. I also have a day column (yesterday) where I have the actual values. Users want to edit/foecast the next 5 days values. I am using a Variable to get the Date column which uses the System Date. However, since I am getting just one date in the Function Module (Code given below), the remaining days are greyed out and I can not enter the forecast values. I would like the same variable to get a series of dates in the same function module. What changes do I nee dto make in the ABAP code so that the remaining columns (Date) becaoe available for editing??
The FM code I have to get "Today's Date" is as follows:
FUNCTION ZCSHFL_GET_TODAY.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_VAR-AREA
*" REFERENCE(I_VARIABLE) TYPE UPC_Y_VARIABLE
*" REFERENCE(I_CHANM) TYPE UPC_Y_CHANM
*" REFERENCE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
data: ls_charsel type upc_ys_charsel.
ls_charsel-seqno = 1.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'EQ'.
ls_charsel-CHANM = I_chanm.
ls_charsel-low = sy-datum.
insert ls_Charsel into table eto_charsel.
ENDFUNCTION.
I want to get the Yestarday's Date as weel as dates for next 4 days from Today for this variable which are being used in the layout. Can anyone suggest the code tor this please.
Thanks very much in advance......
Best.... ShruMaaHi,
What I understand you need to return those dates from function module using parameter ETO_CHARSEL , right? If so just use this code:
ls_charsel-seqno = 1.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'BT'. "we are giving ranges, so days between...
ls_charsel-CHANM = I_chanm.
ls_charsel-low = sy-datum - 1. "...first day is yesterday
ls_charsel-high = sy-datum + 4. "...and last day is 4 days from today
insert ls_Charsel into table eto_charsel.
This way you provide 5 days starting from yesterday till 4 days from today.
Regards
Marcin -
Displaying messages while running BEx queries.
Hi Experts,
Can any one explain me is there any possibility to display some popup messages while running BEx queries?
Regards,
AnushaHi there,
You can do taht with user exit variables with the code something like this:
WHEN 'YOUR_VARIABLE'.
if i_step = 2.
LOOP AT eto_charsel INTO ln_charsel.
*some validation of your own
if ln_charsel-low NE '1'.
*call function to send a message, in this case, an error message
CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
EXPORTING
i_class = 'ERROR!'
i_type = 'E'
i_number = '000'
i_msgv1 = 'Please connect again and'
i_msgv2 = 'use the Revision Layout'.
RAISE no_processing.
endif.
ENDLOOP.
endif.
Diogo. -
Variable Range not working in BPS-Layout.
Hi BI Guru's,
I am facing Problem in BPS - Layout.
My requirement is to get YTD Budget Quantity in Single Coulumn. For Example, I need Quantiy for the Period 001.2009 to 12.2009 in single Column as Budget YTD 2009.
For this I defined a variable on the Planning area, with the characteristics "fiscper" and in the selection condition i entered the range 001.2009 to 012.2009, but when i executed the layout it is showing the quantity for the perios 001.2009 only and not for the entire range.
I tried with the User Exit also, where i copied the standard function module "UPF_VARIABLE_USER_EXIT" to 'Z' function and modified to my requirement.
Following is my Code for the Function Module
clear eto_charsel.
data ls_charsel type upc_ys_charsel.
clear ls_charsel.
i_area = 'ZUCOPA'.
I_CHANM = 'FISCPER'.
i_variable = 'ZACTDYTD1'.
ls_charsel-chanm = i_chanm.
ls_charsel-seqno = '1'.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'BT'.
ls_charsel-low = '2009001'.
ls_charsel-HIGH = '2009012'.
insert ls_charsel into table eto_charsel.
But the after using the Function Module in the User Exit area of Variable also, I am getting the Quantity for the Period 001.2009 only and not for the entire range ( 001.2009 to 012.2009 ).
Please suggest some solution ASAP.
Thanks in advance.
Regards,
VD.Hi Marc,
Thanks For your Reply,
I changed the Layout as suggested by you, where i have now 12 columns for Budget Quantity and a Total column( C1C2....C12).
I do not want to show this 12 column and instead want to show only the total column, so I hide this columnn's in the change layout but after saving the layout these columns again appear in the layout.
How do i hide these columns in the layout????
Thanks
VD -
USER Exit variable doesn't work in BSP
Hi gurus
I made a characteristic variable with user-exit replacement type.
It get the user id from sy-uname. It works well in Gui version. But when I execute the layout in BSP (WI), it doesn't work.
But If i do the hard-coding the line from (l_eto_charsel-low = uid.) to (l_eto_charsel-low = '4012121'.) it works well.
The following is my coding.
Please give me any comment.
CLEAR eto_charsel.
DATA l_eto_charsel TYPE upc_ys_charsel.
DATA uid type c. "(also I have tried 'data uid type sy-uname')
uid = sy-uname.
l_eto_charsel-chanm = i_chanm.
l_eto_charsel-seqno = '0001'.
l_eto_charsel-sign = 'I'.
l_eto_charsel-opt = 'EQ'.
l_eto_charsel-low = uid. ++++>
INSERT l_eto_charsel INTO TABLE eto_charsel.
ENDFUNCTION.
Message was edited by: Bryan LeeHi,
Your patch level seems to be OK.
pls. try the declaration as 'Data: uid like syst-uname' or you could try directly assigning the sy-uname.
Try to debug and see the content of the sy-uname, when it hits this code.
HTH,
Regards,
Nataraj. -
BPS variables and API_SEMBPS_GETDATA
Hi, everybody!
I've faced with the following issue.
I have two planning levels. I have three variables: ZVPYEAR "Year of planning" (based on 0CALYEAR),
ZVPRESP "Responsible person" (based on ZRESP) and ZVPWBS "WBS-element" (based on 0WBS_element), as well.
Data in the plevel1 is restricted by variable ZVPYEAR and presented like this:
0WBS_ELEMENT 0CALYEAR 0RESP_PERSON 0START_DATE 0FINISH_DATE
WBS1 2006 RESP1 01/01/2006 12/31/2006
WBS2 2006 RESP1 03/01/2006 05/31/2006
WBS3 2006 RESP2 04/01/2006 07/31/2006
WBSN 2006 RESP3 08/01/2006 12/31/2006
Data in the plevel2 is restricted by variable ZVPYEAR, ZVPRESP and ZVPWBS. Moreover, list of available WBS-elements for
ZVPWBS I read from plevel1 using the following FM.
FUNCTION ZMZ_WBS_LOAD.
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
DATA: area TYPE upc_y_area VALUE 'PAREA',
plevel LIKE upc_plevel-plevel VALUE 'PLEVEL',
package LIKE upc_package-ppackage VALUE 'PPACKAGE',
layout LIKE upp_param-param VALUE 'PLAYOUT',
read_only LIKE upp_ys_flags-read_only VALUE 'X'.
DATA: res LIKE sy-subrc,
res_mess TYPE bapiret2 OCCURS 0.
DATA: lt_head TYPE upc_ys_api_head OCCURS 0,
ls_head TYPE upc_ys_api_head,
lt_col TYPE upc_ys_api_col OCCURS 0,
ls_col TYPE upc_ys_api_col,
lt_row TYPE upc_ys_api_row OCCURS 0,
ls_row TYPE upc_ys_api_row,
lt_rates TYPE upc_ys_api_data OCCURS 0,
ls_rates TYPE upc_ys_api_data.
DATA: ls_varsel TYPE upc_ys_charsel.
DATA: BEGIN OF lt_select OCCURS 0,
/BIC/ZWBS TYPE /BIC/OIZWBS,
END OF lt_select.
DATA: ls_select LIKE LINE OF lt_select.
DATA: lr_variable TYPE REF TO cl_sem_variable.
DATA: lt_values TYPE upc_yto_charsel.
DATA: ls_values LIKE LINE OF lt_values.
CLEAR lt_values[].
FREE lr_variable.
reading data from planning level
CALL FUNCTION 'API_SEMBPS_GETDATA'
EXPORTING
i_area = area
i_plevel = plevel
i_package = package
i_layout = layout
i_read_only = read_only
IMPORTING
e_subrc = res
TABLES
etk_head = lt_head
etk_row = lt_row
etk_col = lt_col
etk_data = lt_rates
etk_return = res_mess.
IF sy-subrc <> 0.
RETURN.
ENDIF.
getting value of ZVPRESP
CALL METHOD cl_sem_variable=>get_instance
EXPORTING
i_area = area
i_variable = 'ZVPRESP'
RECEIVING
rr_variable = lr_variable
EXCEPTIONS
not_existing = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CALL METHOD lr_variable->get_value
EXPORTING
i_user = sy-uname
i_restrict = 'X'
RECEIVING
rto_value = lt_values
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
restrict WBS according to selected variable ZVPRESP
LOOP AT lt_values INTO ls_values.
AT NEW low.
SELECT /BIC/ZWBS FROM /BIC/PZWBS
INTO ls_select-/BIC/ZWBS
WHERE /BIC/ZRSPNS = ls_values-low.
IF sy-subrc = 0.
APPEND ls_select TO lt_select.
ENDIF.
ENDSELECT.
ENDAT.
ENDLOOP.
IF lt_select[] IS INITIAL.
RETURN.
ENDIF.
returns available WBS-eleemnts
SORT lt_row BY chavlext.
ls_varsel-seqno = '0000'.
ls_varsel-chanm = 'ZWBS'.
ls_varsel-sign = 'I'.
ls_varsel-opt = 'EQ'.
LOOP AT lt_row INTO ls_row.
AT NEW chavlext.
READ TABLE lt_select
INTO ls_select
WITH KEY /BIC/ZWBS = ls_row-chavlext.
IF sy-subrc = 0.
ls_varsel-seqno = ls_varsel-seqno + 1.
ls_varsel-low = ls_row-chavlext.
APPEND ls_varsel TO eto_charsel.
ENDIF.
ENDAT.
ENDLOOP.
ENDFUNCTION.
At the first time everything works fine. But, when I try to change value of ZVPYEAR or ZVPRESP,
list of available values of WBS-elements for ZVPWBS is returned empty.
Perhaps, I should to add something in my FM?
I use
Softw. comp. |Release |Level |Highest SP |Description
--------++--
SAP_BASIS |620 |0055 |SAPKB62055 |SAP Basis Component
SAP_ABA |620 |0055 |SAPKA62055 |Cross-Application Component
SAP_BW |310 |0022 |SAPKW31022 |Business Information Warehouse
PI_BASIS |2004_1_620|0010 |SAPKIPYI5A |Basis Plug-In (PI_BASIS) 2004_1_620
FINBASIS |200 |0018 |SAPK-20018INFINBASIS|FINBASIS 200: Add-on installation reques
BI_CONT |330 |0017 |SAPKIBICQ7 |Business Intelligence Content
SEM-BW |350 |0018 |SAPKGS3518 |SEM-BW 3.2 : Installation.Hi,
Before going through your coding, could you check following first:
Are you using web or GUI?
If you are using web, you can set that Var: ZVPYEAR or ZVPRESP shall be refreshed after change of certain variable.
Check out also, if there is entry in table UPC_DARK2 whether the variable buffer is set (PARAM = 'VAR_BUFFER' VALUE = 'X' ?? )!
check also following notes:
720265, 888016, 629775.
Best Regards,
Suan Liono -
Dear All,
I am using 2 variables in a planning layout: MEMBER (INTUSE in the code) and DEPARTEMNT (INTDEPT1 in the code).
MEMBER must be filled based on the value of DEPARTEMENT. And for this I created a user exit.
In the web page I will have 2 drill downs lists.
the first is for departement. I want to fill the second list, for MEMBER, based on the value of DEPARTEMNT. For this, I need to read the value of the variable DEPARTEMNT.
How can I do this. Please help.
Thx
FUNCTION Z_SEM_INT_GET_VARIABLES.
""Local Interface:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_VARIABLE) TYPE UPC_Y_VARIABLE
*" VALUE(I_CHANM) TYPE UPC_Y_CHANM OPTIONAL
*" VALUE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
clear eto_charsel.
tables: /BIC/PINT_BW, /BIC/SITDEPT.
data: ls_charsel type upc_ys_charsel,
f_tabix like sy-tabix,
l_t_PINT_BW like standard table of /BIC/PINT_BW initial size 0 with header line,
l_t_PITDEPT like standard table of /BIC/PITDEPT initial size 0 with header line,
l_dept like /BIC/PINT_BW-/BIC/ITDEPT.
case I_VARIABLE.
when 'INTUSE'.
select * from /BIC/PINT_BW into table l_t_PINT_BW where /BIC/ITDEPT = l_dept.
loop at l_t_PINT_BW.
ls_charsel-chanm = i_chanm.
ls_charsel-seqno = sy-tabix.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'EQ'.
ls_charsel-low = l_t_PINT_BW-/BIC/INT_BW.
append ls_charsel to eto_charsel.
endloop.
endcase.
endfunction.
Edited by: Siegfried Szameitat on Nov 3, 2008 10:10 AMHi
Follow the exact same code as below and change functional area part as per your requirement.Here Functional area is derived on basis of selected cost center value........
FUNCTION Z_FUNCTIONAL_AREA_SET .
""Local Interface:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_VARIABLE) TYPE UPC_Y_VARIABLE
*" VALUE(I_CHANM) TYPE UPC_Y_CHANM
*" VALUE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
*" EXCEPTIONS
*" FAILED
Change constant according to your needs
CONSTANTS:
On the basis of Cost Centre functional area value are determinded
l_source_var TYPE upc_y_variable VALUE 'ZPVAR003',
l_source_area TYPE upc_y_area VALUE 'ZMLTPA01',
l_use_restricted_values TYPE boole-boole VALUE 'X',
l_buffer_call TYPE boole-boole VALUE ''.
DATA:
l_subrc LIKE sy-subrc,
ls_return LIKE bapiret2,
l_type LIKE upc_var-vartype,
lto_varsel_all TYPE upc_yto_charsel,
lto_varsel TYPE upc_yto_charsel,
lto_var TYPE upc_yto_charsel,
lto_chanm TYPE upc_yto_cha.
DATA: ls_varsel TYPE upc_ys_charsel,
ls_varsel_all type UPC_YS_CHARSEL.
data: l_year(4) type n.
data: t_text type table of t009c with header line,
l_index type sy-tabix,
l_count type sy-tabix,
l_count1 type sy-tabix.
data: begin of t_area occurs 0,
fun_area type /BI0/OIFUNC_AREA,
end of t_area.
data: v_comp_code type /BI0/OICOMP_CODE,
v_compcode type /BI0/OICOMP_CODE,
v_currency type /BI0/OICURRENCY,
v_taxarea type /BIC/OIZTAXAREA,
v_country_gp type /BI0/OICOUNTRY_ID.
read source value
CALL FUNCTION 'Z_VARIABLE_GET_DETAIL'
EXPORTING
i_area = l_source_area
i_variable = l_source_var
i_buffer = l_buffer_call
IMPORTING
e_subrc = l_subrc
es_return = ls_return
e_type = l_type
eto_varsel_all = lto_varsel_all
eto_varsel = lto_varsel
eto_chanm = lto_chanm.
IF l_subrc <> 0.
MESSAGE i010(ZERPBWD) WITH i_variable.
Values of variable &1 cannot be determined
EXIT.
ENDIF.
describe table lto_varsel lines l_count.
if not lto_varsel[] is initial.
lto_var = lto_varsel.
READ TABLE lto_var INTO ls_varsel INDEX 1.
else.
exit.
endif.
*Check the variable
CASE i_variable.
Set the value for Functional Area on the basis of cost center value.
when 'ZPVAR021'.
if l_count = 1.
select ZFUNCAREA
from ZCC_FUCNAREA
into table t_area
where ZCOSTCENTR = ls_varsel-low.
if sy-subrc eq 0.
Set the variable
l_count1 = 1.
loop at t_area.
ls_varsel-chanm = I_CHANM.
ls_varsel-seqno = l_count1.
ls_varsel-sign = 'I'.
ls_varsel-opt = 'EQ'.
ls_varsel-low = t_area-fun_area.
INSERT ls_varsel INto table eto_charsel.
CLEAR ls_varsel.
l_count1 = l_count1 + 1.
endloop.
endif.
endif.
ENDCASE.
ENDFUNCTION
This function module will also be there:
FUNCTION Z_VARIABLE_GET_DETAIL.
""Local Interface:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_VAR-AREA
*" VALUE(I_VARIABLE) TYPE UPC_VAR-VAR
*" VALUE(I_BUFFER) TYPE BOOLE-BOOLE OPTIONAL
*" EXPORTING
*" VALUE(E_SUBRC) TYPE SY-SUBRC
*" VALUE(ES_RETURN) TYPE BAPIRET2
*" VALUE(E_TYPE) TYPE UPC_VAR-VARTYPE
*" REFERENCE(ETO_VARSEL_ALL) TYPE UPC_YTO_CHARSEL
*" REFERENCE(ETO_VARSEL) TYPE UPC_YTO_CHARSEL
*" REFERENCE(ETO_CHANM) TYPE UPC_YTO_CHA
STATICS:
p_subrc LIKE sy-subrc,
ps_return LIKE bapiret2,
p_type LIKE upc_var-vartype,
pto_varsel_all TYPE upc_yto_charsel,
pto_varsel TYPE upc_yto_charsel,
pto_chanm TYPE upc_yto_cha,
p_variable TYPE upc_var-var,
p_area TYPE upc_y_area,
p_first_read LIKE boole-boole VALUE 'X'.
DATA:
lr_variable TYPE REF TO cl_sem_variable.
We can't read the values from the buffer if it is the first read
- the buffer flag is initial the stored area or varname differ from imported values.
IF NOT i_buffer IS INITIAL
AND p_first_read IS INITIAL
AND p_area = i_area
AND p_variable = i_variable.
e_subrc = p_subrc.
es_return = ps_return.
eto_varsel_all = pto_varsel_all.
eto_varsel = pto_varsel.
eto_chanm = pto_chanm.
ELSE.
clear all exporing tables of type reference
CLEAR: eto_chanm, eto_varsel_all, eto_varsel.
CALL METHOD cl_sem_variable=>get_instance
EXPORTING
i_area = i_area
i_variable = i_variable
RECEIVING
rr_variable = lr_variable
EXCEPTIONS
not_existing = 1
OTHERS = 2.
IF sy-subrc <> 0.
e_subrc = 4.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = es_return.
EXIT.
ENDIF.
read details of variable
CALL METHOD lr_variable->get_attributes
IMPORTING
e_type = e_type
eto_chanm = eto_chanm.
read restricted values
CALL METHOD lr_variable->get_value
EXPORTING
i_user = sy-uname
i_restrict = 'X'
RECEIVING
rto_value = eto_varsel
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
e_subrc = 4.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = es_return.
EXIT.
ENDIF.
read all values
CALL METHOD lr_variable->get_value
EXPORTING
i_user = sy-uname
i_restrict = ' '
RECEIVING
rto_value = eto_varsel_all
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
e_subrc = 4.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = es_return.
EXIT.
ENDIF.
-- no error occured => store results to buffer
CLEAR p_first_read.
p_area = i_area.
p_variable = i_variable.
p_subrc = e_subrc.
ps_return = es_return.
pto_varsel_all = eto_varsel_all.
pto_varsel = eto_varsel.
pto_chanm = eto_chanm.
ENDIF.
ENDFUNCTION.
Thanks
Debasish -
Attribute value to exit function module
Hello group,
I'm working in a sem-bps project and I have a problem with an exit function, because
I need the function module to read the value of a characteristic's attribute.
I read the standard function module UPF_VARIABLE_USER_EXIT_ATTR: it retrieves the attribute value through the import parameters ITO_ATTR TYPE UPC_YTO_ATTR.
I put this attribute on my exit function but when I check the content of the attribute its always empty. Do you know how I can transmit the parameter from the exit planning function to the function module?
Any input is appreciated, thanks AndreaAndrea, if you want to fill a variable with the characteristic's attribute of another variable look at the document "HowTo_BPS_VarOfTypeExit.pdf" (i send at your e-mail if you want). It Follows an extract in which it's filled the second variable with the characteristic's attribute of another variable:
Source code: Attribute values
SELECT * FROM /bi0/mbps_produ INTO TABLE lt_chavl
WHERE bps_prodl = ls_varsel-low.
if sy-subrc <> 0.
MESSAGE e026(upc) WITH ls_varsel-low '0BPS_PRODL'.
attribute value not found
exit.
endif.
ls_varsel-seqno = '0000'.
ls_varsel-chanm = '0BPS_PRODU'.
LOOP AT lt_chavl INTO ls_chavl.
ls_varsel-seqno = ls_varsel-seqno + 1.
ls_varsel-low = ls_chavl-bps_produ.
APPEND ls_varsel TO eto_charsel.
ENDLOOP.
In the example above ls_varsel contains the attribute value to provide to eto_charsel (the output table in which you have the result).
I suggest you to debug your application to see how ito_attr is passed to the FM.
Hope it helps.
Fabio -
BPS_WB: Update on change
Hi,
we have BW30B/SEM31B, BW SP25/SEM SP24. We have several planning layouts for the web.
On my web application (web interface builder) there are two dropdown list boxes for variable a and b. b is an exit variable with a function module.
Now we need to refresh and re-execute the function module for b when a changes its value. Therefor we did the following:
- add parameter WEB_REFRESH_ON_CHANGE value X in UPC_DARK2 table
- use the new layout in WIB
- Paramter "update on change by" of variable b we set to "=a"
But selecting another value for a does not force a re-executing of the function module for b.
We ist not correct? Can anyone help?
Thanks,
MathiasHi Marc,
the "event on selection" parameter of A is set to true. Meanwhile I found a hint in OSS 720265 that says the following:
>>> OSS 720265
You must code the dependency yourself in the generated class. You can force the selector to be refreshed, if you add the following line of code in the Initialization method, before the selector should be checked for the initial (inactive) state.
SelectorToRefresh->m_subrc = 3. " force initialization
For example:
"*** inserted code ***
if selector_shoud_be_refreshed. " use meaningful condition here !!!
SelectorToRefresh->m_subrc = 3. " force initialization
endif.
"*** end of inserted code ***
if SelectorToRefresh->m_subrc > 2. " inactive
SelectorToRefresh->api_get_variable( ).
endif.
>>> End OSS 720265
I did so and now I really get into the module at the right time and can stop at a breakpoint within it! But now it seems that the changes do not affect the appearance of the dropdownlistbox in web. The shown entries in the ddlb are just the same although table eto_charsel is different to it at the end of the function module.
Is it possible that this is buffered?
Regards,
Mathias -
In SEM-BPS, I have a layout for manually entering data. The purpose is to enter values for a list of cost centers. This list
of cost centers should change according to a SKF (statistical key figure) entered in the layout's header.
The list of cost centers linked to a given SKF is read from a database table.
This whole process is achieved with the use of a variable of type user-exit.
However, I have two problems:
1) If I change the SKF in the layout's header, I'm not beeing able to force another read to the database table, in order to
refresh the cost center list;
2) I'm not being able to detect the SKF selected in header, altough I'm using the function API_SEMBPS_VARIABLE_GETDETAIL to
do so, wich returns all the SKF's (statistical key figures)
Can anybody help me ?
Thank you,
Ricardo
PS: Here is the exit, in its present state:
<b>FUNCTION ZLACT_SFK_CC.
""Interface local:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_VARIABLE) TYPE UPC_Y_VARIABLE
*" VALUE(I_CHANM) TYPE UPC_Y_CHANM OPTIONAL
*" VALUE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
DATA: ls_charsel TYPE upc_ys_charsel,
seqno type i,
tab_val_sel LIKE UPC_YS_API_VARSEL occurs 0 with header line,
tab_val_sel_all LIKE UPC_YS_API_VARSEL occurs 0 with header line,
head like UPC_YS_API_HEAD occurs 0 with header line.
CLEAR:
eto_charsel, eto_charsel[] ,
tab_val_sel, tab_val_sel[] ,
ls_charsel, char_value, seqno,
t_ccusto, t_ccusto[],
t_iest, t_iest[].
case i_variable.
WHEN 'PRVCCIE'.
Get value of statistical key figure entered in layout's header****
CALL FUNCTION 'API_SEMBPS_VARIABLE_GETDETAIL'
EXPORTING
I_AREA = 'PRRVS'
I_VARIABLE = 'PRVSK'
TABLES
ETK_VARSEL = tab_val_sel.
select cost center list from database table ***********************
select
from ZPR_CC_IE_CG
appending corresponding fields of table t_ccusto
where iest = tab_val_sel-low.
clear:seqno.
loop at tab_val_sel.
ADD 1 TO seqno.
ls_charsel-low = tab_val_sel-low.
ls_charsel-seqno = seqno.
ls_charsel-opt = 'EQ'.
ls_charsel-sign = 'I'.
ls_charsel-chanm = '0STKEYFIG'.
INSERT ls_charsel INTO TABLE eto_charsel.
endloop.
loop at t_ccusto.
ADD 1 TO seqno.
ls_charsel-low = t_ccusto-ccusto.
ls_charsel-seqno = seqno.
ls_charsel-opt = 'EQ'.
ls_charsel-sign = 'I'.
ls_charsel-chanm = i_chanm.
INSERT ls_charsel INTO TABLE eto_charsel.
ENDLOOP.
when others.
*do nothing
ENDCASE.
endfunction.</b>Hello,
I use the exit in the planning level and I link the exit to a variable for "0FISCPER". I copy the data from a "Non-transactional Cube" to a "Transactional Cube" derictly of the period end closing. I still need the data in previous month for calculations in BPS. Maybe, I can use your code.
Thanks and best regards
Constant -
Hello all,
I have a requirement to determine the current year in BPS. I made a variable and wrote a function module.
The code I have is:
DATA: DATE LIKE SY-DATUM,
CURRYEAR TYPE C,
CHARSEL TYPE UPC_YS_CHARSEL.
CLEAR: CHARSEL.
CURRYEAR = DATE(4).
CHARSEL-CHANM = I_CHANM.
CHARSEL-SIGN = 'I'.
CHARSEL-OPT = 'EQ'.
CHARSEL-LOW = CURRYEAR.
INSERT CHARSEL INTO TABLE ETO_CHARSEL.
ENDFUNCTION.
The code is correct and i activated the function module and inserted the variable in folder. When I execute the folder, it says, variable cant be determined.
Any clues?
Thank you/HI Anil Kumar Sharma,
I declared another in the variable called "nextyear" and derived that by incrementing the curryear with 1. this is the code. But when i run the folder, it fills only curryear. Any clues. The code is pasted below.
Thanks a lot.
DATA: DATE LIKE SY-DATUM,
CURRYEAR(4) TYPE C,
NEXTYEAR(4) TYPE C,
CHARSEL TYPE UPC_YS_CHARSEL.
CLEAR: CHARSEL.
DATE(8) = SY-DATUM(8).
CURRYEAR(4) = DATE(4).
NEXTYEAR = CURRYEAR + 1.
CHARSEL-CHANM = I_CHANM.
CHARSEL-SIGN = 'I'.
CHARSEL-OPT = 'EQ'.
CHARSEL-LOW = CURRYEAR.
CHARSEL-HIGH = NEXTYEAR.
ENDFUNCTION. -
BPS: Setting empty Selections in Variables
Im Using Variables for the Selections of my Planninglevel. These Variables are filled by a User Exit.
What do I have to do when I want to Leave the selections for a Variabel empty?
By not using a Variable I would Type in # in the Slections of my Planninglevel, but how can I set it via ABAP-Coding.Hello Tobias,
in BPS there's a difference between an empty selection (= all values) and # (= unassigned value only).
If you want to set the exit variable to all values then return one range entry in eto_charsel (for example: I, BT, "0000", "9999"). If you need the unassigned value only then return an entry with I,EQ and leave low and high empty.
Regards,
Marc
SAP NetWeaver RIG, US BI -
API_SEMBPS_VARIABLE_GETDETAIL issue
Hi SDNer
I have 2 concerns regarding variables.
1. in the variable screen ( After executing planning folder) one variable is user input and the other one is derived from this variable by some Exit FM.
If i enter the user input value for first one, will the derived value for second variable will be reflected in that screen.
2. I have tested FM - API_SEMBPS_VARIABLE_GETDETAIL in SE37, by manually entering plan area and variable name. its working fine and getting the value of input variable from planning layout variable screen but only, when i save the variables after making an entry.....
If after entering variable i dont save FM is giving me the last value only. I guess it is buffer related issue.....
Do i can't test like this ?
Thanks
SaurabhI have written a piece of code for reading variable value from BPS thru API_SEM_BPS_GETVARIABLE_DETAIL and generate other variable value by using FM.
Although generated variable version value is displaying in planning folder variable screen ( When we execute planning folder) but when i execute any function which is using this newly generated variable, system is not finding any value for this variable and throwing error. here is my code
FUNCTION ZVERSION_AUTOMATION_CURR_YEAR.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_AREA-AREA
*" REFERENCE(I_VARIABLE) TYPE UPC_VAR-VAR
*" REFERENCE(I_CHANM) TYPE UPC_Y_CHANM
*" REFERENCE(ITO_CHANM) TYPE UPC_YTO_CHA
*" EXPORTING
*" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL
*" REFERENCE(ETK_VARSEL) LIKE UPC_YS_API_VARSEL
*" STRUCTURE UPC_YS_API_VARSEL
CONSTANTS:
l_use_restricted_values TYPE boole-boole VALUE 'X',
l_buffer_call TYPE boole-boole VALUE 'X'.
DATA: ls_varsel TYPE upc_ys_charsel,
l_entries TYPE i.
DATA:
l_variable type upc_y_variable,
l_area type upc_y_area,
l_subrc LIKE sy-subrc,
ls_return LIKE bapiret2,
l_type LIKE upc_var-vartype,
lto_varsel_all TYPE upc_yto_charsel,
lto_varsel TYPE upc_yto_charsel,
lto_var TYPE upc_yto_charsel,
lto_chanm TYPE upc_yto_cha.
Data: l_current_year type i.
Data: l_plan_year type i.
_READ PLANNING FOR YEAR VARIABLE THRU API_
Data: lp_subrc LIKE sy-subrc.
Data: lpt_varsel type table of upc_ys_api_varsel.
Data: lps_varsel type upc_ys_api_varsel.
call function 'API_SEMBPS_VARIABLE_GETDETAIL'
Exporting
i_area = i_area
i_variable = 'ZFISCYR'
Importing
e_subrc = lp_subrc
tables
etk_varsel = lpt_varsel.
if lp_subrc = 0.
clear lps_varsel.
read table lpt_varsel into lps_varsel index 1.
l_plan_year = lps_varsel-low.
endif.
READ CURRENT YEAR VARIABLE DEFINED ON ONE PLANNING LEVEL
l_variable = i_variable.
l_area = i_area.
CALL FUNCTION 'Z_VAR_GET_DETAIL'
EXPORTING
i_area = 'ZPLBSCF1'
i_variable = 'ZPLYEAR'
i_buffer = l_buffer_call
IMPORTING
e_subrc = l_subrc
es_return = ls_return
e_type = l_type
eto_varsel_all = lto_varsel_all
eto_varsel = lto_varsel
eto_chanm = lto_chanm.
IF l_subrc <> 0.
MESSAGE i136(upc_fw) WITH l_variable.
Values of variable &1 cannot be determined
EXIT.
ENDIF.
IF l_use_restricted_values IS INITIAL.
lto_var = lto_varsel_all.
ELSE.
lto_var = lto_varsel.
ENDIF.
READ TABLE lto_var INTO ls_varsel INDEX 1.
l_current_year = ls_varsel-low.
DETERMINE PLANNING VERSION
Data: DIFF type i.
Data: L_VERSION type c.
Data: ls_chasel type upc_ys_charsel.
DIFF = l_plan_year - l_Current_year.
IF l_plan_year = l_Current_year.
l_VERSION = 'P'.
ELSEIF ( DIFF = 1 ).
l_VERSION = 'B'.
ELSE.
l_VERSION = 'F'.
ENDIF.
ls_chasel-chanm = '0VERSION'.
ls_chasel-opt = 'EQ'.
ls_chasel-low = l_VERSION.
insert ls_chasel into table eto_charsel.
ENDFUNCTION.
Thanks -
Varibales: Charactersic with user value
Hi
Created one characteristic variable, which prompts a pop up window with multiple values, where user has to choose one while executing manual planning. If i select one value from input window, it is stored in buffer and keep on considering that one value only even i want to change to other value. Here i am not getting input window again. Should i go for any NOTE implementation or any setting in any SAP table or any support pack upgradation .
Ours BI7 with support pack 13.
regards,
RPWrite an ABAP variable exit function, call function module POPUP_TO_GET_ONE_VALUE. Write user i/p value into eto_charsel. Supply a result (dummy value if user cancels).
regards,
RP -
Table to extract Usernames (SAP )?
Someone please tell me the name of table in R/3 from which to extract usernames (usernames should be unique key)?
In BPS0.
You must have user name in the dimention of the transactional cube.
Bring user name to the level.
In the area, make a exit variable with user name. and use this in the level.
In the layout, keep this in the header. When the layout is open, you will see the user name getting filled by the system.
Use the following code for this:
DATA: USER LIKE SY-UNAME,
CHARSEL TYPE UPC_YS_CHARSEL..
CLEAR CHARSEL..
USER = SY-UNAME..
CHARSEL-CHANM = I_CHANM. .
CHARSEL-SIGN = 'I'..
CHARSEL-OPT = 'EQ'..
CHARSEL-LOW = USER..
INSERT CHARSEL INTO TABLE ETO_CHARSEL..
Endfunction.
Write this code in Se37.
Ravi Thothadri
Maybe you are looking for
-
InDesign hasn't saved file changes
I've just spent a whole morning working on a file, and NONE of the changes that I've made to the document have been saved by InDesign. I've saved regularly as I've gone, and I've received no error messages or warnings from InDesign, yet I've reopened
-
XPPro cant recognise airport express base station
Just bought a new computer and downgraded to XPPro. Installed Airport express from the disc, but there is no recognition of the base station. Using the network repair function produces an error stating that the IP address cant be recognised..... How
-
I ordered the season pass for The Prisoner, but only episodes 4-8 downloaded. Check for downloads says nothing available and the only thing listed in iTunes is the trailer. Wha' happen?
-
JScrollPane Properties ???
Dear Friends, Kindly let me know how to remove the Table Headers, which is set by default when a JTable is added to a JScrollPane.
-
I am unable to get iphoto to quit. It keeps saying there is a burn in process and to please stop burn before quitting. I have completed the very small burn to a CD that I did, ejected the CD to no avail. This is very frustrating.