Updating text to SAP purchace order

Hi,
  i am working on an inbound idoc , related to purchace order.
  i have a requirement of updating the header and item text to the SAP purchace order . how is this done , should i use a bapi for this .Please reply to me as soon as possible .
Thanks in advance!

Hi
Long Texts are stored in tables
STXH - header
STXL - details.
if you want to read the texts you can use Fun Module  READ_TEXT
Any Application document Header and Item Long texts are stored in STXH table with the 4 parameters OBJECT,ID,NAME and LANG
These texts are fetched from database using READ_TEXT fun module by passing the above 4 parameters.
Double click on the text, from the text editor menu GOTO-> HEDAER
you will find the all above 4 parameters
so accordingly you have to pass to the fun module READ_TEXT to fetch the texts.
To Upload these Long Texts into the system use the fun modules
CREATE_TEXT and SAVE_TEXT fun module for the creation of Header and Item texts
for HEADER
OBJECT = EKKO
OBJECTNAME  = PO Number (ekko-EBELN)
ID = (take the number from the system from the Text editor GOTO->HEADER)
LANG  = SY-LANgu
for Item
OBJECT = EKPO
OBJECTNAME  = PO Number + Item Number  (ekko-EBELN + ekpo-ebelp)
ID = (take the number from the system from the Text editor GOTO->HEADER)
LANG  = SY-LANgu
Pass these parameters and create the text.
sample code
REPORT zmm_longtext
       NO STANDARD PAGE HEADING
       LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
        matnr    LIKE mara-matnr,    " Material
        text     LIKE tline-tdline,  " Long Text
      END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
        matnr LIKE mara-matnr,    " Material
        text  LIKE tline-tdline,  " Long Text
      END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
        INCLUDE STRUCTURE tline.   " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname,   " Object Name
       dl_lan TYPE thead-tdspras,   " Language
       gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
  c_best     TYPE thead-tdid VALUE 'GRUN',
  c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
    IMPORTING
      file_name     = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
  CALL FUNCTION 'UPLOAD'
    EXPORTING
      filename                = p_file
      filetype                = 'DAT'
    TABLES
      data_tab                = itab1
    EXCEPTIONS
      conversion_error        = 1
      invalid_table_width     = 2
      invalid_type            = 3
      no_batch                = 4
      unknown_error           = 5
      gui_refuse_filetransfer = 6
      OTHERS                  = 7.
  SORT itab1 BY matnr.
  LOOP AT itab1.
    CLEAR gv_matnr.
    SELECT SINGLE matnr INTO gv_matnr
       FROM mara WHERE bismt = itab1-matnr.
    IF itab1-text NE ' '.
      itab-matnr = gv_matnr.
      itab-text  = itab1-text.
      APPEND itab.
    ENDIF.
    CLEAR itab.
  ENDLOOP.
  DELETE itab WHERE matnr EQ ' '.
Upload the Texts
  SORT itab BY matnr.
  LOOP AT itab.
    dt_lines-tdformat = 'ST'.
    dt_lines-tdline = itab-text.
    APPEND dt_lines.
    dl_lan = sy-langu.
    dl_name = itab-matnr.
Call the Function Module to Create Text
    CALL FUNCTION 'CREATE_TEXT'
      EXPORTING
        fid         = c_best
        flanguage   = dl_lan
        fname       = dl_name
        fobject     = c_material
        save_direct = 'X'
        fformat     = '*'
      TABLES
        flines      = dt_lines
      EXCEPTIONS
        no_init     = 1
        no_save     = 2
        OTHERS      = 3.
    IF sy-subrc <> 0.
      WRITE:/ 'Long Text Creation failed for Material'(001),
             itab-matnr.
    ELSE.
      WRITE:/ 'Long Text Created Successfully for Material'(002),
             itab-matnr.
    ENDIF.
    AT END OF matnr.
      REFRESH dt_lines.
    ENDAT.
  ENDLOOP.
Regards
Anji

