on 11-09-2012 5:20 AM
Hi Experts,
I have requirement where i need to find out the company code for which, user is assigned to.
I am doing it in one of shopping cart related enhancement in this component /sapsrm/wdc_ui_sc_dofc_hd.
Here Header GUID is available. Can we find out the company code of the creator of shopping cart using header guid.
I could nt find in any of the tables. Please help if any one knows
Hello ravindranath
Please use below code.
DATA: lo_us_context TYPE REF TO /sapsrm/if_pdo_us_context_cons,
lv_be_bukrs TYPE bukrs,
lt_bukrs TYPE bbpt_sc_app_attr_buk,
ls_bukrs TYPE bbps_sc_app_attr_buk.
CALL METHOD /sapsrm/cl_pdo_factory_user=>get_buffered_us_context_cons
RECEIVING
ro_us_context_cons = lo_us_context.
* Get the company code for the user
lt_bukrs = lo_us_context->get_company_code( ).
lv_be_bukrs = lo_us_context->get_be_company_code( ).
* Read no of company code
CLEAR ls_bukrs.
DESCRIBE TABLE lt_bukrs LINES lv_lines.
IF lv_lines = 1.
READ TABLE lt_bukrs INTO ls_bukrs INDEX 1.
ELSE.
READ TABLE lt_bukrs INTO ls_bukrs WITH KEY co_code = lv_be_bukrs.
ENDIF.
lv_bukrs = ls_bukrs-co_code.
Regards,
Neelima
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Look for field CO_CODE from table BBP_PDHGP.
I hope it helps.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.