IDOC_INPUT_ORDERS problems

Hi Friends,
Ive got some problems when posting the idocs of type orders05. I could find a oss note relevant to this.. But i dont know how to do this practically. can somebody help me with this....
Solution:
The standard modules IDOC_INPUT_ORDERS, IDOC_INPUT_ORDCHG,                    
IDOC_INPUT_REQOTE provide customer functions which allow you to read          
additional fields from the Idoc and copy them into screens. For this          
purpose you must call within these functions the standard routines for  copying the fields into tables and, if necessary, for formatting the      
fields and transferring them into the screens.                            
You must carry out correctly the process of the background controlled     
screen sequence, the error-free field transfer and the proper enclosure   
of the documents, in particular if you call screens that are ignored in   
the standard case. SAP is not liable for resulting problems.              
    o  Use Customer function '001' for reading the Idoc fields.           
                                                               o  The filling of the screen fields should be carried out in customer  function 002
Thanks,
Kiran.

Kiran,
Based on your post I am not exactly sure what your problem is.  But I can explain how this BDC processing works.
IDOC_INPUT_ORDERS creates a BDC to load VA01 with the data from the IDOC.  In customer function 001, you can transfer data from the IDOC fields to the program variables.  If you transfer data to standard sap fields in the structures provided, the function module should automatically create the correct BDC Logic.
If the fields you are trying to add to VA01 are not standard SAP fields, then you need to change the BDC internal table in customer function 002.  However you need to take special care when doing this.  Since this is a BDC, you need to ensure that the additional BDC logic that you are added is inserted into the table correctly as to not cause issues when the call transaction is made.
If this doesn't answer your question, please provide more specifics with what you are trying to accomplish.
Chris

