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 parameter Id s problem

Former Member
0 Likes
4,244

Hi All,

I am trying to add new user parameter Id and Parameter values to the existing user in an ABAP pgm using BAPI_USER_GET_DETAIL andBAPI_USER_CHANGE FM.

First get the existing param values using BAPI_USER_GET_DETAIL.

Then use BAPI_USER_CHANGE, (existing param id are populated in the internal table i_parameter along with the new values)

All the param id are valid - but processing the 2 BAPI - the parameter list was the same as the original list i.e. the new entries were ignored.

I tried to use tran se37 for fun BAPI_USER_CHANGE with the new list of param id - the param list is still the same.

Could somebody tell me what is wrong? How to change a parameter id list for a user in an ABAP pgm

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,105

Hi,

Are you passing value to the field <b>PARAMETERX</b>.

If not pass that value and it will work.

Regards,

Atish

6 REPLIES 6
Read only

Former Member
0 Likes
2,105

Hi,

Are you using COMMIT_WORK function module after BAPI call?

Check this link once.

http://www.jt77.com/development2/programming-05407.html

ashish

Message was edited by:

Ashish Gundawar

Read only

Former Member
0 Likes
2,106

Hi,

Are you passing value to the field <b>PARAMETERX</b>.

If not pass that value and it will work.

Regards,

Atish

Read only

0 Likes
2,105

Hi

I did not pass value to PARAMETERX ( only pass new values to PARAMETER1) - Could you please tell me what to populate into PARAMETERX - please - I'm new with ABAP.

P.S. I have used BAPI_TRANS_COMIT - but this still does not work - it returns msg saying the user has been changed but the parameter list is still the same. I may need to use your solution by addting value in PARAMETERX - but I don't know what to put in there

Thanks

Read only

0 Likes
2,105

Hi,

Check the documentation for the BAPI, it says for PRAAMETERX -

Either all or no parameters can be changed.

Set all three fields of PARAMETERX to 'X' if you want to change all parameters.

Hope this helps.

I will try to get working code in the mean time.

ashish

Read only

0 Likes
2,105

Hi,

You need to pass X to these fields PARID PARVA PARTXT of structure PARAMETERX

Regards,

Atish

Read only

0 Likes
2,105

PARAMETERX tells the system what fields in the PARAMETER structure should be updated.

You just put an 'X' in the corresponding field.

This is because the PARAMETER table structure contains every possible field that could be updated, and you might only be updating certain fields while leaving others blank because you don't want to load them.

This is to prevent the problem that would occur if it loaded every field.

In such a case, it would blank out the fields that you passed with a blank value in the PARAMETER table, and you probably don't want that to happen.

Therefore, SAP provides the PARAMETERX structure to identify which of the fields in the PARAMETER table that you actually want to update.

This is the same with all of the structures in these types of BAPIs.

For example, in the same BAPI there is an ADDRESS structure and an ADDRESSX structure. If you were updating only the CITY in the address you would load the CITY field in the ADDRESS structure and mark an 'X' in the CITY field in the ADDRESSX structure. Even though the rest of the ADDRESS structure may contain data (or even be blank) they do not get changed, because they are not marked with an 'X' in the ADDRESSX structure. This makes it easier to control your changes.

The same is true of the PARAMETER table.

Load the values in the PARAMETER table, and identify with the PARAMETERX structure which fields are to be updated.

If you are loading all of the fields, then put in X in all of the fields in PARAMETERX.

But if you are only loading 1 or 2 of them, just put an X in those fields in PARAMETERX that correspond to the data fields in PARAMETER.

Here is the layout of the two:

PARAMETER table structure:

PARID	MEMORYID	CHAR	20	0	Set/Get Parameter ID
PARVA	XUVALUE18	CHAR	18	0	Parameter value
PARTXT	AS4TEXT		CHAR	60	0	Short Text Describing R/3 Repository Objects

PARAMETERX structure:

PARID	BAPIUPDATE	CHAR	1	0	Updated information in related user data field
PARVA	BAPIUPDATE	CHAR	1	0	Updated information in related user data field
PARTXT	BAPIUPDATE	CHAR	1	0	Updated information in related user data field

See how they match up?

Good luck

Brian

Clarification

Message was edited by:

Brian Sammond