BAPI creating incorrect Item Texts

Hi all
I've got a problem where sales orders and credit notes get created via BAPIs but sometimes an item text from the previously created record appears on the following record.
Background
The process is as follows:
1. XI creates a bunch of IDocs containing a mixture of sales order and credit memo doc types
2. These are all processed in one go within a custom function module
3. For Credit notes the BAPI 'BAPI_SALESDOCU_CREATEFROMDATA' is used, if this is successful then the item texts are processed which basically involves adding an item text to the last item. This is done using the SAVE_TEXT function. If there is more than one item the first to penultimate items do not have texts.
4. For other doc types (standard orders, forward orders, paid), function 'SD_SALESDOCUMENT_CREATE' is run in test mode so that a credit check can be performed in advance of creating the document - the sales_text table is populated. If the credit check passes then the order is created using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'. The texts are created vai the BAPI by populating the order_text table.
5. The next Idoc is then processed.
Five times since this went live (about 18 months ago) a Credit Note has been created where the first item on it has the item text from the previous sales order
What I've done so far
1. I've reviewed the code to make sure variables are being cleared - they are
2. I've run data through the system and stepped through it in debug mode - it works fine
3. Our QAS box was restored from PRD recently so contains some of these incorrect documents. I've re-run the exact same batch that casued the incorrect documents - they are all created correctly
4. I've trawled through SAP Notes and this forum
The fact that the problem is not replicable suggests to me that both the data coming in and the bespoke function module are OK. I'm not sure why the different methods have been used for the different doc types but I wonder if this is what's causing the problem, maybe memory is not being cleared or something.
Any pointers, thoughts, solutions or other genreal musings would be greatly appreciated!
Thanks
Andy

Hi Andy
Although you have mentioned that, you have checked whether variables are cleared, but from the issue it looks like there must be some variable that does not gets cleared.....i would suggest you to debug once again and check this out.....it might help.
regards
Lokesh

