Authorization check on Function module return values
Hi,
I have a tricky situation. In our BW implementation, many of the FI infoobjects are authorization relevent. One of the objects is 0COSTCENTER. A user has been assigned with authorization profile, in which the user is authorised for COST CENTER = A* and #. All planning templates were working nice.
We were on SP 12 earlier, now we upgraded to SP 20. Now came a issue, the user gets error that user is not authroised for the data. After our analysis, we found nothing wrong as such, so contacted SAP. They came back with a root cause
In my planning function, an ABAP function module is used. The function module returns a COSTCENTER value. This return value is then assigned to a variable, this variable is of type 0COSTCENTER.
SAP said there was a bug in their own design. The bug was, if the cost center value is directly used in planning function for other calculations, it will throw an authorization error. But, if the COST CENTEr value is given to a variable and that variable is used for other calculations, it works fine. Thats why it worked for us earlier.
Now, they have removed that bug, so variables are also checked against authorizations and they said we need to either change the code or give * for the COST CENTER authorization.
So we have a problem. It is not straight forward to give * for COSTCENTER in FI BW implementation. SAP theory is that they cannot say which value the functional module will return. So they will check against ALL the values for COSTCENTER but not the authorised values.
Has anyone seen this issue before? is it only specific to planning function or its just ABAP concept? Any suggesations to come out this problem?
Bindu, thanks,
The error is coming at the program compile level itself i.e. before executing the planning group itself. As per the F1 help on forumla editor and from their support, the system reads all the reference data, So when it sees the function module and its export parameter, it captures all the data for COST CENTER as reference data.
Thus even I am sure that the return value will be always authorized, the reference data is checked for the full authorization. Thus its failing
Similar Messages
-
Web Services from ABAP function modules return values- leading zeros
I am using several web services from SAP CRM (5.0) that were created from Function modules ( I am assuming that that they are in ABAP).
I can call the web services fine and they work as expected, but I am seeing a lot of leading zeros in the return values of fields in tables from the Web service.
The ABAP ers are telling me that they cannot see the leading zeros.
So my question is where these are appended to the values in the whole process. When I execute the Function Module in SAP CRM from transaction SE37 I can see the leading zeros. So I think that this is something that has to be handled by the ABAP ers and not in the client consuming the web service.
Are the functions in SAP CRM that can remove leading zeros for fields in a table (that is an export parameter?)
JawaharHello Jawahar
If you run your (RFC-enabled) function modules using the SAP-GUI (i.e. in dialog) then the GUI automatically replaces leading zero when the function module returns any data. However, calling the same function module remotely you will always see these leading zeros.
These so-called conversion exits are defined as attribute of domains in the ABAP dictionary. If the function module used for the WebService is a standard fm then you have little chances to get rid of the leading zero. Perhaps the WebService has some attribute to suppress conversion exits or activate them when retrieving the data.
Regards,
Uwe -
Accessing function's return value
Hi there. I have created several pl/sql procedures and functions that I can run as standalone programs and I have no problem integrating them into my java code also. However I cannot access the return value of any created function from my java code. The functions appear to execute correctly because when I deliberately enter an invalid select statement I get the errors I expect to get for that instance nad if I enter a valid select statement in the function the program executes correctly but I still cannot access the function's return value. My java code where I execute the pl/sql function is as follows:
CallableStatement p = cont.conn.prepareCall("{call ? := Hellen.FUNC}");
p.setString(1, "z006"); //hellen.FUNC = function name
p.execute();
How do I access the return value of my function?
Do I need to get a ResultSet?
My function is as follows:
function func
return varchar
is tester varchar(4);
BEGIN
select cfcc_code into tester from hellen.test1 where test1.cfcc_code = 'A21';
return tester;
END;
Any help will be gratefully received, JoeYou need to do something like
p.registerOutParameter(1, java.lang.String);
p.execute();
String result = p.getString(1);Cheers, APC -
How to config Check Digits function module for Student Number Validation
Hi SLCM Experts,
In the SAP-SLCM, How to use check digits function module for validate student number. Just only config it or need to customizing program.
*Any idea to student number validation in SLCM?*
Best Regards,
Suvatchai K.Hi ,
Can you expalin it further ?
You configure the St. no in piq_matr . And set it as external or internal no. range which suits your business .
What is the validation you are looking for ?
Regards
Gajalakshmi -
How to create and execute a function whose return value is a table
hi folks ,
i would like know how to create and execute a function whose return value is a table ,
am new to pl/sql ,
my statement for the function is
SELECT ct.credential_code, c.expiration_date
FROM certifications c, credential_types ct
WHERE ct.crdnt_id = c.crdnt_id
AND c.person_id = person_id;
i would like to have the result of the above query as return value for the function.
Thanks in advance ,
Ashok.chi Ps ,
Can you please do small sample ,
that would help me in clear understanding
thanks in advance
ashok.c -
How to check if function module exist
Hi All!
Does anyone know how to check if function module, which name is provided by the user, exists?
I have to execute a function but when user provides a incrrect name - i receive a short dump. I would like to chceck if this function exists before execution and if not - warn user with message box.
Thanks
TomekREPORT z_tmtest MESSAGE-ID zz.
PARAMETER: a_fname LIKE tfdir-funcname.
PERFORM test_fun_exist USING a_fname.
FORM test_fun_exist *
Test FM Exists
FORM test_fun_exist USING f_funcname LIKE tfdir-funcname.
CALL FUNCTION 'OM_FUNC_MODULE_EXIST'
EXPORTING
function_module = f_funcname
EXCEPTIONS
not_existent = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e001.
ENDIF.
ENDFORM. -
Bypassing authority check in function module
hi experts
I have developed an abap report on material bom explosion using function module cs_bom_explosion
Its working fine and all data are coming ok since I HAVE THE AUTHORITY OF T CODE CS03..
pls note all bom fn modules checks for authorization .
However in production environment some users may not have CS03 AUTHORIZATION.
for them this report is not displaying any bom data.
Now the requirement is such that user will not have cs03 authorization,
but will see the bom data through this report.
so how to stop the authorization check for cs_bom_explosion in abap report.
regards
pankajas per my knowledge, granting the rights to those users is only the solution. Now a days the customers are wanting to add explicit authority-check too in the Z objects!! so, i dont see its good idea to bypass the check.
thanq
Edited by: SAP ABAPer on Mar 7, 2009 6:12 AM -
Combination Checks using Function Module
Hi people,
I am trying to use function module to carry out a 'simple' combination check.
Rules: If no values are entered for WBS, Cost center and profit center, raise and error.
Also, if a value is entered for both cost center and wbs raise an error.
The fucntion module looks okay, but the combination check doesn't work. It still allows the records to be saved in the infocube when I test on the layout, even when the conditions specified are met. No errors are raised.
see code below:
FUNCTION ZFF_BPS_CHCK_CC_WBS_PC.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(IS_CHAS) TYPE ANY
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL
*" EXCEPTIONS
*" NO_VALUES_ENTERED
*" MORE_THAN_ONE
FIELD-SYMBOLS: <fc_profit_ctr> TYPE /BI0/OIProfit_Ctr,
<fc_wbs_elemt> TYPE /BI0/OIWBS_ELEMT,
<fc_costcenter> TYPE /BI0/OICostcenter.
ASSIGN COMPONENT:
'0PROFIT_CTR' OF STRUCTURE is_chas TO <fc_profit_ctr>,
'0WBS_ELEMT' OF STRUCTURE is_chas TO <fc_wbs_elemt>,
'0COSTCENTER' OF STRUCTURE is_chas TO <fc_costcenter>.
*CHECK IF ALL THE VALUES ARE EMPTY
IF <fc_profit_ctr> = '#'
AND <fc_wbs_elemt> = '#'
AND <fc_costcenter> = '#'.
MESSAGE e000(ZBPS) RAISING NO_VALUES_ENTERED .
ENDIF.
*Check if both cost centre and wbs are entered.
IF <fc_costcenter> <> '#'
AND <fc_wbs_elemt> <> '#'.
MESSAGE e000(ZBPS) RAISING MORE_THAN_ONE.
ENDIF.
ENDFUNCTION.
Any helps will be appreciated.
Regards,
UcheHi Uchenna,
The function module will not be called if all of the characteristics being checked are unassigned. Therefore if you are trying to test this combo check by entering a line with blank WBS, CC, PC, then the code will never actually be called.
If you want to ensure this doesn't happen then I recommend writing a FOX that checks for this combination and throws an error if found. You can run the FOX on refresh so the check will happen each time the user enters a new line and hits refresh.
Hope this helps,
Tristan -
Transaction BUS3 - Further checks - Own function module
In order to create additional checks on BP Identification Numbers, we used tx BUS3 to add to view BUP520 under Further Checks our own function module.
As a start we took a straight copy of BUP_BUPA_PAI_MISC, the SAP delivered function module.
After the SAP FM, our Z-module gets called with parameter I_SICHT, identical to the
parameters of the SAP FM. No other parameters nor tables get passed.
How can we get hold of the same data as the SAP FM ? We want to check e.g. table
GT_BUT0ID (identification numbers). It is filled in the SAP FM at the end of FORM bup520_pai, but is empty in the Z-module ?
Thanks for your solution.Hi.
We also validate the ident. numbers but on check or save event.
Create and Add the new z.fm to the event DCHCK (appl = 'BUP') in tcode BUS7.
We use some trick to get this data from memory [SAPLBUD0].
You can try to use it for the PAI (the same f.group = BUD0)
function z_gzp_but0id_get.
""Local interface:
*" TABLES
*" OT_BUT0ID STRUCTURE ZGZP_ST_BUT0ID OPTIONAL
*" OT_MEM_BUT0ID STRUCTURE VBUT0ID OPTIONAL
data: lv_fname1(50) type c value '(SAPLBUD0)GT_BUT0ID[]'.
data: lv_fname2(50) type c value '(SAPLBUD0)MEM_BUT0ID[]'.
***------ ID-NUMMERN -
BEGIN OF GT_BUT0ID OCCURS 0.
INCLUDE STRUCTURE XBUT0ID.
**DATA: XMARK LIKE BOOLE-BOOLE,
TEXT LIKE TB039B-TEXT,
ENTRYDATESTR TYPE BU_ENTRYDATESTR,
DATEFROMSTR TYPE BU_DATEFROMSTR_ID,
DATETOSTR TYPE BU_DATETOSTR_ID,
END OF GT_BUT0ID,
***------ ID-NUMMERN: ZUORDNUNGEN (ALTER STAND) -
BEGIN OF GT_BUT0ID_OLD OCCURS 0.
INCLUDE STRUCTURE XBUT0ID.
**DATA: END OF GT_BUT0ID_OLD,
corresponds to declaration of gt_but0id in include LBUD0TOP
types: tp_s_but0id type zgzp_st_but0id.
types: tp_t_but0id type standard table of zgzp_st_but0id.
types: tp_s_mem_but0id type vbut0id.
types: tp_t_mem_but0id type standard table of vbut0id.
field-symbols: <fs1> type tp_t_but0id.
field-symbols: <fs2> type tp_t_mem_but0id.
data: ls_but0id1 type tp_s_but0id.
data: ls_but0id2 type vbut0id.
if ot_but0id is requested.
assign (lv_fname1) to <fs1>.
clear ot_but0id[].
loop at <fs1> into ls_but0id1.
ot_but0id = ls_but0id1.
append ot_but0id.
endloop.
endif.
if ot_mem_but0id is requested.
assign (lv_fname2) to <fs2>.
clear ot_mem_but0id[].
loop at <fs2> into ls_but0id2.
ot_mem_but0id = ls_but0id2.
append ot_mem_but0id.
endloop.
endif.
endfunction.
I hope it helps.
Regards, Robert -
How to pick the entries from a function module fields values
hi guys,
i have a function module 'BP_JOBLOG_READ.when i execute this for a particular jobname,i will get some entries.again if i click those entries,i will get some fields with values.in that one field 'text' contains total credit amount(purely numeric).how to fetch this value into internal tabel and update into my internal table.very urgent.plz provide some coding.rewards wil b there for helpful sggestion.Mahesh,
Use the FM BP_JOBLOG_SHOW to display those job logs.
Hope this is helpful.
Thanks,
Naren -
DDIC function Module to values to a Domain
Hi ABAPers,
What is the DDIC function module to set values to a Domain?
Thanks in advance.
Regards,
Ramesh.Hi GP,
I would like to set the values to the domain in runtime so that I get them in the input help.
Not to the get the values of the domain that is entered in the Data Dicitonary.
Thanks for ur suggestion.
regards,
Ramesh -
Function not returning value in Discoverer report
Hi All,
I am using a PL/SQL function in a Discoverer Report to return a particular date. The way I am using is that I have created a PL/SQL function and registered the same in Discoverer Administatrator.
My problem is that when i run the report this function returns NULL for one particular unit but when i run the same on toad as
'select max_term_dt_pkg.max_term_dt_fn('703813','OM - AWAITING_SHIPPING - 1179628') from dual'
it returns the date as 26-May-2009
Actually it should return a value in the report also.
Can anyone guide me what could be the problem.
Regards,
ShrutiHi Rod,
There are no session variables to be set. I have myself created that and it is returning values for other units also.
Below is the function :
CREATE OR REPLACE PACKAGE BODY APPS.max_term_dt_pkg
AS
FUNCTION max_term_dt_fn (p_unit_num VARCHAR2, p_order_status VARCHAR2)
RETURN DATE
IS
l_contract_number VARCHAR2 (20);
--okc_k_headers_b.contract_number%TYPE;
l_max_term_date DATE; --okc_k_lines_b.date_terminated%TYPE;
BEGIN
IF p_order_status IN ('RMA on Unit', 'OKS 30 Days Notice Given')
THEN
l_max_term_date := NULL;
ELSE
SELECT contract_number
INTO l_contract_number
FROM (SELECT DISTINCT okhb.sts_code, okhb.date_terminated,
okhb.contract_number,
oklb_ib.attribute15 unit, okhb.start_date,
okhb.end_date, okhb.creation_date
FROM apps.okc_k_headers_b okhb,
apps.okc_k_lines_b oklb_ib --,
WHERE okhb.ID = oklb_ib.dnz_chr_id
AND lse_id = 9
AND oklb_ib.attribute15 = p_unit_num
ORDER BY okhb.start_date DESC,
okhb.creation_date DESC)
--ORDER BY okhb.start_date DESC)
WHERE ROWNUM = 1;
SELECT date_terminated
INTO l_max_term_date
FROM (SELECT oklb.dnz_chr_id, oklb.ID, oklb.date_terminated,
oklb.sts_code, mic.category_concat_segs,
mic.category_set_name
FROM apps.okc_k_headers_b okhb,
apps.okc_k_lines_b oklb,
apps.okc_k_items oki,
--apps.mtl_system_items_b msib,
mtl_item_categories_v mic
WHERE oklb.dnz_chr_id = okhb.ID
AND okhb.contract_number = l_contract_number
AND oklb.lse_id = 1
AND oki.cle_id = oklb.ID
-- AND msib.inventory_item_id = oki.object1_id1
-- AND msib.organization_id = oki.object1_id2
--AND segment1 = 'OKS-RNTL-MAINT-WH'
--AND oklb.sts_code = 'TERMINATED'
AND oklb.date_terminated IS NOT NULL
AND mic.inventory_item_id = oki.object1_id1
--msib.inventory_item_id
AND mic.organization_id = oki.object1_id2
--msib.organization_id
AND mic.category_set_name = 'Product'
AND mic.category_concat_segs = 'OKS-Base'
ORDER BY oklb.date_terminated DESC)
WHERE ROWNUM = 1;
END IF;
RETURN l_max_term_date;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN NULL;
WHEN OTHERS
THEN
RETURN NULL;
END;
END;
Regards,
Shruti -
Authorization to run function module
I am facing a peculiar problem, We have 2 kinds of users in the system, one with debug display rights and other rights that a developer has, the second user has got authorization for TCODES and is a end user, i.e. Order-Delivery-Billing Rights.
Now in the billing exit we have put a Function Module, which will do the some back end movement for the user. Now the dilemma is, the user with debug rights is able to do the transaction and the function module runs at the back end without the knowledge of the user, but when the end user runs the same T Code, the function module doesnu2019t run at the back end.
How do I give authorization to the end user, so that function module runs in his ID even though he does not have debug rights, or what object has to be attached to the user??Execute the transaction SU53 just after run the program with the invalid user.
This transaction shows yous what is the authoritation that is failed.
Regards, -
Authorization objects to function module
Hi Experts
I want to set the authorization object to the particulare function module.
How can we set the authorization objects to the function modules, plese explain me briefly.
regards
rajaramHi,
Goto
s_tcode,s_program,s_rfc,s_tabu_dis these are authorization objects that SAP provides..
also go through thsi following link..
http://help.sap.com/saphelp_nw04/helpdata/en/4f/b541d812aea34695d54758cec0796f/content.htm
Regards
Kiran -
Issue with function module updated values
Hi Experts,
We have an issue with customized program. In this program function module 'BBP_PD_SC_GETDETAIL' not picking
the updated values when the UI was opened. But when we were executing the same function module directly by providing the values manually it is picking up the correct data.
We thought it was a problem with session killing or buffer refresh ? We dont know how to handle this issue.
If you have any suggestions that would be great help full for me . Please reply asap.
Regards,
ChanduHi,
Thanks for your quick reply.
I have passed the values to the function module in the program and also used the same values for manually testing of the function module. Getting the correct values when I was testing manually.
We thought it was a session killing problem as we developed the customized code. So any idea how to refresh the session even
though the UI(User Interface) was opened.
This issue was solved when the UI was closed and opened again.
Any other ideas on this issue ?
Regards,
Chandu
Maybe you are looking for
-
HT5557 How do I use my iTunes account balance to purchase from iBooks?
How do I use my iTunes account balance to purchase from iBooks?
-
How to change Host directory location?(Problems with host and ed)
Hi I'm having a problem with the commands Host and Ed. The problem being that when I run them they send back an error saying SQL>host /bin/gnome-terminal: No such file or directory or SQL> ed Wrote file /home/joe/Documents/editfile.sql /bin/gnome-ter
-
Cannot view Keynote slides except in slideshow or slide navigator
I'm using Keynote '09 version 5.0.3 (791) on Macbook Pro Intel Core 2 Duo with OS X 10.6.3. Been working fine ... always. Today I installed the latest Apple update and ... bad times. Firstly, many of my settings (screensaver, desktop, etc.) have chan
-
0VENDOR value issues in one report BI
Hi BI Experts, We have an issue in one of our BI reports. One user (say 'A') has 0VENDOR=* in his analysis authorization and another user (say 'B') has 0VENDOR restricted to the value fetched for that user during runtime. Rest all authorization are s
-
How to undo garageband upgrade
Hi I just downloaded the last garage band upgrade, but all the tutorials I find are in the old verision, which also seems to have more sound fx. is it possible to undo the upgrade at all? help please