How to edit inbound idoc with data errors in multiple segments and reproces

Hi friends,
i have a requirement for error handling of inbound sales order(ORDERS04) without using WORKFLOW and WE19.
i have seen some function modules like edic_* ..
but my doubt is how to edit the error data(how can i identify the particular error fileds in the segments)and how to reprocess the same idoc.
Please help me...
Thanks in advance

Hi Narasimh,
Please find the following steps to edit IDOC segment after you find the error using WE02.
The example codes can be found in website 
http://www.sapgenie.com/sapedi/idoc_abap.htm
STEP 1 - Open document to edit
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_EDIT'
       EXPORTING
            document_number               = t_docnum
       IMPORTING
            idoc_control                  = itab_edidc
       TABLES
            idoc_data                     = itab_edidd
       EXCEPTIONS
            document_foreign_lock         = 1
            document_not_exist            = 2
            document_not_open             = 3
            status_is_unable_for_changing = 4
            OTHERS                        = 5.
STEP 2 - Loop at itab_edidd and change data
LOOP AT itab_edidd WHERE segnam = 'E1EDKA1'.
  e1edka1 = itab_edidd-sdata.
  IF e1edka1-parvw = 'LF'.
    e1edka1-partn = t_eikto.
    itab_edidd-sdata = e1edka1.
    MODIFY itab_edidd.
    EXIT.
  ENDIF.
ENDLOOP.
STEP 3 - Change data segments
CALL FUNCTION 'EDI_CHANGE_DATA_SEGMENTS'
           TABLES
                idoc_changed_data_range = itab_edidd
           EXCEPTIONS
                idoc_not_open           = 1
                data_record_not_exist   = 2
                 OTHERS                  = 3.
STEP 3a - Change control record
CALL FUNCTION 'EDI_CHANGE_CONTROL_RECORD'
       EXPORTING
            idoc_changed_control         = itab_edidc
       EXCEPTIONS
            idoc_not_open                = 1
            direction_change_not_allowed = 2
            OTHERS                       = 3.
STEP 4 - Close Idoc
Update IDoc status
CLEAR t_itab_edids40.
  t_itab_edids40-docnum      = t_docnum.
  t_itab_edids40-status      = '51'.
  t_itab_edids40-repid       = sy-repid.
  t_itab_edids40-tabnam      = 'EDI_DS'.
  t_itab_edids40-mandt       = sy-mandt.
  t_itab_edids40-stamqu      = 'SAP'.
  t_itab_edids40-stamid      = 'B1'.
  t_itab_edids40-stamno      = '999'.
  t_itab_edids40-stapa1      = 'Sold to changed to '.
  t_itab_edids40-stapa2      = t_new_kunnr.
  t_itab_edids40-logdat      = sy-datum.
  t_itab_edids40-logtim      = sy-uzeit.
  APPEND t_itab_edids40.
  CALL FUNCTION 'EDI_DOCUMENT_CLOSE_EDIT'
       EXPORTING
            document_number  = t_docnum
            do_commit        = 'X'
            do_update        = 'X'
            write_all_status = 'X'
       TABLES
            status_records   = t_itab_edids40
       EXCEPTIONS
            idoc_not_open    = 1
            db_error         = 2
            OTHERS           = 3.
Hope this will help.
Regards,
Ferry Lianto

