Populate Header text in VA01

HI All,
There is a requirement to popuate the Header text of a sales order,
When the item -VBAP-POSNR for example : item 20,50,70 has beyond deliver date then I have to populate the header text
as -  'Item 20,50,70 has beyond deliver date'.
For this Im using SAVE_TEXT... but unable to get the right functionality how to make use of it.
Could anyone provide some pointers.
Thanks.

Plz refrer to followin code I have used it and it works. Originally i wrote this code to copy text from ref SO to internal SO.
but it will work for u just change it a bit.
USER EXIT is USEREXIT_SAVE_DOCUMENT in include MV45AFZZ.
  CONSTANTS: lc_language        TYPE thead-tdspras  VALUE 'E',
               lc_object          TYPE thead-tdobject VALUE 'VBBP',
BE CAREFUL with TEXT ID
LOOP AT lt_text_copy INTO ls_text_copy WHERE matnr = l_matnr.
      Read the maintained text (w.r.t Reference Order)
          MOVE: ls_text_copy-tdid TO l_id,
                ls_configuration-atwrt TO l_name.
      Wait for a few moments before reading the data.
          WAIT UP TO 20 SECONDS.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              id                      = l_id                   "(Text ID of text to be read)
              language                = lc_language            "(Language of text to be read)
              name                    = l_name                 "(Concatenated value of VBELN and POSNR)
              object                  = lc_object              "(Object of text to be read)
            IMPORTING
              header                  = ls_header              "(Object of text to be read)
            TABLES
              lines                   = lt_lines               "(Lines of text read)
            EXCEPTIONS
              id                      = 1
              language                = 2
              name                    = 3
              not_found               = 4
              object                  = 5
              reference_check         = 6
              wrong_access_to_archive = 7
              OTHERS                  = 8.
     Create the text (w.r.t Current Sales Order)
     Name of the text to be created
          MOVE: p_vbak-vbeln TO l_vbeln,
                ls_vbap-posnr TO l_posnr.
          CONCATENATE l_vbeln l_posnr INTO l_so_posnr.
          CLEAR l_name.
          MOVE l_so_posnr TO l_name.
      Wait for a few moments before writing the data.
          WAIT UP TO 20 SECONDS.
          CALL FUNCTION 'CREATE_TEXT'
            EXPORTING
              fid         = l_id                       "(Text ID of the text to be created)
              flanguage   = lc_language                "(Language of the text to be created)
              fname       = l_name                     "(Name of the text to be created)
              fobject     = lc_object                  "(Object of the text to be created)
              save_direct = 'X'
            TABLES
              flines      = lt_lines                   "(Lines of the text to be created)
            EXCEPTIONS
              no_init     = 1
              no_save     = 2
              OTHERS      = 3.
          CALL FUNCTION 'SAVE_TEXT'
            EXPORTING
              header          = ls_header
              insert          = 'X'
              savemode_direct = 'X'
            TABLES
              lines           = lt_lines
            EXCEPTIONS
              id              = 1
              language        = 2
              name            = 3
              object          = 4
              OTHERS          = 5.
          IF sy-subrc <> 0.
          ENDIF.
            Clear variables
          CLEAR: l_id, l_name.
        ENDLOOP.   "(END OF LOOPING ON TEXT IDs)
      ELSE.
        when material does not exists in the ztable.
        EXIT.
      ENDIF.
    ENDLOOP.       "(END OF LOOP ON THE SALES ORDER LINE ITEM)
     ENDCASE.
   ENDIF.
  ENDFORM.                    " ZZ_TEXT_COPY
Edited by: Prasenjit Singh Bist on Aug 23, 2011 3:35 PM