Similar Messages

  • Enhancement in IDOC_INPUT_ORDERS not saving changes after order creation

    I have an enhancement at the beginning of the IDOC_INPUT_ORDERS function module used to create sales orders via EDI.  In the enhancement, I take the data records and make some changes to some quantities and units of measure.  After making these changes, I let the function module continue on as normal.  The order does get created with my changes in them, however, the IDoc doesn't reflect my changes.
    Here's an example:  An EDI order comes in with 6 EAs of a material.  In my enhancement, I change it from 6 EAs to 2 3PK.  I then let it go on its way.  The order gets created fine with 2 3PKs, however the IDoc after its a ll done still says 6 EAs. 
    The enhancement runs before the FM puts the data into the tables it uses. I tried using the last user exit to open the IDoc and editing it there using the EDI_DOCUMENT_OPEN_FOR_EDIT FM but it says its open. 
    Can anyone give me any clues on how to make my changes stick to the IDoc?
    Thanks,
    Curtis

    Ok, I figured out why it's not saving.  Not realizing it, but the tables are passed into the FM by reference, so what I'm changing is only a copy.  So what I tried to do is use the 004 (I've also tried the 005) user exits to try to update the actual DB.  I used the following FMs (EDI_DOCUMENT_OPEN_FOR_EDIT, EDI_CHANGE_DATA_SEGMENTS, and EDI_DOCUMENT_CLOSE_EDIT).  The problem is that I can't change them because the IDoc is still open.
    Does anyone have any ideas on how I can achieve my goal of changing the IDoc?
    Thanks,
    Curtis

  • Sales Order Creation with reference to Quotation using FM IDOC_INPUT_ORDERS

    HI Guru's,
    I've a requirement to create the sale order from the quotation.
    For this we are using the FM "IDOC_INPUT_ORDERS".
    Here my problem is i'm able to create the sales order with the custom program, but if i made any changes to the quotation Header
    (Ship-to party address) before creating the sales order, it is not reflecting into the sales order header level (ship-to party address).
    What  i was thinking is we are not using the Quotation as reference to create the sales order while filling the segments.
    Could you please tell me which segment do i need to use fill the reference document number (quotation) at header level.
    one more problem, if i change ship-to party of one line item, it is affecting the other line items also.
    Please guide me what to do???
    Thanks,
    Adi.

    HI Ramesh,
    Question:
    Could you please tell me which segment do i need to use fill the reference document number (quotation) at header level.
    Sol: use segment E1EDK02
    Segment type E1EDK02 IDoc: Document header reference data
    QUALF 011 : Referenced Document Number
    BELNR XXXXX IDOC document number
    DATUM 20100121 IDOC: Date'
    what i've used in my program
    I'm using the E1EDK02 segment as you mentioned above.
    le1edk02-qualf = '011'.
    e1edk02-belnr = Quotes-vbeln.
    Question:
    Here my problem is i'm able to create the sales order with the custom program, but if i made any changes to the quotation Header
    (Ship-to party address) before creating the sales order, it is not reflecting into the sales order header level (ship-to party address).
    Sol: Check you custom code .. whether you are bringing write address to segement or not
    (if you change any address in Quotation then Address master is added with new entry with new address no )
    In my program..
    I'm passing the partner numbers and partner types (WE & AG) to the segment "E1EDKA1". (Ship-to & Sold-to).
    What i was thinking is the above segment is causing the problems, because if we reference the Quotation, we should not pass the Ship-to and sold-to numbers, it should take all those from quotation.
    I've tried to comment the code which we have written for that segment "E1EDKA1", it is giving me the error saying that
    Customer numbers can't be determined for the document number..
    Please guide me how to solve this problem..
    Thanks,
    Adi.

  • Sales order with reference to contract using IDOC_INPUT_ORDERS

    Hi all,
    I had the requirement to create sales order with reference to contract based on some validations of idoc values and then passing the modified idoc data table to IDOC_INPUT_ORDERS. I have completed the coding till the modification of data in a new function module ('Z') and then calling the IDOC_INPUT_ORDERS FM inside that. Now my problem is while creating the sales order, the bdc for Txn VA01 is not populating those values to screen fields which I want to populate. I could find out that some modifs needs to be done in some user exit for reference to contract case.But finding difficulty in getting the exact place to make the modifications. Any pointer to this problem would be highly appreciated.
    Regards,
    Divya

    Hi,
    This issue is been resolved.
    One of my friend helped me with resolving this issue..
    Once the below mentioned configurations were done on SPRO, the Sales Order was created with reference to Contract and the Qty was reflected when tried to create a new Order referring the same contract.;
    u2022     SPRO --> SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Define Sales Document Types  --> Field : Outline agreement message; from blank to u201CBu201D.
    u2022     SPRO  -->SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Maintain Sales Document Types for AFS  --> Field : Outline agreement message; from blank to u201CAu201D

  • IDOC_INPUT_ORDERS segment E1EDKA1 is inheriting values from default

    I'm trying to use a user exit in IDOC_INPUT_ORDERS ... function group VEDA.
    What I want to do is clear the WE (ship to) DXVBADR segment and fill it with a diferent destination.
    My problem is that some of the fields are overwritten by the customer address settings when it was created with transaction XD01.I can't seem to get any control over many of them. When I examine the code in IDOC_INPUT_ORDERS, I can see why. Many fields, example HAUSN aren't checked. They just get over-written by the default customer settings from XD01.
    EXIT_SAPLVEDA_001 and EXIT_SAPLVEDA_002 don't seem to work.
    If I could get control over EXIT_SAPLVEDA_002, I could modify the bdc lines for the ship to party. But, that seems very error prone to me.
    Has anyone else encountered this problem?

    I couldn't find any "official" way to do it. So, I used EXIT_SAPLVEDA_002 to blow away all of the fields on the ship to address screen and rebuild it. This probably isn't the most elegant way to do it. But, it works for me and has been stable in my production system.
    P.S.
    I can't get my code pasting to format correctly.
    I'm surrounding it by
    but it isn't working today.
    You may need to claw your way through this mess.
    * FUNCTION EXIT_SAPLVEDA_002.
    *&  Include           ZXVEDU04
    *{   INSERT         ES1K900037                                 
    *"*"Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(DXVBAK) OPTIONAL
    *"             VALUE(DVTCOMAG) OPTIONAL
    *"             VALUE(DLAST_DYNPRO) OPTIONAL
    *"             VALUE(DXMESCOD) LIKE  EDIDC-MESCOD OPTIONAL
    *"       TABLES
    *"              DXBDCDATA STRUCTURE  BDCDATA OPTIONAL
    *"              DXVBAP OPTIONAL
    *"              DXVBEP OPTIONAL
    *"              DYVBEP OPTIONAL
    *"              DXVBADR OPTIONAL
    *"              DYVBADR OPTIONAL
    *"              DXVBPA STRUCTURE  VBPAVB OPTIONAL
    *"              DXVBUV OPTIONAL
    *"              DIDOC_DATA STRUCTURE  EDIDD OPTIONAL
    *"              DXKOMV OPTIONAL
    *"              DXVEKP OPTIONAL
    *"              DYVEKP OPTIONAL
    *"       EXCEPTIONS
    *"              USER_ERROR
    *&==============================================================
    *&                         MODIFICATION LOG
    *&==============================================================
    *& Developer    : Ed Baker (ebaker)
    *& Date         : 5 November 2009
    *& Change Marker: ejb091105
    *& CTS request  : 800899
    *& Transport    : DE1K980565
    *& Description
    *& Added:
    *&  [1] Protection for NAME4 segments to preserve previous
    *&      user exit functionality
    *&  [2] Added insert of NAME3 segment
    " EXIT_SAPLVEDA_002
    data: ta_bdcdata            like bdcdata occurs 0.
    data: ts_bdcdata            like bdcdata.
    *>>>>>>>>>> Save NAME4 segment ejb091105 <<<<<<<<<<<START<
    *"05.11.2009 06:57:13
    * Holding table for NAME4 segments
    * these need to be preserved for compatability with
    * previous user ext.
    data: ta_bdcdata_name4      like bdcdata occurs 0.
    data: ts_bdcdata_name4      like bdcdata .
    *>>>>>>>>>> Save NAME4 segments ejb091105 <<<<<<<<<<<END<
    data: ta_idoc_data          like edidd occurs 0 .
    data: ts_idoc_data          like edidd.
    data: tmp_data              like bdcdata.
    data: v_we_index            like sy-tabix.
    data: v_v09c_index          like sy-tabix.
    data: v_addr1_begin         like sy-tabix.
    data: v_addr1_end           like sy-tabix.
    data: v_index               like sy-tabix.
    data: v_lines               type i.
    data: v_string              type string.
    data: v_sich_found          type c.
    data: st_e1edka1            like e1edka1.
    data: st_vbak               like vbak.
    data: ra_vkorg like RANGE OF tvko-vkorg.
    data: rs_vkorg like LINE OF ra_vkorg.
    *& Build range table of allowed sales orgs
    refresh ra_vkorg[].
    rs_vkorg-sign = 'I'.
    rs_vkorg-option = 'EQ'.
    rs_vkorg-low = '0010'.
    rs_vkorg-high = space.
    APPEND rs_vkorg to ra_vkorg.
    rs_vkorg-sign = 'I'.
    rs_vkorg-option = 'EQ'.
    rs_vkorg-low = '0020'.
    rs_vkorg-high = space.
    APPEND rs_vkorg to ra_vkorg.
    rs_vkorg-sign = 'I'.
    rs_vkorg-option = 'EQ'.
    rs_vkorg-low = '0070'.
    rs_vkorg-high = space.
    APPEND rs_vkorg to ra_vkorg.
    st_vbak = dxvbak.
    *>>>>>>>>>> Wrapper for NAME4 check ejb091105 <<<<<<<<<<<START<
    *"05.11.2009 08:25:40
    "check st_vbak-vkorg in ra_vkorg .
    if st_vbak-vkorg in ra_vkorg.
    *>>>>>>>>>> Wrapper for NAME4 check ejb091105 <<<<<<<<<<<END<
      " VKORG check passed. Go ahead and convert the inputs
      " to internal tables with structures.
      ta_bdcdata[] = DXBDCDATA[].
      ta_idoc_data[] = DIDOC_DATA[].
      " Get the ship to address information
      READ TABLE ta_idoc_data into ts_idoc_data
        with key segnam = 'E1EDKA1'
                 sdata+0(2) = 'WE'.
      IF sy-subrc = 0.
        st_e1edka1 = ts_idoc_data-sdata.
      ENDIF.
      " If the NAME1 field is blank, the default ship to address
      " is the same as the customer. Don't do anything. Just leave.
      check st_e1edka1-name1 ne space.
      " Wait until the SICH (SAVE) code is reached before doing
      " anything with the TA_BDCDATA table
      LOOP AT  ta_bdcdata into ts_bdcdata .
        if ts_bdcdata-fnam = 'BDC_OKCODE'
          and ts_bdcdata-FVAL = 'SICH'.
          v_sich_found = 'X'.
        endif.
      ENDLOOP .
      " the ta_bdcdata itab is stable once the SICH ok_code is found
      " you can go ahead and
      " process it and not have to worry about looping through it
      " multiple times
      IF v_sich_found = 'X'.
    *  >>>>>>>>>> Preserve NAME4 segment ejb091105 <<<<<<<<<<<START<
    *  "05.11.2009 07:01:15
      " Preserve any NAME4 segment for compatability
      " with previous user exit.
          LOOP AT ta_bdcdata into ts_bdcdata
            where fnam = 'NAME4'.
            ts_bdcdata_name4 = ts_bdcdata.
          ENDLOOP.
    *  >>>>>>>>>> Preserve NAME4 segment ejb091105 <<<<<<<<<<<END<
      " First: find the line that says WE ship-to information is nex
          LOOP AT ta_bdcdata into ts_bdcdata .
            IF ts_bdcdata-program = 'SAPLV09C'.
              v_index = sy-tabix + 1 .
              read table ta_bdcdata INTO tmp_data
                index v_index .
              IF sy-subrc = 0.
                v_we_index = v_index .
                exit.
              ENDIF.
            ENDIF.
          ENDLOOP.
      " Second: find the line where the addr1_data segments start
      LOOP AT ta_bdcdata into ts_bdcdata .
        if sy-tabix > v_we_index.
          IF ts_bdcdata-program = 'SAPLV09C'.
            v_addr1_begin = sy-tabix + 1.
            exit.
          ENDIF.
        ENDIF.
      ENDLOOP.
      " Third: find the BDC_OKCODE for the last addr1_data
      LOOP AT ta_bdcdata into ts_bdcdata .
        IF sy-tabix > v_addr1_begin.
          IF  ts_bdcdata-fnam = 'BDC_OKCODE'
          and ts_bdcdata-fval = 'ENT1'.
            v_addr1_end = sy-tabix - 1 .
          ENDIF.
        ENDIF.
      ENDLOOP.
      " Fourth: delete all of the ADDR1_DATA lines
      " program SAPLV09C and screen 5000
      if v_addr1_begin > 0.
       " v_addr1_end
        delete ta_bdcdata
         from v_addr1_begin to v_addr1_end.
    *  &============================================================
    *  &============================================================
      " Fifth: build up whatever you want
    *  &============================================================
    *  &============================================================
          clear ts_bdcdata.
          ts_bdcdata-dynpro = '0000'.
          ts_bdcdata-fnam   = 'ADDR1_DATA-NAME1'.
          ts_bdcdata-fval   = st_e1edka1-name1.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          if st_e1edka1-name2 is initial.
            ts_bdcdata-fnam   = 'ADDR1_DATA-NAME2'.
            ts_bdcdata-fval   = ''.
          else.
            ts_bdcdata-fnam   = 'ADDR1_DATA-NAME2'.
            ts_bdcdata-fval   = st_e1edka1-name2 .
          endif.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
    *  >>>>>>>>>> Add the NAME3 segment ejb091105 <<<<<<<<<<<START<
    *  "05.11.2009 07:41:58
    *  & Add the NAME3 segment. It's used sometimes
          if st_e1edka1-name3 is initial.
            ts_bdcdata-fnam   = 'ADDR1_DATA-NAME3'.
            ts_bdcdata-fval   = ''.
          else.
            ts_bdcdata-fnam   = 'ADDR1_DATA-NAME3'.
            ts_bdcdata-fval   = st_e1edka1-name3 .
          endif.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
    *  >>>>>>>>>> Add the NAME3 segment ejb091105 <<<<<<<<<<<END<
    *  >>>>>>>>>>> Preserve NAME4 segment ejb091105 <<<<<<<<<<<<STAR
    *  "05.11.2009 07:10:29
    *  & Insert the preserved NAME4 segment
          IF not ts_bdcdata_name4 is initial.
            ts_bdcdata-fnam = 'ADDR1_DATA-NAME4'.
            ts_bdcdata-fval = ''.
          else.
            ts_bdcdata-fnam = 'ADDR1_DATA-NAME4'.
            ts_bdcdata-fval = ts_bdcdata_name4-fval.
          ENDIF.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
    *  >>>>>>>>>>> Preserve NAME4 segment ejb091105 <<<<<<<<<<<<END<
          ts_bdcdata-fnam   = 'ADDR1_DATA-STREET'.
          ts_bdcdata-fval   = st_e1edka1-stras.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
         if st_e1edka1-land1 = 'US'.
          ts_bdcdata-fnam   = 'ADDR1_DATA-HOUSE_NUM1'.
          ts_bdcdata-fval   = st_e1edka1-hausn.
         else.
          ts_bdcdata-fnam   = 'ADDR1_DATA-HOUSE_NUM1'.
          ts_bdcdata-fval   = ''.
         endif.
         insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
         add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'ADDR1_DATA-CITY1'.
          ts_bdcdata-fval   = st_e1edka1-ort01.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'ADDR1_DATA-CITY2'.
          ts_bdcdata-fval   = st_e1edka1-ort02 .  " implement county
                                                  " ejb091118
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          if st_e1edka1-land1 = 'US'.
            ts_bdcdata-fnam   = 'ADDR1_DATA-REGION'.
            ts_bdcdata-fval   = st_e1edka1-regio.
          else.
            ts_bdcdata-fnam   = 'ADDR1_DATA-REGION'.
            ts_bdcdata-fval   = ''.
          endif.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          if st_e1edka1-land1 ne 'US'.
            ts_bdcdata-fnam   = 'ADDR1_DATA-TAXJURCODE'.
            ts_bdcdata-fval   = '' .
          endif.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'ADDR1_DATA-TIME_ZONE'.
          ts_bdcdata-fval   = ''.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'ADDR1_DATA-POST_CODE1' .
          ts_bdcdata-fval   = st_e1edka1-pstlz.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'ADDR1_DATA-COUNTRY'.
          ts_bdcdata-fval   = st_e1edka1-land1.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          IF st_e1edka1-telf1 ne space.
            ts_bdcdata-fnam   = 'SZA1_D0100-TEL_NUMBER'.
            ts_bdcdata-fval   = st_e1edka1-telf1 .
          else.
            ts_bdcdata-fnam   = 'SZA1_D0100-TEL_NUMBER'.
            ts_bdcdata-fval   = ''.
          ENDIF.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          ts_bdcdata-fnam   = 'SZA1_D0100-TEL_EXTENS'.
          ts_bdcdata-fval   = ''.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
          if st_e1edka1-PFACH ne space.
           ts_bdcdata-fnam   = 'ADDR1_DATA-PO_BOX'.
           ts_bdcdata-fval   = st_e1edka1-PFACH.
          else.
            ts_bdcdata-fnam   = 'ADDR1_DATA-PO_BOX'.
            ts_bdcdata-fval   = ''.
          endif.
          insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
          add 1 to v_addr1_begin.
    *  " all remaining fields on the ship to screen will be blank.
    *  *    ts_bdcdata-fnam = 'EXTENSION1'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'EXTENSION2'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'PO_BOX_CTY'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'PO_BOX_LOC'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'PO_BOX_REG'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'POST_CODE2'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'POST_CODE3'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'REMARK'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam = 'TIME_ZONE'.
    *  *    ts_bdcdata-fval = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
    *  " Fill in all of the SZA1_D0100 fields
    *      IF st_e1edka1-telf1 ne space.
    *        ts_bdcdata-fnam   = 'SZA1_D0100-TEL_NUMBER'.
    *        ts_bdcdata-fval   = st_e1edka1-telf1 .
    *      else.
    *        ts_bdcdata-fnam   = 'SZA1_D0100-TEL_NUMBER'.
    *        ts_bdcdata-fval   = ''.
    *      ENDIF.
    *      insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *      add 1 to v_addr1_begin.
    *      ts_bdcdata-fnam   = 'SZA1_D0100-MOB_NUMBER'.
    *      ts_bdcdata-fval   = ''.
    *      insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *      add 1 to v_addr1_begin.
    *      ts_bdcdata-fnam   = 'SZA1_D0100-FAX_NUMBER'.
    *      ts_bdcdata-fval   = ''.
    *      insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *      add 1 to v_addr1_begin.
    *      ts_bdcdata-fnam   = 'SZA1_D0100-FAX_NUMBER'.
    *      ts_bdcdata-fval   = ''.
    *      insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *      add 1 to v_addr1_begin.
    *      ts_bdcdata-fnam   = 'SZA1_D0100-SMTP_ADDR'.
    *      ts_bdcdata-fval   = ''.
    *      insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *      add 1 to v_addr1_begin.
    *  *    ts_bdcdata-fnam   = 'SZA1_D0100-DEFLT_COMM'.
    *  *    ts_bdcdata-fval   = ''.
    *  *    insert ts_bdcdata into ta_bdcdata index v_addr1_begin .
    *  *    add 1 to v_addr1_begin.
      endif.
      DXBDCDATA[] = ta_bdcdata[]. "restore the passed parameter
      ENDIF.
    endif. " end of st_vbak test
    *}   INSERT
    loop at DXBDCDATA where FNAM = 'ADDR1_DATA-NAME4'.
      DXBDCDATA-FNAM = 'ADDR1_DATA-STR_SUPPL1'.
      Modify DXBDCDATA.
    endloop.

  • Problem in Idoc extension for ORDERS05

    HI all,
    Am facing problem in inbound idoc, we have extended the Idoc ORDERS05 with one custom segment, and written the code in user exit EXIT_SAPLVEDA_001 and include ZXVEDU03 exit is triggering properly, sales orderis genarted successfull, but z-fileds are not updating in VBAK table,
    so plz help....
    Regards,
    Suresh.D
    Edited by: suresh dameruppula on Oct 20, 2009 2:39 PM

    Hi Suresh,
    The function exit and the include what you found is to read data from the IDOC segment into either internal table or structure.
    That's the first step which you have done is part of the below set:-
    EXIT_SAPLVEDA_001 & ZXVEDU03
    Now you need to populate the which you have read from the idoc into the document for that you need to write the code in the below set. The below one is a function exit which will be called during the BDC. You can see this below
    Aufruf Transaktion Auftragerfassung VA01                             *
    call transaction Order Entry VA01                                    *
            CASE xaprau.
    at line number 131 in the function module IDOC_INPUT_ORDERS.
    EXIT_SAPLVEDA_002 & ZXVEDU04
    Please let me know if you still have any further queries.
    Thanks,
    Mahesh.

  • Manual price condition item for the Idoc IDOC_INPUT_ORDERS

    Hello,
    I need to inform the item manual price using the function module for IDOCs IDOC_INPUT_ORDERS. I am trying by the segment E1EDP05, field Price, but it doesn´t work properly.
    Thanks in advance
    Regards

    Manuel,
    Merely putting the 'price' into a segment-field won't result in good result. You will need to (potentially)populate a few more fields to tell SAP what you want changed. Here is an example, I have a Condition Type called 'Z123' which is a manual condition record. It has been defined as a 'dollar-off' based discount (as opposed to a percentage etc). If I want to push through a discount of, say, $1.00 per unit then I will be populating the following fields within E1EDP05:
    KSCHL - 'Z123'
    KRATE - '2.21'
    MEAUN - 'EA'
    KOEIN - 'NZD'
    Try that and see how you get on. Also check your EDI config around the handling of Messages for Inbound Orders.
    Here's another hint... Simulate what you want to achieve by creating a sales order manually on the system with the relevant condition types populated and then trigger an outbound IDoc. Take a look at the E1EDP05 segment of the outbound IDoc and it will effectively tell you what you need to populate and where to populate it.
    Since I'm on a roll and feeling altruistic, here's another hint for you... Use WE19 and use the 'Inbound function module' icon and from the dialogue box select the 'Process in the Foreground'. As this function module is effectively a dirty old BDC wrapped around a SAP standard FM, you can step through it and see how it is behaving...
    If you are still having problems, let me know, and I will help you out as much as I can.
    Cheers,
    Paul...

  • IDOC segment Data updation problem

    I have done the Idoc extention for ORDERS05.I have written a code to insert data for my z segments in IDOC_INPUT_ORDERS.But when I run the program its not updating data to z segements as well as other segments
    What may be the problem..
    READ TABLE dedidd INTO wa_edidd WITH KEY segnam = c-e1edka1
                                                      sdata(3) = 'AG'.
            IF sy-subrc = 0.
              CLEAR w-index.
              w-index = sy-tabix.
              wa_e1edka1 = wa_edidd-sdata.
              CLEAR : wa_e1edka1-parvw,
                      wa_e1edka1-partn.
              wa_e1edka1-parvw = w-parvw.
              wa_e1edka1-partn = w-inpnr_ag.
              wa_edidd-sdata = wa_e1edka1.
              MODIFY dedidd FROM wa_edidd INDEX w-index TRANSPORTING sdata.
    ENDIF.
    Thanks
    Umesh

    Hi,
    Use Comparing fields addition in MODIFY Statement...
    MODIFY ........ COMPARING <key fields>
    Hope this would help you.
    Regards
    Narin Nandivada.

  • Message ORDERS05 IDOC problem

    Hello everyone!!!
    My name is Rocio, I'm a new developer on IDOCS and I have a problem with de message ORDERS05.
    I'm forming an STANDARD INBOUNT IDOC for Transaction VA02
    I want to put a field (Assignment - ZUONR ) that is on Header>Accounting. in VA02(Transaction).   
    I use the segment E1EDK02             QUALF       017  : Assignment Number
    But when I generated my idoc, this field is ok, but when I go to see the order..this field doesn't appear  its  empty...
    Can anyone help me because i don´t why is this happened?
    And i need this file with an IDOC value. because we are going to use this value in the invoice.
    Thanks for your help!!!
    Title was edited by:
            Alvaro Tejada Galindo

    Hi experts,
    I take this post to ask a new (added) question:
    We would like to know how to insert a value for ZUONR vía IDOC_INPUT_ORDERS
        We already know that we must implement user exit EXIT_SAPLVEDA_001 in order to get from one segment of the ORDERS IDOC  the value we want to insert into ZUONR.
        But when we analyze the following logic of the function module we see that the way SAP is generating the order is vía call transaction of VA01, and it seems that there's no vbak-zuonr field in the bdcdata structure passed to the call transaction.
        We assume that we need to implement the user exit EXIT_SAPLVEDA_002 to append the vbak-zuonr field with the proper value to the bdcdata structure, but we would like to know if there is some previous note explaning the way to do it or if there's other easier way to reach the same result.
    Thanks.

  • Idoc debugging problem

    Hi Experts,
    I have created FM "Z_OV_GIS_UPDATE", which is having only 3 table parameters of type EDIDC, EDIDD and BDIDOCSTAT.
    I found some of idocs in WE05. I made use of one Idoc and try to debug by tcode WE19 and by the FM Z_OV_GIS_UPDATE, tcode is throwing error like "Interface for function Z_OV_GIS_UPDATE is incorrect".
    Please advice to avoid this problem,
    solution will be Appreciated.
    Thanks,
    bhasha

    Hi,
      The function module interface should be the same for all the IDOC processing FMs..
      Check the function module IDOC_INPUT_ORDERS for the sample interface..And modify your FM accordingly..
    Thanks,
    Naren

  • Problem for Process code creation in IDOCS

    Hi Experts,
       I have copied function module 'IDOC_INPUT_ORDERS' into 'Z_IDOC_INPUT_ORDERS'.I have done some extension idoc population in this.My problem is I want to assign this 'Z_IDOC_INPUT_ORDERS' FUNCTION MODULE to one new process code.While creating new process code i have to assign this Z FM there.But There is one drop down list is showing under function module field.I need to select this Z FM from this dropdown list.But it's not showing in this drop down list.What can i do for this .
    Can he give needful support regarding this.It's very urgent requirement
    Appreciable for ur good help.
    with rgds,
    srihari.V.

    Hi,
    You need to add your FM in transaction code BD51 and go to transaction WE57 to assign to the corresponding message type. Next, you go to transaction WE42. The FM should be visible.
    Regards,
    Ferry Lianto

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

Maybe you are looking for

  • HP 900 Series printer and OS 10.4

    I am having problems trying to print on my series 900 HP printers. When I press print it starts and then stops printing. I then have to press start printing again for it to finish. In the process it wastes a couple of pages of paper. This started whe

  • Country-Specific PO SmartForms

    We have a standard PO SmartFrom for US, MX and CAN. Due to legalities in CAN, they want their "Terms and Conditions" as part of the PO print-out (SmartForm). If we create a CAN specific Form, how does the system know to use this for for PO's with CAN

  • Insert Editing, Why Won't Clips Appear In The Timeline?

    Every time I attempt an insert edit, either via the "downward arrow" symbol or via "W" on the keyboard the clip appears in a secondary time/storyline below the Timeline, with a blank space in the main Timeline of exactly the same duration as the clip

  • Word Files in Java

    Hi everybody, I know this question has probably been asked a zillion and one times before, but I think I might be putting a bit of a new spin on it. Anyway, I was looking at the Jakarta API's to read and write Microsoft Word Files in Java, and I coul

  • Discoverer Plus - IDL:DCCORBAException:1.0

    I have encountered error: IDL:DCCORBAException:1.0 when i'm trying to create a report in Discover Plus that has 3 parameter fields. If i put values in the 3 fields, the report will generate, however, if i put a value into only 1 of those fields and l