Create contract with Purchase Requisition reference using BAPI

Hi friends! I need some help here to create a contract with reference to some purshase requisition. I found BAPI_CONTRACT_CREATE to do this, but I have no idea how to do to create with reference to pruchase requisition.
Anyone can give me a sample code or an idea how I can do this?
Thanks in advance for any help.

Thanks friend. I filled Header, Headerx, item e itemx but I'm getting this error:
No instance of object type PurchasingContract has been created. External reference: # 1
Item category 9 not supported
I need fill something else?

Similar Messages

  • Contract with Purchase Requisition mandatory

    Hi gurus,
    pls. I need help to customize during creation of contract, the purchase requisiton as mandatory.
    I made the next customizing, but doesn´t work
    1 - SAP Customizing Implementation Guide --> Materials Management --> Purchasing --> Contract --> Define Document Types:
    Create MK4W with copie to MK and create field selection MK4W with copie to MKK.
    Link purchase requisition - document type
    2 - SAP Customizing Implementation Guide -->  Materials Management -->  Purchasing -->  Contract --> Define Screen Layout at Document Level:
    Create MK4W with copie to MKK, and flaged purchase requisiton as reference data at item level.
    The problem is during ME31K, I create a contract without purchase requisition as mandatory, can you tell me if I need to customize something more ? Thanks to show me the path !
    Thanks in advance.

    Dear,
    Did you checked the indicator in selection group for "Reference data, item" for Purchase requisition  as " Reqd Entry".
    Also while creating Contract, make sure you are selcting  MK4W  Document type in Agreement type field.
    Check and revert.
    Regards
    Utsav

  • Purchase order with purchase requisition reference

    Hi All,
    I want to make config in system such that it should not allow me to create purchase order without purchase requisition.
    Can anyone guide me to resolve this issue.
    Which config i should do for this?
    Regards,
    Deepak.

    Hi,
    please consider that the system is not coded to have the PR field MEPO1211-BANFN to be set to required.
    The field BANFN cannot be made a required entry in ME21N. However you can use "Function Authorizations" (OMET) to restrict the user to only order with reference to a purchase requisition.
    As both the agreement field and purchase requisition fields are reference fields they are populated when created in reference and thus the system would not accept attempting to make them a mandatory field.
    Please use the OMET transaction and the PID EFB to accomplish your desired functionality.
    And also check the below link:
    PO with ref to PR

  • Create materials with multiple organizational levels using BAPI

    Dear Gurus,
    I have to develop a program generating materials from an Excel file. I am using the BAPI_MATERIAL_SAVEDATA.
    On the Excel file a new material can be associated to 'n' organizational levels. For eg :
    MATNR              MTART            SALES_ORG            DISTR_CHAN
    01                       ZAAA                Z100                           Z1
    01                       ZAAA                Z100                           Z2
    We can add sales_data in the BAPI but in a structure, not in a table !
    The funny thing is that I have found online the /AFS/BAPI_MATERIAL_SAVEDATA which allowed n sales data line but this BAPI is delivered in a package specialised in footwear industry !
    I cannot find a good way to solve this problem. I will strongly appreciate any help to find a solution as I am blocked.
    Thanks a lot!
    Ben

    Thanks Jurgen for your quick answer.
    Just what do you put in the field 'Function' of the different tables ?
    Here's my code for headdata and salesdata :
      CLEAR ls_headdata.
      ls_headdata-function = 'INS'.
      ls_headdata-material = gs_datatab-matnr.
      ls_headdata-ind_sector = gs_datatab-mbrsh.
      ls_headdata-matl_type = gs_datatab-mtart.
      ls_headdata-sales_view = 'X'.
      APPEND ls_headdata TO lt_headdata.
      CLEAR ls_salesdata.
      CLEAR ls_salesdatax.
      ls_salesdata-function = 'INS'.
      ls_salesdatax-function = 'INS'.
      ls_salesdata-material = gs_datatab-matnr.
      ls_salesdatax-material = gs_datatab-matnr.
      ls_salesdata-sales_org = gs_datatab-vkorg.
      ls_salesdatax-sales_org = gs_datatab-vkorg.
      ls_salesdata-distr_chan = gs_datatab-vtweg.
      ls_salesdatax-distr_chan = gs_datatab-vtweg.
      ls_salesdata-sal_status = gs_datatab-vmsta.
      ls_salesdatax-sal_status = 'X'.
      ls_salesdata-valid_from = gs_datatab-vmstd.
      ls_salesdatax-valid_from = 'X'.
      APPEND ls_salesdata TO lt_salesdata.
      APPEND ls_salesdatax TO lt_salesdatax.
      CLEAR ls_salesdata.
      CLEAR ls_salesdatax.
      ls_salesdata-function = 'INS'.
      ls_salesdatax-function = 'INS'.
      ls_salesdata-material = gs_datatab-matnr.
      ls_salesdatax-material = gs_datatab-matnr.
      ls_salesdata-sales_org = gs_datatab2-vkorg.
      ls_salesdatax-sales_org = gs_datatab2-vkorg.
      ls_salesdata-distr_chan = gs_datatab2-vtweg.
      ls_salesdatax-distr_chan = gs_datatab2-vtweg.
      ls_salesdata-sal_status = gs_datatab2-vmsta.
      ls_salesdatax-sal_status = 'X'.
      ls_salesdata-valid_from = gs_datatab2-vmstd.
      ls_salesdatax-valid_from = 'X'.
      APPEND ls_salesdata TO lt_salesdata.
      APPEND ls_salesdatax TO lt_salesdatax.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'
        EXPORTING
          noappllog                  = 'X'
          nochangedoc                = ' '
          testrun                    = ' '
          inpfldcheck                = ' '
      FLAG_CAD_CALL              = ' '
      NO_ROLLBACK_WORK           = ' '
      FLAG_ONLINE                = ' '
       IMPORTING
         return                     = ls_return
        TABLES
          headdata                   = lt_headdata
         salesdata                  = lt_salesdata
         salesdatax                 = lt_salesdatax
    (Of course I have other structures like clientdata, plantdata etc.)
    But I get the error message M3305 (The material &&&&& does not exist or is not activated)
    Edited by: Fonctionnel OSS on Oct 29, 2010 2:20 PM

  • ME59N .PO with Purchase requisitions

    Hi MM Experts,
    I am trying to create PO with Purchase requisitions  Document Type ZNB  with using T -code Document Type ZNB the Purchase order not creating with ZNB type PO.  its creating with standard NB  type PO. my requirement is to be created with ZNB.
    is there any customizing to do this.
    Thanksin Advance,
    Anthyodaya.

    Hi, thank u very much..  Danken......
    for u more 10 points...  
    i posted another question about the  . 
    as u posted u r ideas but i can not reach my client requirements.
    is there any CHICK MARK for the all the PO  for all the line iteams  for CONFORMED.
    2,   is there any single date for the PO all item levels
    3,how to enter alll the item level conformation date automaticalley (when we have same date for all item levels)
    When the purchase having 40 to 50 line items its dificult to enter each one line item conformation date.
    is it possible any option for all the PO with one CHICK mark for conformation. or any option for one date for all the PO LINE ITEMs . is there standard customizing or any BADI or USER EXIT
    Regards,
    Anthyodaya.

  • Create Purchase requisitions directly using PS network or indirectly ME51N

    Hello SAP-PS consultants,
    My customer manage big projects that most of the work done by suppliers, contractors and consultants. We use WBS element to define phases in project and for link to budget control in FM (every phase as different budget). We also use activities network to manage the work in the phases. I offer my customer to create Purchase requisitions, as a standard integrated process, using activities. My customer thinks that is more difficult and complicated to create Purchase requisitions directly using PS network. From your experience, is it better to create purchase directly using PS network or indirectly using MM transaction?
    Regards
    Muly Zohar

    Hi Muly,
    The decision to go for PR creation from PS or from MM will be based on the customer requirement.
    1.If the customer requirement is to have both the cost integration as well as the integration project schedule with the PR , then you create the PR from PS.Any changes in the dates of the network will change the requirement dates of the components and will be transferred to the Purchase requisition. Further more planned cost distribution across the duration of the activity is possible in this approach.
    2. Creating the PR from MM will have only the cost integration with the project. Any changes in the project schedule will not transfer the requirement date to the purchase requisition. You normally go for this where scheduling and procurement are independent of each other.
    By clearly explaining these points to your client, I hope they can  make a better choice of which approach to take based on business requirement.
    Regards
    K Ramaiah

  • Contract to purchase requisition

    Hi!
    I have this situation: I want to creat a contract with reference to a purchase requisition and I'd want to divide the quantity of the purchase requisition. For exemple: I created a purchase requisition with 100 quantity. Now I'd like to creat a contract with 50 e another contract with 50. After that the system should block the creation of the contract with this requisition, becouse the full quantity is complitly requirid. I activated message 06053 but in this case I can use the purchase requisition only one time (whithout divide the quantity of the purchase requisition). I already put the message 06 076, but it works only for PO, a need it for contracts.
    I wrotte this message 2 days ago, but I have had an answare that was not satisfactory.
    Regards,

    Hi!
    I tried both messeges (06 078 and 06 099), but they don´t work. Any other sugestion?

  • Problem when creating contract  with foreign trade / customs

    Hi,
    I encountered a problem when creating contract / outline agreement.
    I used ME31K to create a contract with a vendor outside of our country. I suppose that I should be able to see "Foreign Trade / Customs" in "Header" menu, but this entry is gray, I cannot enter it.
    I tried to create a scheduling agreement using ME31L with the same vendor and material, I can see "Foreign Trade / Customs" information. I suppose these two process are similar, aren't they?
    Btw., I checked the master data according to this thread:
    http://help.sap.com/saphelp_46c/helpdata/en/ed/3b6cc697e711d1b4e20000e82d81b0/content.htm
    Can anyone give me some hint?
    Thanks!
    Charlie

    These two processes are different:
    The Contract agreement or the Outline Agreement is that create the centrally contract (cross-plant) where it can maintain different pricing conditions for each and every plant. It creates the Release Order with reference to Outline Agreement. No detailed delivery schedule can be made in the Release Order. No Release documentation is created. Only time-dependent conditions can be created, Some Item Category 'M' and 'W' can be used.
    Whereas the Scheduling Agreement is the Plant Location what must be entered in the Scheduling Agreement. Its no need to create any other purchasing document except for delivery schedule line via Transaction ME38 or MRP running (with the appropriate setting of Source List). Delivery Schedule line items are created subject to your specific requirement. It can create both Scheduling Agreement with or without release of Documentation (subject to the Document Type LP or LPA) with the selection of either FRC or JIT delivery schedule. Either time-dependent or time-independent conditions can be created subject to the customizing in the Document Type of the Scheduling Agreement. Item Category 'M' and 'W' can not be used.

  • Generated a report which gives PR(Purchase Requisition) analysis using ALV.

    hi experts,
    please give me tables and fields for following report, and also exlain me briefly,
    Generated a report which gives PR(Purchase Requisition) analysis using ALV.
    thanks in advance,
    radhakrishna

    Hi
    please find this report which link SO PO PR and Prd Ord and there status.
    >
    REPORT z_so_info.
    TABLES: vbak, vbap, afko, afpo.
    *Field catalog
    TYPE-POOLS: slis.
    DATA: lv_repid TYPE sy-repid VALUE sy-repid,
    xfield TYPE slis_t_fieldcat_alv,
    afield TYPE slis_fieldcat_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(25) text-002.
    SELECT-OPTIONS: so_so FOR vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    PARAMETERS:
    p_kunnr LIKE vbak-kunnr, " sold-to
    p_kunwe LIKE vbak-kunnr. " ship-to
    SELECTION-SCREEN END OF BLOCK b2.
    *Constants
    CONSTANTS: c_zor TYPE vbak-auart VALUE 'ZOR',
    c_we TYPE vbpa-parvw VALUE 'WE',
    c_ag TYPE vbpa-parvw VALUE 'AG'.
    c_space TYPE space.
    *Ranges
    RANGES: ra_parvw FOR vbpa-parvw,
    ra_kunnr FOR vbpa-kunnr.
    *Tables
    DATA: BEGIN OF gt_output OCCURS 0,
    vbeln LIKE vbak-vbeln, " sales order number
    posnr LIKE vbap-posnr, " SO item number
    matnr LIKE vbap-matnr, " material number
    sh LIKE vbpa-kunnr, " Ship-to
    sp LIKE vbpa-kunnr, " Sold-to
    lifnr LIKE ekko-lifnr, " Vendor
    bstnk LIKE vbak-bstnk, " PO number
    banfn LIKE vbep-banfn, " Purchase requi
    po_st TYPE char30, " PO status text
    pstyv TYPE vbap-pstyv, " Item catagory
    aufnr LIKE afpo-aufnr, " Production Order
    prd_stat TYPE string, " Prd order status
    END OF gt_output.
    DATA: wa_output LIKE gt_output.
    FIELD-SYMBOLS: <fs_output> LIKE gt_output.
    *Table for sales order and PO
    TYPES : BEGIN OF gs_data,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    pstyv TYPE vbap-pstyv,
    matnr TYPE vbap-matnr,
    END OF gs_data.
    DATA: gt_data TYPE STANDARD TABLE OF gs_data,
    wa_data TYPE gs_data.
    *Table for Production Orders
    TYPES: BEGIN OF gs_prd,
    aufnr TYPE afpo-aufnr,
    posnr TYPE afpo-posnr,
    kdauf TYPE afpo-kdauf,
    kdpos TYPE afpo-kdpos,
    wepos TYPE afpo-wepos, "Goods Receipt Indicator
    elikz TYPE afpo-elikz, "Delivery Completed Indicator
    objnr TYPE aufk-objnr, "Object number
    getri TYPE afko-getri, "Confirmed Order Finish Date
    gltri TYPE afko-gltri, "Actual finish date
    END OF gs_prd.
    DATA: gt_prd TYPE STANDARD TABLE OF gs_prd,
    wa_prd TYPE gs_prd.
    *Table for partner data
    TYPES: BEGIN OF gs_partner,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    parvw TYPE vbpa-parvw,
    kunnr TYPE vbpa-kunnr,
    END OF gs_partner.
    DATA: gt_partner TYPE STANDARD TABLE OF gs_partner,
    wa_partner TYPE gs_partner.
    TYPES: BEGIN OF gs_po,
    ebeln TYPE ekkn-ebeln,
    ebelp TYPE ekkn-ebelp,
    vbeln TYPE ekkn-vbeln,
    vbelp TYPE ekkn-vbelp,
    END OF gs_po.
    DATA: gt_po TYPE STANDARD TABLE OF gs_po,
    wa_po TYPE gs_po.
    TYPES: BEGIN OF gs_preq,
    vbeln TYPE vbep-vbeln,
    posnr TYPE vbep-posnr,
    banfn TYPE vbep-banfn,
    END OF gs_preq.
    DATA: gt_preq TYPE STANDARD TABLE OF gs_preq,
    wa_preq TYPE gs_preq.
    TYPES: BEGIN OF gs_po_stat,
    ebeln TYPE ekko-ebeln,
    procstat TYPE ekko-procstat,
    lifnr TYPE ekko-lifnr,
    END OF gs_po_stat.
    DATA: gt_po_stat TYPE STANDARD TABLE OF gs_po_stat,
    wa_po_stat TYPE gs_po_stat.
    *Field symbols
    FIELD-SYMBOLS: <fs> TYPE tj02t-txt04,
    <fs_temp> TYPE tj02t-txt04,
    <fs_stat> TYPE char30.
    START-OF-SELECTION.
    PERFORM fr_build_range.
    PERFORM fr_get_data.
    PERFORM fr_build_fc.
    PERFORM fr_output.
    *& Form fr_get_data
    text
    --> p1 text
    <-- p2 text
    FORM fr_get_data.
    *Get SO
    SELECT avbeln aposnr apstyv amatnr
    FROM vbap AS a
    JOIN vbak AS b
    ON avbeln = bvbeln
    JOIN vbpa AS c
    ON bvbeln = cvbeln
    INTO TABLE gt_data
    WHERE b~vbeln IN so_so
    AND b~auart EQ c_zor "Only Sales Orders
    AND c~kunnr IN ra_kunnr. "from selection screen
    DELETE ADJACENT DUPLICATES FROM gt_data COMPARING vbeln posnr.
    *get data of the production order
    IF NOT gt_data[] IS INITIAL.
    SELECT aaufnr aposnr akdauf akdpos awepos aelikz
    b~objnr
    FROM afpo AS a
    JOIN aufk AS b
    ON aaufnr = baufnr
    INTO TABLE gt_prd
    FOR ALL ENTRIES IN gt_data
    WHERE a~kdauf EQ gt_data-vbeln
    AND a~kdpos EQ gt_data-posnr.
    ENDIF.
    *Get partner data
    IF NOT gt_data[] IS INITIAL.
    SELECT vbeln posnr parvw kunnr
    FROM vbpa
    INTO TABLE gt_partner
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln.
    ENDIF.
    *Get Purchase Order
    IF NOT gt_data[] IS INITIAL.
    SELECT ebeln ebelp vbeln vbelp
    FROM ekkn
    INTO TABLE gt_po
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND vbelp EQ gt_data-posnr.
    SELECT vbeln posnr banfn
    FROM vbep
    INTO TABLE gt_preq
    FOR ALL ENTRIES IN gt_data
    WHERE vbeln EQ gt_data-vbeln
    AND posnr EQ gt_data-posnr.
    ENDIF.
    IF NOT gt_po[] IS INITIAL.
    SELECT aebeln aprocstat a~lifnr
    FROM ekko AS a
    JOIN ekpo AS b
    ON aebeln = bebeln
    INTO TABLE gt_po_stat
    FOR ALL ENTRIES IN gt_po
    WHERE b~ebeln EQ gt_po-ebeln
    AND b~ebelp EQ gt_po-ebelp.
    ENDIF.
    *Move data to output table
    LOOP AT gt_data INTO wa_data.
    wa_output-vbeln = wa_data-vbeln.
    wa_output-posnr = wa_data-posnr.
    wa_output-pstyv = wa_data-pstyv.
    wa_output-matnr = wa_data-matnr.
    READ TABLE gt_po INTO wa_po WITH KEY vbeln = wa_data-vbeln
    vbelp = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-bstnk = wa_po-ebeln.
    READ TABLE gt_po_stat INTO wa_po_stat WITH KEY ebeln = wa_po-ebeln.
    IF sy-subrc EQ 0.
    wa_output-lifnr = wa_po_stat-lifnr.
    CASE wa_po_stat-procstat.
    WHEN '01'.
    wa_output-po_st = 'Version in process'.
    WHEN '02'.
    wa_output-po_st = 'Active'.
    WHEN '03'.
    wa_output-po_st = 'In release'.
    WHEN '04'.
    wa_output-po_st = 'Partially released'.
    WHEN '05'.
    wa_output-po_st = 'Released Completely'.
    WHEN '08'.
    wa_output-po_st = 'Rejected'.
    ENDCASE.
    ENDIF. "inner read subrc
    ENDIF. "outer read subrc
    READ TABLE gt_preq INTO wa_preq WITH KEY vbeln = wa_data-vbeln
    posnr = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-banfn = wa_preq-banfn.
    ENDIF.
    READ TABLE gt_prd INTO wa_prd WITH KEY kdauf = wa_data-vbeln
    kdpos = wa_data-posnr.
    IF sy-subrc EQ 0.
    wa_output-aufnr = wa_prd-aufnr.
    *get the purchase requisition for production order as well
    SELECT SINGLE banfn
    FROM ebkn
    INTO wa_output-banfn
    WHERE aufnr EQ wa_prd-aufnr.
    *Get the status of the production order
    PERFORM fr_get_prd_stat USING wa_prd-objnr
    CHANGING wa_output-prd_stat.
    ENDIF. " sy-subrc
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_we.
    IF sy-subrc EQ 0.
    wa_output-sh = wa_partner-kunnr.
    ENDIF.
    READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
    parvw = c_ag.
    IF sy-subrc EQ 0.
    wa_output-sp = wa_partner-kunnr.
    ENDIF.
    APPEND wa_output TO gt_output.
    CLEAR: wa_data, wa_prd,wa_partner,wa_output.
    ENDLOOP.
    ENDFORM. " fr_get_data
    *& Form fr_build_range
    text
    --> p1 text
    <-- p2 text
    FORM fr_build_range .
    *Range for partner function
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SH' TO ra_parvw-low. " we
    APPEND ra_parvw.
    CLEAR ra_parvw.
    MOVE 'I' TO ra_parvw-sign.
    MOVE 'EQ' TO ra_parvw-option.
    MOVE 'SP' TO ra_parvw-low. " ag
    APPEND ra_parvw.
    CLEAR ra_parvw.
    *Range for ship-to and sold-to
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunnr TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    MOVE 'I' TO ra_kunnr-sign.
    MOVE 'EQ' TO ra_kunnr-option.
    MOVE p_kunwe TO ra_kunnr-low.
    APPEND ra_kunnr.
    CLEAR ra_kunnr.
    ENDFORM. " fr_build_range
    *& Form fr_build_fc
    text
    --> p1 text
    <-- p2 text
    FORM fr_build_fc .
    sales order number
    afield-fieldname = 'VBELN'.
    afield-seltext_s = 'Sales #'.
    afield-ref_tabname = 'VBAK'.
    APPEND afield TO xfield. CLEAR afield.
    sales ITEM number
    afield-fieldname = 'POSNR'.
    afield-seltext_s = 'Item #'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    Material Number
    afield-fieldname = 'MATNR'.
    afield-seltext_s = 'Material #'.
    afield-ref_tabname = 'VBAP'.
    afield-outputlen = 10.
    APPEND afield TO xfield. CLEAR afield.
    *Vendor Number
    afield-fieldname = 'LIFNR'.
    afield-seltext_s = 'Vendor Num.'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    ship-to-party
    afield-fieldname = 'SH'.
    afield-seltext_s = 'Ship-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    sold-to-party
    afield-fieldname = 'SP'.
    afield-seltext_s = 'Sold-to'.
    afield-ref_tabname = 'VBPA'.
    APPEND afield TO xfield. CLEAR afield.
    *PO number
    afield-fieldname = 'BSTNK'.
    afield-seltext_s = 'PO NUM'.
    afield-ref_tabname = 'EKKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PO status
    afield-fieldname = 'PO_STAT'.
    afield-seltext_s = 'Step'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    *PO step status
    afield-fieldname = 'PO_ST'.
    afield-seltext_s = 'PO.Status'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    *Purchase requisition
    afield-fieldname = 'BANFN'.
    afield-seltext_s = 'Pur. Req.'.
    afield-ref_tabname = 'VBEP'.
    APPEND afield TO xfield. CLEAR afield.
    *Item catagory
    afield-fieldname = 'PSTYV'.
    afield-seltext_s = 'Itm. Catg'.
    afield-ref_tabname = 'VBAP'.
    APPEND afield TO xfield. CLEAR afield.
    *Prodcution Order number
    afield-fieldname = 'AUFNR'.
    afield-seltext_m = 'Prod.Order'.
    afield-ref_tabname = 'AFKO'.
    APPEND afield TO xfield. CLEAR afield.
    *PRODCUTION status
    afield-fieldname = 'PRD_STAT'.
    afield-seltext_s = 'Prd. Step'.
    afield-ref_tabname = 'zbacklog_v2'.
    afield-outputlen = 20.
    APPEND afield TO xfield. CLEAR afield.
    *PRODUCTION step status
    afield-fieldname = 'PRD_ST'.
    afield-seltext_s = 'Prd. Status'.
    afield-ref_tabname = 'zbacklog_v2'.
    APPEND afield TO xfield. CLEAR afield.
    ENDFORM. " fr_build_fc
    *& Form fr_output
    text
    --> p1 text
    <-- p2 text
    FORM fr_output .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    it_fieldcat = xfield[]
    i_default = 'X'
    i_save = 'A'
    TABLES
    t_outtab = gt_output
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM. " fr_output
    *& Form fr_get_prd_stat
    text
    -->P_WA_PRD_OBJNR text
    FORM fr_get_prd_stat USING p_objnr CHANGING p_prd_stat.
    DATA: lt_status TYPE STANDARD TABLE OF jstat,
    wa_status TYPE jstat,
    lv_status TYPE tj02t-txt04,
    lv_temp2 TYPE char5,
    lv_buff TYPE string.
    CALL FUNCTION 'STATUS_READ'
    EXPORTING
    client = sy-mandt
    objnr = p_objnr
    only_active = 'X'
    TABLES
    status = lt_status
    EXCEPTIONS
    object_not_found = 1
    OTHERS = 2.
    LOOP AT lt_status INTO wa_status.
    IF wa_status-stat(1) EQ 'I'.
    SELECT txt04 FROM tj02t
    INTO lv_status
    WHERE istat EQ wa_status-stat
    AND spras EQ 'E'.
    ENDSELECT.
    lv_temp2 = lv_status.
    CONCATENATE lv_temp2 p_prd_stat INTO p_prd_stat
    SEPARATED BY ','.
    ENDIF.
    CLEAR: wa_status, lv_status, lv_temp2.
    ENDLOOP.
    lv_buff = p_prd_stat.
    *Status of Production Order
    IF lv_buff CS 'CRTD'.
    p_prd_stat = 'Not Active'.
    ENDIF.
    IF lv_buff CS 'REL'.
    IF lv_buff CS 'GMPS'.
    p_prd_stat = 'Printed In Prod'.
    ELSE.
    p_prd_stat = 'Printed'.
    ENDIF.
    ENDIF.
    IF lv_buff CS 'TECO'.
    p_prd_stat = 'Technically Compt.'.
    ENDIF.
    ENDFORM. " fr_get_prd_stat
    >

  • MIRO: posting to G/L Accounts with purchase order reference

    hello
    our company want to post an invoice for other expense in MIRO through the tab "G/L Acconunt" and don't through the tab "PO reference".
    our problem that when we post through "G/L Account" how we allocate the "purchasing document" to the line of G/L Account?
    in miro there is an option to create a posting line with purchase order reference to a g/l account and i read the documentation that says proceed as follows:
    1. choose miro
    2. enter header data as required
    3. allocate the invoice to a document and check the items to be settled - i don't underdand what i need to do in this step?
    4. choose the tab page g/l account
    5. enter data as requierd.
    thanks
    meir

    hi
    in the table below your MIRO screen you will see PO Reference on this tab select the item of the PO that you need post for this PO, in the tab G/L account you can make manual post aditional to the PO, also you can in the tab PO reference modify amounts and quantity if you need, but it is not recommended

  • Creating contract with service line items

    Hi,
    My requirement is to create contract with multiple service line item. The issue is my system is ECC5 so i don't have BAPIS like BAPI_CONTRACT_CREATE or BAPI_SERVICE_CREATE .How do we achieve this without writing a bdc. Do we have any equivalent bapi in ECC5.

    Hi,
    Check this Fm BAPI_CONTRACT_CREATEFROMDATA

  • Number of PO with Purchase requisition number not null

    Hi Experts,
    I need to number of PO with Purchase requisition number not null in ECC
    T-CODE nse16n and table name =EKPO
    But when I make EKPO-BANFN not equal NULL it doesnt work ? how can do that ?
    I custom my data source 2LIS_02_SCL with EKET.BANFN I want to check my DS with ECC data .
    Thanks and best regards
    Ilyaebi

    IF you need to check the number of PO's with Purchase requisition number not null then simply open the table EKPO in SE12, click on Contents and against the field BANFN right click on the empty box where you enter values and click on Options. From the pop up window selecte Not Equal to and check the Number of Entries in the table. You will get the desired result even though the volume of data might be large.
    Regards,
    Arminder

  • Is it Possible to create a simulation purchase requisition?

    Hi everybody,
    I was wondering  whether it is possible to create a simulative purchase requisition in transaction MS02.
    Or if it is possible to convert a Simulative Planned Order into a purchase order in transaction MD02/MD04.
    Thank you kindly for your help.
    Best regards
    Mitch

    Hello
    There is no such thing as a simulative purchase requisition on LTP. Even for externally procured materials, system still created a planned order.
    What you can do is to copy a simulative planned order to the operative MRP. Later, this planned order can be converted to purchase requisition and to purchase order.
    Take a look on the following link for more details:
    Copying the Long-Term Planning Results to Operative Planning - Long-Term Planning (PP-MP-LTP) - SAP Library
    BR
    Caetano

  • Create a Service Purchase Requisition using BAPI_PR_CREATE

    Hi Everyone,
    I am using BAPI_PR_CREATE.
    I am able to create Standard Purchase requisition.
    But while creating Service Purchase Requisition, i am not able to create.
    I am getting no errors for the PR Item, but even after entering Services for the PR Item i am getting error message in return table of bapi "Please Maintain Services or limits'.
    Do i have to pass value to Package_No field in the item level table of BAPI_PR_CREATE.
    Please help.
    Regards,
    Akash

    Hi,
    Check this link for creation of services.
    Bapi_pr_change in services
    PO Upload through BAPI_PO_CREATE1 - Problem in Service Item
    BAPI_PO_CREATE1 Error
    Hope it helps
    Sujay

  • Creation with Reference using BAPIs

    We're looking into creating an order with reference to a quotation or a return order with reference to an order or invoice.
    According to OSS note 370988 you can only achieve this using a workaround. We're in the process of testing it, so we were wondering whether anybody else out there already has experience with it.
    Specifically:
    - are there any issues in the document flow (based on our testing so far no) ?
    - are there issues with regards to pricing ?
    - do the final documents look as if created using VA01 ?
    Are there other approaches ? E.g. how does the SAP web shop do it ?
    Thanks
    Adrian

    HI Adrian Zehnder,
    1) If you want create order with reference to quotation like ex quotation document type is ymea then create quotation using standard bapi 2) By using bapi get the details of the quotation and pass that data to BAPI_SALESORDER_CREATEFROMDAT2 fill the fields ref_doc, ref_doc_it, and ref_doc_ca  3) There i s no issue with pricing everything will copy.4) It will like created in va01.Post if you need more help in this.
    Regards,
    Madhu.

Maybe you are looking for

  • Fix: 10.5.2 (Windows 7 , I AGREE, does not start)

    I run on windows 7 and decided to upgrade my itunes software. After the install, the license agreement was displayed and I clicked I AGREE  but iTunes never started. I emailed Apple (hard to know where to direct it,and they sent me an emails with lot

  • Import 3D Objects - CS5

    I've seen a few older posts on the subject of importing 3D objects into AE but none specifically speaking to CS5 and any new capabilities.  The developer of Bluff Titler asked the question on what formats could be exported from Bluff Titler so that u

  • Error in Accessing Application from client

    Code Created Entities, Views, Application in a project. Apllication tests ok. In another project attempting to access application with the folowing code. ApplicationModule am = oracle.jbo.client.Configuration.createRootApplicationModule ("Ufax.UfaxAp

  • Join v.s. Subquery

    I have a user query looks like this: select LASTNAME,MIDDLENAME,FIRSTNAME,PHONE from giver where giver_nbr= (select giver_nbr from giver_visit where giver_id = 1902 and visit_nbr= '0001' ) And I am wondering should this be changed to: select a.LASTNA

  • Iweb site deletion

    Is there any way to restore a deleted iweb site, that was accidently deleted from iweb. Jeff