Status Record Code

Hi All,
Currently i'm working on custom IDOC and i've done with creation of custon idoc, segment and message type. Now i'm developing the outbound program for Custom IDOC and need to add status code into the program. can anyone send me sample code to add the status record. I checked some standard progarms like BD10 but unable to get code for status record......and wht are status codes are required in Outbound program...
Your help will b highly appreciated
Rgds
Faisal

Hi Faisal,
Check for Error / Success
    IF NOT wf_exit_flag IS INITIAL .
      idoc_contrl-status = co_51.   "IDOC in Error
    ELSE .
      idoc_contrl-status = co_53.   "IDOC in Posted Status
    ENDIF.
set IDOC status.
    PERFORM set_idoc_status.
Check this perfom and its corresponding form.
*&      Form  set_idoc_status
      text
FORM set_idoc_status.
fill error / success message with corresponding
*status
  CLEAR: wa_error, wa_success.
  LOOP AT tb_error INTO wa_error.
    idoc_status-docnum = idoc_contrl-docnum.
    idoc_status-status = co_51.
    idoc_status-msgid  = wa_error-msgid.
    idoc_status-msgno  = wa_error-msgno.
    idoc_status-msgv1  = wa_error-msgv1.
    idoc_status-msgv2  = wa_error-msgv2.
    idoc_status-msgv3  = wa_error-msgv3.
    idoc_status-msgv4  = wa_error-msgv4.
    APPEND idoc_status.
    CLEAR wa_error.
  ENDLOOP.
  LOOP AT tb_success INTO wa_success.
    idoc_status-docnum = idoc_contrl-docnum.
    idoc_status-status = co_53.
    idoc_status-msgid  = wa_success-msgid.
    idoc_status-msgno  = wa_success-msgno.
    idoc_status-msgv1  = wa_success-msgv1.
    idoc_status-msgv2  = wa_success-msgv2.
    idoc_status-msgv3  = wa_success-msgv3.
    idoc_status-msgv4  = wa_success-msgv4.
    APPEND idoc_status.
    CLEAR wa_success.
  ENDLOOP.
ENDFORM.
*&      Form  execute_action
      text
Mohinder