Similar Messages

  • How to Test, Inbound idoc ,with out the Sender System, using a Text File

    Hi Guru's .
    we wanted to test BLAORD03 inbound idoc (Message Type BLAORD).with out the SENDER SYSTEM.
    on the same client.
    we wanted to test this idoc with text file from our local machine.
    Can anyone give us detail steps.like how to create  File layout
    with Segment name,and values for the fields.how to pass this file to the system.
    Thanks in advance.

    Hi Aparna.
    My requirement is to test the idoc with Inbound File.
    Generate a file with the data entered through segments through we19 ,and use the same file for processing through we16.
    when i am trying to do this syst complaing about
    Partner Profile not available, and some times
    port not available. and some  times with
    'No further processing defined'.
    but i maintained part profiles and port perfectly.
    Can you help me in testing with test 'File' port.

  • How to auto save output with date added to file name, and email the results?

    Hi,
    We found a script to capture disk space usage, that automatically places the results into an Excel file. We would like the script to autosave this file to a specific directroy with the date ran as part of teh file name. We would then like these results to
    be emailed to us if possible. (also if possible to highlight cell in red that is 5% OR less available disk space would be great)
    Here is what we have:
    $erroractionpreference = “SilentlyContinue”
    $a = New-Object -comobject Excel.Application
    $a.visible = $True
    $b = $a.Workbooks.Add()
    $c = $b.Worksheets.Item(1)
    $c.Cells.Item(1,1) = “Machine Name”
    $c.Cells.Item(1,2) = “Drive”
    $c.Cells.Item(1,3) = “Total size (GB)”
    $c.Cells.Item(1,4) = “Free Space (GB)”
    $c.Cells.Item(1,5) = “Free Space (%)”
    $c.cells.item(1,6) = "Name "
    $d = $c.UsedRange
    $d.Interior.ColorIndex = 19
    $d.Font.ColorIndex = 11
    $d.Font.Bold = $True
    $d.EntireColumn.AutoFit()
    $intRow = 2
    $colComputers = get-content "C:\Servers.txt"
    foreach ($strComputer in $colComputers)
    $colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
    foreach ($objdisk in $colDisks)
    $c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
    $c.Cells.Item($intRow, 2) = $objDisk.DeviceID
    $c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
    $c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
    $c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
    $c.cells.item($introw, 6) = $objdisk.volumename
    $intRow = $intRow + 1
    $d.EntireColumn.AutoFit()
    cls
    Thank You

    Hi Phorbin1128,
    The script below amy be helpful for you to save the Excel file with date in filename, and send email with the attachment of the excel report.
    $erroractionpreference = “SilentlyContinue”
    $a = New-Object -comobject Excel.Application
    $a.visible = $True
    $b = $a.Workbooks.Add()
    $c = $b.Worksheets.Item(1)
    $c.Cells.Item(1,1) = “Machine Name”
    $c.Cells.Item(1,2) = “Drive”
    $c.Cells.Item(1,3) = “Total size (GB)”
    $c.Cells.Item(1,4) = “Free Space (GB)”
    $c.Cells.Item(1,5) = “Free Space (%)”
    $c.cells.item(1,6) = "Name "
    $d = $c.UsedRange
    $d.Interior.ColorIndex = 19
    $d.Font.ColorIndex = 11
    $d.Font.Bold = $True
    $d.EntireColumn.AutoFit()
    $intRow = 2
    $colComputers = get-content "C:\Servers.txt"
    foreach ($strComputer in $colComputers)
    $colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
    foreach ($objdisk in $colDisks)
    $c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
    $c.Cells.Item($intRow, 2) = $objDisk.DeviceID
    $c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
    $c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
    $c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
    $c.cells.item($introw, 6) = $objdisk.volumename
    $intRow = $intRow + 1
    $d.EntireColumn.AutoFit()
    $date=Get-Date -f yyyy-MM-dd
    $filename = "D:\test\"+$date+".xlsx"
    $b.SaveAs($filename)
    $a.Quit()
    Send-MailMessage -SmtpServer xxxxxxxxxx -To [email protected] -From [email protected] -Subject "test mail" -Body "file name is: $new_file" -attachment $filename
    For more detailed information about the cmdlet Send-MailMessage, please refer to this article:
    Send-MailMessage
    I hope this helps.

  • How to pass a function with the same argument multiple times and return values in variables?

    The problem I have is I created a function which really is some kind of database.  Basically a bunch of:
    if (a.value == "this number"){
    b.value = "this expression";
    Inside the form are 2 dropdown lists that return numerical values which I want to process through that function and put the return value inside separate variables.
    var a = this.getField("OPE003.EVEN.1.MIP");
    Mip(a);
    var result1 = Mip();
    I tried to overwriting *a* to process the second field
    a = this.getField("OPE003.EVEN.2.MIP");
    Mip(a);
    var result2 = Mip();
    result1 and result2 are put in an array, joined as a string.
    Doing so, I always get the last processing twice as the final result.
    Can I use a function as a batch processing tool that way?

    You are right, I changed the code to what you said but how do I pass another value through my fonction so I can get Result1 and Result2?
    is it
    var a = this.getField("OPE003.EVEN.1.MIP");
    var b = this.getField("OPE003.EVEN.2.MIP");
    var result1 = Mip(a);
    var result2 = Mip(b);
    var c = new Array[result1, result2]

  • B1358 error while posting inbound idoc with a FM

    Hi
    We are trying to post and inbound IDOC with the help of an rfc and eventually creating an invoice from a bdc wrapped in the RFC
    The idocs are successfully pushed to R/3 while they are not getting posted and the error code in we02 is as follows
    No status record was passed to ALE by the application
    Message no. B1358
    Diagnosis
    The application failed to return a status record to the ALE layer after the IDoc was processed.
    This is due to an error in the application function module which processed the inbound IDoc.
    Procedure
    If you wrote the application function module yourself, you need to change the program.
    If the function module in question is a standard application function module, you should consult SAP.
    Note: we are using a custom function module
    regards
    krishna

    Hi Krishna,
    I assume that your function module processing the IDOC does not follow the ALE/IDOC processing rules.
    Please check out the programming guidelines in the SAP Online Help under:
    <a href="http://help.sap.com/saphelp_nw70/helpdata/en/78/21758051ce11d189570000e829fbbd/frameset.htm">http://help.sap.com/saphelp_nw70/helpdata/en/78/21758051ce11d189570000e829fbbd/frameset.htm</a>
    Important are the parameters and tables that need to be returned, containing the correct IDOC processing status. Please take the IDOC processing quite serious in regards to complete Logical Unit of Works.
    Best regards,
    SIlvia

  • How to process inbound idoc in R/3 with status 75 - idoc received via qRFC?

    Hi gurus,
    we are using EOIO for source to R/3, and all the idocs a received in r/3 with this status. But they can't be processed from BD87. How to process these?
    Thanks,
    Olian
    Edited by: Olian Saludew on Sep 11, 2008 11:44 AM

    Hi,
    Idocs Works on tRFC Queues.
    Check this Report to Process Inbound Idocs with Specified Status.
    RBDAPP01
    Regards
    Seshagiri

  • How to find the Size of an Idoc With data

    Hi All,
    There is business case where in the partner needs an Idoc with size 200KB - 250KB  triggerd from SAP.
    Is there any chace of knowing the size of an Idoc with data before it gets tirrgerd from SAP.
    Please Help
    Thanks,
    Suma

    Hi Dinil,
    I have provided you with a sample that would show you the how you can get the size of an arraylist
    the sample has a page untitled1 and a bean named test.
    I have run in on jdev 11.1.2 and it is ok, it will be ok on 11.1.3
    after running the sample you will see the 2.
    please remember that you must add the JSTL taglib on the viewcontroller.
    just right click on viewcontroller, go to tag lib select the jstl.
    page
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>untitled1</title>
    </head>
    <body>
    <h:form>
    <h:outputText value="#{fn:length(test.a)}"/>
    </h:form>
    </body>
    </html>
    </f:view>
    bean
    import java.util.ArrayList;
    public class Test {
    public Test() {
    a= new ArrayList();
    Object o=new Object();
    a.add(o);
    a.add(o);
    ArrayList a;
    public void setA(ArrayList a) {
    this.a = a;
    public ArrayList getA() {
    return a;
    I hope this sample came handy.
    regards,

  • Inbound idoc with error status 52 messege type hrmd_a07

    i have an inbound idoc with status 52
    error messege : Object 01 ,P ,00056786 does not exist: infotype 0302 cannot be created
                             Object 01 ,P ,00056786 does not exist: infotype 0006 cannot be created
    i debugged but i haven't find out the reason
    am updating 0000,0001,0002,0003,0006 infotypes

    Hi rahul,
    Need to check the address filed (0006) for BP mapped to postion (00056786)
    Infotype 0302 (Additional Actions) :
    Infotype 0302 is not maintained directly and is automatically updated by Infotype 0000 .
    The additional actions Infotype (0302) is of time constraint 3 (gaps and overlaps).
    Specifically in some cases if we want to have a non status-changing Action on the same day where already a personnel action is existing at that time we can activate the Infotype 302 by executing Report RPUEVSUP.
    please check and let me know . I think it will be helpfull
    Thanks and Regards,
    Krishna

  • How to create Inbound Idocs in a ABAP program? Any function Module?

    Hello Experts,
    My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
    I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
    If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
    I populated T_EDIDD with data records from  IDOC_INBOUND_WRITE_TO_DB.
    To the function module IDOC_INPUT_ORDERS,  T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
    I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
    I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
    Can anybody please provide inputs?
    Regards.

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to Edit Contact List with email

    How to Edit Contact List  with email ID  in the heading
    Regards,
    Charles.KE

    eh? Can you please give some detail of what you're attempting to do ?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to post inbound idoc in sap system?

    Dear All,
    How to post inbound Idoc in sap system?
    Regards,
    Amar
    Edited by: amar kumar on Nov 23, 2009 2:53 PM

    Hi Amar,
    Use the FM IDOC_WRITE_AND_START_INBOUND to post an inbound IDoc. Just build the EDIDD and *EDIDC8 tables and enter a profile for a inbound message type from a partner. It returns a IDoc number. Don't forget to do commit work.
    Regards
    Abhii

  • How to use TRUNC function with dates in Expression Builder in OBIEE.

    Hi There,
    How to use TRUNC function with dates in Expression Builder in OBIEE.
    TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
    Thanks in advance

    use this instead:
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE)

  • How to copy Log text (with Date, Time stamp ) User IDfrom BP to Transaction

    Hi Experts,
                     Can someone guide us how  to copy Log text (with Date ,Time & User ID) fron Business partner  (Prospect) to transactions by text detrmination procedure.
    Regards,
    Basavaraj Patil

    save text
    Fill out following parameters of SAVE_TEXT function module:
    HEADER
    TDOBJECT C 10 BUT000
    TDNAME C 70 10 digit BP number
    TDID C 4 Z001
    TDSPRAS C 1 Language
    INSERT = ’X’
    LINES
    TDFORMAT TDLINE
    |
    |testtttttttttttttttttttttttt( Your text)
    I would suggest you to use some other BAPI that would attach your text to BP than SAVE_TEXT.
    If you still wanted to use SAVE_TEXT then first make sure how the TDNAME is generated. It depends on the text determination procedure. For examples, it can be guid of BP, GUID followed by date or time or else the BP number itself.
    Just go to BP transaction, double click on the text pad, it will open you the SAP Script editor. Click on menu GOTO and select Header which will give you info about your TDID, TDOBJECT, TDNAME....
    Hope this helps.

  • How to edit a text with same font in a image in photoshop 7

    how to edit a text with same font in a image in photoshop 7

    Good day!
    The question seems to provide insufficient information for a relevant answer.
    Do you have the font?
    Is the text a (Type) Layer of its own or part of the image?
    Could you please post a screenshot with the Layers Panel visible?
    Regards,
    Pfaffenbichler

Maybe you are looking for

  • I have AirPort Extreme connected for Wi-Fi.

    I have had great luck with my AirPort Extreme to run internet on my Mac-Book Pro until the power to the unit was accidentally flipped off. Now, the modem is connected and the unit has a green light, but I can't connect to the internet on any computer

  • Control key for sub-operation

    Hi, what is the control key used for sub-operations for which we do not want seperate confirmation. when main operation confirms, the sub-operation should get confirm automatically. please advise.

  • Kindle download error

    I got a new iphone 4, now my books in my Kindle app won't download from archive. I get a message "Error, Please remove the book from your device and redownload it from your archived items." I have tried deleting and re-downloading from archive, get t

  • Multiple masters for a company

    We are currently in the process of implementing Oracle EBS in our company and we are also implementing Oracle Projects. Ours is a Engineering Construction company, and under the Business Unit (which is a profit center) there are many project sites. O

  • Hi guys I want to know how to create SRM portal?

    Hi guys I am right now creating SRM portal, can anyone give info about please.