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

Issue in if Statement

Former Member
0 Likes
491

Dear gurus

im having a problem in if statement

problem is that we have SAP ID on which we do multiple logins. i have made an application

and written below code in that application.

IF user-bname EQ 'MLABTPFL'.
      IF p_name EQ 'AK' AND p_pass EQ 'AKLAB1'. "Dont want to use hard coded.
        IF user-costcenter EQ '0009100001' OR
           user-costcenter EQ '0002820106'.
          user-costcenter = '0000000000' .
        ENDIF.
      ELSEIF p_name EQ 'MA' AND p_pass EQ 'MALAB2'.
        IF user-costcenter EQ '0009100001' OR
           user-costcenter EQ '0001820106'.
          user-costcenter = '0000000000' .
        ENDIF.
      ENDIF.
    ENDIF.

in this code i have to do the hard coding of userid and password .

i dont want to hard coded the checks. how can it be resolved.

Regards

Saad Nisar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
460

Hi

1) In SE11 => Create a Z-table with fields USERID,PASSWORD, any other fields needed; and maintain the user id's and passwords in that table

2) In program : read Z-table in to LW_usertable and do IF checks on the structure.

Regards

Deepa

2 REPLIES 2
Read only

Former Member
0 Likes
461

Hi

1) In SE11 => Create a Z-table with fields USERID,PASSWORD, any other fields needed; and maintain the user id's and passwords in that table

2) In program : read Z-table in to LW_usertable and do IF checks on the structure.

Regards

Deepa

Read only

birendra_chatterjee
Active Participant
0 Likes
460

Use transaction STVARV and maintain the costcenters there based on name (p_name). Then select the values of costcenters from table TVARV based on the value in p_name.