03-14-2007 1:55 PM
i am working in user exit where i need to read the data from internal table edidd of an idoc on the basis of idoc type only. This idoc type can be obtained from the field edidc-doctyp of table edidc..But there is no import or export or table parameter declared for this table. How can i acess idoc type from this table?.
.......thanx in advance...
03-14-2007 2:07 PM
Hi,
First find out what are all the data fields available in that user exit.(from Import/export paramters you will know)
then with the help of them, you have to fecth the data from this table by writing some code.
Regards,
Anji
03-14-2007 2:08 PM
I think you are looking like the following
in the EDIDC you have always one IDoc type.
loop at idoc_data where docnum = i_idoc_contrl-docnum.
if idoc_data-segnam eq 'E1EDPK1'
move idoc_data-sdata to i_y1yt1.
append i_y1yt1.
endif.
if idoc_data-segnam eq 'E1EDPk2''.
move idoc_data-sdata to i_y1yt2.
append i_y1yt2.
endif.
Please provide more info
aRs
03-14-2007 2:16 PM
If you are not able to get the IDocType as import then you can read the Idoc Type from the table EDIDC by passing the IDoc number to it.....
Once you get the IDoc type then u can use your conditions.........
03-14-2007 3:26 PM
Hi,
IDOC type is always available in structure EDIDC. Where are you coding this user-exit. If this user-exit triggers while inbound / outbound IDOC, then it should have EDIDC as one of the import parameter.
If you want to access IDOC data from EDIDD based on idoc segments, then you can write the code like this.
For Example, you are processing idoc ORDERS05. You can write like this.
LOOP AT IDOC_DATA
CASE IDOC_DATA-SEGNAM.
*- header data -------------------------------------------------------*
WHEN 'E1EDK01'.
MOVE IDOC_DATA-SDATA TO E1EDK01.
*- organistion data header --------------------------------------------*
WHEN 'E1EDK14'.
MOVE IDOC_DATA-SDATA TO E1EDK14.
*- header date --------------------------------------------------------*
WHEN 'E1EDK03'.
MOVE IDOC_DATA-SDATA TO E1EDK03.
*- header taxes -------------------------------------------------------*
WHEN 'E1EDK04'.
MOVE IDOC_DATA-SDATA TO E1EDK04.
*- header conditions --------------------------------------------------*
WHEN 'E1EDK05'.
MOVE IDOC_DATA-SDATA TO E1EDK05.
*- partner data -------------------------------------------------------*
WHEN 'E1EDKA1'.
MOVE IDOC_DATA-SDATA TO E1EDKA1.
*- reference data -----------------------------------------------------*
WHEN 'E1EDK02'.
MOVE IDOC_DATA-SDATA TO E1EDK02.
*- delivery terms header ----------------------------------------------*
WHEN 'E1EDK17'.
MOVE IDOC_DATA-SDATA TO E1EDK17.
*- payment terms header -----------------------------------------------*
WHEN 'E1EDK18'.
MOVE IDOC_DATA-SDATA TO E1EDK18.
*- additional data header ---------------------------------------------*
WHEN 'E1EDK35'.
MOVE IDOC_DATA-SDATA TO E1EDK35.
*- payment cards header -----------------------------------------------*
WHEN 'E1EDK36'.
MOVE IDOC_DATA-SDATA TO E1EDK36.
*- text identification header -----------------------------------------*
WHEN 'E1EDKT1'.
MOVE IDOC_DATA-SDATA TO E1EDKT1.
*- text header --------------------------------------------------------*
WHEN 'E1EDKT2'.
MOVE IDOC_DATA-SDATA TO E1EDKT2.
*- item data ----------------------------------------------------------*
WHEN 'E1EDP01'.
MOVE IDOC_DATA-SDATA TO E1EDP01.
*- additionals --------------------------------------------------------*
WHEN 'E1ADDI1'.
MOVE IDOC_DATA-SDATA TO E1addi1.
*- item reference data ------------------------------------------------*
WHEN 'E1EDP02'.
MOVE IDOC_DATA-SDATA TO E1EDP02.
*- CU: reference order item/ instance on the configuration ------------*
WHEN 'E1CUREF'.
MOVE IDOC_DATA-SDATA TO E1CUREF.
*- item date ----------------------------------------------------------*
WHEN 'E1EDP03'.
MOVE IDOC_DATA-SDATA TO E1EDP03.
*- item taxes ---------------------------------------------------------*
WHEN 'E1EDP04'.
MOVE IDOC_DATA-SDATA TO E1EDP04.
*- item conditions ----------------------------------------------------*
WHEN 'E1EDP05'.
MOVE IDOC_DATA-SDATA TO E1EDP05.
*- item partner data --------------------------------------------------*
WHEN 'E1EDPA1'.
MOVE IDOC_DATA-SDATA TO E1EDPA1.
*- item delivery terms ------------------------------------------------*
WHEN 'E1EDP17'.
MOVE IDOC_DATA-SDATA TO E1EDP17.
*- item payment terms -------------------------------------------------*
WHEN 'E1EDP18'.
MOVE IDOC_DATA-SDATA TO E1EDP18.
*- additional data item -----------------------------------------------*
WHEN 'E1EDP35'.
MOVE IDOC_DATA-SDATA TO E1EDP35.
*- Aitem object data --------------------------------------------------*
WHEN 'E1EDP19'.
MOVE IDOC_DATA-SDATA TO E1EDP19.
*- item schedules -----------------------------------------------------*
WHEN 'E1EDP20'.
MOVE IDOC_DATA-SDATA TO E1EDP20.
*- item text identification -------------------------------------------*
WHEN 'E1EDPT1'.
MOVE IDOC_DATA-SDATA TO E1EDPT1.
*- item text ----------------------------------------------------------*
WHEN 'E1EDPT2'.
MOVE IDOC_DATA-SDATA TO E1EDPT2.
*- summary ------------------------------------------------------------*
WHEN 'E1EDS01'.
MOVE IDOC_DATA-SDATA TO E1EDS01.
*- customer-spezific segments -----------------------------------------*
WHEN OTHERS.
* PERFORM USER_SEGMENTS. "user exit
ENDCASE.
ENDLOOP.
Please calrify which IDOC and user-exit you are using and what you want to achieve. I may be able to provide you the exact solution if you give me these details.
Regards,
RS