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: 

AUTHORITY-CHECK OBJECT 'V_LIKP_VST'

Former Member
0 Kudos

Hi Friends,

I have a subroutine written in my custom program for authority check. But, the performance is very slow when I run my program. I am checking the authorization for my select-option s_vstel. I have used authorization check only for PARAMETERS option earlier. But, now in this program I am checking for a select-option. Appreciate the help if anyone could give me suggestion what wrong I am doing here.

   FORM CHECK_AUTHORIZATION.

  DATA: BEGIN OF LT_VSTEL OCCURS 0,
        VSTEL LIKE VEKP-VSTEL,
        END OF LT_VSTEL.

  DATA: LX_VSTEL LIKE LINE OF LT_VSTEL,
        R_VSTEL  LIKE LINE OF S_VSTEL.

  SELECT DISTINCT VSTEL FROM VEKP INTO TABLE LT_VSTEL
                        WHERE VSTEL IN S_VSTEL.

  CLEAR   S_VSTEL.
  REFRESH S_VSTEL.

  LOOP AT LT_VSTEL INTO LX_VSTEL.
    AUTHORITY-CHECK OBJECT 'V_LIKP_VST'
                        ID 'ACTVT' FIELD '03'
                        ID 'VSTEL' FIELD LX_VSTEL-VSTEL.

    IF SY-SUBRC NE 0.
      CLEAR: GV_MESSAGE.
      CONCATENATE TEXT-003 SY-REPID INTO GV_MESSAGE SEPARATED BY SPACE.
      MESSAGE GV_MESSAGE TYPE GC_E.
    ELSE.
      R_VSTEL-SIGN   = GC_I.
      R_VSTEL-OPTION = GC_EQ.
      R_VSTEL-LOW    = LX_VSTEL-VSTEL.
      APPEND R_VSTEL TO S_VSTEL.
    ENDIF.
  ENDLOOP.

ENDFORM.                    " CHECK_AUTHORIZATION

Thanks in Advance,

Nani.

5 REPLIES 5

former_member209722
Participant
0 Kudos

Hi

If your not passing value in the selection-screen select options...Program fatches all the entries in VEKP table and also you are using non key field in the where clause. There may be lot entries in that table. Instead of checking VEKP use TVST table to get shipping points.

Thanks,

Chandra

0 Kudos

Thanks for the reply Chandra. Here is what I have done.

FORM CHECK_AUTHORIZATION.

  DATA: BEGIN OF LT_VSTEL OCCURS 0,
        VSTEL LIKE TVST-VSTEL,
        END OF LT_VSTEL.

  DATA: LX_VSTEL LIKE LINE OF LT_VSTEL,
        R_VSTEL  LIKE LINE OF S_VSTEL.

  SELECT DISTINCT VSTEL FROM TVST INTO TABLE LT_VSTEL
                        WHERE VSTEL IN S_VSTEL.

  CLEAR   S_VSTEL.
  REFRESH S_VSTEL.

  LOOP AT LT_VSTEL INTO LX_VSTEL.
    AUTHORITY-CHECK OBJECT 'V_LIKP_VST'
                        ID 'ACTVT' FIELD '03'
                        ID 'VSTEL' FIELD LX_VSTEL-VSTEL.

    IF SY-SUBRC NE 0.
      CLEAR: GV_MESSAGE.
      CONCATENATE TEXT-003 SY-REPID INTO GV_MESSAGE SEPARATED BY SPACE.
      MESSAGE GV_MESSAGE TYPE GC_E.
    ELSE.
      R_VSTEL-SIGN   = GC_I.
      R_VSTEL-OPTION = GC_EQ.
      R_VSTEL-LOW    = LX_VSTEL-VSTEL.
      APPEND R_VSTEL TO S_VSTEL.
    ENDIF.
  ENDLOOP.

ENDFORM.                    " CHECK_AUTHORIZATION

Anybody any other suggestions please?

0 Kudos

Hi

is the issue still exists?..Execute program...and check SM66 transction where exactly program is taking more time...there you can check which table taking more time...

Thanks,

Chandra

0 Kudos

Please check in SE30 and ST05 where the problem is. Secondly if VSTEL is key field (cant check as no access to SAP)  no need to use DISTINCT clause.

Check in trace which is the problem statement.

Thanks

Nabheet

0 Kudos

Also the SE30 and ST05 will you which statements are tking long time