02-15-2007 7:44 PM
Hi experts,
the data which I need is not on interface of user-exit. I can do export table to memory id and than in user-exit import that. Does this work always?
I have seen that sometimes is possible to see data with
(include-name)table-name. Can I always use this?
In detail: in transaction ME51N is new tabstrip created with customer fields.I have to know the purchase order for the selected item which is filled on another tabstrip.
Can anyone help me?
Thanks.
Best regards,
Danijela
02-15-2007 9:27 PM
Hi Danijela,
To answer your question about the "(module)object" approach:
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.
I found this a long time ago on the web and used it successfully multiple times in the past.
Hope this helps,
Guenther
02-15-2007 8:00 PM
you might be having the purchase order in your main program, try accessing it in the debug mode and see.
02-15-2007 8:05 PM
hi,
I think export and import is the correct solution. after using the value by importing, clear the id....for own clarification.
02-15-2007 9:27 PM
Hi Danijela,
To answer your question about the "(module)object" approach:
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.
I found this a long time ago on the web and used it successfully multiple times in the past.
Hope this helps,
Guenther