Similar Messages

  • SAP VB script for updating texts in purchase orders

    Hello,
    I am trying to create a SAP script for updating texts in purchase orders. It is in the last third - Item Detail,  Texts tab.
    The script is ok apart from the fact that it always deletes whatever text is in there and than add a new one.
    I would like to keep history in the texts tab and always just add one line to existing texts. Is there any way (command) how
    to keep existing texts and only add a new line to the top?
    Thanks a lot!
    Jan

    Yes, you are exactly right. I have already figured it out as well. I did not expect it would be that easy. But thanks a lot anyway for replying on this!
    Now I am struggeling with changing SAPLMEGUI in vb scripts for ME22n. Sometimes, there is SAPLMEGUI:0010 and sometimes SAPLMEGUI:0015. Even when the users have the same screens in the beginning the SAPLMEGUI number differs. They also do one item by hand and than it changes. It keeps changing between SAPLMEGUI:0010 and SAPLMEGUI:0015
    Is there a way how to have the same number of SAPLMEGUI or how to eliminate this issue?
    Thanks a lot
    Jan

  • How to update the sales text in the Sales Order.

    Dear all,
    I want to Update the sales text in the Sales Order. I used the "CREATE_TEXT" but i couldn't update using it.
    Can u please guide me, how to use the Function Module to update the sales Order line item text values.
    Thank U
    Uwanthi

    HI
    Check this link
    User Exit to update Sales order text (Terms of delivery) on saving it
    Regards,
    Krishna

  • 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)

  • Viewing SRM Purchase Order Vendor Text in SAP

    When looking at purchase orders using SAP transaction ME23N I can see the short text created for purchase orders. I would like to be able to access the data from the SRM Vendor Text field as this usually contains more useful information.
    I have tried looking at multiple text fields within ME23N but none of them seem to contain this information.
    Is this just an access problem or is there a way of bringing this information to the transaction (or another SAP transaction, rather than opening up SRM each time)
    Any ideas appreciated

    in other words: you had modified SAP programs.
    If you upgrade or apply hotpackages then you have to perform the transaction SPAU, where you define whether you accept SAP changes or keep the modification as is.
    It can be that basis just resets all to SAP standard. hence you have to redo your changes.

  • After releasing the order same screen user updating the quantity in process order  in sap pp

    Hi experts,
    After releasing the order in the same screen user updating the quantity in process order  in sap pp.
    How to control it.
    can any help in this regards
    Thanking you,
    Rishit.

    Hi Rishit,
    You can control it by BAdi WORKORDER_UPDATE method AT_SAVE make error message if there is any change in quantity.
    Or you can create Transaction Variant through SHD0 for CO02 and make field Total Qty (CAUFVD-GAMNG) as output only.
    Regards,
    R.Brahmankar

  • Print Preview: SAP GUI showing updated text, CRM UI not showing updated text

    Hello,
    can anyone please help me with "Print Preview" button in CRM UI:
    In the CRM UI when a certain data is changed on the document, a note on the document is updated with changes in data. When pressing the "Print Preview" button the generated PDF is not showing an updated text. If i run the SmartForm directly in SAP GUI after the data change, the generated PDF shows an updated text. If i reload the CRM UI (close the browser and run the CRM_UI transaction) the "Print Preview" shows an updated text.
    What should i do, that the Print Preview in the CRM UI would also show an updated text (without reloading the CRM UI) ?
    Im thinking it could be a problem with the parameters SFPDOCPARAMS and SFPOUTPUTPARAMS, that are used when calling the SmartForm FM. The parameters are set as this:
       ls_outputparams-nodialog = 'X'.
       ls_outputparams-getpdf = 'X'.
       ls_outputparams-connection = 'ADS'.
       CALL FUNCTION 'FP_JOB_OPEN'
         CHANGING
           ie_outputparams = ls_outputparams
         EXCEPTIONS
           cancel          = 1
           usage_error     = 2
           system_error    = 3
           internal_error  = 4
           OTHERS          = 5.
       ls_docparams-country = 'SI'.
       ls_docparams-langu = sy-langu.
       CALL FUNCTION lv_name
         EXPORTING
           /1bcdwb/docparams  = ls_docparams
           I_HEADER_GUID      = ls_orderadm_h_wrk-guid
         IMPORTING
           /1bcdwb/formoutput = ls_formoutput
         EXCEPTIONS
           usage_error        = 1
           system_error       = 2
           internal_error     = 3
           OTHERS             = 4.
    SAP gurus, please help

    I figured the solution:
    In the Code Initialization of my interface (SFP transaction) i had to initialize the buffer:
       CALL FUNCTION 'INIT_LOAD_TEXT_BUFFER'
         EXPORTING
           EXCL_ID       = ls_stxh-tdid
           EXCL_LANGUAGE = ls_stxh-tdspras
           EXCL_NAME     = ls_stxh-tdname
           EXCL_OBJECT   = ls_stxh-tdobject
         EXCEPTIONS
           NOT_FOUND     = 1
           OTHERS        = 2.
    This way the text is loaded from the updated note every time a "Print Preview" button is pressed.

  • Text Flow from service order to requisition

    Hi Everyone,
    I having a problem regarding text flow from service orders IW31/IW32 to requisition ME53N.
    I created/updated a service order in IW31/IW32 and enter some text in "Operation Short Text" column. When I release the service order the short text should ideally be reflected in purchase requisition. What's happening right now is that "If the length of text entered in IW32 is more than 40 characters then the text is reflected in requisition ME53N otherwise any updates to this column text are not reflected in ME53N".
    I debugged ME53N and found that it gets the value of text using READ_TEXT so I hope the same is stored in standard text while saving IW31/IW32. I checked the text also which is created after saving Iw32 and it contains changed data only if the length of the data is more than 40 characters.
    To me it looks like standard SAP process that the text will flow from service order to purchase requisition only if the data length is more than 40 characters. If anyone has any idea can you please share. Is there any sugesstion for correcting this. Any reason or OSS.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Aug 13, 2008 3:30 PM

    Hi,
    my situation is:
    - a WM managed warehouse, society A;
    - a HU managed warehouse (without WM), society B;
    - a purchasing process of HU from society A towards society B.
    Society B have a scheduling agreement; when a delivery schedule appears, in society A born a sales order and a delivery. After the registration of the delivery good issue, an idoc transfer information for inbound delivery creation.
    This process is ok without WM, but with a WM managed warehouse the idoc has the following problem:
    "V51VP - item was not found - process cancelled".
    Can you help me to transfer these HU?

  • How to add custom text on ISA B2B Order

    Hi,
    On Order page of ISA B2B I have created a custom text field  "Shipping Attention".When I try to add this text in the header like
    header.addExtensionData("Z123","Value") in Z_BasketRefreshAction which extends MaintainBasketDispatcherAction, it is not reflecting in the "Shipping Attn"(created in the text tab in CRM)  field in CRM system.
    The flow:
    /b2b/maintainbasket --> Z_BasketRefreshAction --> /b2b/basketrefresh --> MaintainBasketRefreshAction --> b2b/updatedocumentview
    Please let me know if I missing something...
    Thanks in Advance.
    Regards,
    Muthu

    Hello,
    You have covered the first two layers of the request - response cycle cake - the View (JSP) and the Control (Java) layers. The icing is done in the backend BAdI and using the right function module. I am assuming the CRM backend.
    A typical request-response in the application goes like this. I will give example for the header extensions.
    Added the custom variable in the HTML layer (JSP page)
    Traversed through the Dispatcher, Parser and get the input value from the JSP page variable and added it to the Business Object (Header) using addExtensionData.
    The java application layer actually makes an "Update Header" call during the update cycle - like when you click that "Update" button.
    In the SAP E-Commerce design, during this "update" cycles, the application flows through specific BAdI call sequence. It calls what I call the Header BAdI CRM_ISA_BASKET_HEAD when the header information is updated. You have to extend this BAdI and implement at least two methods.
    It has two methods - which are called during this request - response cycle. First method CHANGEHEAD_SET_DATA is called during the request cycle - that is from ISA to CRM (when update is clicked). This is where your extension data has to be transferred from the Java layer to the backend layer (model). You will essentially read from the table IT_EXTENSION and call SAVE_TEXT function module. Since your requirement is to update text, this is the FM to be called. Many other cases use the FM mentioned by Mike. This is where the data from the web layer is persisted in the backend model.
    And the other method GETHEAD_GET_DATA is called during the response cycle. In this method, you will essentially read from the model - in your case READ_TEXT and set it back in the extension layer CT_EXTENSION
    The update header call from the Java layer will now receive the data back from the model and will automagically transfer the values from the backend (ABAP layer) back to the Java layer to be accessible by you in the JSP using getExtensionData call.
    What you have to do are the steps .5 and 6 in order to complete the request-response cycle.
    Easwar Ram
    http://www.parxlns.com

  • Formatted Text Edit & SAP Script Text

    I'm working through a business requirement to input some long text, and then update an existing SAP script text object (attached to a sales order).
    I'm using a formatted text editor to allow the users to enter the text - however I can't find a utlity that allows me to convert this data into a format that can be saved into a sap script text.
    Thanks,
    Heather

    Hi Heather,
    Please check this...
    Re: From Web Dypro Text area to SAP Script  text object(Tline table)
    http:///Tutorials/Smartforms/PassingTableData/Script1.htm ... add saptecnical.com before tutorials.
    Cheers,
    Kris.

  • Update the cost in sale order

    dear sir
    i check with abaper ,he says the value is updated from sale order
    they get the consumption of sales using customized transaction
    actual cost is zero
    user create the material master withot pricing
    we ask to update the material master and they do the costing run
    in material master standard costing estimate found
    after they  run the consumption report ,once again actual cost is zero
    i chech\ked in  costing status using CK11N ,std cost estimate found
    is it  possible to update the cost in sales order
    (redetermine or recalculate the pricng in sale order)
    so that my consumpotion report will update
    thanks

    Hi,
    Check the following link
    http://help.sap.com/saphelp_46c/helpdata/en/90/ba6da4446711d189420000e829fbbd/content.htm
    Regards,
    Saju.S

  • No update of Sales Orderfrom purchase order (Error M2 815)

    Hi,
    Any inputs.
    SO-- PR -- PO.WHILE CREATING PO, USER GOT ERROR MESSAGE.
    Error Message: No update of Sales Orderfrom purchase order (Error M2 815).
    Materia & vendor has AUTO PO flagged.
    Rgrds....

    Dear
    Please check the below link will help you
    http://sap.ittoolbox.com/groups/technical-functional/sap-log-sd/error-message-no-update-of-sales-order-xxxxxx-from-purchase-order-error-v1-045-2992973
    Regards

  • TEXT material in Sales Order - Unit of Measurement is blank

    We need to trigger a PR from a text item in sales order.
    Only problem we are facing is an error message saying "Enter Order Unit". But there is no value in F4 help for order unit. There is no permissible value for unit of measure in F4 help, as it is derived from material master.

    here is the exact requirement. We want to trigger a PR for procurement of services from a sales order. To trigger a PR for services and use service entry sheet for service confirmation we need to use item category D-Services in the PR and PO. Item category D does not allow a material to be entered as there will be no invetory tracking for this services. This is standard SAP property for item category D in the PR.
    So to trigger a PR only with a text line from a sales order you need to have a sales order line item only with the text and trigger a schedule line category with the order type NB, Item category as D and account assignment category as R.

  • Unit of Measurement is blank  - Text material in Sales Order -

    Dear Experts,
    We need to trigger a PR from a text item in sales order.
    Only problem we are facing is an error message saying "Enter Order Unit". But there is no value in F4 help for order unit. There
    is no permissible value for unit of measure in F4 help, as it is derived from material master.
    Thanks
    Shri..

    Dear Expert,
    Here is the exact requirement. We want to trigger a PR for procurement of services from a sales order. To trigger a PR for services and use service entry sheet for service confirmation we need to use item category D-Services in the PR and PO. Item category D does not allow a material to be entered as there will be no invetory tracking for this services. This is standard SAP property for item category D in the PR.
    Just to add. If the item category has schedule lines allowed field marked it will not grey out the quantity and UOM field in sales order.
    I tried adding the UOM in the debuggin mode and everything is working fine. Need to know if there is any standard setting to achive this.
    So to trigger a PR only with a text line from a sales order you need to have a sales order line item only with the text and trigger a schedule line category with the order type NB, Item category as D and account assignment category as R.
    Thanks
    Shri..

  • How to restrict header text changes in sales order level

    Dear Experts,
    how to restrict header text changes in sales order level change mode
    thanks

    Hello Chandu,
    how to restrict header text changes in sales order level change mode
    In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
    Please try out this approach and let us know your latest observation on this issue.
    Regards,
    Sarthak