Similar Messages

  • Find header-text in VA01 before save

    In a salesorder creation (VA01) I have inserted a text in the header.
    Goto - header - text.
    Before saving the document, I need to see if there is any text - and what the text is.
    The tables are  not updated, so I can't make a look-up there.
    Any suggestions?
    Br
    Lars

    Hi
    I found this old post with valuable info from Bianchi, but there was no complete example, so here is one.
    I made this solution in a VL01N exit, but it should be quit easy to adjust it to work in VA01, and many other transactions.
    * Get the texts
       DATA: memory_id(30).
       DATA theader LIKE thead.
       DATA BEGIN OF catalog OCCURS 50.
               INCLUDE STRUCTURE tcatalog.
       DATA END OF catalog.
    * 1. Get catalog of current texts - 
    *  the catalog links the text ids (TDID) to an internal id for the temporary texts
       REFRESH catalog.
       IMPORT catalog FROM MEMORY ID 'SAPLSTXD'.
       IF sy-subrc > 0.
         CLEAR catalog. REFRESH catalog.
       ENDIF.
    * Find internal catalog id for text Z022
       LOOP AT catalog WHERE tdobject = 'VBBK'
                         AND tdid   = 'Z022'.
         EXIT.
       ENDLOOP.
       IF sy-subrc = 0.
    * Build memory id for the selected text id (Z022)
         CONCATENATE 'SAPLSTXD' catalog-id INTO memory_id.
    * Import data from memory
         IMPORT thead TO theader
                tline TO it_lines
         FROM MEMORY ID memory_id.
    * I didn't bother to investigate the following routine - it just seems to be working
         PERFORM read_reference_lines(saplstxd)
                                      TABLES it_lines
                                       USING sy-mandt
                                             theader.
    * IT_LINES now contains the temporay text in same format as
    * if it was read from database with function module READ_TEXT
         LOOP AT it_lines ASSIGNING <fs_lines>.
           CASE sy-tabix.
             WHEN 1.
               g_tline_z022_1 = <fs_lines>.
             WHEN 2.
               g_tline_z022_2 = <fs_lines>.
             WHEN 3.
               g_tline_z022_3 = <fs_lines>.
             WHEN 4.
               g_tline_z022_4 = <fs_lines>.
             WHEN 5.
               g_tline_z022_5 = <fs_lines>.
             WHEN OTHERS.
               EXIT.
           ENDCASE.
         ENDLOOP.
       ENDIF.
    Message was edited by: Thomas Madsen Nielsen
    PS. This example will only work in create mode (VL01N). In Change mode VL02N you need in some cases to read the data from database with READ_TEXT.

  • Populate header text of ME22N

    Hi All,
    I wan tto populate the header text field of the transaction code ME22N. I want to populate the header text by the requester's email-id. Th erequirementment is like all the POs has been created but now the email-ids has to be populated. Is there any way to populate all the email-ids we have in the header text field of the Tcode except populating them One by One ?
    Many Thanks...

    Hi,
    You can create a BDC for that.
    That would be simplest way to do it.
    Regards,
    Raj

  • Populate header text with reference number and vendor name

    Hi Experts,
    My client wants to populate the line item text field - SGTXT in MIRO / FB60 with the reference number field XBLNR and the vendor name.
    Is it possible to do it before the invoice get posted?. Like, just after the user entered the vendor account number and the reference number in FB60 system picks the vendor name against the vendor number from LFA1 table and the reference number entered in FB60 screen and populates them in text field ?
    Similarly in MIRO - before the invoice get posted is it possible to pick the reference number from MIRO screen and pick the vendor name based on the PO number entered on the MIRO screen.
    Please advise how to do this.
    Thank you
    Shino

    Hi
    This can be achieved by using a User Exit in Substitution rule. This is done through GGB1. Define the rule
    Prerequisite
    (System T Code =FB01 or MIRO) and Account Type = K
    Substitution
    User Exit
    The following link will be of help to you to define a user exit in substitutition rule
    http://help.sap.com/saphelp_46c/helpdata/en/5b/d231a843c611d182b30000e829fbfe/content.htm
    Regards
    Sanil Bhandari

  • Auto Populate  Header Text in-ERS(MRRL)

    HI Guru's,
    Iam new to MM
    Using with T.Code:MRRL  Evaluate Reciept Settlement( ERS) Logical INvoice Verification. posting FI Document..my client wants to auto polulate PO Item Text (ekpo-txz01) into BSEG-SGTXT.for all line itmes.. is there any config settings need to change? any one can please advice me..
    I  excute the T.Code: MRRL following FI Documents Posting..
    1 31 305556     Black Bag and Access
    2 86 202002     GR/IR - Non FA         (Displaying Text for thislline item)
    3 40 106002     Input GST          
    regards
    JK

    Hi,
    To copy PO item text to the FI doc item text, it means they need to have a 1 to 1 relationship.  So when running MRRL, you must use Document Selection '3' (Document selection per order item).
    You can implement user exit MRMH0001 to copy the PO item text to the logistics invoice item text which should then propagate to the FI doc item text.  Make sure currently in FI there is no substitution rule that overwrites the item text field.
    Another thing to consider is that PO item text can be multiple lines with hundreds of characters where as BSEG-SGTXT is only 50 char long.
    Phyllis.

  • Populate PR Header text

    Hi all,
      While creating PR in ME51n i want to populate 'Header Text' with some predefined texts.
      Any suggestinos to achieve this pls.
    I tried with 'ME_PROCESS_REQ_CUST' but didnt got it.
    Regard's,
    Jean.

    Got it with 'ME_PROCESS_REQ_CUST' .

  • Billing Document Header Text

    Hi
    I am looking to populate header text depending on the value of the billing document.  I have some standard text the needs to be displayed plus a value that needs to be calculated during processing e.g.
    "Blah blah value £ 12.32 blah blah"
    What is the best approch for this (SAP 45b)?
    1. Access sequence requirment number for 'texts'
    2. Access sequence requirment number for 'data transfer'
    3. User exit?
    Thanks...
    J

    basic question, please search before posting (in the correct forum).
    Thread locked
    Thomas

  • How to populate the Ser Entry ext key into the Doc Head text in ML81N Txn??

    Hello all,
    My requirement is to to populate the Service Entry external key into the Document Header text.
    ( ServiceEntry - ERS Invoice (MRRL) ). through ML81N Transaction.I have checked for exits in ML81N as well as MIRO. those doesn't seem very convincing.
    IF i see the field of Document header text where i need to populate the data it is
    ( BKPF-BKTXT ) how do i populate the data ( SE external field ) which is in ESSR table..?
    if any one has some piece of code please send it across.
    this is urgent pls help...........
    Any pointers for this would be highly appreciated.
    Thanks,
    Sreekanth...

    Please close this thread.Open new thread in forum [SAP Community Network Forums » ABAP Development » ABAP, General |;

  • User exit/BADi to populate the header text in MIRO transaction

    Hi all,
    I am searching user exit or badi to populate the header text in MIRO transaction.
    My requirement is, before post the invoice I need to populate the some text in Header text field (MIRO -> Details tab -> header text field). I need to populate this field in the MM document as well as FI document (Accounting Document). I have tried all the user exits and BADi's related to MIRO/MRRL. Doesn't work. If anybody knows please share.
    Thanks,
    Santosh
    Edited by: Santosh Ghonasgi on May 13, 2010 4:48 PM

    Hello santosh,
    I am not sure whether a suitable exit / BADI exists to update the header text in MIRO directly.
    there is one related forum:
    User exit/BADi to change the header text in MIRO transaction
    Hope, it may helpful for you to proceed with some other parallel solution.
    Regards,
    Selva K.
    Edited by: Selvakumar Krishnan on May 13, 2010 5:29 PM

  • Populate document header text in SES by bapi BAPI_ENTRYSHEET_CREATE

    Hi,
    I am using BAPI BAPI_ENTRYSHEET_CREATE to create a service entry sheet. But I am not able to populate the document header text (bktxt) in acceptance tab in service entry sheet header in ML81N.
    Can anybody help me what I need to pass to this BAPI in order to populate this field.
    Thanks,
    Mainak

    Hey Mainak,
    I am aware that the question was posted by you long back, but I am replying so that other readers probably can benefit from the answer below -
    I faced the similar issue recently in one of the projects. The solution that i have opted is as below -
    1. I leveraged the changing parameter 'ESSR' work area of the user exit 'EXIT_SAPLMLSR_010'. This user exit is internally called via BAPI_ENTRYSHEET_CREATE.
    2. You can export the value of 'ESSR-BKTXT' field to memory ID from the calling program and import it within this user exit and pass it to changing parameter ESSR.
    Hope this helps to other readers!
    - Thanks,
    Urvi.

  • Sales document header-- head text changes not working in VA01 if we rasie with reference to quotation

    Hi,
    Greetings!!
    We have raised a quotation, in this quotation we have manually updated Job number (1234) and project number (9876) in header--> header text and saved the quotation.
    With reference to this Quotation we raised a sales order(VA01)  and here we have changed job number from 1234 to ABCD and project number  from 876 to EFGHIJ and saved the sales document but system by default takes quotation  job and project number only. If we go to change mode of sales document (VA02) our changes working fine.
                    ould you please let us know how we can overcome this issue?  Or this is standard  behavior or what?
    Regards,
    Sree

    Hi,
    Text determination configuration is done in VOTXN
    check VOTXN for your text determination procedure and under access sequence check if there is any routine added

  • Reg sales order Header text VA01/VA02

    Hi,
    In VA01/VA02 ..
    From menu bar
    Goto   -> Header  ->  Texts
    In this texts tabstrip left side Form header, Header note1, Header note2 & Geo transmit status
    These 4 elements are there.
    Now the above 4 elements r working if u r double clicking on them, then u can enter the text.
    but my requirement is that should work even if u press single click also...
    How to achieve it..
    Thanks in advance..
    VR

    Hi venkat,
        can you please address my problem, as u got same problem like me... below is the details ...
    I am facing some problem during the recording of hader text.. Details given below...
    I need to do this by using BDC...
    &#61607; VA01 Steps as follows:
    1. Open VA01
    o Enter G2 or L2 order Type
    o Enter 9991 for Sales Org
    o Enter 01 for Dist Channel
    o Enter 99 for Division
    2. Enter Customer SAP # from spreadsheet to ship to and sold to
    (Enter some appropriate number)
    3. Enter Material Code from spreadsheet to Material
    (Enter some appropriate number)
    4. Enter target quantity as 1
    5. Enter Billing date as system date
    6. Go to Sales Tab
    7. Select Blank for billing block
    8. Enter order reason 013 for G2 type or 012 for L2
    9. Goto Header, Texts, Choose Invoice header text
    10. Enter SVB# from file as well as Quarter Text from file in notes
    11. Save
    this is want i need to do in order to create invoice serivce request by using BDC.
    I can able to get the fields till 8 th point ( i can able to write the program ), but from the 9 th point i m facing the problem..
    Bcz it just i need to enter some text here..( may be it's bcz of click )
    This is could not able to do it , can you please help me how can i do this ?
    Please let me know if i m not clear with my explanation...
    Looking forward for your response...
    Regards,
    Suresh...

  • How to populate Doc Header Text Field & Ref Field in OASV Transaction?

    Hello everyone,
    I need to seek your help regarding, on how can I populate values in "Document Header Text Field" & "Reference Text Field" in OASV transaction, as these fields are invisible and are mandotory at document type.
    (I know we can disable their status in the document type, but we don't want to do so).
    Regards,
    Saurabh Patni

    Hi Mukthar,
    Thanks for the quick reply.
    I had tried to work out with substitution rule for the document type and transaction code, but still no use, the same error persists.
    (In Subsitution I am going with constant value to be replaced), I am defining it for Callup point 1, but it is not working.

  • Bdc for sales header text va01

    we need to write a bdc program for va01. In that we need to
    upload header text also .
    So please kindly tell me how to upload flat file to va01 along with
    header text.And how we need to declare the flat file.
    if it is not possible through bdc then tell me how to do with bapi.
    thank you so much for all the replies

    Record the transaction properly for header text along with other fields properly, it will generate the code for you when you save the recording and create the Program using the Recording.
    if not You can go with the BAPI,
    BAPI : BAPI_SALESORDER_CREATEFROMDAT2
    Table parameter ORDER_TEXT is used for the creation of the text.
    Read the documentation of the BAPI.

  • How to  read header texts in the on save user exit of VA01

    Hi Experts,
    I have a requirement to read the header texts in the on save user exit.
    I have to check whether departmental code in header text is not initial or not.
    Can any one please pour in some points of how it can be done......
    Thanks in Advance.
    Prem

    Hi
    U can use fm READ_TEXT:
    DATA: THEAD LIKE THEAD,
          TLINES LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
    THEAD-TDID     = <text id>.
    THEAD-TDSPRAD  = <language>.
    THEAD-TDOBJECT = 'VBBK'.
    THEAD-TDNAME   = VBAK-VBELN.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = THEAD-TDID
        LANGUAGE                      = THEAD-TDSPRAD
        NAME                          = THEAD-TDNAME
        OBJECT                        = THEAD-TDOBJECT
      TABLES
        LINES                         = TLINES
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    U can use it in all situations ( inserting and updating) because that fm returns the buffered text.
    Max

Maybe you are looking for

  • IOS 8 - my calendar doesn't scroll forwards from week to week since updating to IOS any ideas to help?

    SMain with updating to IOS 8 my iPad calendar doesn't scroll forwards from week to week. Any idess on what I can do? thanks

  • DVCPRO HD AJA LHe

    I need help to capture a dance recital I did four weeks ago with a Sony FX1 but I have problems. I capture from the component FX1 to component Aja LHe. I connect the RCA cables from the FX1 to XLR analog LHe channels 1 and 2. I also use an impedance

  • SRM Standalone : PO send to external without BC and XI

    Hello, We are <b>SRM 4.0 Standalone</b>, <b>no</b> XI, <b>no</b> BC. <u>Question</u>: How to send POs to external non-SAP systems (EAI in our case) without XI and BC?? Using <b>BBP_PO_SEND_XML</b>, at the point where System Type("<i>iv_system_type</i

  • RFC Vs Class/Interface

    Hi, I have created a Class using SE80 using Class/Interface option. Can anybody please explain me what will be difference between RFC and Class Interface. Whether Class Interface can be used as same RFC? If yes how class can be accessed from other le

  • Can objects be passed between Applets and JSP?

    Can objects be passed between Applets and JSP? If so how? Thanks in advance. Scott