Problem solve Get help with specific problems with your technologies, process and projects.

Retrieving missing data from user exit functions

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.

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.
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.
This was last published in November 2003

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close