Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_USER_CHANGE

Former Member
0 Likes
1,829

Hi Friends,

I have to change User's License Data in SU01 transaction. I am using BAPI_USER_CHANGE and after that BAPI_TRANSACTION_COMMIT.

I have tried commit work and wait also.

The problem is bapi_user_change says the user has been changed. But when i see it in SU01 there is no change.

What is the problem, I am not able to understand?

Kindly help.

9 REPLIES 9
Read only

Former Member
0 Likes
1,445

This message was moderated.

Read only

0 Likes
1,445

Hi all,

see the code below and then reply :

UCLASS-LIC_TYPE = '55'.

UCLASS-COUNTRY_SURCHARGE = '100'.

UCLASS-SUBSTITUTE_FROM = sy-datum.

UCLASS-SUBSTITUTE_UNTIL = '99991231'.

UCLASS-SYSID = 'DS1'.

UCLASS-CLIENT = '600'.

UCLASSX-UCLASS = 'X'.

UCLASSX-UCLASSSYS = 'X'.

CALL FUNCTION 'BAPI_USER_CHANGE'

EXPORTING

username = 'BCZRIM'

UCLASS = UCLASS

UCLASSX = uclassx

tables

return = RETURN

  • UCLASSSYS = UCLASSSYS

.

IF SY-SUBRC EQ 0.

data : wa_return type BAPIRET2.

clear wa_return.

*

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = wa_return

.

endif.

Read only

0 Likes
1,445

Hi Pradeep,

sy-subrc is not checked in BAPI.

Use this.

if RETURN is not initial.

bapi call_transaction_commit.

endif.

It will work provided all the data that you are passing is correct.

Regards,

Shree Tejus C.

Read only

0 Likes
1,445

Hi,

Error : Change indicator X is not supported

It's giving me an error on passing the change flag structure uclassx.

thanks,

pradeep

Read only

0 Likes
1,445

Pradeep,

UCLASSX-UCLASSSYS = 'X'"is wrong which you passed

The following values are permitted for the field UCLASSX-UCLASSSYS:

'R' The system-specific user classifications are deleted, and replaced with current values from the table.
'S' Only the user classifications for the listed systems are replaced. If the user classifications for a system are to be deleted, the user type must be initial.
Space The table is not used.

Read only

0 Likes
1,445

Hi,

Even I have tried with R & S also, then also it is not working.

DATA : uclass TYPE bapiuclass,

uclassx TYPE bapiuclassx,

return TYPE STANDARD TABLE OF bapiret2 INITIAL SIZE 0,

uclasssys TYPE STANDARD TABLE OF bapiuclasssys INITIAL SIZE 0.

DATA : wa_uclasssys TYPE bapiuclasssys.

uclass-lic_type = '55'.

uclass-country_surcharge = '100'.

uclass-substitute_from = sy-datum.

uclass-substitute_until = '99991231'.

uclass-sysid = 'DS1'.

uclass-client = '600'.

*UCLASSX-UCLASS = 'X'.

uclassx-uclasssys = 'R'.

CALL FUNCTION 'BAPI_USER_CHANGE'

EXPORTING

username = 'AJVHBI'

uclass = uclass

uclassx = uclassx

TABLES

return = return.

IF return IS NOT INITIAL.

DATA : wa_return TYPE bapiret2.

CLEAR wa_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

IMPORTING

return = wa_return.

ENDIF.

Read only

0 Likes
1,445

What about UCLASSSYS table which is in Table paramenter?

Read only

Former Member
0 Likes
1,445

Hi Pradeep,

pass the parameter you want to change and then raise the flag as 'X' after the parameter...like below

If we want to change address then...provide the address details:

wa_address-FIRSTNAME = 'TEST'.

wa_address-LASTNAME = 'USER'.

then raise the change flag against each field we changed...

wa_addressx-FIRSTNAME = 'X'.

wa_addressx-LASTNAME = 'X'.

try wth this it works in my case..

Read only

0 Likes
1,445

This worked for me too.

Thanks a lot.