Similar Messages

  • IDoc Control Record and Status Record Code,  where is it!!!

    Hi,
      Where can i see the code for generation of control record and status record of IDoc.
       Thanks in advance for your answers

    hi ,
    1.first create an segment with the fields u want tcode we31 relase it .
    2. create an idoc and assign segment to it tcode we30.
    3.crate a message type  tcode we81
    4.assign that message to idoc  tcode we 82.
    do the ale configarations .
    now u can write the code in our sender system
    *1.     Create parameters/select-options for input data. i.e., message type, logical system.
    parameters : p_mestyp like edmsg-msgtyp default 'ZKKUMSG',
                 p_logsys like tbdlst-logsys obligatory.
    *2.     Create Data objects for control record, data record and database table.
    data : c_segment like edidd-segnam value 'ZKKUSEG',        "Data record (IDoc)-Segment type
           c_idoctp like edidc-idoctp value 'ZKKUIDOC'.            "Control record (IDoc)-Basic type
    data : begin of i_tab occurs 0,
              ZKSNO   like ZKSTD-ZKSNO,
              ZKSNAME like ZKSTD-ZKSNAME,
           end of i_tab.
    data : w_itab like i_tab.
    data : s_segment like ZKKUSEG.
    data : i_edidd like edidd occurs 0 with header line.
    data : i_control_record like edidc.
    data : i_comm_idoc like edidc occurs 0 with header line.
    *3.     Select the data from responding tables into internal table for a defined condition.
    here you have take ur internal table
    *select single zsno zsname from zkiran into corresponding fields of itab where zsno = p_sno.
    *4.     create control record into internal table.
    i_control_record-mestyp = p_mestyp.         "Message Type
    i_control_record-idoctp = c_idoctp.         "Basic type
    i_control_record-rcvprt = 'LS'.             "Partner Type of Receiver
    i_control_record-rcvprn = p_logsys.         "Partner Number of Recipient
    *5.     create data record into internal table.
    *i_edidd-segnam =   c_segment.
    loop at i_tab into w_itab.
    s_segment-zksno    = w_itab-ZKSNO.                     "Application Data
    s_segment-zksname  = w_itab-ZKSNAME.
    i_edidd-sdata     = s_segment.
    i_edidd-segnam    = c_segment.
    clear w_itab.
    append i_edidd.
    endloop.
    *6.     Process ALE Service Layer using the function module  MASTER_IDOC_DISTRIBUTE.  It returns the corresponding IDoc No.s.
    call function 'MASTER_IDOC_DISTRIBUTE'
      exporting
        master_idoc_control            = i_control_record
      tables
        communication_idoc_control     = i_comm_idoc
        master_idoc_data               = i_edidd
      exceptions
        error_in_idoc_control          = 1
        error_writing_idoc_status      = 2
        error_in_idoc_data             = 3
        sending_logical_system_unknown = 4
        others                         = 5.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *7.     Display Communication IDocs.
    loop at i_comm_idoc.
      write : / 'Communication IDoc No. is : ', i_comm_idoc-docnum.
    endloop.
    *8.     Commit Work.
    commit work.
    i hope this sample code help u .
    thanks

  • Current day EBS - memo record for status BAI codes

    Hello all,
    My client has a requirement of uploading current day EBS statement (only 1 file at the start of the day). I believe that FF.5 will allow the upload of this statement and then we can use transaction FPS3 to select the particular records so as to create Memo records in Cash Management. Can anyone guide me if we can also create memo records for the 'status' BAI codes from this statement. Example- creating memo records for BAI code '040' - Opening available, '060' Closing available, etc. These status BAI codes are part of '03' record type in the current day bank statement. Any help or sharing of your experience on this will be very helpful.

    Satyen,
    For creating Memo records for the status BAI codes like 040-Opening available, 100-Total Credits, 400-Total Debits, etc., you will have to create a pre-processor program. This will rewrite the original bank statement received from the bank and create 16 records for these status BAI codes.
    For e.g.  the 03 record in one account looks as follows in the file received from the bank.
    03,99999538,USD,010,82499230,,,015,82499230,,,030,82499230,,,/
    The preprocessor program will rewrite this as follows:
    03,99999538,USD,,,,/
    16,010,82499230,,,/
    16,015,82499230,,,/
    16,030,82499230,,,/
    and so on.
    Then this rewritten BAI file is uploaded into SAP using FF_5. Then you can go into FPS3 and create memo records for these status codes.
    I have been using this method with lot of success.
    If anyone has different suggestion that would help me too.
    Kalyan

  • Error while updating the status record of IDOC in SAP

    Hi All,
    I am facing this problem. I have done outbound processing and IDOC was sent successfully from SAP to EDI system and it was processed in EDI and now EDI system wants to send the status back to SAP with a status message and the status number that we are using is '24' and we have mapped all the fields in the status table EDIDS and made sure that EDI system sends all those and I think Counter field can not be determined by EDI system so EDI system used the counter '1' since it can not determine how many counters are already there in SAP and unless we pass the value to this counter field we were getting the error. After passing all the values the status of the IDOC is updated with the status '00' instead of '24' and we do not know why it is happened and I would like to know how SAP converts the status record that is received from the EDI system.
    Please let me know how the status record will be translated into SAP from EDI system and I ahve followed basically EDIDS structure and the IDOC status is updating in SAP but with wrong status number and the alignemnt also missing in SAP fields like if I give some text in the EDI it is splitting and storing in 2 fields.
    Please help me in this and I think I have explained the problem in a detail manner.
    Thanks,
    Ramesh.

    Hi Naresh,
    Thanks for the reply and my question is since EDI system is able to send the status back to SAP from EDI system and only problem is it is updatinf the status wrong and I have checked the EDIDS table also and the entry is creating with another counter and please confirm me that it is because of EDI does not support the status record update so that I can confirm to the client that there is nothing wrong in the way SAP functions and EDI system can not update the status code in the SAP.
    Thanks,
    Ramesh.

  • Inbund IDOC error: Status records with status 51 after status 53

    Hi all,
    I'm looking to resolve an issue related to posting an inbound IDOC. when I process inbound IDOC created from report prg I'm getting a status message: "Status records with status 51 after 53" .
    Functionality: I'm creating an IDOC from flat file and processing it to post Customer master data into SAP. During this process creation of IDOC is successful but when I'm changing the existing data record (customer master data) IDOC is throwing this error.
    Changing data: For changing existing data I'm passing KUNNR field and overwriting the remaining data. Even though the idoc status is 51 the changed data is getting posted in to SAP. Here my concern is to see IDOC status as 53.
    Regards,
    Ganesh.
    Edited by: Ganesh Sunkara on Aug 1, 2009 3:45 AM

    Hi all,
    I solved this issue by myself. There is an error in the user exit code.
    regards,
    Ganesh.

  • Some question on IDOC (Control Record/Data Record/Status Record)

    Dear all,
    I am new in this area, and would like to enquire some question on this topic.
    When I view a IDOC via WE02, each of the IDOC record will consist of Control Record/Data Record/Status Record).
    Questions:
    I notice that the data records consists of many segment (i.e. E1EDK01, etc) which are use to store application data.
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Thanks.
    Tuff

    Hi Tuff,
    As everything in SAP, with IDOCs too there are
    1) Standard IDOCs
    2) Standard IDOCs(Extending - Enhancement to an IDOC, to accomodate for custom values)
    3) Custom IDOCs
    And every IDOC has,
    Control record - EDIDC Structure - This mostly reflects the partner profile information, along with few more details which are used for IDOC extension, Sequencing etc
    Data Records - EDID4 Structure - These records contain the actual business data of the document in concern. So for ORDERS05 it would contain order details, INVOIC02 - Invoice details so on...
    Status Records - These records capture the status of an IDOC from the time it is received/sent from your system and a corresponding business document is created/changed. So this will have messages like "IDOC sent to the port OK" etc which are status from the communication layer(ALE) to application specific messages like "Sales Order XXX created" or "Invalid Material" etc.
    You would have noticed something called as Process code in the partner profile, this is associated with a FM(or work flow task etc) which has the business logic coded in.
    So in case of an Inbound IDOC, the sending system updates the IDOC - Control and Data records, and sends it to the receiving system. On the receiving system the IDOC's control record is validated against the partner profiles set, if an entry is found then using the process code it finds the associated FM which will decode the data from the IDOC data records as per the IDOC type and then use it to post data into SAP (VIA BDC, Batch Input, BAPI etc).
    And all this while the Status records are being updated accordingly.
    So with the above context will try to answer your questions,
    1 - My question is do I have to manually create all these segment and do a mapping to my application field one by one (i.e. that is when I want to create a brand new message type from scratch)?
    In case of a custom IDOC, yes you will have  to.
    In case of a standard IDOC, you wouldn't have you just have set up the necessary configuration (Partner Profile, Process code etc)
    In case of a standard IDOC extended to accommodate for some custom values(for which there are no fields in standard IDOC - Let us say you have added some new fields on VA01) - In this case you can still use the standard Process code and Standard FM associated with it, SAP provides several Function exits in these FM's which you can leverage to add your custom logic.
    2 - If question no. 1 is Yes, how to do it, what are the transaction code to create it? can you show me the step by step.
    There are several documents available on the net and on SDN detailing step by step approach for all the above three cases,
    just search for step by step guide for IDOCS - sap.
    3 - I don't have to create the Control record and the status record for my new message type right ? because those field value will automatically pull out from partner profile and system status message, am I correct?
    Again it depends, in case of using a standard IDOC you wouldn't have to. But in case you have some customizations/enhancements then you might have to.
    For Ex: updating the control record accordingly for indicating that you have extended the standard IDOC. Or append custom messages to the status record as per the business logic.
    Try out the examples you find on the net and post any specific questions you might have.
    Regards,
    Chen

  • Status 51:No status record was passed to ALE by the application

    Hi All,
    my scenario is file->XI->IDOC.
    data is reaching r/3 system, but i see below error in WE02
    status 51: Application document not posted
    No status record was passed to ALE by the application
    registering the function module, linking FM with basic type with direction equal to 2, assigning FM to process code and inbound parameters of partner profiles are configured well.
    Plz let me know if i missed any steps.
    Thanks,
    Goutham

    use similar thread
    Inbound IDOC
    In WE19, Give the IDOC number & execute ... then put the cursor on the idoc control record . then click on the Standard Inbound push button on the application tool bar.it will show show all the details like partner no,type , message type , process code & function module name ...
    now put a break point in the function module .. & debug .
    if u r using customised inbound function module , then click on inbound function module .. there u will get a pop screen with FM name & debugging option in both background & foreground mode...
    Edited by: Dharamveer Gaur on Sep 19, 2008 2:17 PM

  • No status record was passed to ALE by the application

    Hi Experts,
    My requirement is something like this: The middleware (XI) is triggering an IDOC which is Inbound to SAP-ECC. This IDOC is used for posting of Financial documents (Invoice and Credit memos).
    I am processing the IDOC by writing a FM. Inside the FM I am reading data from IDOC and using a BAPI to post the documents. Then I am updating the status of the IDOC based on successful or unsuccessful posting.
    Issue: When XI triggers the IDOC, the IDOC is resulting in status "No status record was passed to ALE by the application". This is not the status that I am populating inside my FM. This means that the control is not entering the FM at all (please correct if I am wrong).
    My findings: When I re-process the same IDOC which resulted in error previously using WE19, the control goes inside my FM (obviously as I give my FM name in WE19 ) and the status gets populated according to my code.
    Problem that I am facing is only when I am trying to do an Intergration testing.
    I have searched SDN for same issue and found out that I need to clear/refresh all the necessary variables. I am doing that (and double checked it too).
    Please help me with this problem as I am running out of ways to find the solution (and time also ).
    Many thanks,
    Daljeet.

    Hi Daljeet,
    Please check SM58 logs.
    Thanks,
    Best regards,
    Prashant

  • IDocStatus Application document not posted, No status record passed to ALE

    Hi,
    I am sending CREMAS04 IDOC to receiver system.The receiver system should create vendor entry in master table by using IDOC data.
    IDOC is getting posted successfully in R/3,but while calling inbound function module i.e process code CRE1 I am getting following status records :
    51 Application document not posted
    No status record was passed to ALE by application.
    62 IDOC passed to application
    Direct call started.
    64 IDOC ready to be transfered to application
    No filters , No conversion , No version change .
    50 IDoc added
    Please help me to resolve this problem.

    Shweta,
    The IDOC has been posted by XI to the R3 system.  It is the funtional module that is not able to handle the IDOC and only your Functional Team can tell you why the IDOC is not being processed properly by the R3 system.
    It can be because of multiple reasons including invalid data, etc . For instance we once faced an issue once when the User ID used to post the IDOC did not have the authorizations to do financial manipulations and it was our functional team that was able to pin point the reason to us.
    Regards,
    Bhavesh

  • Application failed to return status record to ALE layer after Idoc procesed

    Hi,
    I am loading a full load to Product category (hierarchies) through process chain.
    One of the load failed with the following error. The Idoc has status 51 in BW.
    Can some suggest me the process for correcting this.
    Thanks
    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.

    Hi
    If this is standard code then you will have to write code to populate the status message in exit. But in case of custom code, the above mentioned solution is best (if coding logic is correct). I have given this solution to many queries and all worked.
    Thanks
    Anuraag

  • Idoc status record

    hi,
      How idoc status records are filled when it comes to inbound side ?
    Ganesh

    Hi,
    Please try to test using this FM to check whether your ALE distribution model has been setup correctly or not for the message type.
    ALE_MODEL_INFO_GET
    ALE_MODEL_AUTH_INFO_GET
    If not, yo need to maintain distribution model (t/code BD64).
    <b>Reward points</b>
    Regards

  • Re STATUS Record-HR

    Hi,
    I have created FM for Hiring Action(HR) using BDC session,
    Inbound Process
    When i am trying to pass the FM to IDOC it is giving me Status Record 51 which specifies 'No status record was passed to ALE by the application',
    What exactly i have to do in my FM for this error,
    Can u reply with Code.
    Thanks
    Abhay

    Hi,
    using transaction PA40 in batch-input always causes problems, so maybe u can try to do it using PA30.
    Regards,

  • Idocs status records!!!

    Hi,
    We have a requirement in which the status records need to be added in the inbound Idoc.
    In the present scenario, Idoc status records are being created like : status 52 Inbound delivery/deliveries are created(no's are 000001 to 000005). This is current scenario.
    Requirement is like :
    we need to have the number of status records depends on Inbound deliveries created.
    For ex : If two inbound deliveries gets created in an Inbound Idoc, then In Idoc status records should be like :
    Status 52 Inbound delivery created ( no 0000001 to 0000001)
    Status 52 Inbound delivery created ( no 0000002 to 0000002)
    Status 52 Inbound delivery created ( no 0000003 to 0000003).
    and so on.......
    Please let us know how can we acheive the above scenario?
    Thanks in advance.
    Ramesh.

    The inputs to the IDoc processing function are:
    *"*"Local interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT_METHOD) TYPE  BDWFAP_PAR-INPUTMETHD
    *"     REFERENCE(MASS_PROCESSING) TYPE  BDWFAP_PAR-MASS_PROC
    *"  EXPORTING
    *"     VALUE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"     VALUE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"     VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"     VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"  TABLES
    *"      IDOC_DATA STRUCTURE  EDIDD
    *"      IDOC_CONTRL STRUCTURE  EDIDC
    *"      *IDOC_STATUS STRUCTURE  BDIDOCSTAT*
    *"      RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"      SERIALIZATION_INFO STRUCTURE  BDI_SER
    *"  EXCEPTIONS
    *"      WRONG_FUNCTION_CALLED
    The status records are returned from the processing function via the parameter IDOC_STATUS which is an internal table so you can append multiple entries to it.
    The only restriction is that all records must have the same status code (ex. all must be 51 is there is an error, or all must be 53 if there are no errors).  An IDoc processing function executes as a single DB transaction so it is all or nothing.
    ~Ian

  • Question on the status record of Idocs.

    Hi all,
    Where does the status of the idoc update::
    1) In the idoc in the sap system/Idoc Archive
    OR
    2)The one we transfer to the OS as a flat file (for the translators(EDI subsystem) to work on)?
    OR
    both of the above?
    Thanks,
    Charles.

    Hi,
    Whenever the IDOC is generated there are one to many status record updated to idoc depending on it is inbound / outbound and various process / system is goes through.
    Check transaction <b>WE47</b> to see all IDOC related status.
    This is the range of status for IDOC.
    OUTBOUND Idoc - Status between 1 to 49
    INBOUND Idoc  - Status between 50 to 74
    Also you can check the View <b>V_STACUST</b>. If you want to check status(s) of any idoc check table EDIDS.
    Regarding two scenario you are talking about.
    1. In the idoc in the sap system/Idoc Archive.
    - When IDOC is generated, it get status record
    - When you archive already created IDOC, the neither the status records are updated / changed or new status record are created
    2. The one we transfer to the OS as a flat file (for the translators(EDI subsystem) to work on)?
    - If you mean that you are sending IDOC to fine port then yes in that case also IDOC has status records.
    Can you explain your second question in more detail?
    Let me know if you have any other question.
    Regards,
    RS

  • Report to display all the status records of an Idoc

    Hi,
      I need to find out all the status records for an idoc and display them as a report. Is there any existing SAP Report that does that. I checked in table edids and all the status records of the idoc are not stored in the status text which is empty althogh there are 12 counters for the idoc.
    regards
    Aveek

    Hey Aveek;
       Try this, which will get the most recent one.  You would just need to change it to loop at the edids records to get at them all...
          TABLES: *edidc, *edids, *t100.
          DATA: wf_string type string.
          CLEAR *edids.
          SELECT SINGLE *
             INTO *edids
             FROM edids
             WHERE docnum = *edidc-docnum
               AND status = '51'.
          SELECT SINGLE text
             INTO *t100-text
             FROM t100
             WHERE sprsl = 'EN'
               AND arbgb = *edids-stamid
               AND msgnr = *edids-stamno.
             CLEAR wf_string.
          MOVE *edids-stapa1 TO wf_string.
          REPLACE '&' WITH wf_string INTO *t100-text.
          IF sy-subrc EQ 0.
            CLEAR wf_string.
            MOVE *edids-stapa2 TO wf_string.
            REPLACE '&' WITH wf_string INTO *t100-text.
            IF sy-subrc EQ 0.
              CLEAR wf_string.
              MOVE *edids-stapa3 TO wf_string.
              REPLACE '&' WITH wf_string INTO *t100-text.
              IF sy-subrc EQ 0.
                CLEAR wf_string.
                MOVE *edids-stapa4 TO wf_string.
                REPLACE '&' WITH wf_string INTO *t100-text.
              ENDIF.
            ENDIF.
          ENDIF.
          A little sloppy (OK, alot!), but it gets the job done...
    Cheers,
    John

