on ‎2009 Sep 08 4:36 PM
HI Experts,
I am using SRM 5.0,we are using shopping cart scenario and as per my current requirement i have to find out the spending limit of the user which is maintain in PPO_BBP transaction under extended Attribute tab in output limit.
I think the name of the attribute for the same is "SPEND_LIM".
I have used the function Module "BBP_READ_ATTRIBUTES" for the same using IV_USER as SAP User ID
IV_SCENARIO = BBP
IT_ATTR_LIST = SPEND_LIM
but in the output i am getting some garbage values with the Proper currency(##倀ఀEUR).
Can anyone tell me how to find the Spending limit/Output limit attribute of extended attribute tab??
We have maintain the values using Org. Structure only,it is not maintained by ROLES or SU01 data.
I have already tried to find the value in table "SPERS_OBJ" but it is not there also.
Please help me.
Thanks in Advance.
Request clarification before answering.
Hi,
The Value is amount + currency code. Here is some sample code.
*&---------------------------------------------------------------------*
*& Report Z_ATTR_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_ATTR_TEST.
DATA: LT_ATTRIBUTES TYPE BBPT_ATTR_LIST,
LS_ATTRIBUTES TYPE BBP_ATTR_LIST,
LT_ATTR TYPE BBPT_ATTR,
LS_ATTR TYPE BBPS_ATTR,
LT_VALUE TYPE BBPT_ATTR_VALUES,
LS_VALUE TYPE BBPS_ATTR_VALUES.
DATA: ls_apprv_lim TYPE BBP_SPERS_AL,
lv_attr_apprv_lim TYPE bbps_attr_values.
PARAMETER: LV_USER TYPE BALUSER.
MOVE 'KNT' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
MOVE 'CNT' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
MOVE 'ADDR_SHIPT' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
MOVE 'PRI' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
MOVE 'SLAPPROVER' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
MOVE 'APPRV_LIM' TO LS_ATTRIBUTES-ATTR_ID.
APPEND LS_ATTRIBUTES TO LT_ATTRIBUTES.
CALL FUNCTION 'BBP_READ_ATTRIBUTES'
EXPORTING
* IV_OBJECT =
IV_USER = LV_USER
* IV_ORGUNIT =
* IV_PARTNER =
* IV_APPLIC =
* IV_SCENARIO = 'BBP'
* IV_ATTR_SINGLE =
IT_ATTR_LIST = LT_ATTRIBUTES
IMPORTING
ET_ATTR = LT_ATTR
* ET_ATTR_DFT =
* EV_ATTR_DFT_SINGLE =
EXCEPTIONS
OBJECT_ID_NOT_FOUND = 1
NO_ATTRIBUTES_REQUESTED = 2
ATTRIBUTES_READ_ERROR = 3
OTHERS = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
exit.
ENDIF.
WRITE: / 'User: ', LV_USER.
WRITE: / 'Attribute LogSys Value S D E A'.
WRITE: / '----------|----------|------------------------|-------|'.
loop at lt_attr into ls_attr.
loop at ls_attr-vlist into ls_value.
if ls_attr-ATTR_ID = 'APPRV_LIM'.
FIELD-SYMBOLS <approval_limit> LIKE ls_apprv_lim.
ASSIGN ls_value-VALUE TO <approval_limit> CASTING.
ls_apprv_lim = <approval_limit>.
WRITE: / ls_attr-ATTR_ID(10), ls_value-VALUE_LOGSYS(10), ls_apprv_lim-APPROVAL_LIMIT,ls_apprv_lim-currency(3), ls_value-INH_STATUS,ls_value-DFT_FLAG,ls_value-EXCLUDED, ls_value-AUTO_DFT_FLAG.
else.
WRITE: / ls_attr-ATTR_ID(10), ls_value-VALUE_LOGSYS(10), ls_value-VALUE(20), ' ', ls_value-INH_STATUS,ls_value-DFT_FLAG,ls_value-EXCLUDED, ls_value-AUTO_DFT_FLAG.
endif.
endloop.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Masa,
Thanks for the code but that is of no use for me,i don;t want to find Approval limit of the user.i want to find the spending limit of the user and i guess for the spending limit the technical attribute name is "SPEND_LIM"' and i have tried to find the value of that using FM BBP_READ_ATTRIBUTES" but its giving me some garbage value,is there any SAP note which is missing.
Why it is giving me garbage value where as value is maintain in the Organization Structure.
It your code you are finding Approval Limit i.e. "APPRV_LIM" and spending limit is different from approval limit.
Can you plz tell me how to find Spending limit of a user???
Spending Limit comes under "Extended attribute" tab inside "PO VALUE LIMIT" radio Button and under "STANDARD VALUES" header with the name as "Output Limit" on the Organization Structure screen.
Edited by: paresh sojitra on Sep 9, 2009 7:52 AM
Hi,
Please also check this note if you have display problem in PPOMA* transaction.
https://service.sap.com/sap/support/notes/1089273
Regards,
Masa
HI,
Thanks for the input again but my problem is the value itself is not coming in the Function Module "BBP_READ_ATTRIBUTES".
The code you have given will help to get the values from output of a function module but here there is no value coming when i use this FM.
Is there any table where this Spending limit is getting store so that i can apply select query to find out that value.
Hello Paresh,
For approval and/or output limit, look at HRP5503 table.
With sub-type '100', data concern output limit (SPEND_LIM attribute).
With sub-type '200', data concern approval limit (APPRV_LIM attribute).
Additionally, with MF BBP_READ_ATTRIBUTES in SRM 4.0., i have got same problem as described by Paresh: exporting parameters for both attributes give value "####EUR'.
Regards.
Laurent.
Edited by: Laurent Burtaire on Sep 9, 2009 10:56 AM
Hello Paresh,
When debugging FM BBP_READ_ATTRIBUTES (with the parameters you mentioned) I realized when converting the value (field ET_ATTR_DFT[1]-VALUE) into HEX you'll see the value maintained in PPOMA_BBP.
So you might want to convert the value after reading it using the FM.
Hope above helps.
Franz
HI Laurent,
I have tried to find out the values in the table directly using the object id which i am getting from BP_CENTRALPERSON_GET but there is no such value found in table HRP5503 .
Also the note 1089273 is not relevant for my support pack.
I have also debug the function module to find out the solution and found that inside "BBP_READ_ATTRIBUTES" FM one more FM is getting called.
In that FM line number 351 function call is getting garbage value and if go inside that then FM Method ATTRIBUTES_READ_LOCAL_5503 is fetching the value from HRP5503 table and aftre doing that when the value is assign to Character variable field-symbol from Decimal field-symbol the garbage value is coming because of type mismatch.
So there must be an OSS note for the same must have been released by SAP,can any one tell me the note number i have support pack till SRM SERVER 550 - SAPKIBKS12.
I have found out the alternate solution for this issue to find the spending limit.
DATA : lt_subty_range TYPE RANGE OF subtyp,
ls_subty_range LIKE LINE OF lt_subty_range.
ls_subty_range-sign = 'I'.
ls_subty_range-option = 'EQ'.
ls_subty_range-low = '0100'.
COLLECT ls_subty_range INTO lt_subty_range.
SELECT * FROM hrp5503
INTO CORRESPONDING FIELDS OF TABLE lt_p5503
FOR ALL ENTRIES IN lt_objects
WHERE plvar = lt_objects-plvar
AND otype = lt_objects-otype
AND objid = lt_objects-objid
AND subty IN lt_subty_range
AND begda <= sy-datum
AND endda >= sy-datum.
Its working fine for me.
I am closing this issue here.those who know the proper SAP note for this issue,please do post it here.
Another solution is to use the function module but you need to extract the results into a structure as follows:
DATA: ps_data type bbp_spers_sl, " spend limit and currency,
lt_attr_list type table of bbp_attr_list,
lt_attr type bbpt_attr,
ls_attr type bbpt_attr.
CALL FUNCTION 'BBP_READ_ATTRIBUTES'
iv_user = iv_user
iv_scenario = 'BBP'
iv_attr_single = ls_attr_list
IMPORTING
et_attr = lt_attr
....
READ table lt_attr into ls_attr Index 1.
READ table ls_attr-vlist into ls_list index 1.
FIELD-SYMBOLS <spend_limit> LIKE ps_data.
ASSIGN ls_list-value TO <spend_limit> CASTING.
ps_data = <spend_limit>.
results = ps_data-spending_limit
ps_data-currency
BUS4101 object referenced for this solution. (program RBUS4101)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.