Purchase Requisition and Sales Order Linkage (Order Costing)

Dear, Gurus
I have a scenario where in the Purchase Requisition you can assign acct cat C for Sales Order to item 010 for example. What exactly is this used for I mean is it used to transfer the price of the purchase into the Sales Order? Or its just a linking for reporting purpose? User would like if the purchase order or its requisition price come into the conditions of my Sales Order. Is this possible if yes how or thru which condition type? I was told this is order costing and I have no idea how to configure my sales order in terms of order costing to pull the price of the purchase requisition or purchase order.
Recap
1)     What is the purpose of the linkage to the Sales order?
2)     Can the price be linked into the sales order this way?
3)     Any other valuable information I should know please feel free.
Thanks and hope to hear from you geniuses.

Aroop thanks for your reply.
My scenario is not the same as in 3rd party processing. In fact my scenario is make to order and even repairs of other companies machinery. Now what we are trying to achieve is lets say in the repair or in production of the customers machinery or service, MM needs to make a purchase for a part or tool etc. That in itself has a price. Meaning our purchase mm dept has to pay the vendor for the purchase made and in return we need to charge our customer for that purchase. So we would like for the price of the purchase order come in our sales order condition type as a surcharge.
We were able to fetch the price of the production order automatically thru condition type EK02.
We would like to do the same from purchase order.

Similar Messages

  • Tell me the link between Purchase Requisition and Sales Order Number

    tell me the link between Purchase Requisition(MEREQ_TOPLINE-BANFN_EXT) and Sales Order Number(COBL-KDAUF)

    Hi Puja,
    If you have created sales order  for matrial which has both procurement type,after MRP run you will get
    planned order.This planned order you can convert to purchase requisition for external procurement or
    subcontracting.
    You will find sales order number in details of purchase requisition ( ME52N) in Account assignment tab.
    Hope this help you.
    Regards,
    Raja

  • Purchase requisition without sales order

    Hi experts,
    I'm facing with a very strange problem. In our system,  purchase requisition are created automatically when sales order are created. Problem is that some purchase requisition does not contain linkage to sales order (does not have any linkage in account assignment). From this strange behaviour,  when i want to create purchase order (ME58), sap gives me error: Enter sales order.
    Does anyone know where is the problem?
    Thanks in advance.

    Dear,
    Please check following config,
    Step 1)
    If you are always followwing a third party process for a material then you have to create the material using item category group BANS in Material Master.
    The procument type should be marked as External procurement (F) in MRP 2 view of the material master record.  if you are not always allowing third party order processing then u can create a material master record with item category group as NORM and the procurement type should be marked as ( X) meaning both types of procurment ( in house manufacturing and external procurement).
    step 2)
    the item category in the order should be manually changed as TAS.
    For that you need to confugure the item category determination
    Ord type + item cat grp + usge + Hiv level = Item cat + Manual item cat
    OR + NORM +      +       = TAN . + TAS
    OR + BANS +       +       = TAS
    Step 3)
    make sure that during the item category configuration for TAS  you need to mark relevnat for billing indicator as F
    step 4)
    The schedule line cateogry for this type should be CS.
    make sure that you mark  subsequent type as NB - purchase requisition  in this schedule line category as this will trigger the purchase requision order immediately after the creation of the sales order and the PO to vendor is created against this purchase requiesion.
    Regards
    AJIT K SINGH

  • Make item to create Purchase Requisition and Work Order

    I have a requirement for a Make item to create Back to Back Purchase Order from Sales Order. At the same time, need to create Work Order from Sales Order for the same item. I have done all setups for Back to Back order and able to create Purchase Requisition from Sales Order line. But how to create Work Order. What are the setups to achieve this? Thanks

    Ajith_Kz; Consultant wrote:
    I have a requirement for a Make item to create Back to Back Purchase Order from Sales Order. At the same time, need to create Work Order from Sales Order for the same item. I have done all setups for Back to Back order and able to create Purchase Requisition from Sales Order line. But how to create Work Order. What are the setups to achieve this? ThanksI guess it can't be done..when u say u created a purchase req?i was just wondering how did the system let u to create a POR when you say it is a make item?
    HTH
    Mahendra

  • Changes in short text in Purchase Requisition and Purchase Order

    Dear experts,
    Can you help me with the following issue:
    During creation of Purchase Requisition and Purchase Order with Account assignment category K-Cost center the field Short text to allow input of data in it.
    In all other cases During creation of Purchase Requisition and Purchase Order without Account assignment category K-Cost center the field Short text to be forbidden for input of data
    Is it possible?
    Thank you
    Regards

    Dear Vasil Pavlov ,
    This cannot be realize in sap standard system. You may want to write your own coding using
    ME_PROCESS_REQ and ME_PROCESS_PO for  purchase requisition and purchase order respectively.
    Best Regards,
    Loke Foong

  • Update Purchase Requisition from Sales Order

    Hi,
    My requirement is to Update Purchase Requisition from Sales Order based on the Vendor number in
    Purchase Requisition .
    I have used Userexit         :- MV45AFZB
                     Customerexit :- EXIT_SAPFV45E_002
                     BADI             :- ME_REQ_OI_EXT, ME_REQ_POSTED
    for my requirement, but in vain.
    Of these Userexit  MV45AFZB, Customerexit EXIT_SAPFV45E_002, BADI ME_REQ_OI_EXT are getting triggered in Sales order creation but, Purchase requisition is not yet triggered and we dont have the VENDOR value with which i need to do perform some checks and update the Purchase requisition.
    After I SAVE sales order, BADI ME_REQ_POSTED is getting triggered.Here, the purchase requisition is created ( not yet inserted into the database ) .I also have required VENDOR value, but in the given
    BADI ME_REQ_POSTED I can make checks according to my requirement but not able to update the new values into purchase requisition.
    Literally speaking, Iam struck up..Dont know what to do.....
    Please let me know any Userexit/BADI/BTE where I can  Update Purchase Requisition from Sales Order based on the Vendor number in
    Purchase Requisition .
    Thanks,
    Shivaa..

    Hi Max,
    It just struck to me...
    As suggested by you, I thought of calling BAPI BAPI_REQUISITION_CHANGE  from user exit USEREXIT_SAVE_DOCUMENT in MV45AFZZ .
    I f I give PReq no. , BAPI BAPI_REQUISITION_CHANGE  will take the particular PReq no., from database and then change it according to our requirements...
    But, in our scenario I am calling the BAPI BAPI_REQUISITION_CHANGE  and passing a PReq no..which doesnt exist in the d/b itself.....
    Anyways, let me try......
    Meanwhile ,please suggest any other options for resolving the issue in question......

  • Report with purchase requisitions and purchase orders: how?

    Hi,
    I need to get a list of items bought with their purchase requisitions and purchase orders (when they exist). This can be done looking at each purchase order (ME23N), ou purchase requisition (ME53N), and writing it down. But in some cases, I have to do it on about 450 operations. I'd like to get this list without having to search for each requisition ou order. I can get a complete list of orders and requisitions, but without any relationship between them (they are mixed as if they were the same thing, but there´s a field telling it that row is an order or a requisition). Using some macros in excel, I can find this relationship in 40% of the cases (for example, if item 421351 was purchased only once, an order for item 421351 is related to a requisition for item 421351). Is there any way to get this list automatically? Or is there any field that tell me this relationship?
    Thanks,
    Francisco Morbiolo
    Votorantim Cimentos
    Votorantim, SP - Brazil

    Sorry, I forgot to tell this: I don´t have access to SQ01/SQ02/SQ03.
    I get the orders and requisition reports using ZGLPS020.
    Thanks,
    Francisco Morbiolo
    Votorantim Cimentos
    Votorantim, SP - Brazil

  • Purchase requisitions and purchase orders

    Hello Gurus,
         In contrast, by default, both purchase requisitions and purchase orders can be generated automatically for the item category ALES, will you please tell me the sequence and where to create purchase requisitions and purchase orders  ?
    Many thanks,

    Hello,
    The PO is getting created automatically because of the Create PO automatically check in the item categroy ALES.
    But in normal case, the PR will be generated, it is a request for purchase, it should get approved by the purchasign dept, then create PO with reference to the PR.
    Prase

  • Badi for purchase requisition and stock transfer order

    Hi,
    Could anybody please tell the BADI to update the item details (dates etc) in the 'Purchase requisition' and stock transfer orders.
    I could find ME_PROCESS_REQ etc but could not locate the methods to modify the item level data.
    Thanks & regards,
    Ravish

    Hi,
    You can use the same badi which you found out.
    ME_PROCESS_REQ.
    In that there is a method process_item.
    There you can get the line items of the PR.
    Then in the POST method you can do the stock transfer .
    In the check method also you can check the entire process of PR.
    With Regards,
    Sumodh.P

  • Automatic Link of  Documents in purchase requisition and purchase order

    Dear guru.
    I have created a document in CV01N and I have linked it in document data view of a material master(MM02).
    For every purchase requisition and purchase order position created for this material I need that the system execute an automatic link to this document.
    How can I do that ?
    Thanks

    Hello,
    You can only derive the attached documents from the preceding documents only (for example. Purchase Requisition). Deriving the attached document from the material master is not a standard scenario. This scenario is not in the system. You need to manually attach it.
    bg, Gabor

  • SAP  workflow for purchase requisition and purchase  order

    Hello  Sap Workflow,
    Can you  please help me on  building workflow for purchase requisition and  purchase order    with  the necessary screen shots  ?
    your quick response  will be greatly appreciated.
    Thanks in Advance

    Hi,
    Please check http://help.sap.com .
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/04/92761846f311d189470000e829fbbd/frameset.htm
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/04/92775546f311d189470000e829fbbd/frameset.htm
    Configuration guides are available in SAP Solution Manager.
    Regards,
    Masa

  • Create purchase requisition form  sales order

    What are all the settings required for autiomatic creation of Purchase requisition from sales order. I am new to this topic

    Hi,
    When the material is trading / externally procured, then the requirement in the Sale order generates PR. This is because the material is required in the sale order & seperate manual data entry for generating material requirement is avoided.
    Regards,
    Prashant Kolhatkar

  • Planned orders to Purchase Requisitions and orders

    Hi,
            Just wondering if this is possible. I heard this from a client and want to confirm if it's true.
    The client owns the technology and has contractors manufacture the product.
    A planned order is generated by the client and based on the type of contractor, some of them are converted to Purchase orders and others to Purchase requisitions.
    Is this possible? I was thinking, planned orders ans purchase requisitions are completely different entities. Planned orders are for internal manufacturing which are subsequently changed to Production orders and purchase requisitions are for external procurement that would be converted to Purchase orders.
    But converting the Planned orders to Purchase Requisitions and orders is what I could not digest.
    Is there any possibility of this case?
    Thanks.

    Hi,
    We can create planned orders & convert them into purchase requisition or into production order.
    In the material master ,mrp2 view give the procurment type as 'X', for both internal & external procurement.
    Also include purchasing view for this material.
    When you run mrp using md02, a planned order will be created for the rquirement (Eg:say 100 nos given using t.code md61).
    Use t.code md04 to view the stock/requirement list.
    Here double click the planned order, you can see tabs such as convert into purchase requisition, into production order, into process order.
    Click convert into pur req & enter 50 Nos. Then a pur req will be created which can be further converted into pur order.
    Again come to md04 screen.
    You can see a planned order & pur req for 50 nos.
    This planned order can be converted into production order & 50 nos can be produced internally.
    Hope this clears your doubt.
    Regards,
    Senthilkumar SD

  • Planned orders to Purchase Requisitions and Purchase Orders

    Hi,
            Just wondering if this is possible. I heard this from a client and want to confirm if it's true.
    The client owns the technology and has contractors manufacture the product.
    A planned order is generated by the client and based on the type of contractor, some of them are converted to Purchase orders and others to Purchase requisitions.
    Is this possible? I was thinking, planned orders ans purchase requisitions are completely different entities. Planned orders are for internal manufacturing which are subsequently changed to Production orders and purchase requisitions are for external procurement that would be converted to Purchase orders.
    But converting the Planned orders to Purchase Requisitions and orders is what I could not digest.
    Is there any possibility of this case?
    Thanks.

    Hi,
    We can create planned orders & convert them into purchase requisition or into production order.
    In the material master ,mrp2 view give the procurment type as 'X', for both internal & external procurement.
    Also include purchasing view for this material.
    When you run mrp using md02, a planned order will be created for the rquirement (Eg:say 100 nos given using t.code md61).
    Use t.code md04 to view the stock/requirement list.
    Here double click the planned order, you can see tabs such as convert into purchase requisition, into production order, into process order.
    Click convert into pur req & enter 50 Nos. Then a pur req will be created which can be further converted into pur order.
    Again come to md04 screen.
    You can see a planned order & pur req for 50 nos.
    This planned order can be converted into production order & 50 nos can be produced internally.
    Hope this clears your doubt.
    Regards,
    Senthilkumar SD

  • Report on list of purchase requisitions and related POs..

    Hi,
    I have a requirement to generate a simple abap report to display a list of purchase requisitions and its related POs. If my understanding is correct, for a single purchase requisition, multiple POs can exist, right ? Can someone help me with the select query for this ? also can you let me know typically what can be the basic fields displayd in such a report ?
    I need to understand the relationship between the tables involved for pur req and Pur orders.
    thanks

    Hi check this code... to get PO and PR related to SO..
    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

Maybe you are looking for