Bapi for Purchase Order Text

Hello...
which Bapi should I use for enter to a material Purchase Order Text(MM01 or MM02)??
Thanks ......

Hi,
i am not shure about the bapi
but this FM solves u r problem.
K_PURCHASE_ORDERS_READ_TEXTS
Thanks

Similar Messages

  • BAPI for Purchase Order Confirmation and update EKES table

    Hi all,
    I have a requirement to update the PO confirmation soon after successful creation of PO in an IDOC.
    I have used BAPI_PO_CHANGE function module which didnt serve the purpose as it cannot update confirmations.
    I tried using ME_CONFIRMATION_UPDATE where I was able to add a confirmation entry in EKES table but that is not being reflected in ME23N transaction when I display the PO.
    Please help me out on this.
    Thanks & Regards
    Pavan

    NB: Never use a standard update FM (check attributes of ME_CONFIRMATION_UPDATE) its often only a SQL statement collector without any check, logging of changes or database consistency, if you perform a where-used you should find it is never called alone but with a bunch of other update FM after checks and other update preparation.
    Get back to the BAPI and table parameter POCONFIRMATION, also use BAPI_PO_GETDETAIL1 to get current data for the call of BAPI_PO_CHANGE.
    Regards,
    Raymond
    PS: If it is not in 197958 - BAPIs for purchase orders: Missing functions, you should be able to do it

  • BDC for Purchase order text updation in MM02 Transaction

    Hi ALL,
    I am updating purchase order text of a material in MM02 using BDC program.
    I have done recording, and the program is updating text if the text field already contains some value. but,
    when the field is empty and if the program tries to feed new data then it is not working.
    Please help me!
    regds,
    Rajan

    Hi
    material master purchase order long text
    you can use through BDC or LSMW it is possible,
    here we need to check in lsmw  Direct input mentod Program name "/SAPDMC/SAP_LSMW_IMPORT_TEXTS"  object name (0001) method(0001) program type (D).
    Header we have ---  MATNR and TEXT ID
    Item ---LINE(Text line).
    in header- for NAME and ID map the source fields MATNR and TEXID respectively.
    OBJECT and SPRAS pass the constants.
    in Item--for TEXTFORMAT pass the constant '*' and for the TEXTLINE map the input field LINE of the ITEM structure.
        or else u can check in SE37 'CREATE_TEXT'   , in that function module check it object Id , name , spras, lineitem,  language "E"
    here i mention example of text flat file,
    H  100-100 best
    longtext1

  • The long text for purchase order text  field in mm03

    Hi,
         Please provide me long text for purchase order field.in mm03 the view purchase order text having the long text for purchase order.this is enter when ever your creating the material.but we have table and field name for that and also how to handle this long text.please provide me urgently.
    Thanks & Regards,
    Radhakrishna.

    Hi,
    A sample code for ur requirement.
    TABLES : ekko,   "Purchasing Document Header
             ekpo,   "Purchasing Document Item
             thead.  "SAPscript: Text Header
    DATA: t_theads LIKE stxh  OCCURS 0 WITH HEADER LINE.
    DATA: t_tlines LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA: v_ebeln_ebelp(15) TYPE c.
    TYPES: BEGIN OF t_download,
           ebeln LIKE ekko-ebeln,
           ebelp LIKE ekpo-ebelp,
           tdobject LIKE stxh-tdobject,
           tdid LIKE stxh-tdid,
           tdspras LIKE stxh-tdspras,
           count(4) TYPE c,
           tdformat LIKE tline-tdformat,
           tdline LIKE tline-tdline,
         END OF t_download.
    TYPES: BEGIN OF t_header,
          line1(20) TYPE c,
          line2(20) TYPE c,
          line3(20) TYPE c,
          line4(10) TYPE c,
          line5(10) TYPE c,
          line6(10) TYPE c,
          line7(10) TYPE c,
          line8(10) TYPE c,
          END OF t_header.
    DATA: g_filename TYPE string.
    DATA: gt_header TYPE STANDARD TABLE OF t_header.
    DATA: gs_header TYPE t_header.
    DATA: gt_download TYPE STANDARD TABLE OF t_download.
    DATA: gs_download TYPE t_download,
        gt_tlines   LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA: v_subrc TYPE subrc.
    DATA: v_nb_lines TYPE i.
    DATA: v_ok TYPE i.
    DATA: v_ko TYPE i.
    DATA: v_ow TYPE i.
    DATA:  p_fname TYPE string.
    DATA: g_append.
                              SELECTION SCREEN                          *
    SELECT-OPTIONS : s_ebeln  FOR ekko-ebeln.
    PARAMETERS:
       p_filedn(132) TYPE c OBLIGATORY,
       p_file(132) TYPE c OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filedn.
      PERFORM file_f4_get CHANGING p_filedn.
    START-OF-SELECTION.
    *Select all the purchase order corresponding to select criteria
      CLEAR t_theads. REFRESH t_theads.
      SELECT *
      FROM ekko
      WHERE ebeln IN s_ebeln.
    *Select all the text for P.O. header
        SELECT * FROM stxh
              APPENDING TABLE t_theads
              WHERE tdobject = 'EKKO'
              AND tdname      = ekko-ebeln.
    *Select Item of each P.O.
        SELECT *
        FROM ekpo
        WHERE ebeln = ekko-ebeln.
          CONCATENATE ekpo-ebeln ekpo-ebelp
          INTO v_ebeln_ebelp.
    *Select the text for P.O. item.
          SELECT * FROM stxh
                APPENDING TABLE t_theads
                WHERE tdobject = 'EKPO'
                  AND tdname   = v_ebeln_ebelp.
        ENDSELECT.              "select ekpo
      ENDSELECT.             "select ekko
      DESCRIBE TABLE t_theads LINES v_nb_lines.
      LOOP AT t_theads.
    Read the text from pool
        CLEAR thead.
        REFRESH t_tlines.
        CALL FUNCTION 'READ_TEXT'                               "#EC *
             EXPORTING
                  id                      = t_theads-tdid
                  language                = t_theads-tdspras
                  name                    = t_theads-tdname
                  object                  = t_theads-tdobject
             IMPORTING
                  header                  = thead
             TABLES
                  lines                   = t_tlines
             EXCEPTIONS
                  id                      = 1
                  language                = 2
                  name                    = 3
                  not_found               = 4
                  object                  = 5
                  reference_check         = 6
                  wrong_access_to_archive = 7
                  OTHERS                  = 8.
        MOVE-CORRESPONDING thead TO gs_download.
        gs_download-ebeln = thead-tdname+0(10).
        IF thead-tdobject = 'EKPO'.
          gs_download-ebelp = thead-tdname+10(5).
        ENDIF.
        gs_download-count = 0.
        LOOP AT gt_tlines.
          gs_download-tdformat = gt_tlines-tdformat.
          gs_download-tdline = gt_tlines-tdline.
          gs_download-count = gs_download-count + 1.
          APPEND gs_download TO gt_download.
        ENDLOOP.
        CLEAR gs_download.
      ENDLOOP.
    END-OF-SELECTION.
    Hope this helps.
    please reward points if  useful.
    Regards
    rose

  • BAPI for Purchase Order Vendor Confirmations

    Can any body suggest me the BAPI for the purchase order vendor confirmations transaction code me22n - Tab<b>-(Confirmations)</b> alone.
    regs,
    Raja

    Dear Asha,
    Pls find the below code, this handles only the BDC part of the program.Updates only the EKES table thru standard confirmation tab on ME22N.
    Kindly clarify any doubts in this reg.
    regs,
    Raja.
    FORM ins_stdtable .
      DATA:var TYPE c LENGTH 30,
      cstr(02) TYPE n value '01'.
      data istr(02) type n value '00'.
      DATA recno TYPE i.
      data: eblc type c length 5,
      ebli type i.
      DATA: kebeln LIKE utab-ebeln.
      DATA: BEGIN OF indx,
             ebelp type ekes-ebelp,
             eindx type i,
            END OF indx.
      DATA : CNT TYPE I value 1.
      DATA: COUNTER(2) TYPE N VALUE '01',
      ROWS TYPE P.
      DATA: w_textout            LIKE t100-text.
      DATA: gd_update TYPE i,
            gd_lines TYPE i.
      data :waek like indx,
      itabek LIKE TABLE OF waek.
    *Used to stores error information from CALL TRANSACTION Function Module
      DATA: BEGIN OF messtab OCCURS 0.
              INCLUDE STRUCTURE bdcmsgcoll.
      DATA: END OF messtab.
      SELECT MAX( ETENS ) FROM ekes INTO zetens WHERE ebeln =
      ekko-ebeln.
      recno = zetens.
      LOOP AT utab.
        SELECT distinct ebelp INTO CORRESPONDING FIELDS OF TABLE
        itabek  FROM eket  WHERE ebeln = ekko-ebeln.
        loop at itabek into waek.
          ebli =  ebli + 1.
          waek-eindx = ebli.
          modify itabek from waek.
        endloop.
        loop at itabek into waek where ebelp = utab-ebelp.
          eblc = waek-eindx.
          condense eblc.
        endloop.
        AT NEW ebeln.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=MECHOB'.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0002'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=MEOK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'MEPO_SELECT-EBELN'.
          PERFORM bdc_field       USING 'MEPO_SELECT-EBELN'
                                         utab-ebeln.
          AT New EBELP.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_CURSOR'
                                      'DYN_6000-LIST'.
            perform bdc_field       using 'DYN_6000-LIST'
                                     eblc.
            perform bdc_field       using 'BDC_OKCODE'
                                          '=DDOWN3200'.
            PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=TABIDT15'.
            perform bdc_field       using 'DYN_6000-LIST'
                                    eblc.
            PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          'PICK'.
          ENDAT.
        ENDAT.
        PERFORM bdc_field       USING 'DYN_6000-LIST'
                                          eblc.
        recno = recno + 1.
        cstr = recno.
        counter = cstr.
    *This is to check whether the scheduled line item exceeding 12 rows. if so, use *page up
        if counter >= 13.
          rows = counter MOD 13.
          istr = ( ( counter - rows ) / 13 ).
          do istr times.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_OKCODE'
                                    '=EINB_CREATE'.
          enddo.
          DO 2 TIMES.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_OKCODE'
                                    '=P+'.
          enddo.
          COUNTER = '03'.
          cstr = '03'.
        ENDIF.
        CONCATENATE 'EKES-EBTYP('  cstr  ')' INTO var.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                          var.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
        PERFORM bdc_field       USING var
                                    utab-ebtyp.
        CONCATENATE 'RM06E-EEIND('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-eeind.
        CONCATENATE 'EKES-MENGE('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-menge.
        CONCATENATE 'J_3ASZDI-J_3ASIZED('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-j_3asize.
        AT END OF Ebelp.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=MESAVE'.
          perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
          perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
          CALL TRANSACTION 'ME22N' USING bdcdata MODE 'E'.
          IF sy-subrc EQ 0.
            savedone = 'Y'.
            saveflag = 'Y'.
            initflag = 'N'.
            MESSAGE 'SAVED' TYPE 'I'.
          else.
            saveflag = 'N'.
            savedone = 'N'.
            initflag = 'Y'.
            MESSAGE 'Not Saved' Type 'I'.
          endif.
          CLEAR: bdcdata.
          REFRESH bdcdata.
        ENDAT.
      ENDLOOP.
    ENDFORM.
    Hope this will help u

  • BAPI for PURCHASE ORDER with OPEN QUANTITY field

    Hi All,
    I wanted to use the BAPI_PO_GETDETAIL to get the Purchase Order details upon triggering from Warehouse management system,
    But the details required contains a field called OPEN QUANTITY...which is not used in this BAPI.
    I request to let me know if any BAPI exits for PO details having the structure for this field:Open Quantity.
    Am using SAP version 4.0B.
    If not exists please advise how to customize the existing BAPI to meet the requirement.
    thanks
    mahi

    Hi,
    Open quantity is a calculated field. I guess the BAPI gives the details of the delivery, so take the ordered qty and substract the delivered qty from that.
    Delivery data is EKET table.
    Regards,
    Ravi

  • BAPI for Purchase Order Creation

    Hi All,
    Purchase Order creation through BAPI, Auto Po creation. Please advise program.
    The requirement is: when we delivery the goods from one plant to another plant,PO should create in second plant with goods what delivered from first plant.
    Pranitha
    Moderator message : Spec/requirements dumping is not allowed. Thread locked.
    Edited by: Vinod Kumar on Sep 30, 2011 3:37 PM

    Hi,
    As per  u r requirement
    you can use  : BAPI =>    BAPI_PO_CREATE  with suitable Document  Type ( Stock trasnfert : STO )
    IF  u want to auto po must be created after each delivry in this case you need to use BADI
    'MB_MIGO_BADI; In This BAPI  There is method : POST_DOCUMENT
    In this method u can write code for Auto PO Creation by using BAPI .
    Hope This will Resolve u r query.
    Thanks and Regads
    Santosh

  • BAPI for Purchase order change

    Hi experts,
      I just want to change PO quantity by BAPI function module: BAPI_PO_CHANGE, I fill in PO number, Item number, material number and PO quantity to parameters, but result is not well. it shows a message below and the purchase order is not changed.
    message:
    For the currency code  ALE communication is not allowed
    Message no. B1889
    Diagnosis
    The ISO code assigned to the current currency code is not unique and the primary flag is NOT set. This currency code can therefore not be used for external communication.
    I checked currency config in SPRO and the assignment of ISO code is unique and the primary flag is setted actually.
    so what else can I do to solve this problem.
    thanks in advance.
    jack

    The B1889 message has the following reasons:
      -> The primary flag of the found ISO code is assigned more than once.
      -> The ISO code is not unique and the primary flag is not assigned
         for associated SAP currency codes.
      -> The ISO code is not unique and the current SAP currency code has
         NOT assigned the primary flag.
    First case: CC   ISOCD  XPRIMARY
                CNY   CNY      X
                RMB   CNY
    Your ISO code is not unique, therefore you are using the primary flag.
    If a dataset wich currency code CNY is encountered, everything is ok
    because none of the 3 rules mentioned above can be applied.
    If a dataset contains currence code  RMB, rule (3) will be applied.
    Therefore, you get the following output in this case:
      "For curreny code  RMB  ALE Communication is not allowed"
    Second case: CC   ISOCD  XPRIMARY
                 CNY   CNY
                 RMB   CNY    X
    If a dataset contains currency code RMB, everything is ok because it is
    flagged as primary. Like in the first case, if CNY is encountered,
    rule (3) will be applied and you will get the output:
      "For curreny code CNY ALE Communication is not allowed"
    If you are using both CNY  and RMB together, it is not possible to avoi
    the B1889 message beause there will be always the case that your ISO
    code is not unique AND that one currency code is not flagged as primary,
    which is summed up in rule (3).
    Please see information in attached note  "144349 ALE: Problems with
    currency conve".

  • BAPI for purchase order

    Hi all,
    I have to retrieve the invoice verification due date given the following:
    •     Retrieve batch number from item level of billing (VBRP-CHARG)
    •     Pick up  purchase order number from batch master data MCH1
    •     Based on PO number, retrieve invoice verification number (EKBE-BELNR) where :
    1.     EKBE-EBELN = PO Number
    2.     EKBE-VGABE = ‘2’
    •     Based on Invoice receipt number, pick up due data on BSEG-FDTAG where BSEG-BLNR is equal with above invoice verification number.
    I've done the first bullet point but don't know how to proceed. How can i pick up the purchase order number, do we have any BAPI for that?
    Thanks!

    Used FM VB_BATCH_GET_DETAIL to get PO number

  • BAPI for purchase order .. to create and delete confirmation

    HI Gurus
    I need to create and delete PO(Purchase order) confirmation in SAP 4.7 R3 .
    Please let me know which BAPI i can use for .. in SAP 4.7
    1. Create PO confirmation
    2. Delete PO confirmation
    Many thanks and regards
    Sandeep Sharma

    Hi Sandeep,
    In SAP 4.7 R3 & ECC 5.0. we don't have BAPI to delete / create PO confirmatons.
    Use this FM for both : ME_CONFIRMATION_UPDATE
    In addition to above , we need to use this FM : ME_CONFIRMATION_REDISTR_ITEMS , for PO item update in MD04 transaction.
    In addtion to above 2 FM, you need to used Change doucment FM for write log data.
    Thanks.

  • BAPI for purchase order enhancement in DMS

    hi, guru,
    one of the client requirement is,
    Is there any BAPI s for enhance ment of DMS and Purchase order FUnctionalities?
    points!!!!!!!!!!1

    Hi,
    regarding the DMS BAPIs please see the transaction BAPI in your system or the SAP note 766277 which contains a complete documentation on all DMS BAPIs.
    Best regards,
    Christoph

  • BAPI for purchase order TA Me27

    Hi,
    I´m looking for a BAPI to create purchase orders like in TA ME27. I don´t have the vendor...
    So I think, BAPI_PO_CREATE is not working because the vendor is mandatory...
    Thank You!

    Sorry, I mean creating a stock transport order and therefore using TA ME27.
    If you use order type 'UB' in TA ME27, you can create also stock transport orders...
    Do you know a BAPI for that?
    Thank You!

  • FM or BAPI for Purchase Order Creation.

    can ne1 help me to
    create purchase order reference to PReq(Requisition) thru ne FM or BAPI.

    Hi,
    We can create the PO Using the BAPI_PO_CREATE1 function module.
    in this function module fill up the all necessary Details.
    With details in Item Table we haveto give  the Fields PREQ_NO and PREQ_ITEM  for each item .
    then it will creates the PO with PREQ.
    Reward Points If useful.
    Thanks&Regards,
    Srinivas.

  • Bapi for "Purchase Order Return"

    Hi,
    Is there any BAPI for business process of
    "Purchase Return".
    Warm Regards
    Kuldeep K. Joshi

    Hi,
    Is there any BAPI for business process of
    "Purchase Return".
    Warm Regards
    Kuldeep K. Joshi

  • Step by step bapi for purchase order

    hi friends,
    i am very new to bapi i have requiremet to upload purchase order
    using bapi can any one tell me how to use bapi_po_create
    which parameter i hvae to pass .plz do the need ful.
    regards
    sonu

    Hi Sir,
    I am sending you the code in which i have implemented bapi pocreate.Please go through the FM ,you will easily understand it.
    Plz do reward if useful.
    Thankx.
    method do_handle_event.
    *CALL METHOD SUPER->DO_HANDLE_EVENT
    EXPORTING
       EVENT           =
       HTMLB_EVENT     =
       HTMLB_EVENT_EX  =
       GLOBAL_MESSAGES =
    RECEIVING
       GLOBAL_EVENT    =
      data: event_id type string.
      data zpr_num1 type banfn.
      data zreturn type zsn_bapiret2.
      data ret type bapireturn-type.
      data message type bapi_msg.
      data returnval type bapimepoheader-po_number.
      data: r_view type ref to if_bsp_page.
      data: crt_view type ref to if_bsp_page.
      data po_num_head type bapimepoheader.
      data zpoheader_it type zbapimepoheader_tab.
      data zpoheaderx_it type zbapimepoheaderx_tab.
    to add a new item to list
      if htmlb_event is bound and htmlb_event->server_event = 'onadd'.
        zpr_num = request->get_form_field( 'PRNo' ) .
        data: zpr_num3 type banfn.
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpr_num
          importing
            output = zpr_num3.
        zpr_num = zpr_num3.
        data: temp_tab1  type zrmheader.
        delete from zrmheader.
        zpoheader-vendor = request->get_form_field( 'Vendor' ) .
        zpoheader-purch_org = request->get_form_field( 'POrg' ).
        zpoheader-pur_group = request->get_form_field( 'PGrp' ).
        zpoheader-doc_type = 'NB'.
        zpoheader-item_intvl = request->get_form_field( 'Item' ).
        zpoheader-comp_code = request->get_form_field( 'CCode' ).
        zpoheader-doc_date = request->get_form_field( 'DocDate' ).
        delivdate_new = request->get_form_field( 'DelivDate' ).
        temp_tab1-vendor = request->get_form_field( 'Vendor' ) .
        temp_tab1-purch_org = request->get_form_field( 'POrg' ).
        temp_tab1-pur_group = request->get_form_field( 'PGrp' ).
        temp_tab1-doc_type = 'NB'.
        temp_tab1-item_intvl = request->get_form_field( 'Item' ).
        temp_tab1-comp_code = request->get_form_field( 'CCode' ).
        temp_tab1-doc_date = request->get_form_field( 'DocDate' ).
        data: temp_tabx1  type zrmheaderx.
        delete from zrmheaderx.
        temp_tabx1-vendor = 'x'.
        temp_tabx1-purch_org = 'x'.
        temp_tabx1-pur_group = 'x'.
        temp_tabx1-doc_type = 'x'.
        temp_tabx1-comp_code = 'x'.
        temp_tabx1-doc_date = 'x'.
        insert into zrmheader values temp_tab1.
        insert into zrmheaderx values temp_tabx1.
        data: temp_tab  type zrmitem .
        data: temp_tabx type zrmitemx.
        zitem1-acctasscat = request->get_form_field( 'A' ).
        temp_tab-acctasscat = request->get_form_field( 'A' ).
        zitem1-item_cat = request->get_form_field( 'I' ).
        temp_tab-item_cat = request->get_form_field( 'I' ).
        zitem1-material = request->get_form_field( 'Material' ).
        temp_tab-material = request->get_form_field( 'Material' ).
        zitem1-quantity = request->get_form_field( 'POQuantity' ).
        temp_tab-quantity = request->get_form_field( 'POQuantity' ).
        zitem1-po_unit = request->get_form_field( 'OUN' ).
        temp_tab-po_unit = request->get_form_field( 'OUN' ).
        zitem1-net_price = request->get_form_field( 'NetPrice' ).
        temp_tab-net_price = request->get_form_field( 'NetPrice' ).
        zitem1-plant = request->get_form_field( 'Plnt' ).
        temp_tab-plant = request->get_form_field( 'Plnt' ).
        zitem1-po_item = request->get_form_field( 'Item' ).
        temp_tab-po_item = request->get_form_field( 'Item' ).
        zitem1-stge_loc = request->get_form_field( 'Sloc' ).
        temp_tab-stge_loc = request->get_form_field( 'Sloc' ).
        zitem1-customer = request->get_form_field( 'Customer' ).
        temp_tab-customer = request->get_form_field( 'Customer' ).
        zitem1-incoterms2 = 'XDFGRT'.
        temp_tab-incoterms2 = 'XDFGRT'.
        append  zitem1 to zitem.
        insert into zrmitem values temp_tab.
        zitemx1-acctasscat = 'x'.
        zitemx1-item_cat = 'x'.
        zitemx1-material = 'x'.
        zitemx1-quantity = 'x'.
        zitemx1-net_price = 'x'.
        zitemx1-plant = 'x'.
        zitemx1-po_item = 00010.
        zitemx1-po_itemx = 'x'.
        zitemx1-stge_loc = 'x'.
        zitemx1-customer = 'x'.
        zitemx1-incoterms2 = 'x'.
       append  zitemx1 to zitemx.
        temp_tabx-acctasscat = 'x'.
        temp_tabx-item_cat = 'x'.
        temp_tabx-material = 'x'.
        temp_tabx-quantity = 'x'.
        temp_tabx-net_price = 'x'.
        temp_tabx-plant = 'x'.
        temp_tabx-po_item = 00010.
        temp_tabx-po_itemx = 'x'.
        temp_tabx-stge_loc = 'x'.
        temp_tabx-customer = 'x'.
        temp_tabx-incoterms2 = 'x'.
        insert into zrmitemx values temp_tabx.
        select * from zrmitem into corresponding fields of table zitem.
        zpr_num = request->get_form_field( 'PRNo' ) .
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpr_num
          importing
            output = zpr_num1.
            LEN           =
        call function 'BAPI_REQUISITION_GETDETAIL'
          exporting
            number                               = zpr_num1
      ACCOUNT_ASSIGNMENT                   = ' '
      ITEM_TEXTS                           = ' '
      SERVICES                             = ' '
      SERVICE_TEXTS                        = ' '
          tables
            requisition_items                    = item_tab
      REQUISITION_ACCOUNT_ASSIGNMENT       =
      REQUISITION_TEXT                     =
      REQUISITION_LIMITS                   =
      REQUISITION_CONTRACT_LIMITS          =
      REQUISITION_SERVICES                 =
      REQUISITION_SERVICES_TEXTS           =
      REQUISITION_SRV_ACCASS_VALUES        =
      RETURN                               =
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
    *IMPORTING
    *RETURN = i_return
    to save the item details and generate a PO number
      elseif htmlb_event is bound and htmlb_event->server_event = 'onsave'.
        zpr_num = request->get_form_field( 'PRNo' ) .
        data: zpr_num4 type banfn.
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpr_num
          importing
            output = zpr_num4.
        zpr_num = zpr_num4.
        data: temp_t2 type zrmsched,
              count2 type n,
              a2 type n value 1.
        data:temp_t type zrmitem,
             count type n,
             a type n value 1.
        select * from zrmitem into corresponding fields of table data_tab.
        count = sy-dbcnt.
        do count times.
          read table data_tab into temp_t index a.
          a = a + 1.
          zitem1-po_item = temp_t-po_item.
          zitem1-acctasscat = temp_t-acctasscat.
          zitem1-item_cat = temp_t-item_cat.
          zitem1-material = temp_t-material.
          zitem1-quantity = temp_t-quantity.
          zitem1-po_unit = temp_t-po_unit.
          zitem1-net_price = temp_t-net_price.
          zitem1-plant = temp_t-plant.
          zitem1-stge_loc = temp_t-stge_loc.
          zitem1-customer = temp_t-customer.
          zitem1-incoterms2 = temp_t-incoterms2.
          append zitem1 to zitem.
          zitemx1-acctasscat = 'x'.
          zitemx1-item_cat = 'x'.
          zitemx1-material = 'x'.
          zitemx1-quantity = 'x'.
          zitemx1-net_price = 'x'.
          zitemx1-plant = 'x'.
          zitemx1-po_item = temp_t-po_item.
          zitemx1-po_itemx = 'x'.
          zitemx1-stge_loc = 'x'.
          zitemx1-customer = 'x'.
          zitemx1-incoterms2 = 'x'.
          append  zitemx1 to zitemx.
        enddo.
    count2 = sy-dbcnt.
        zpoheader-vendor = request->get_form_field( 'Vendor' ) .
        zpoheader-purch_org = request->get_form_field( 'POrg' ).
        zpoheader-pur_group = request->get_form_field( 'PGrp' ).
        zpoheader-doc_type = 'NB'.
        zpoheader-item_intvl = request->get_form_field( 'Item' ).
        zpoheader-comp_code = request->get_form_field( 'CCode' ).
        zpoheader-doc_date = request->get_form_field( 'DocDate' ).
        delivdate_new = request->get_form_field( 'DelivDate' ).
        zpoheaderx-vendor = 'x'.
        zpoheaderx-purch_org = 'x'.
        zpoheaderx-pur_group = 'x'.
        zpoheaderx-doc_type = 'x'.
        zpoheaderx-comp_code = 'x'.
        zpoheaderx-doc_date = 'x'.
        data: zpovendor type elifn.
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpoheader-vendor
          importing
            output = zpovendor.
        zpoheader-vendor = zpovendor.
        call function 'BAPI_PO_CREATE1'
          exporting
            poheader                     = zpoheader
            poheaderx                    = zpoheaderx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
         importing
           exppurchaseorder             = po_num
             EXPHEADER                    = PO_NUM_HEAD
      EXPPOEXPIMPHEADER            =
         tables
            RETURN                       = zreturn
            poitem                       = zitem
            poitemx                      = zitemx
      POADDRDELIVERY               =
    POSCHEDULE                   = zposched
    POSCHEDULEX                  = zposchedx
      POACCOUNT                    =
      POACCOUNTPROFITSEGMENT       =
      POACCOUNTX                   =
      POCONDHEADER                 =
      POCONDHEADERX                =
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
      POSERVICES                   =
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      POCOMPONENTS                 =
      POCOMPONENTSX                =
      POSHIPPING                   =
      POSHIPPINGX                  =
      POSHIPPINGEXP                =
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
             wait = 'X'
         IMPORTING
         RETURN =
        delete from zrmitem.
        delete from zrmitemx.
        select * from zrmitem into corresponding fields of table zitem.
        if po_num = ' '.
          po_num = 'Try Again'.
        endif.
    to store po_num and corresponding pr number
        data: temp_tt type zpo_pr_nums.
        temp_tt-pr_num = zpr_num.
        temp_tt-po_num = po_num.
        insert into zpo_pr_nums values temp_tt.
    to store po num and corresponding delivery date
        data: wa11 type zpo_delivdate.
        wa11-po_number = po_num.
        wa11-deliv_date = delivdate_new.
        insert into zpo_delivdate values wa11.
        zpoheader-vendor = ' '.
        zpoheader-purch_org = ' '.
        zpoheader-pur_group = ' '.
        zpoheader-doc_type = ' '.
        zpoheader-item_intvl = ' '.
        zpoheader-comp_code = ' '.
        zpoheader-doc_date = ' '.
        delivdate_new = ' '.
    to enter a PR Number
      elseif htmlb_event is bound and htmlb_event->server_event = 'onenter'.
        delete from zrmitem.
        delete from zrmitemx.
        select * from zrmitem into corresponding fields of table zitem.
        zpr_num = request->get_form_field( 'PRNo' ) .
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpr_num
          importing
            output = zpr_num1.
            LEN           =
        call function 'BAPI_REQUISITION_GETDETAIL'
          exporting
            number                               = zpr_num1
      ACCOUNT_ASSIGNMENT                   = ' '
      ITEM_TEXTS                           = ' '
      SERVICES                             = ' '
      SERVICE_TEXTS                        = ' '
          tables
            requisition_items                    = item_tab
      REQUISITION_ACCOUNT_ASSIGNMENT       =
      REQUISITION_TEXT                     =
      REQUISITION_LIMITS                   =
      REQUISITION_CONTRACT_LIMITS          =
      REQUISITION_SERVICES                 =
      REQUISITION_SERVICES_TEXTS           =
      REQUISITION_SRV_ACCASS_VALUES        =
      RETURN                               =
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
    *IMPORTING
    *RETURN = i_return
    to select an item from drop down item menu
      elseif htmlb_event is bound and htmlb_event->server_event = 'select'.
        data: zselection2 type bnfpo.
        data: data type ref to cl_htmlb_dropdownlistbox.
        zpr_num = request->get_form_field( 'PRNo' ) .
        data: zpr_num2 type banfn.
        call function 'ZCONVERT_ALPHA'
          exporting
            input  = zpr_num
          importing
            output = zpr_num2.
        data ?= cl_htmlb_manager=>get_data(
                                            request = runtime->server->request
                                            name    = 'dropdownlistbox'
                                            id      = 'ItemSel'
        if data is not initial.
          zselection2 = data->selection.
        endif.
        zpoheader-vendor = request->get_form_field( 'Vendor' ) .
        zpoheader-purch_org = request->get_form_field( 'POrg' ).
        zpoheader-pur_group = request->get_form_field( 'PGrp' ).
        zpoheader-doc_type = 'NB'.
        zpoheader-item_intvl = request->get_form_field( 'Item' ).
        zpoheader-comp_code = request->get_form_field( 'CCode' ).
        zpoheader-doc_date = request->get_form_field( 'DocDate' ).
        call function 'BAPI_REQUISITION_GETDETAIL'
          exporting
            number                               = zpr_num2
      ACCOUNT_ASSIGNMENT                   = ' '
      ITEM_TEXTS                           = ' '
      SERVICES                             = ' '
      SERVICE_TEXTS                        = ' '
          tables
            requisition_items                    = item_tab
      REQUISITION_ACCOUNT_ASSIGNMENT       =
      REQUISITION_TEXT                     =
      REQUISITION_LIMITS                   =
      REQUISITION_CONTRACT_LIMITS          =
      REQUISITION_SERVICES                 =
      REQUISITION_SERVICES_TEXTS           =
      REQUISITION_SRV_ACCASS_VALUES        =
      RETURN                               =
        data wa1 type bapieban.
        loop at item_tab into wa1.
          if wa1-preq_item = zselection2.
            item_new = wa1-preq_item.
            material_new = wa1-material.
            plant_new = wa1-plant.
            quantity_new = wa1-quantity.
            unit_new = wa1-unit.
            delivdate_new = wa1-deliv_date.
          endif.
        endloop.
      endif.

Maybe you are looking for

  • Image processor defaulting to camera raw settings

    I'm trying to process a folder of RAW files. I'm using image processor and selecting the "open first image to apply settings" button. It opens the first Raw file in the folder and I can apply the Raw settings I want. This creates an xmp file next to

  • 'Deferred tax: Post invoice and payment separately $1

    Hi A customer invoice is posted with service tax.If we go to f-04 to make an entry of payment received and Debit bank, debit TDS certificate receivable for the TDS amount deducted and click on process open items thereby selecting the customer and the

  • No accounting document created u201CError in Accounting interfaceu201D

    Short Text     no accounting document was created for invoice     Long Text     Dear all, In our production environment for a billing document u201C201461113u201D no accounting document was created and left with Posting status u201CError in Accountin

  • How do i made Blurs in PhotoShop CS2?

    How do i make blurs in photoshop CS2? and if you can answer this, how do i make blurs in FinalCut Express 4? Thanks

  • Automatical uninatall ThinkVantage Access Conections

    We need to uninstall ThinkVantage Access Connections for more than 5000 clients. But we can not do it manually. Who Can tell how to make the automatic removal of ThinkVantage Access Connections? Solved! Go to Solution.