Home > SAP Tips > ABAP/Java developer tips > Retrieving missing data from user exit functions
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ABAP/JAVA DEVELOPER TIPS

Retrieving missing data from user exit functions


Robert Bagg
11.21.2003
Rating: -4.47- (out of 5) Hall of fame tip of the month winner


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


Have you been in a user exit function and the data you need wasn't passed on to you? You can easily grab the data from the memory stack using this little trick. Let's say that you need some IDoc information that was created from the function IDOC_INPUT_DELVRY... You can get it directly from the call stack like this.
The code was written in R/3 4.6C but should work in any SAP version.

Code

DATA: i_EDIDC like EDIDC,
      i_EDIDD like EDIDD occurs 0 with header line.

CONSTANTS:
      c_EDIDD(21)  value '(SAPLV55K)IDOC_DATA[]',
      c_EDIDC(21)  value '(SAPLV55K)IDOC_CONTRL',
      c_E1ADRM1(7)      value 'E1ADRM1'
      c_SHPCON(6)  value 'SHPCON'.

Field-symbols: <FC>, <FD> .
clear: i_EDIDC, i_EDIDD.
refresh: i_EDIDD.

* Get the Control Record from memory
assign (c_EDIDC) to <FC>.
if SY-SUBRC = 0.
  i_EDIDC = <FC>.

  IF i_EDIDC-MESTYP = c_SHPCON.

*   None of the partner information can be passed directly from
*   the IDOC function, so we'll get it from memory.

*   Get IDOC data records from memory
    assign (c_EDIDD) to <FD>.
    i_EDIDD[] = <FD>.

*   Now you have the entire IDOC available to you without making
*   a DB select.
    read table i_EDIDD with key SEGNAM   = c_E1ADRM1.

*   Load new value HERE...

  ENDIF.
ENDIF.

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
ABAP/Java developer tips
Fixing a common OPEN_FORM and START_FORM error in SAPscript
Select Text fields: Case-insensitive
Finding BADIs you can use
Is this the quickest way to find a BADI?
ABAP Objects in SAP Workflow to provide improved performance
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects
Find a BADI in a minute
Top 10 SAP tips of 2007
How to transport an SAP query in R/3 4.6x

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.

HomeNewsTopicsBlogsTipsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, 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