Tip

BAPI to retrieve "Check Values" (like SU53 result)

Sometimes BAPI/RFC calls fail due to missing authorization and it is not easy to find the reason. While it is possible with SAPGUI to retrieve this information via transaction SU53 to display check values, this might not be possible from another front-end (i.e. Web) since this information is only stored temporarily (it is lost as soon as the user logs off). The following BAPI can be called immediately after the failing BAPI/RFC -i.e. in an error routine. It returns the check values in an ASCII table.


FUNCTION Z_BAPI_GET_AUTH_VIOLATION_INFO.
*"----------------------------------------------------------------------
*"*"Local interface:
*"       TABLES
*"              ASCII_LIST STRUCTURE  W3HTML
*"----------------------------------------------------------------------
* This BAPI returns information about authority violation, similar to
* transaction code SU53.
* Since that information gets stored temporarily in SAP, the BAPI has to
* be called in an active session.
* I.e. if a an authority violation occurs and the user logs off, no
* information will be available after re-logon.
************************************************************************

  DATA: ASCII_TEMP  LIKE LISTZEILE OCCURS 1 WITH HEADER LINE,
        OUTPUT_LIST LIKE ABAPLIST  OCCURS 1 WITH HEADER LINE.
  SUBMIT SAPMS01G EXPORTING LIST TO MEMORY AND RETURN.

  CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
            LISTOBJECT = OUTPUT_LIST
       EXCEPTIONS
           

    Requires Free Membership to View

NOT_FOUND = 1 OTHERS = 2. CALL FUNCTION 'LIST_TO_ASCI' TABLES LISTASCI = ASCII_TEMP LISTOBJECT = OUTPUT_LIST EXCEPTIONS EMPTY_LIST = 1 LIST_INDEX_INVALID = 2 OTHERS = 3. LOOP AT ASCII_TEMP. ASCII_LIST = ASCII_TEMP. APPEND ASCII_LIST. ENDLOOP. ENDFUNCTION.

This was first published in March 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.