Application Development 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: 

different user use same tcode

Former Member
0 Kudos

Hi frnds,

4 ip paras, and two (abap & basis ) users

abap user login means 1st 2fields enable then another 2 fields disable,

same as any user(basis)

this is requirement.

How can prodect the parameters.

Thanks in advance.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

I don't understand you requirement, nevertheless

- check [LOOP AT SCREEN|http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_SCREEN.htm] and [MODIFY SCREEN|http://help.sap.com/abapdocu_70/en/ABAPMODIFY_SCREEN.htm] in [AT SELECTION-SCREEN OUPUT|http://help.sap.com/abapdocu_70/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_1@1@].

- use[ SY-UNAME|http://help.sap.com/abapdocu_70/en/ABENSYSTEM_FIELDS.htm] to check user, or better use an [AUTHORITY-CHECK|http://help.sap.com/abapdocu_70/en/ABAPAUTHORITY-CHECK.htm].

"What is conceived well is stated clearly, and the words to say it come easily."

Regards,

Raymond

15 REPLIES 15

former_member182426
Active Contributor
0 Kudos

Hi,

Please post the threads clearly, dont use short words......

Any how, is the users are only two or more... i.e basis users are more than one...

If its more than one... just copy the same t-code and create a role assign this t-code to basis with ur requirement...

Same way abap users...

If you have only two user ID's i.e one ABAP, one Basis u can hard code itself and use single t-code...

Regards,

Shankar.

matt
Active Contributor
0 Kudos

Please restate your requirements with rather more clarity.

matt

Former Member
0 Kudos

Hello frnds,

10 input parameters.

use diff users.

1st user 1st 5 fields another 5fields are enter for 2nd user useing primery key.

1st user enter 5fldsalso display in display mode for that 2nd user also display another 5flds are chage mode.

Thanks in advance.

matt
Active Contributor
0 Kudos

No - still no idea what you're asking about.

yang_aiolos
Active Participant
0 Kudos

maybe you can create a tcode for the screen,then use two transaction variants to meet the requirement.

raymond_giuseppi
Active Contributor
0 Kudos

I don't understand you requirement, nevertheless

- check [LOOP AT SCREEN|http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_SCREEN.htm] and [MODIFY SCREEN|http://help.sap.com/abapdocu_70/en/ABAPMODIFY_SCREEN.htm] in [AT SELECTION-SCREEN OUPUT|http://help.sap.com/abapdocu_70/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_1@1@].

- use[ SY-UNAME|http://help.sap.com/abapdocu_70/en/ABENSYSTEM_FIELDS.htm] to check user, or better use an [AUTHORITY-CHECK|http://help.sap.com/abapdocu_70/en/ABAPAUTHORITY-CHECK.htm].

"What is conceived well is stated clearly, and the words to say it come easily."

Regards,

Raymond

0 Kudos

Hi,

This is my code:

data : itab type of znew with header line.

selection-screen begin of block b with frame title text-001.

 parameters:p_name like znew-za modif id MMU,
            p_name1 like znew-zb modif id MMU,
            p_name2 like znew-zc modif id QMU,
            p_name3 like znew-zd modif id QMU,

selection-screen end of block b.

loop at screen.
  if sy-uname = 'abapuser'.
    if screen-group1 = 'MMU'.
      screen-input = '0'.

      itab-name = p_name.
      itab-name1 = p_name1.
      itab-name2 = p_name2.
      itab-name3 = p_name3.

    endif.
  endif.

  if sy-uname = 'basis'.
    if screen-group1 = 'qmu'.
      screen-input = '0'.

      itab-name = p_name.
      itab-name1 = p_name1.
      itab-name2 = p_name2.
      itab-name3 = p_name3.
     endif.
  endif.
endloop.

Error:

in abap user,

1st two fields are change mode

But in basis user,

all the 4 fields are chage mode

I want change mode for 3, 4th fields 1st two fields are display mode.

Thanks in advance.

Edited by: Matt on Mar 5, 2010 9:55 AM - fixed formatting

0 Kudos

Try something like (Constants in uppercase, MODIFY, and a little structuring)

 AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    CASE screen-group1.
      WHEN 'MMU'. " Here we disable input if user is ABAPUSER
        IF sy-uname EQ 'ABAPUSER'.
          screen-input = '0'.
        ENDIF.
      WHEN 'QMU'. " Here we disable input if user is BASIS
        IF sy-uname EQ 'BASIS'. 
          screen-input = '0'.
        ENDIF.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.

AT SELECTION-SCREEN.

  itab-name = p_name.
  itab-name1 = p_name1.
  itab-name2 = p_name2.
  itab-name3 = p_name3.

Regards,

Raymond

0 Kudos

Hi ,

This code also same issue,

in abap user,

3, 4th input fields are chande mode.

But another user,

All the 4 fields are change mode.

How can i protect 1st two fields in that user.

Thanks in advance

0 Kudos

Sorry, but as i don't understand your exact requirement, you will have to adapt the code yourself.

Perhaps, you can try to reverse the tests, (replace "sy-uname EQ 'ABAPUSER'." by "IF sy-uname NE 'BASIS'." and vice versa.)

Regards,

Raymond

0 Kudos

Hi,

the problem is with letter's case - you should use UPPER CASE - specially for GROUP1 field.

I would write:


IF sy-uname = 'BASIS'.
  IF screen-group1 = 'QMU'.
    ...

Regards,

--

Przemysław

0 Kudos

Hello,


at selection-screen output.
if sy-uname = 'abapuser'.
loop at screen.
if screen-group1 = 'MMU'.
screen-input = 0.
modify screen.
endif.
endloop.
elseif sy-uname = 'basis'.
loop at screen.
if screen-group1 = 'QMU'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.

.

Regards,

Sachin

0 Kudos

Hi, frnds,

This is my full coding:

data:itab type table of znew with header line.

selection-screen begin of block b with frame title text-001.

parameters:p_name like znew-za modif id MMU,

p_name1 like znew-zb modif id MMU,

p_name2 like znew-zc modif id QMU,

p_name3 like znew-zd modif id QMU,

r1 radiobutton group a, " For update into database

r2 radiobutton group a. " For update into database

selection-screen end of block b.

at selection-screen output.

loop at screen.

if sy-uname = 'ABAPUSER'.

if screen-group1 = 'QMU'.

screen-input = '0'.

if r1 = 'X'.

itab-name = p_name.

itab-name1 = p_name1.

itab-name2 = p_name2.

itab-name3 = p_name3.

modify znew from itab.

if sy-subrc = 0.

write: 'The above records was inserted in to the table ZNEW Succesfully'.

endif.

elseif r2 = 'X'.

select * from znew into table itab where za = p_name.

if sy-subrc = 0.

loop at itab.

write:/ itab-name, itab-name1, itab-name2, itab-name3.

endloop.

else.

write: 'There is no records found in the znew table'.

endif.

endif.

modify screen.

endif.

endif.

endloop.

loop at screen.

if sy-uname = 'testuser'.

if screen-group1 = 'MMU'.

screen-input = '0'.

if r1 = 'X'.

itab-name = p_name.

itab-name1 = p_name1.

itab-name2 = p_name2.

itab-name3 = p_name3.

modify znew from itab.

if sy-subrc = 0.

write: 'The above records was inserted in to the table ZNEW Succesfully'.

endif.

elseif r2 = 'X'.

select * from znew into table itab where za = p_name.

if sy-subrc = 0.

loop at itab.

write:/ itab-name, itab-name1, itab-name2, itab-name3.

endloop.

else.

write: 'There is no records found in the znew table'.

endif.

endif.

modify screen.

endif.

endif.

endloop.

Plz any one give solution.

Thanks in advance

0 Kudos

Hello,

Your entire code is written in the At selection-screen output event. This event is triggered before your selection screen is displayed.

Just add the code written in my previous post in the event at selection-screen output.

After that write the other portion of code to update or display data from z table in the event start-of-selection.


start-of-selection.
if r1 = 'X'.
itab-name = p_name.
assign remaining fields with value from selection scree.
modify the z table.
else.
select data from z table into the internal table.
loop across the table and write the contents.
endif.

Modify the above pseudo code as per your requirement.

Hope this helps.

Regards,

Sachin

0 Kudos

Hi frnds,

This issue was not sloved, Plz help me.

Thanks in advance.