Home > SAP software/management Tips > SAP ABAP/Java developer tips > BAPI to retrieve "Check Values" (like SU53 result)
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP ABAP/JAVA DEVELOPER TIPS

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


ABAP63
03.08.2002
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.



Code

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
            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.

Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SAP ABAP/Java developer tips
How to do additional dialog processing after SAP COMMIT WORK statement
How to find a piece of SAP ABAP code without debugging
How to read an SAP transaction in an ABAP code
How to provide an SAP R/3 4.5B application server with a Web service interface
How to find owners and transports of deleted ABAP programs
Fixing a common OPEN_FORM and START_FORM error in SAPscript
Select Text fields: Case-insensitive
Is this the quickest way to find a BADI?
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



NetWeaver SAP White Papers
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts