Showing posts with label Idocs. Show all posts
Showing posts with label Idocs. Show all posts

Tuesday, March 8, 2016

Idoc user exits - fetch item number from parent segment

 
Demo code for Idoc (EDI) user exits, where you don’t get item number in all segments.  This shows how to fetch item number from Parent segment (E1EDP01 in this case).
 
E1EDPA1 (Partner function segment in ORDERS idoc) does NOT have item number in it, So fetch from parent E1EDP01 (Item details) segment. To do that, write LOOP with  segnam = E1EDP01 or E1EDPA1 – demo code is shown below.
 
    LOOP AT int_edidd ASSIGNING <fs_edidd> WHERE segnam 'E1EDP01'
                                             
OR  segnam 'E1EDPA1'.

      
IF <fs_edidd>-segnam 'E1EDP01'.
        
CLEAR ls_e1edp01,
                lv_ebelp
.
        ls_e1edp01 
<fs_edidd>-sdata.
        lv_ebelp   
=  ls_e1edp01-posex.
        
CONTINUE.
      
ENDIF.

      
CLEARls_e1edpa1.
      
CHECK  <fs_edidd>-sdata+0(2) = 'WE'.
      ls_e1edpa1 
<fs_edidd>-sdata.

      
REFRESHlt_po_del_addr[].
*     Get  PO del address
      
CALL FUNCTION 'BAPI_PO_GETDETAIL1'
        
EXPORTING
          PURCHASEORDER    
xekko-ebeln
          DELIVERY_ADDRESS 
'X'
        
TABLES
          POADDRDELIVERY   
lt_po_del_addr.

*     Get Item PO delivery address
      
CLEARls_po_del_addr.
      
READ TABLE lt_po_del_addr INTO ls_po_del_addr WITH KEY po_item lv_ebelp.
      
IF sy-subrc EQ 0.
        ls_e1edpa1
-strs2 ls_po_del_addr-str_suppl3.
        ls_e1edpa1
-pfach ls_po_del_addr-location.
        <fs_edidd>
-sdata ls_e1edpa1.
      
ENDIF.
    
ENDLOOP.
 

Friday, July 31, 2015

List of Inbound and outbound Idoc user-exits

Inbound Idoc extension


WE31 - To create custom segment
WE30 - To create extension

WE82 - To do mapping

WE57 - Assign new extension to Function module.

In incoming idoc, extension should be given in CIMTYP  - while using WE19, give in CIMTYP of control record (header)

Above setup is enough for inbound extension - No setup needed in partner profile to include extension (you however need to include process code)

Invoice verification (MIRO) - INVOIC
basic type: INVOIC02
extension: ZINVOIC

Monday, July 27, 2015

Trigger idoc on change of customer data


For the automatic transfer of master data ,we can use change pointer technique.
Following are the steps to be followed:-
1) Enable change pointer globally (t.code BD61).
 
2)Enable Change Pointers for a Message Type (t.code BD50).
Here you have to check the Active checkbox corresponding to customer master message type 'DEBMAS'.
 
3)Specify the Fields for Which Change Pointers Are to Be Written (t.code BD52).
Various number of fields are present here corresponding to message type'DEBMAS'. If you want to add any other field , you can add here.
 
Apart from above three settings, all other ALE configurations are required like( partner profile, distribution model etc.) Eg: SALE tcode, setup distribution model
 
For triggering the Idoc program 'RBDMIDOC' should be scheduled.
When you make any change in the customer master , Idoc will be triggered automatically from your SAP system.

Thursday, March 12, 2015

Order Idoc - to pass Text id



Please fill following in idoc to give EAN number in Text field in SAP.


E1EDP01-POSEX = item number (start with 1 and continue sequence numbers for all items)
 
E1EDPT1-TDID = 'ZCEA' and TSSPRAS = 'E' and

E1EDPT2-TDLINE = EAN number  -  and E1EDPT2- TDFORMAT = * (asterisk)

Monday, December 8, 2014

EDI Idocs tips


How to retransmit multiple idocs:

Dropbox -> CMS -> EDI Idocs -> 'How to retransmit multiple idocs'

Friday, August 29, 2014

Set up EDI Idoc (Custom)


WE30 - To create basic type (or Extension) of custom idoc

WE31 - To create segments - with fields - Once you create you set them 'Release'

WE81 - Define Message type  -

WE82 - Link message type with idoc type


Outbound Idoc (Custom) -
- In Partner profile in WE20 set this new idoc type for the partner you want to sent to (like Logical System (LS) or Customer etc)
- Create a function module using FM MASTER_IDOC_DISTRIBUTE .  Take reference of MASTERIDOC_CREATE_* functions.
- Use the above function in your program to trigger idocs

 

Friday, August 1, 2014

Program to change status of Idocs


Program to change status of Idocs (for eg: in case you want to 'archive' and make them Green) :

RC1_IDOC_SET_STATUS  - You can set status to 71 (archive) - Idocs turn Green after the status is set.

Monday, June 30, 2014

Idocs reciever port determination


Reciever port for outbound idocs can be determined from
1) Distribution model (in SALE tcode) - where  message type is assigned to reciever's Logical system (LS) which is assigned to sender's LS
2) From Partner profiles (WE20), where recieving port determined from Partner (KU, LS, etc).
 

Friday, March 21, 2014

Setup EDI idoc (Standard)


How to setup new EDI idoc (Standard)

Step 1:  Find relavant Idoc type and Message type - This is based on business process.
Dropbox -> CMS -> EDI Idocs -> 'EDI with EDIFACT - Mapping Types' doc can help  - Or just search in internet

Step 2: Go to WE19  - > Get template for Test based on Messag type

Step 3: Get an idea on what to fill in template using WE60 tcode (look for Documentation)
You can also find XML templates in internet for message type.

Step 4: Run and make sure it works.  Now, note down if you require any additional fields.

 

Wednesday, March 5, 2014

EDI Tcodes


WEDI - Area menu for EDI relavant tcodes

WE05 - Idoc List
WE19 -  Test tool for Idoc processing - you can run FM in foreground and debug (take an existing idoc and run it)
WE09 - Search Idocs for Business content (you can search for a field value) - You can change field values here and save (which then can be reprocessed using BD87/84)

WE20 - Partner profiles
WE60 - Mapping Structures/Documentation 

WE21 - Ports definition in Idoc processing  (setup SAPPI_PRD port here )

SALE - Idoc Interface ALE settings (setup distribution model, logical sys etc here)

WE30 - Develop idoc types
WE31 - Develop idoc segments

WE57 - To setup FM <-> Message type assignment
WE41/WE42 - Process codes

BD84 - Reprocess Idocs
BD87 - Status monitor

RSEOUT00 - Process all Selected Idocs (for Partner) - This way you can collect all Idocs for a partner and send them at a time.

VOE2 - To map customer to Sales area and Order type
VOE4 - To map customer ship-to (external) with internal number  (We dont want our customer to remember all the ship-to numbers.. do we?)

IDOC -  Idoc and EDI basis

Vendor to Us(our comp) mapping (for INVOIC type - vend invoice):
OBCA - Map vendor company code to our real company code
OBCD - Map External tax rate to Tax code
OBCE - EDI INVOIC Programming parameters