Similar Messages

  • PROBLEM IN CREATING BOM ITEM TEXT FROM TEXT FILE

    Hi All,
    I am developing interface program for creating BOM based on data it text file. in my text file contain three column(material, qty and longtext). These text i need to upload to BOM TCODE CS01). Using SAVE_TEXT I have generated text object. it don't says any error. But while viewing text in CS03, text is not visible. Give me suggestion or give me any other method for updating item text from textfile.
    Thanks in advance.
    Regards.
    Peranandam.

    Hi Carl,
    Actually problem is SAVE_TEXT updates text but I cant able to view in CSO3 transaction. because while creating BOM I forget for updating language key for long text. After updating language key I can able to view text in CS03.
    Now I am facing another problem. If I am executing program directly without going to debug mode, It is not updates text. Logic everything is correct. Give me some suggestions for solving this issue. I am also tried with commit work, Commit_text and wait up n seconds statement.
    Regards,
    Peranandam

  • Create quotation item text thru bdc

    hi all,
    I have created  quotation upload BDC in that
    how to create item text thru BDC program..
    i used save_text function module,
    after creating quotation i included this logic, but i want create text at the same time while creating quotation.
    concatenate i_zvbap1-vbeln  i_zvbap1-posnr into v_textname.
    move v_textname to tname-tdname.
    move 'VBBP' to tname-tdobject.
    move '0001' to tname-tdid.
    move sy-langu to tname-tdspras.
    append tname.
    read table i_upload1 with key matnr = i_zvbap1-ematnr
            if sy-subrc = 0.
              lines-tdformat = '*'.
              move i_upload1-refid to lines-tdline.
              move i_upload1-refid to i_zvbap1-refid.
              modify i_zvbap1.
              append lines.
              clear lines.
            endif.
          endloop.
          call function 'SAVE_TEXT'
            exporting
              client          = sy-mandt
              header          = tname
              insert          = 'X'
              savemode_direct = 'X'
            importing
              newheader       = tname
            tables
              lines           = lines
            exceptions
              id              = 1
              language        = 2
              name            = 3
              object          = 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.
    how can i achieve this
    thanks

    thanks for ur reply..while creating quotation i have to create text...
    but i think i need to pass parameters like
    NAME
    OBJECT
    ID etc..
    name will be concatenation of quotation number and item number, before creating i will be not having those info..
    can u explain me in detail...
    what parameters i have to give
    thanks

  • Item Texts Is Not Being Created in BAPI_BILLINGDOC_CREATEMULTIPLE

    Hi.
    I am Using Bapi TO Create Invoice, Every thing is created successfully , but item text is not being created. Code is as below.
    DATA: s_vbap TYPE vbap,
                t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE,
                t_datain TYPE STANDARD TABLE OF bapikomfktx WITH HEADER LINE,
                t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE,
                t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE.
          SELECT SINGLE * FROM likp
          WHERE vbeln = v_del_doc_no.
          SELECT SINGLE * FROM lips WHERE
          vbeln = v_del_doc_no.
          t_billing-salesorg = likp-vkorg.
          t_billing-ref_doc = likp-vbeln.
          t_billing-ref_item = lips-posnr.
          t_billing-doc_number = v_del_doc_no.
          t_billing-itm_number = lips-posnr.
    *      SELECT SINGLE fkarv FROM tvak
    *            INTO  t_billing-ordbilltyp
    *            WHERE auart EQ zsoa_so_header-auart.
          SELECT SINGLE auart FROM vbak
                      INTO  t_billing-ordbilltyp
                      WHERE vbeln EQ order_num.
          t_billing-price_date = sy-datum.
          t_billing-ref_doc_ca = likp-vbtyp.
          t_billing-material = lips-matnr.
          t_billing-plant = lips-werks.
          APPEND t_billing.
          BREAK-POINT.
          CLEAR: t_datain.
         t_datain-ref_doc = v_del_doc_no.
          t_datain-ref_item = '000010'.
          t_datain-applobject = 'VBBP'.
          t_datain-text_id    = '0001'.
          t_datain-langu      = sy-langu.
          t_datain-format_col = '*'.
          t_datain-text_line  = 'FSG 2829'.
          APPEND t_datain.
          CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
            TABLES
              billingdatain = t_billing
              textdatain    = t_datain
              return        = t_return
              success       = t_success.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
          LOOP AT t_return.
            itab_msg-type = t_return-type.
            itab_msg-msg =  t_return-message.
            APPEND itab_msg.
            CLEAR  itab_msg.
          ENDLOOP.
          READ TABLE t_success INDEX 1.
          p_i_bill_doc = t_success-bill_doc.
        ENDIF.
      ENDIF.
      CLEAR: itab_so_items, itab_so_items[] , delivery_no , itab_return[].
    So Text FSG 2829 is not being created in Item Text.....

    Hi Tahir,
    You can check with the below thread
    A question of BAPI_BILLINGDOC_CREATEMULTIPLE
    Regards,
    Pawan

  • Sale order item text through BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    We are creating a sale order through a 'Zprogram'. Uploading the required details from a excel sheet and  passing to a BAPI_SALESORDER_CREATEFROMDAT2.
    We are using the 'order_text' parameter to create the item text. If there are multiple lines in the same item text likes this
    (we are passing it in a single line)
    Order type ORDER_ID   PO number u2026u2026 Item Note - Zi01
    STD                   2                   10                Currency - RS
                                                                       Test order -1
                                                                       Test item - 2                                                                               
    It is creating the sale order with the item text  and the item text when viewed normally its appears one below one. But if we click the 'detail' button and view it through the editor mode it is appearing in the same line with # characters in between.
    TAX_CURRENCY = Rupees #TAX_UNIT_PRICE =0.0000# Test order = 1
    It is replacing the enter statement with '#.' We can split the text where # appears and pass it as a separate line .but this will create a problem when the data itself contains a  # character.
    Please advise how we can avoid this and can create the sale order item text correctly.
    Regards,
    Charumathi Balachandran

    As you said, How are creating single line text from the multi line text.
    I hope you are using a CONTACTENATE statemetn to do so. Please the SEPARATOR being used for this.
    I hope you have copied texts from excel sheet to SE38 editor. Please copy text from Excel to Notepad, then Notepad to SE38.
    Edited by: Priyanka Chowdry on Dec 20, 2010 11:21 AM

  • Item text in Purchase Order getting updated with info. record Purchase Order Text

    Hello All,
    I am working in a roll out project and facing issue in text repeating twice for the line item in the Purchase Order for the new company code for which rollout is happening
    Issue:
    Item text in Purchase Order getting updated with info. record Purchase Order Text
    01) PO Text is maintained in the material master under "Purchase Order Text" tab
    02) The PO text that is maintained in material master is getting updated in the Purchase Info. Record
    03) When Purchase Order is created, the "Item Text" gets updated in the Purchase Order automatically only for the new company code for which rollout is happening. when printed, this results in the text getting duplicated twice
    03.1) this behavior is not observed in the Plants/ Company code that is already Live
    Configurations in the system:
    The copying rules for the "Texts for Purchase Orders" is
    Source Object = "Info Record", Source Text="Purchase Order Text", Fix="*"
    We have modified the Purchase Order form to print one of  the condition types maintained for calculating the tax. Other than this there is no change to the plants that are already live.
    I could not locate any "Purchase Organization" / "Company Code" / "Plant specific configuration.
    Am I missing any configuration or where can I look in what is causing this error.
    Request help from the experts in the forum.
    with Regards,
    Dhandapani R

    There is no company/purchasing/plant specific customizing for purchase order text.
    The customizing copying rules for the "Texts for Purchase Orders" affects all equally .
    If the text in the purchase order in ME23N is already filled different to other plants, then you either have a modification in place, or the texts are differently maintained in the referenced data (vendor, material, info record, contract)

  • Line item text in ALV..urgent

    hello
       i m creating an alv interactive report. in basic list i have fields from likp table and in interactive i have lips table fields. one need one more field in interactive list and that is "line item text" field. (i have matnr and arktx in interactive). for the time being i created line item text in VL02>>ITEM>>TEXTS>> FOR ITEM NUMBER(POSNR). I didnt understand where this line item text is stored ; i mean in which table it is stored . how to retreive this field from a table??

    Hi,
    You have to use the FM READ_TEXT..to get the text name..
    The following are the details you have to pass to the FM..
    Text name - Delivery number + line item.
    Language - SY-LANGU
    Text ID - ????
    Text Object - VBBP.
    You can get the above details in the text itself..
    Display the text..
    Double click on the text to get to the editor..
    In the menu..choose..GOTO -> HEADER..
    There you can see the details like Text ID, text name & text object..And use them in the FM read_text..
    Thanks
    Naren

  • BOM Item Text/Long Text

    Hi Gurus,
    I want to change a BOM and update/create the BOM Item text/Long text. I just want to change the BOM and create an item text (If the text is more than 80 chars, then I should be able to create a long text).
    I tried using FMs SAVE_TEXT and CREATE_TEXT without much luck. Could someone throw some light on how to achieve this.
    R

    Thanks Sudheer. Yes, I'm passing the correct parameters. Please see below.
            CONCATENATE sy-mandt ls_stpo-stlty ls_stpo-stlnr
                                     ls_stpo-stlkn ls_stpo-stpoz
              INTO lf_tdname.
              CALL FUNCTION 'CREATE_TEXT'
                EXPORTING
                  fid       = 'MPO'
                  flanguage = sy-langu
                  fname     = lf_tdname
                  fobject   = 'BOM'
                TABLES
                  flines    = lt_lines
                EXCEPTIONS
                  no_init   = 1
                  no_save   = 2
                  OTHERS    = 3.
    The thing is that it should save the text in Line1 and line 2 of the item text if the length is less than 80. I assume that the TEXT Fms will do it for me. Please correct me if I'm wrong.
    I have also tried a direct database update by changing the stpo-ltxsp field. No luck again. Did someone has updated/created the text using this method ?

  • Inbound idoc  mess type:DESADV basic type: DELVRY03  Item text

    Hi all,
    W're having a inbound process to create inbound deliveries via IDOC.
    mess type:DESADV basic type: DELVRY03 
    We want to create a item text on the delivery via the IDOC.  Is this possible?
    I see that there's a segment E1TXTH9 - E1TXTP9  to put in texts.
    But as I see it, to create a text, we have to give the delivery nr in TDOBJECT TDOBNAME TDID  TDSPRAS LANGUA_ISO.
    But since we are creating it, this is not possible.
    Is there any way to create an item text on an inbound delivery via the IDOC?  And how.
    Thanks a lot!
    Caroline,

    Hi Chris,
    Before end of the ur functiond module (Idoc_input_xxxxxxx) create an Enhnacement spot  . at this point I hope so delivey will be created already .so now u can get the delivery number
    **********The Logic for Text Field filling*******************
    IF NOT  vbeln IS INITIAL.
    DATA : L_FNAME TYPE THEAD-TDNAME,
           L_FID TYPE THEAD-TDID,
           IT_TLINE  TYPE TABLE OF TLINE,
           WA_TLINE LIKE LINE OF IT_TLINE.
    CONSTANTS :C_FID TYPE THEAD-TDID VALUE '0004',
               C_FID1 TYPE THEAD-TDID VALUE '0007',
               c_Text(40) type c value 'xxxxxxxxx',
               C_LANG  TYPE THEAD-TDSPRAS value 'E',
               C_FOBJECT TYPE  THEAD-TDOBJECT VALUE 'BELEG',
               C_FFORMAT TYPE TLINE-TDFORMAT VALUE '*'.
    Reading  the Idoc data table for Text field population
         READ TABLE IDOC_dATA INTO IS_EDIDD
                              WITH KEY SEGNAM =  c_segnam_e1edkt2.
         MOVE IS_EDIDD-SDATA TO IS_E1EDKT2.
         CONCATENATE mrm_RBKPV-BUKRS mrm_BELNR mrm_GJAHR  INTO L_FNAME.
         if sy-subrc = 0.
           MOVE: IS_E1EDKT2-TDLINE TO WA_TLINE-TDLINE,
                 C_FFORMAT TO  WA_TLINE-TDFORMAT.
                 APPEND WA_TLINE TO IT_TLINE.
              CALL FUNCTION 'CREATE_TEXT'
                EXPORTING
                  fid               = c_FID
                  flanguage         = C_LANG
                  fname             = L_FNAME
                  fobject           = C_FOBJECT
                  SAVE_DIRECT       = C_X
                 FFORMAT            = C_FFORMAT
                tables
                  flines            = IT_TLINE
              EXCEPTIONS
                NO_INIT           = 1
                NO_SAVE           = 2
                OTHERS            = 3
              IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
    I hope it resolves ur problem.Please let me know if u have any
    Queries.
    Rgds
    Sree m

  • Create PR header text via BAPI

    Dear all,
    Is there any BAPI which enable us to create the header text for the purchase requisition?
    I have tried out BAPI BAPI_REQUISITION_CREATE but the text creation is at item level.
    Please advise.
    Thank you in advance.

    Hi,
    Since the text could be read using FM 'READ_TEXT', then it should be able to save it using FM 'SAVE_TEXT'.
    Or you could use LSMW with direct input method with object 0001 method 0001 and program name /SAPDMC/SAP_LSMW_IMPORT_TEXTS.
    Another method is by using BDC after BAPI_REQUISITION_CREATE.
    Please note that above method only applicable if the PR is successfully created.
    Regards,
    Teddy Kurniawan

  • Transfer text of VBKD-BSTKD_E into a item text category when creating order

    Hi,
    when creating an order a text should be entered manually in the field 'VBKD-BSTKD_E' . Because the order is a third-party-order and we want to have this information of field 'VBKD-BSTKD_E'  also in the MM-purchase requisition to this order, the manual entered text of 'VBKD-BSTKD_E' should be transfered into a special item-text-category in the sales order (We made already the customizing that this special item-text-category goes automatically into the MM-purchase requisition when saving the SD-order). Now we have tried already to solve this issue with the function module 'change_text' and 'create_text' in the SD-user-Exits (1. Try: userexit_move_field_to_vbap and 2.Try: ZXVVAU05). We were able to change or create the text with these function modules but, although we used afterwards additionaly function module 'Save_text' to save the text, the text wasn't saved by the system.
    Has anybody an idea how this could work?
    Regards
    Stephan

    Read the header lever text using READ_TEXT, and use the SAVE_TEXT to save the text at the item level.  Obviously you have to change the TDOBJECT field before saving it.
    Albert

  • Dynamically create and remove TEXT items in forms

    Hi Guys,
    Is there a way to dynamically create and remove TEXT items in form. For example I have the EMP and DEPT table and when
    I select the EMP table name from the LOV, rows of the EMP table with column name and data should get displayed on the screen and likewise a similar action for DEPT table and
    so on. I have about 90 tables from where data could be required to view and edit. They all have varying number of columns.
    Any suggestions ?
    Thanks
    KMD
    null

    Use OLE concept of developer and map Excel as an object
    Nadeem
    null

  • CREATE SUBSTITUTION RULE FOR u0093COPYING LINE ITEM TEXT FOR LINE ITEMSu0094

    Hi every body
    When user post transactions in FB60 we have give the line item text, Suppose no.of lineitems are there in tht instnace my client asked to create the substitution rule to “COPYING LINE ITEM TEXT FOR LINE ITEMS”
    pls tell me the processes how to create the substitution rule
    Plz can anyboby help me out...
    laxmi velaga

    sorry,
    link doesn't work:
    here's the content:
    you must add your rules at event 3 (complete document)
    in an exit of ZGGBS000:
    data htext type bseg-sgtxt.
    *find
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt <> space.
      move  bseg-sgtxt to htext.
      ENDLOOP.
    *copy
      LOOP AT BOOL_DATA-BSEG INTO BSEG
                      WHERE    bseg-sgtxt = space.
      move  htext to bseg-sgtxt
    *modify
      MODIFY BOOL_DATA-BSEG FROM BSEG.^
      ENDLOOP.
    http://help.sap.com/saphelp_47x200/helpdata/en/5b/d231a843c611d182b30000e829fbfe/frameset.htm
    please reward useful answers
    thanks and regards
    Andreas

  • Restrict all the text in a datagrid input without having to create custom item renderers

    Is there a way to restrict all the text in a datagrid input
    without having to create custom item renderers for each
    column?

    How are you trying to restrict it? If you're trying to
    restrict it uniformly, for example, to entirely numerical inputs,
    then the easiest way I know of to do so is with an itemEditor. You
    can just add the same itemEditor to each column that way.
    This only saves work over custom renderers if you're trying
    to restrict multiple columns in the same manner, but for numeric
    only tables, it's pretty short.
    You could probably also do it with itemEdit and
    itemEditBeginning events, but that would likely be more work then
    simply declaring a single global itemEditor and using it in all
    your columns.

  • Create New Filed in Line Item Text Tab

    Hi Experts,
    How Can I create a new filed in Quotation > Line Item > Text Tab ?
    Tks. & Brgds.
    Ripon

    Hi,
    Hope your requirement is to add one u2018Text typeu2019 in the line item of the sales order.  Say you want to add u2018ITEM DETAILS_SOURCEu2019 in the line item text of sales order. Follow the steps given below.
    1.     SPRO >> SD >> Basic function >> Text Control. Click u2018Text Controlu2019
    2.     Click on u2018Define Text Typeu2019
    3.     Select u2018Sales Documentu2019 and then u2018Itemu2019
    4.     Click on u2018Changeu2019; select the Text procedure u2018Sales itemu2019 and click on u2018Text IDu2019
    5.     The text object is VBBP; Create a new u2018Text  IDu2019; Go for a  new entry and enter the sequence number (higher than the existing one); enter TEXT id as u2018ITEM DETAILS_SOURCEu2019; save
    6.     Now the new text id will be displayed at item text if you create a sales document that includes inquiry, quotation and sales order.
    Hope this will be useful to you.
    Regards,     
    K Bharathi