Maybe you are looking for

  • How do I control a servo-valve to open and close with Dasylab?

    I am currently using a servo-valve to run an endurance test and would like to control it to open a close  at a set frequency rate and set pressure rate (6000psi). Is there a controller that I can use to do that?  I am using Dasylab with a NI Daq boar

  • Need to Add and Remove Columns of ADF Read Only table from Backing bean

    I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page. I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns. But the Issue which I am facing is onl

  • WPA2 Enterprise and autonomous 1231

    I have a bunch of standalone AIR-AP1231G-A-K9 running c1200-k9w7-mx.123-8.JEC2/c1200-k9w7-mx.123-8.JEC2 which is currently setup for guest and company ssid. The guest I don't care but for company, it goes back to a Microsoft IAS radious Certificate A

  • Dark blue in JPEG photo is distorted/saturated in iMovie, nowhere else

    I am creating a movie with scanned jpegs. In some of them, I am wearing a dark blue suit. These photos look great in iPhoto (exactly like the original). But when I add it to iMovie, the dark blue suit looks distorted/saturated, especially in shadows.

  • Flash 10 install fail after 10.6.2 update. Help please.

    It all started after the new 10.6.2 update I did for Snow Leopard I don't know if this is an something you here at adobe can fix or its something going on at Apple. Is anyone else having this problem or is it just me? Opera, and firefox unexpectidy q