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

Similar Messages

  • How to create column header text while downloading file

    How can we create column header text while downloading file using function GUI_DOWNLOAD(in SAP Release 4.6c) because there is no FIELDNAMES parameter in
    4.6c version.

    Hii,
      Check this sample code. I have called GUI_DOWNLOAD twice. Onetime to download header of table and next time data of table
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:\flight.xls'
       FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    *   CONFIRM_OVERWRITE             = ' '
    *   NO_AUTH_CHECK                 = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   WRITE_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = t_head
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF sy-subrc NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      IF sy-subrc NE 0.
    *  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards
    Abhijeet

  • Create a Header Text ID in Purchase Requisition

    Hi All,
    I have a requirement of creating a Header Text ID in Purchase Requisition.
    I tried to create it using SPRO but it only creates Texts for Item level.
    I think we can do it using copy control. Please share your input.
    Regards,
    Amit

    Hi Amit ...
    i dont think we can maintain Header Texts at PR header ( also check in MM forums )....
    what you can do is , maintain same text for Vendor(LFM1-Object) ..then it wll automatically can copy to following documents ..ie. PO.
    regards
    Prabhu

  • Dump after creating new header text on sales order and invoice.

    Hello,
    We have created one header text on sales order and the same text for invoices, on VOTXN customizing.
    Testing the new text, system let us save the text fine, but later, if we display the text, system give us dump error.
    My question is, after transport the customizing to the next environment, is necessary run a standard program. Since VOTXN, we have generated the new access created, but dump appear displaying text header tab.
    Any help on this?
    Thanks in advance

    Hello Customer master table man
    1) Did you review the dump analysis- ST22?  Do that because the dump amy or may not be related to the Text config changes.
    2) You are also mentioning about transporting?  Did you already transport and are facing this issue in the target client or is it happening in the source client and you want to avoid it in the target? OSS note 1117467 throws light on transporting issues.
    Review the following OSS notes:
    548615 - FAQ: Text determination in SD II
    548517 - FAQ: Text determination in SD I
    1117467 - Text Customizing change not transferred in target system II
    970153 - Change to Customizing text not transferred to target system
    Hope this helps.

  • How to pass header text in bapi for sale order

    hai to all
    i am using BAPI_SALESORDER_CREATEFROMDAT2 to create sale order
    i can find order_text in tables parameters for creating item texts
    but in my senario i have to maintain header text
    please advice me how to proceed
    rgds
    vijay

    Hi Vijay,
    As I mentioned <b>it is very much possible to create sales order header text with this BAPI only</b>.
    Just check out following working code:
    REPORT yab_testso .
    DATA: orderheaderin LIKE bapisdhd1,
    orderitem TYPE TABLE OF bapisditm,
    wa_orderitem TYPE bapisditm,
    orderitemx TYPE TABLE OF bapisditmx,
    wa_orderitemx TYPE bapisditmx,
    orderpart TYPE TABLE OF bapiparnr,
    wa_orderpartner TYPE bapiparnr,
    ordertext TYPE TABLE OF bapisdtext,
    wa_text TYPE bapisdtext,
    orderret TYPE TABLE OF bapiret2,
    wa_ret TYPE bapiret2,
    lv_lines type i.
    orderheaderin-doc_type = 'ZZOR'.
    orderheaderin-sales_org = 'SS01'.
    orderheaderin-distr_chan = 'SH'.
    orderheaderin-division = 'ST'.
    wa_orderpartner-partn_role = 'SP'.
    wa_orderpartner-partn_numb = '1000000342'.
    APPEND wa_orderpartner TO orderpart.
    wa_orderpartner-partn_role = 'WE'.
    wa_orderpartner-partn_numb = '1000000342'.
    APPEND wa_orderpartner TO orderpart.
    wa_orderitem-itm_number = '10'.
    wa_orderitem-material = '000000111000000185'.
    wa_orderitem-target_qty = '10'.
    APPEND wa_orderitem TO orderitem.
    wa_text-text_id = '0012'.
    wa_text-langu = 'E'.
    wa_text-text_line = 'Test for text creation'.
    APPEND wa_text TO ordertext.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        order_header_in               = orderheaderin
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
      SALESDOCUMENT                 =
      TABLES
       return                        = orderret
       order_items_in                =  orderitem
      ORDER_ITEMS_INX               =
        order_partners                = orderpart
      ORDER_SCHEDULES_IN            =
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN           =
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
       order_text                    =  ordertext
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
    describe table orderret lines lv_lines.
    READ TABLE orderret into wa_ret index lv_lines.
    IF wa_ret-type = 'S'.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      WRITE: / wa_ret-message_v2.
    ENDIF.
    Hope it helps.
    Regards,
    Akshay Bhagwat
    Note: Pls reward points if this helps you.

  • Problems for creating a header text in a Purchase Requisition by IDOC

    Hello,
    I´m creating Purchase Requisition by IDOC. I use PREQCR02  like basic type (   Message type PREQCR-Create purchase requisition )
    I don´t have any proble for creating item text, but I can´t create a header one.
    Any Idea?
    thanks for all.

    What is "it" that you cannot do (+ hate)???
    What is "status"? LineStatus???
    What is your problem when you try to skip an item?
    PS: You should always use enums instead of hard-coded values e.g.: Use the BoAPARDocumentTypes Enumeration for delivery.Lines.BaseType

  • Create PR header text for local PR only

    Dear all,
    I want to create a new PR header text which is used for local PR ONLY.
    I used tran. code SE75 to craeted a new text ID for PR. After created, the new header text item appeared in all PR types. May I ask how to do if I wan this PR header text appeared in local PR only.
    Many thanks foe all of your ideas.
    Thanks
    Sunny

    Hi,
       As of my knowledge, the PO / PR texts CANT be created for a particular document type - It will be applicable for all document types in standard SAP. If you want the text to be visible for particular document type only, then you have to go for development.
    Regards,
    AKPT

  • Create the Header Text In Sales Order Header

    Hi All,
    I want to create a new header text in the sales order header level, Would you mind give me some manual to create this ?
    Regards,
    Luke

    Hi Luke,
    Please goto T-code VOTXN->Sales Document->Header->Text object     VBBK
    You could create Text ID and access sequence.
    Assign the access sequence to text ID.
    Assign the text ID to the procedure.
    Assign the procedure to sales order type.
    Please also refer the following online documentation:
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/55f993545a11d1a7020000e829fd11/frameset.htm
    Hope it helps.
    Regards,
    Smile
    Edited by: Smile Zhang on Jul 3, 2008 7:22 AM

  • How to create an Equipment Address via BAPI or FM?

    Hi all,
    I have to create/update Equipments via RFC including Address data. For the Equipment master data, I use BAPI_EQUI_CREATE, but it has no address data as import parameter.
    To add the address data, I don't seem to find a suitable BAPI/FM:
    BAPI_ADDRESSORG_SAVEREPLICA doesn't do the job because there is no entry for equipments in table TSADOBJ. I could customize this, but then there is table TSADRV: there is an entry for Equi's
    EQUI     EQUNR     EQUI     ILOA     ADRNR     PM01     0     0
    but no FM associated to retrieve the address key.
    FM ADDR_INSERT didn't do the job either for some unknown reason ...
    Who can help me?
    Thanks a lot in advance & cheers
    Jörg

    Hi Rob,
    thanks for your answer.
    But when I create an equipment, the address number doesn't exist beforehand.
    And how do I pass on the address data (street, city, etc.)?
    I will have a look at the note you mention.
    Cheers
    Jörg

  • Automatically determine conditions when creating a purchase order via bapi

    Hi Gurus,
    I need some help...
    I'm creating purchase orders with data of some sales orders. Tha data from sales orders is transfered to an alv grid... In this alv I need to display the values for the price scheme (as in ME21N when I put de material and vendor and press enter).
    Thanks in adavnce,
    LR

    Dear Anna Shao 
    1 .Our SBO is version 2007B
    2. The Decimal of Amount is 2 and that of Price is 6
    3. Vat rate is 17%
    4. The gross price is not small,the problem is that the difference is not small either.Sometimes  it's bigger than 0.1 RMB.I can give you the example.
    LineNo     ItemCode  Quantity  UnitPrice       VatRate      GrossPrice     LineTotal     GrossTotal
    1            A     10         299.145299    J1(17%)      349.995299      2991.45      3499.95
    2            A     10         299.150000    J1(17%)      350.000000      2991.45      3500.00
    3            A     10         299.150000    J1(17%)      350.010000      2991.50      3500.10
    If you set the unit price list for ItemCode 'A', you will get the result like row 1 above.
    If you set the gross price list for ItemCode 'A' ,you will get the result like row 2 above.
    If you do not set any price list for ItemCode 'A'  and you just set the unit price 299.150000 in the purchase order,you will get the result like row 3 above.
    The perfect one is row 2.It is just what  our customer needs.So they set the gross price list for ItemCode 'A'.  But another problem occured when using MRP order recommendation. It is the one why I post a thread,just as I have descripted at first
    Edited by: Jianzhong Zhang on Feb 25, 2009 3:53 AM

  • Problem: Create SO with BAPI_SALESORDER_CREATEFROMDAT2 & Head-Text Elements

    Hi all,
    I hape that sb can help me with my problem.
    I have created a ABAP-Program to create sales-orders with the function module:
    BAPI_SALESORDER_CREATEFROMDAT2
    Everythiunk works fine but I can not create text-elements (from the head) with this bapi.
    I know that I have to use the table "ORDER_TEXT" but I do not know how to fill this table.
    Can anybody help me?
    Best regards,
    pb974

    Hi,
    yes, you have to fill the order_text table. The following fields you have to fill:
    DOC_NUMBER   
    -> not to fill, let it blank
    ITM_NUMBER     
    -> if you want to create a header-text then fill ITM_NUMBER with '000000'
    -> if you want to create a position-text then fill the related position-number '000010' or '000020'....
    TEXT_ID
    -> fill this field with the text-id for which you want to create the text.
    -> The text-id must be defined in your customizing
    LANGU
    -> set the language for the text: 'E' or 'D' or......
    LANGU_ISO
    -> let it blank
    FORMAT_COL
    -> set a star (*) if you want to have the standard-format. If you have a special format defined in SapScript or in a Style you can set this one.
    TEXT_LINE
    -> fill in the text
    FUNCTION
    -> let it blank
    see below:
    data: i_text     LIKE bapisdtext  OCCURS 0 WITH HEADER LINE.
    Texte...
            CLEAR i_text.
            i_text-itm_number  = '000010'.    "Text for Position 10
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 10 - line 2'.   "the text
            APPEND i_text.
    ...if your text has more then one row... the same one to do...
            i_text-itm_number  = '000010'.    "Text for Position 10
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 10 - line 2'.   "the text
            APPEND i_text.
    ...and so one...
    and now text for position 20...
            CLEAR i_text.
            i_text-itm_number  = '000020'.    "Text for Position 20
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'Text für Pos. 20 - Zeile 1'.   "the text
            APPEND i_text.
    ...and now the text for position in englisch
            i_text-itm_number  = '000020'.    "Text for Position 20
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'E'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 20 - line 1'.   "the text
            APPEND i_text.
    I hope it's a help for you.
    Erhard

  • Importing a "texts table" from R3  to create standard texts with BAPI

    Hi,
    I'm mapping a custom structure to BAPI_SALESORDER_CHANGE.
    I need to read a table in R3 containing some text lines that I have to use to create a header text (structure ORDER_TEXT).
    Someone has already faced a similar problem? What is the best way to solve it ?
    Thanks for any help.
    Simona

    Hi,
    the best/standard way to do this is to implement it in an integration process(business process)
    inside it you can and call an RFC for instance which will read the table and return the data and then you can use the RFC response to map it (transformation step) elsewhere (to a new message). You do it all in one integration process.
    about calling (committing) the BAPI you can refer to my weblog:
    /people/michal.krawczyk2/blog/2005/05/09/how-to-call-a-bapi-asynchronously-from-xi--with-qrfc
    Regards,
    michal

  • How to Create header text in Quotations?

    Helli Experts,
    Can anybody of you tell me how to create Header text for Quotations in SD?
    I want to fetch it into Layout Set. I want to hardcode it.
    Harish

    Hi,
    Use the SAVE_TEXT and READ_TEXT Function module to create a header text through program.
    Prabhudas

  • Create Header Text ID for Purchase Requisition

    Hi All,
    I have a requirement of creating a Header Text ID in Purchase Requisition.
    I tried to create it using SPRO but it only creates Texts at Item level.
    I think we can do it using copy control. Please share your input.
    Regards,
    Amit

    Hi Amit ...
    i dont think we can maintain Header Texts at PR header ( also check in MM forums )....
    what you can do is , maintain same text for Vendor(LFM1-Object) ..then it wll automatically can copy to following documents ..ie. PO.
    regards
    Prabhu

  • Create BOM alternative via BAPI

    How can we create a BOM alternative via BAPI?
    I now use CSAP_MAT_BOM_MAINTAIN but then I get the following error:
    BOM already exists for 1234 W041 9
    I do not want to use batch input.
    Kind regards,
    Lieselot

    Hi,
    U can use the  following BAPI'S
    BAPI_MATERIAL_BOM_GROUP_CREAT
    BAPI_MAT_BOM_EXISTENCE_CHECK
    i hope they solve your purpose!!
    thanks