Maybe you are looking for

  • FaceTime with 3G network

    I manage to FaceTime on "3G" network. I did it with the new iPad (64GB wifi) while connected (via hotspot) to my iPhone 4. The iPhone 4 itself was on 3G network. I guess the iPad 'thinks' it was on wifi, thus enabling the FaceTime. The iPhone's 3G si

  • WLS6.0 sp1 and MS Active Directory

    Hi, Is it possible to configure WLS' LDAP security realm to use MS' Active Directory to authenticate users? A quick yes or no would be appreciated - I'll worry about the finer details of how later!! Regards Laura Allen

  • Conversion of LTP Planned orders to Active planned orders

    Hi PP Guru's, I want to convert LTP Planned orders of Multiple Materials to active planned orders. Using MD43 (Interactive planning), I am able to covert only one material LTP Planned orders to active planned orders. Can any one advise me if there is

  • Publishing to YouTube Failed: The request timed out.

    Why do I get "Publishing to YouTube Failed: The request timed out." when trying to load to YouTube. It doesn't happen all the time, just once in a while but it's been happening everytime for the past week!! I am using the pre-set drop down feature -

  • Repository installtion error inJCAPS 51

    I am getting "Error while expanding eManager\eManager.war" error while trying to install repository. The ports are available. Firewalls are cleared. Dont know how to debug. It will be great if anybody provide info to debug the error.