Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

regarding idoc userexits

Former Member
0 Likes
631

hi all,

i would like to know how to do userexits in idocs

and the t-code to create user exits

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
555

Hi Kiran,

Welcome to SDN.

First you need to identify the FM module that will be used for inbound or outbound IDoc process. Then next step is to find custom exit available inside the corresponding FM to add your custom codes.

For example, function module IDOC_OUTPUT_ORDRSP is used to generate the IDoc type ORDERS05. There is a last user exits that can be used to modify the EDIDD segments prior to generate IDoc ORDERS05. Let's say you want to add quotation date to segment E1EDK03.

*- final customer-Function
CALL CUSTOMER-FUNCTION '003'
  EXPORTING
    DCONTROL_RECORD_OUT = CONTROL_RECORD_OUT
    DORDER_NUMBER       = ORDER_RESPONSE_NUMBER
    DXVBAK              = XVBAK
    DXHVBKD             = XHVBKD
  TABLES
    DXVBKD              = XVBKD
    DXVBPA              = XVBPA
    DXVBAP              = XVBAP
    DXVBEP              = XVBEP
    DIKOMV              = IKOMV
    DIKOMVD             = IKOMVD
    DINT_EDIDD          = INT_EDIDD
  EXCEPTIONS
    ERROR_MESSAGE_RECEIVED        = 1
    DATA_NOT_RELEVANT_FOR_SENDING = 2.

Then in user exits EXIT_SAPLVEDC_003, you can code like this.

data: wa_edidd   like edidd,       
      wa_e1edk03 like e1edk03.    
 
loop at dint_edidd.   
  if dint_edidd-segnam = 'E1EDK03'.     
    move dint_edidd-sdata to wa_e1edk03.     
 
    if wa_e1edk03-iddat = '013'.       
      exit.      
    else.        
      clear wa_edidd.            
      clear wa_e1edk03.        
      move dint_edidd to wa_edidd.       
      wa_e1edk03-iddat = '013'.       
      wa_e1edk03-datum = <quotation date>          
      move wa_e1edk03 to wa_edidd-sdata.       
      append wa_edidd-sdata to dint_edidd.     
    endif.   
  endif. 
endloop.

To create user exits in IDoc, you need to double click on the include program (i.e. EXIT_SAPLVEDC_003) then system will ask to create a new transport request. Once you have complete the above steps then you code your custom logic. Please ensure to save the changes and activate at the end.

If you can use transaction SE80/SE38/SE37 to modify the user exit.

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Read only

0 Likes
555

And don't forget cmod and smod to activate and view the exit

Read only

Former Member
0 Likes
555

Hi,

Can any body provide me with document/information on function module IDOC_OUTPUT_OILTPI50_MASS that process pushes Sales order Idoc(OILTPI50 for oil-industry) to pertner system ?

Also tell me how to modify any of the userexits available to incorporate the similar processing for STO, please.

Plz help me on an URGENT basis.