Maybe you are looking for

  • Windows 7 Home Share Not Working Unless Logged In to Computer

    So my old computer with Windows Home Server blew up last week.  I bought a new computer with Windows 7 running and have everything set up. Here's the rub...  I cannot access my itunes home share unless I am logged in or remotely logged int to the com

  • Command line control of AppleVNC or ARD?

    I have a headless G3 running that is running the AppleVNC server and I want to shut it off via ssh. I've misplaced the password and I want to use OSXvnc instead. The problem is it seems that AppleVNC is supervised somehow, so whenever I try to kill i

  • Hang after upgrading the Mac OS (10.6.7) last nite

    Hi, I just updated the Mac OS last night. Before that, I uploaded lots of photos in iPhotos. After uploading and software update in the Mac and restarted, the iPhoto was hanged and did not respond. Any ideas to resolve it?? Pls kindly advise.

  • Unable to load swf files in flash

    Hi, since creating all the animation in one flash file will produce a big file i tried to split and create small flash files and load these files in the main flash movie using the image and swf loader component. eg. main.swf, sub1.swf, sub2.swf. In t

  • Where to get a patch and how to apply it

    Hi there, I have to ask a really beginners question, so please don't crucify for doing so. I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production I'm doing some studying about PL/SQL Hierarchical Profiler. Studying PL/SQL Hiera