Maybe you are looking for

  • Windows 7 Drivers For Qosmio G40-12S

    I have a Qosmio G40-12S with windows Vista Ultimate 32bit And i have Install a Windows7 Ultimate 32bit instead of vista , Before that i had download all drivers in this link (http://eu.computers.toshiba-europe.com/innovation/download_drivers_bios.jsp

  • Vendor Master Duplication

    Hi All I need to make a setting where I dont want the vendor master data to be created more than once, and I want the deciding field to be the VAT Registration number {Field STCEG} from the vendor master. I have already set up a message to appear in

  • How do I unsync all of my family's phones from icloud?

    My family just did the new ios update and now we're all synced. Everyone is getting everyone eleses texts! How can we disconnect when we all share the same itunes account?

  • Installing Mac OS X on an external firewire hard drive.

    No matter what I try, I cannot get my Mac mini to boot from the SuperDrive, in order to install the Mac OS X operating system onto my external firewire hard drive... The Mac mini always recognises the external firewire HD, each time the system boots-

  • Java applications won't load with bridge installed

    I am using JAWS (Job Access With Speech) by Freedom Scientific, version 4.02 which is supposed to work with the current version of the Access Bridge. I am also using Java 2 JDK 1.3.0 on an NT 4.0 system. When I turn on the java console window and run