Subcontracting Process...its urgent

Hi everyone,
I have abuisness scenario that the manufacturing plant 1000 purchase raw material X from vendor A. But the goods are not taken into the stock of plant 1000. It will lie with Vendor A who in turn will send material X to Vendor B to manufacture the final product Y. This Y is than recieved in stock in Plant 1000.
How to map this in SAP Please let me know the steps. Also what should be the excise scenario.
Regards
john

Hi,
Check the below steps:
If components to be provided to a vendor are supplied not by your company but by a third-party, you can order the components from the third-party and specify the subcontractor in the purchase order as the delivery address. At goods receipt the components are posted directly to the stock of the material provided to vendor.
Entering a Purchase Order for Components
To order components for a subcontract order from a vendor and have them delivered direct to the subcontractor, enter a standard purchase order with a different delivery address:
From the Purchasing menu, choose Purchase order ® Create ® Vendor known.
Maintain the data on the initial screen. Make sure you enter the vendor of the components and the plant concerned.
Enter the items.
Then choose Item ® More functions ® Delivery address.
A dialog box appears in which you enter the delivery address.
In the field Vendor enter the number of the subcontractor and select the SC vendor box.
Selecting the box causes the components at goods receipt to be posted directly to the stock of the material provided to vendor when the goods receipt is posted.
Save the purchase order.
Posting the Goods Receipt of the Components
If the subcontractor lets you know that the components have arrived, you can enter the goods receipt for the purchase order. The components are posted directly to the stock of the material provided to vendor.
Stock Update
A goods receipt posting has the following results in the system:
the stock of material provided to vendor at plant level is increased. The stock of material provided to vendor is not managed at storage location level, since the stock is no longer stored at your company.
Valuated stock at plant level increases.
Documents
An accounting document is created for the material document.
After this normal subcontracting order for finished product.
Regards,
Ramakrishna

Similar Messages

  • Process chain problem...., its urgent

    Hi all
    in my process chain we are loading 4 loads into ODS. After 3 loads, 4th load didn't take place. its not yet started even 3rd one successfully ran. its not showing error also. what can i do. after 4th one ODS activation process is there.
    Please advice me. will i go for manual loading. if i do manual, what abt activation after 4th load. will i do activation also manual or else it will trigger automatically as part of process chain........../
    Advice me frnds..., its urgent
    Regards
    swetha

    Hi Swetha,
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
    Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
    Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
    Try this solution with your 3rd ODS..hope this will solve your problem for this instance. This is just a workaround.
    Before next scheduel of the process chain..remove the link between 3rd ODS and 4th ODS and then reconnect once again and activate the process chain and schedule it as per your schedule cycle. From next upload onwards everything works fine.
    Assign points if it is helpful.
    Regards,
    Sreedhar

  • Tables for subcontracting process

    Hi All,
    Pls tell the tables for components in subcontracting process.
    Regards
    Sunil

    Hi
    After creating a subcontacting po, it will update the following tables
    RESB , EKET , EKKO, EKPO
    Join the two tables RESB and EKET with RSNUM , PO NUmber, Line item as the linking field, if u pass the PO Number in the EKET Table then you can able to see all the components that you have mentioned in the PO for the Final Product. This component is not from the Material BOM , its from what you have maintained in the PO.
    Pls clarify in your query , completing means closing the PO with GR,IR or just PO creation.
    Regards
    Amuthan M.
    Edited by: Amuthan M on Nov 3, 2009 2:28 PM

  • Hi All, How we can handle a table control in bdc - in detail its urgent pls

    Hi All, How we can handle a table control in bdc - in detail its urgent. Please send me the explanation in detail.
    Thanks&regards.
    Bharat

    hi,
    Create Table Control
    • Step 1 (Create new structure for table control)
    Type is name of structure (ZTC_EKKO) and press create
    • Step 2 (Create Program)
    Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
    Enter your program name, please ensure that is begins with SAPMZ…… as this is a module pool (dialog program).
    Press enter to create, and press yes!
    Ensure that you create a top include, and press Enter.
    Accept the name created for the top include.
    Press Enter.
    Press Save
    • Step 3 (Create TOP include)
    Double click on the top include and enter following ABAP code:
    Tables: ZTC_EKKO.
    controls: tc100 type tableview using screen 100.
    data: ok_code type sy-ucomm.
    data: it_ekko type standard
    table of ZTC_EKKO initial size 0,
    wa_ekko type ZTC_EKKO.
    data: ok_code type sy-ucomm.
    Press Save and Activate
    • Step 4 (Create screen)
    Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
    • Step 5 (Create table control)
    Press the Layout button to bring up the screen painter editor.
    Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
    • Step 6 (Populate table control )
    Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the ‘Get from Dict’ button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
    Below is the result, there will been syntax errors if we check now! So Save and go back into the flow logic tab.
    • Step 7 (Create flow control )
    Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    module data_retrieval.
    loop at it_ekko into wa_ekko with control TC100.
    module populate_screen.
    endloop.
    PROCESS AFTER INPUT.
    loop at it_ekko.
    endloop.
    MODULE USER_COMMAND_0100.
    Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
    Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
    check this one
    REPORT ZCALL_TRANS_TAB1 .
    TABLES: LFA1,LFBK,lfb1.
    data: BEGIN OF it_vendor occurs 0,
    LIFNR LIKE LFA1-LIFNR,
    bukrs like lfb1-bukrs,
    END OF it_vendor.
    DATA: BEGIN OF IT_BANK occurs 0,
    LIFNR LIKE LFA1-LIFNR,
    BANKS LIKE LFBK-BANKS,
    BANKL LIKE LFBK-BANKL,
    BANKN LIKE LFBK-BANKN,
    koinh like lfbk-koinh,
    END OF IT_BANK.
    data: it_bdcdata like bdcdata occurs 0 with header line.
    data: it_messages like bdcmsgcoll occurs 0 with header line.
    *selection screen.
    selection-screen: begin of block b1 with frame.
    parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
    obligatory.
    parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
    obligatory.
    selection-screen: end of block b1.
    *at selection screen.
    at selection-screen on value-request for p_file.
    perform f4_help using p_file.
    at selection-screen on value-request for p_file1.
    perform f4_help1 using p_file1.
    *start of selection
    start-of-selection.
    *******uploading file
    perform upload_file using p_file P_FILE1.
    ******open session.
    perform populate_data.
    *& Form f4_help
    form f4_help using p_p_file.
    data: l_file type ibipparms-path.
    call function 'F4_FILENAME'
    importing
    file_name = l_file.
    p_file = l_file.
    endform. " f4_help
    *& Form POPULATE_DATA
    form populate_data .
    DATA: L_STRING TYPE STRing.
    DATA: L_COUNTER(2) TYPE n.
    loop at it_vendor.
    perform bdc_dynpro using 'SAPMF02K' '0106'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02K-D0130'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02K-LIFNR'
    it_vendor-lifnr.
    perform bdc_field using 'RF02K-BUKRS'
    it_vendor-bukrs.
    perform bdc_field using 'RF02K-D0130'
    'X'.
    perform bdc_dynpro using 'SAPMF02K' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'LFBK-bankn(03)'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    *********bank details
    CLEAR l_COUNTER.
    LOOP AT IT_BANK WHERE LIFNR = IT_VENDOR-LIFNR.
    l_COUNTER = l_COUNTER + 1.
    clear l_string.
    CONCATENATE 'lfbk-banks(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-banks.
    clear l_string.
    CONCATENATE 'lfbk-bankl(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-bankl.
    clear l_string.
    CONCATENATE 'lfbk-bankn(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-bankn.
    endloop.
    ******CALL TRANSACTION.
    call transaction 'FK02' using it_bdcdata mode 'A'
    messages into it_messages.
    write:/ sy-subrc.
    perform format_messages.
    clear it_bdcdata.
    refresh it_bdcdata.
    endloop.
    endform. " POPULATE_DATA
    *& Form FORMAT_MESSAGES
    form format_messages .
    data: l_msg(100).
    loop at it_messages.
    call function 'FORMAT_MESSAGE'
    exporting
    id = it_messages-msgid
    lang = sy-langu
    no = it_messages-msgnr
    v1 = it_messages-msgv1
    v2 = it_messages-msgv2
    v3 = it_messages-msgv3
    v4 = it_messages-msgv4
    importing
    msg = l_msg
    exceptions
    not_found = 1
    others = 2
    write:/ l_msg.
    endloop.
    endform. " FORMAT_MESSAGES
    *& Form bdc_dynpro
    form bdc_dynpro using value(p_program)
    value(p_screen).
    it_bdcdata-program = p_program.
    it_bdcdata-dynpro = p_screen.
    it_bdcdata-dynbegin = 'X'.
    append it_bdcdata.
    clear it_bdcdata.
    endform. " bdc_dynpro
    *& Form bdc_field
    form bdc_field using value(p_fnam)
    value(p_fval).
    it_bdcdata-fnam = p_fnam.
    it_bdcdata-fval = p_fval.
    append it_bdcdata.
    clear it_bdcdata.
    endform. " bdc_field
    *& Form upload_file
    form upload_file using p_p_file
    p_p_file1.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = P_P_FILE
    FILETYPE = 'DAT'
    HEADLEN = ' '
    LINE_EXIT = ' '
    TRUNCLEN = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    DAT_D_FORMAT = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    data_tab = IT_VENDOR
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    *******UPLOADING BANK DETAILS
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = P_P_FILE1
    FILETYPE = 'DAT'
    HEADLEN = ' '
    LINE_EXIT = ' '
    TRUNCLEN = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    DAT_D_FORMAT = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    data_tab = IT_BANK
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    endform. " upload_file
    *& Form f4_help1
    -->P_P_FILE1 text
    form f4_help1 using p_p_file1.
    data:l_file1 type ibipparms-path.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = l_file1.
    p_file1 = l_file1.
    endform. " f4_help1
    http://sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Regards,
    Sankar

  • Subcontracting Process

    Hi
    If any one can explain in detail about scenario material vendor posting directly to subcontracting vendor
    It 's very urgent
    Thanks & Regards,
    Sadhish

    Hi Sadhish,
    Sub Contracting Cycle
    (1) You have a material that can be procured externally, and you have maintained BOM with components. Any waste generated and received during subcontracting process can be maintained as component with negative quantity.
    (2) You create a subcontracting PO (PO with Item Category L). You can also maintain Purchase Info Record for Subcontract category for material and subcontractor.
    (3) You make a transfer posting to issue components for SC PO. Material is sent to subcontractor. As material remains under your ownership, system does not make any value entry. But quantity is shown as "Material Provided to Vendor"
    (4) You receive finished material against SC-PO. You also specify components consumed in manufacturing of finished goods. Additionally, if you have negative components in BOM, now you'll also receive subcontracting by-products. There are three events, so three accounting entries are generated:
    DR FG Stock/ SC By-Product Stock
    CR Change in Stock (FG/ SC By-Product )
    (for finished goods received)
    DR Subcontracting Charges
    CR GR/IR Clg
    (for moneys payable to Subcontractor)
    DR Consumption (Components)
    CR Change in Stock (FG/ SC By-Product )
    (material provided to Vendor is now charged to expense)
    (5) You do the IV for SC Invoice, and the process is complete.
    Process of Subcontract in MM
    Sub-contract business process:
    You want to buy material from the supplier (processed material/ assembled item) , but for some reason (quality of certain item / price ) you will give some component to vendor .
    Vendor shall process the item / use the item provided & supply the final item.
    SAP process:
    1.Create the finished goods material code.
    2.Maintain the BOM for the material.
    3.Create PO with item category as "L" .
    4.Issue material to vendor with movement type 541
    5.Receive the material against the PO with movement type 101.
    6.MIRO to account for vendor's invoice for the service charge& material used by him.
    Can anybody tell me how a process has to be given to subcontracting?
    Suppose, I have 3 operations 1)weaving 2)dyeing 3)cutting & packing
    if no 2 process (i.e Dyeing) has to be given to subcontracting, what process should i follow ?
    The following process to be followed for subcontracting.
    1. Item code(material master) to be created at the stage of before dyeing.
    2. Item code(material master) to be created after Dyeing as subcontracted item.(F30)
    3. Bill of material to becreated for the material(2) calling for material(1)
    4. Inforecord and source list to be created for material(2) with the corresponding vendor
    5. PO to be released for material (2)
    6.Along with PO the material(1) to be issued to vendor
    7.On receipt of material when GR is made the stock with vendor will get updated.
    How to Create a Subcontract Order?
    To create a subcontract order, proceed as follows:
    Enter the material you want to order and the item category for subcontracting (L) in the order item.
    Press ENTER to display the screen for component processing.
    Enter the components that the vendor requires to manufacture the product.
    Please note:
    – You do not need to enter the date required for the components. This date is proposed by the system when you press ENTER.
    It is calculated as follows:
    Delivery date of the item - Planned delivery time
    – If you do not want the quantity of the components to be changed if the order quantity of the end product is altered, set the indicator Fixed quantity (column F).
    – You can determine whether the components are available on the date required by selecting Edit -> Availability check.
    If you entered a bill of material as the material in the subcontract order, the components are created automatically.
    If you want to determine the components in the bill of material at a later date (for example, if the bill of material is subsequently changed), choose Item -> Component -> New BOM explosion. The existing components are deleted and redetermined in the bill of material.
    Save the purchase order.
    When you print the purchase order, the components are printed per order item
    Subcontracting - Key Points
    Special Procurement Process.
    Item category: L
    Order type: NB
    In info record vendor should be maintained as subcontractor.
    Vendor (Subcontractor) receives the components used to manufacture a finished product directly from your company or through third party.
    Your company should place a purchase order for the finished product. In this manually you can enter the required individual components or it can be determined via the explosion of BOM (if exists).
    Stock check at vendor level: ME2O
    Company stock check: MMBE
    GR for individual components through movement type: 501 or 561 (if with out PO or without reference).
    GI to subcontracting vendor: through movement type 541.
    GR from sub contracting vendor: through movement type: 101
    Movement type 543 is displayed to cancel the material cost account.
    If the subcontracting order has to be generated through materials planning,the special procurement key has to be set in MRP 2 screen.
    - To create the Subcon Info Record : Tcode ME11 - Info Category - Click Subcontracting
    - To create Material BOM : Tcode CS01
    - With the Info and Material Setup, you can then create the Purchase Order in Tcode ME21N
    Hope it wud have answered ur question
    Reward if useful
    Aasif

  • In put variable to have default from date as current date..its urgent

    query has input data as an interval it could be replaced with a single start end date parameters.only the start date needs a default value...
    plz its urgent..
    i will assign points...

    Hi,
    Steps to follow,
    1) In bex, Create a new variable of 0Calday characteristic.
    Set the following attributes:
    Type of Variable: Characteristic Value
    Variable name: ZCEMONT
    Variable Description: Caldate
    Processing by: Customer Exit (Drop down combo box)
    Characteristic: Calendar date
    Press Next
    Variable Represents: Range Value
    Variable Entry is: Mandatory
    Check Ready for Input
    And Press Next
    Press Finish.
    2) Transaction CMOD
    Create a new project, maintain the short text, and assign a development class.
    (It’s better to ask somebody senior in our project about this, because every project have one main project and development class)
    If you have project say Zproject. Choose option components. Click Change.
    Double-click on EXIT_SAPLRRS0_001.Then double-click on ZXRSRU01.
    Enter the coding .Save and activate the coding.
    INCLUDE ZXRSRU01 *
    DATA: L_S_RANGE TYPE RSR_S_RANGESID. 'In global area
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. 'In global area
    DATA: zdate like sy-datum.
    CASE I_VNAM.
    WHEN 'ZCEMONT'.
    IF i_step = 1.
    zdate = 'your default value'.
    l_s_range-low = zdate.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDCASE.
    Activate the project. This is very important.
    3) TO test now, use that variable ZCEMONT in query some where by going to BEx designer.save the query.Don;t run it.
    4) First run it in RSRT(Tran code).
    Hope i m clear.
    Now your report
    1)Place your Priority infoobject in rows
    2)In column area in Bex, Right Click and New Structure.
    3) Right click the New Structure->New Selection"DOWNTIME"->Drag your KF ZDOWNTIME
    4) Now Create a New Formula and drag  DOWNTIME->
    ='DOWNTIME'<4
    5) same for other two.
    Regards,
    San!
    Message was edited by: San!
    Message was edited by: San!

  • Plz Help me regarding oracle  event alerts..... Its urgent !!

    Hi all,
    How to create oracle event alert when particular column is update. plz help me.... Acutually i need email alert when ever list price for an item column in pricing table get updated+... plz. Its urgent.

    In that thread,... gareth.roberts say to modify the trigger definition to the column. Actually i am new to oracle >alert. How do i get that trigger definition and from where i have to get. and how to modify the trigger definition . >
    plz...Need not to say like that, I am just trying to help you. I believe if you are new try to read and understand the documents and process. Please start with Oracle Alert User's Guide to create a alert and send notification.
    I do not have any ready made scenario, I can refer you the documents to do the same,
    [How to Create a Basic Trigger|https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=119667.1]
    [RDBPROD: How to Create an Update Trigger Which Depends on Any Other Field|https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=68037.1]
    To view the Trigger Information you can use TOAD and modify the same as per your need.
    Thanks,
    Anchorage :)

  • Table control...? its urgent

    Hi friends,
    Can anyone gve me example table control program..
    My requirement is I have to display blank table control.....but when user enetrs value.. and submits it should be added to the inetrnal table in my program please help......
    Also if he wants to see the records in table control..which he enetered earlier the table should be displayed as populated..
    Please help its urgent....points will be rewarded....

    Seet he following ex:
    Created table control using wizard.
    *& Module pool       ZTEST_TBLCTRL
    PROGRAM  ZTEST_TBLCTRL.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TC1'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   ZFG_SRNO, ZFIH0004.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TC1'
    *TYPES: BEGIN OF T_TC1,
            ZSRNO LIKE ZFG_SRNO-ZSRNO,
            SCRNAME LIKE ZFIH0004-SCRNAME,
          END OF T_TC1.
    *TYPES: BEGIN OF T_TC1.
    STRUCTURE ZFG_SRNO.
          END OF T_TC1.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TC1'
    *DATA:     G_TC1_ITAB   TYPE T_TC1 OCCURS 0 WITH HEADER LINE,
             G_TC1_WA     TYPE T_TC1. "work area
    DATA:     G_TC1_ITAB   LIKE ZFG_SRNO OCCURS 0 WITH HEADER LINE,
              G_TC1_WA     LIKE G_TC1_ITAB. "work area
    DATA:     G_TC1_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TC1' ITSELF
    CONTROLS: TC1 TYPE TABLEVIEW USING SCREEN 0100.
    *&SPWIZARD: LINES OF TABLECONTROL 'TC1'
    DATA:     G_TC1_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM,
              S_CODE LIKE SY-UCOMM,
              MARK.
    DATA: T1(10).
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE TC1_INIT OUTPUT.
    IF G_TC1_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZFG_SRNO'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_TC1_itab'
       SELECT * FROM ZFG_SRNO
          INTO CORRESPONDING FIELDS
          OF TABLE G_TC1_ITAB.
       G_TC1_COPIED = 'X'.
       REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    IF T1 <> SPACE.
    G_TC1_ITAB-ZSRNO = T1.
    CLEAR T1.
    APPEND G_TC1_ITAB.
        REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    *TC1-TOP_LINE = 1.
    ENDIF.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE TC1_MOVE OUTPUT.
      MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
           if sy-subrc ne 0.
    *append G_TC1_WA to G_TC1_ITAB.
    *endif.
    READ TABLE G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    IF SY-SUBRC = 0.
        G_TC1_WA-ZSRNO = G_TC1_ITAB-ZSRNO.
    ENDIF.
    MOVE-CORRESPONDING G_TC1_ITAB TO ZFG_SRNO.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
      tc1-lines = G_TC1_LINES + 100.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TC1_GET_LINES OUTPUT.
      G_TC1_LINES = SY-LOOPC.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TC1_MODIFY INPUT.
    *break-point.
    MOVE-CORRESPONDING ZFG_SRNO TO  G_TC1_ITAB.
    MODIFY G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    G_TC1_COPIED = 'X'.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
      MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.
      MODIFY G_TC1_ITAB
        FROM G_TC1_WA
        INDEX TC1-CURRENT_LINE.
          G_TC1_COPIED = 'X'.
          if sy-subrc ne 0.
    append G_TC1_WA to G_TC1_ITAB.
    endif.
    *modify G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TC1_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'TC1'
                                  'G_TC1_ITAB'
                                  'FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.
      INCLUDE TABLECONTROL_FORMS                                         *
    *&      Form  USER_OK_TC                                               *
    FORM USER_OK_TC USING    P_TC_NAME TYPE DYNFNAM
                              P_TABLE_NAME
                              P_MARK_NAME
                     CHANGING P_OK      LIKE SY-UCOMM.
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA: L_OK              TYPE SY-UCOMM,
             L_OFFSET          TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    *&SPWIZARD: Table control specific operations                          *
    *&SPWIZARD: evaluate TC name and operations                            *
       SEARCH P_OK FOR P_TC_NAME.
       IF SY-SUBRC <> 0.
         EXIT.
       ENDIF.
       L_OFFSET = STRLEN( P_TC_NAME ) + 1.
       L_OK = P_OK+L_OFFSET.
    *&SPWIZARD: execute general and TC specific operations                 *
       CASE L_OK.
         WHEN 'INSR'.                      "insert row
           PERFORM FCODE_INSERT_ROW USING    P_TC_NAME
                                             P_TABLE_NAME.
           CLEAR P_OK.
         WHEN 'DELE'.                      "delete row
           PERFORM FCODE_DELETE_ROW USING    P_TC_NAME
                                             P_TABLE_NAME
                                             P_MARK_NAME.
           CLEAR P_OK.
         WHEN 'P--' OR                     "top of list
              'P-'  OR                     "previous page
              'P+'  OR                     "next page
              'P++'.                       "bottom of list
           PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
                                                 L_OK.
           CLEAR P_OK.
        WHEN 'L--'.                       "total left
          PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
        WHEN 'L-'.                        "column left
          PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
        WHEN 'R+'.                        "column right
          PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
        WHEN 'R++'.                       "total right
          PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
         WHEN 'MARK'.                      "mark all filled lines
           PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                             P_TABLE_NAME
                                             P_MARK_NAME   .
           CLEAR P_OK.
         WHEN 'DMRK'.                      "demark all filled lines
           PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                               P_TABLE_NAME
                                               P_MARK_NAME .
           CLEAR P_OK.
        WHEN 'SASCEND'   OR
             'SDESCEND'.                  "sort column
          PERFORM FCODE_SORT_TC USING P_TC_NAME
                                      l_ok.
       ENDCASE.
    ENDFORM.                              " USER_OK_TC
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM fcode_insert_row
                   USING    P_TC_NAME           TYPE DYNFNAM
                            P_TABLE_NAME             .
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_LINES_NAME       LIKE FELD-NAME.
       DATA L_SELLINE          LIKE SY-STEPL.
       DATA L_LASTLINE         TYPE I.
       DATA L_LINE             TYPE I.
       DATA L_TABLE_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
       FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
       FIELD-SYMBOLS <LINES>              TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
       CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
       ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line                                           *
       GET CURSOR LINE L_SELLINE.
       IF SY-SUBRC <> 0.                   " append line to table
         L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line                                               *
         IF L_SELLINE > <LINES>.
           <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
         ELSE.
           <TC>-TOP_LINE = 1.
         ENDIF.
       ELSE.                               " insert line into table
         L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
         L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
       ENDIF.
    *&SPWIZARD: set new cursor line                                        *
       L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line                                        *
       INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
       <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor                                                 *
       SET CURSOR LINE L_LINE.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM fcode_delete_row
                   USING    P_TC_NAME           TYPE DYNFNAM
                            P_TABLE_NAME
                            P_MARK_NAME   .
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_TABLE_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>         TYPE cxtab_control.
       FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
       FIELD-SYMBOLS <WA>.
       FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
       DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
       LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         IF <MARK_FIELD> = 'X'.
           DELETE <TABLE> INDEX SYST-TABIX.
           IF SY-SUBRC = 0.
             <TC>-LINES = <TC>-LINES - 1.
           ENDIF.
         ENDIF.
       ENDLOOP.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
          text
         -->P_TC_NAME  name of tablecontrol
         -->P_OK       ok code
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                           P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_TC_NEW_TOP_LINE     TYPE I.
       DATA L_TC_NAME             LIKE FELD-NAME.
       DATA L_TC_LINES_NAME       LIKE FELD-NAME.
       DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>         TYPE cxtab_control.
       FIELD-SYMBOLS <LINES>      TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl                              *
       CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
       ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled?                                         *
       IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ...                                                   *
         L_TC_NEW_TOP_LINE = 1.
       ELSE.
    *&SPWIZARD: no, ...                                                    *
         CALL FUNCTION 'SCROLLING_IN_TABLE'
              EXPORTING
                   ENTRY_ACT             = <TC>-TOP_LINE
                   ENTRY_FROM            = 1
                   ENTRY_TO              = <TC>-LINES
                   LAST_PAGE_FULL        = 'X'
                   LOOPS                 = <LINES>
                   OK_CODE               = P_OK
                   OVERLAPPING           = 'X'
              IMPORTING
                   ENTRY_NEW             = L_TC_NEW_TOP_LINE
              EXCEPTIONS
                 NO_ENTRY_OR_PAGE_ACT  = 01
                 NO_ENTRY_TO           = 02
                 NO_OK_CODE_OR_PAGE_GO = 03
                   OTHERS                = 0.
       ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
       GET CURSOR FIELD L_TC_FIELD_NAME
                  AREA  L_TC_NAME.
       IF SYST-SUBRC = 0.
         IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column                                           *
           SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
         ENDIF.
       ENDIF.
    *&SPWIZARD: set the new top line                                       *
       <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
          marks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                   P_TABLE_NAME
                                   P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         <MARK_FIELD> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
          demarks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                     P_TABLE_NAME
                                     P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         <MARK_FIELD> = SPACE.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Module  D20XX_INIT  OUTPUT
          text
    MODULE D20XX_INIT OUTPUT.
    *if screen-name = 'ZSRNO'.
           SCREEN-INPUT = 0.
           SCREEN-COLOR = 0.
           MODIFY SCREEN.
         endif.
    ENDMODULE.                 " D20XX_INIT  OUTPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    *CLEAR R1_REF.
    DO 30 TIMES.
       APPEND G_TC1_ITAB.
    ENDDO.
      DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  TAB1_INIT  OUTPUT
          text
    MODULE TAB1_INIT OUTPUT.
    ENDMODULE.                 " TAB1_INIT  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  MESSAGE  INPUT
          text
    MODULE MESSAGE INPUT.
    OK_CODE = SY-UCOMM.
    S_CODE = OK_CODE.
    CLEAR OK_CODE.
    if S_CODE = 'DELE'.
    loop at G_TC1_ITAB.
    if G_TC1_ITAB-scrname = 'X'.
    delete g_tc1_itab.
    endif.
    endloop.
    ELSEIF S_CODE = 'SAVE'.
    G_TC1_WA-ZSRNO = T1.
    MOVE-CORRESPONDING  G_TC1_WA TO ZFG_SRNO.
      REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    ENDMODULE.                 " MESSAGE  INPUT
    *&      Module  DELETE_RECORD  INPUT
          text
    MODULE DELETE_RECORD INPUT.
      IF MARK = 'X' AND S_CODE = 'DELE'.
        DELETE TABLE G_TC1_ITAB FROM ZFG_SRNO.
        DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
      ENDIF.
    ENDMODULE.                 " DELETE_RECORD  INPUT
    *********************Screen modules*********************
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC1'
      MODULE TC1_INIT.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
      LOOP AT   G_TC1_ITAB
           INTO G_TC1_WA
           WITH CONTROL TC1
           CURSOR TC1-CURRENT_LINE.
    *&SPWIZARD:   MODULE TC1_CHANGE_FIELD_ATTR
        MODULE TC1_MOVE.
       MODULE TAB1_INIT.
       MODULE TC1_GET_LINES.
      ENDLOOP.
    MODULE D20XX_INIT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'
    *BREAK POINT.
      LOOP AT G_TC1_ITAB.
        CHAIN.
          FIELD ZFG_SRNO-ZSRNO.
          MODULE TC1_MODIFY ON CHAIN-REQUEST.
         MODULE TC1_MODIFY.
        ENDCHAIN.
          MODULE MESSAGE .
        MODULE DELETE_RECORD.
      ENDLOOP.
      MODULE TC1_USER_COMMAND.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
    MODULE USER_COMMAND_0100.

  • How to control CPU Utilazation on linux, Its URGENT

    Hi Friends,
    Our Os is Linux. And weblogic server is running on production mode.
    time to time CPU usage is reaching till 90%. I checked from console
    that there are standby process. Please help me to controll CPU usage.
    At what point should I concentrate.
    Please help me. its urgent.

    In our application that is CMS(Content Management System), has used Unsynchonized HashMap.
    Is this causing High CPU Utilization, and what may be other root cause for the same.
    Plaese help me.

  • ITS Urgent : HELP

    I dont kmow were i am going wrong, plz guide me , I am not able to fix please help me
    My requirement is to show the List of the users on the jsp page
    please help me (plz dont use <jsp:useBean> tag )
    < UserBean.java >
    import java.io.*;
    import java.util.*;
    public class UserBean implements Serializable
         public UserBean(){}
         public void setUserEmailID(String s)
              ueid=s;
         public String getUserEmailID()
              return ueid;
         public void setUserPassword(String s)
              pwd=s;
         public String getUserPassword()
              return pwd;
         private String pwd,ueid;
    <UserService.java>
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    public class UserService implements Serializable
         List<Users> users;
         public UserService(){}
         public List<Users> getUsers(){
              return users;}
         public void setUsers(List<Users> users)
              this.users=users;
    <User.java>
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    public class User implements Serializable
         UserService userService;
         public User(){}
         public UserService getUserService()
              try{
                   Class.forName("com.mysql.jdbc.Driver");
                   Connection con= DiverManager.getConnection("jdbc:mysql://981.345.78.445/Bidding","mysql","xxxx");
                   PreparedStatement ps=con.prepareStatement("select * from User");
                   ResultSet rs=ps.executeQuery();
                   UserBean userBean=new UserBean();
                   while (rs.next())
                   userBean.setUserEmailID(rs.getString(3));
                   userBean.setUserPassword(rs.getString(4));
                   List<Users> users=new ArrayList<Users>();
                   users.add(userBean);
                   return;
                   catch(Exception e){
                            e.printStackTrace();
                             out.println(e);
                        }finally{
                             try{
                                  con.close();
                             }catch(Exception e){
              this.userService=new UserService();
              userService.setUsers(users);
              return userService;
         }//UserService
              public void setUserService(UserService userService)
                   this.userService=userService;
    }//User----------------------------------------------------------------------------------------------
    Plz Help me with the correct solution its V. Very Urgent...
    (I am using only Jsp and Servlets (Bidding project)) jsp will be towards the browsers side and servlet will be the middleware ie( between jsp and the database) For the processing I am using a plane java class and in the output the required result is the list it must be displayed on the jsp page..
    This topic has no replies.

    ITS urgent enough for you to copy and paste double posted threads in less than an hour? I hate that stuff. Why not just post again in the original thread to move it to the top? It isn't like you added anything new to the topic.
    "Plz Help me with the correct solution its V. Very Urgent...
    (I am using only Jsp and Servlets (Bidding project)) "
    The correct solution is to admit you don't have the skillset available for the job right now, pass on it, and then study JSP/Servlets so as not to miss the next opportunity.

  • Need help in bdc its urgent

    hai friends
    my reequirement is extracting data from 4.6 c for  purchase order me21 into flat file format.(tab delimitter) .currently we are working on ecc 6 version.i had already written bdc code for me21 in ecc6 version for uploading data.
    please help me its urgent.
    give any sample code for writing extract program

    Hi Friend,
    if it help full to u please give me max point.i am sending code.
    REPORT ZMXX0295 LINE-SIZE 132 NO STANDARD PAGE HEADING.
    +
    Comparisom of PIR or Contract price with latest PO price
    +
    This program was created to compare PIR prices or contract prices
    with the latest PO price.
    It reads the source lists for the specified materials to determine
    the PIR or contract prices. Afterwards it reads the PO history to
    get the purchase order prices.
    The material to be processed can either be selected from the data
    base (material master) or via an PC upload file.
    The output can be sorted in different variants.
    +
    +
    *eject
    Definition of database tables --------------------------------------+
    TABLES: EINA,                     "Purchasing Info Record: General Data
            EINE,                     "PIR: Purchasing Organization Data
            EIPA,                     "Order Price History, Info Record
            EKAB,                     "Contract Release Documentation
            *EKKO,                    "Contract / PO header
            EKKO,                     "Contract / PO header
            *EKPO,                    "Contract / PO item
            EKPO,                     "Contract / PO item
            EORD,                     "Source list
            TCURC.                    "Currency codes
    *eject
    Definition of internal tables / data -------------------------------+
    DATA: BEGIN OF MAT_PRICE OCCURS 0,
            VRTYP LIKE EORD-VRTYP,                   "Document type
            INFNR LIKE EINE-INFNR,                   "Info record / Contract
            MATNR LIKE EINA-MATNR,                   "Material
            WERKS LIKE EINE-WERKS,                   "Plant
            EKORG LIKE EINE-EKORG,                   "Purch. organization
            LIFNR LIKE EINA-LIFNR,                   "Vendor
            FLIFN LIKE EORD-FLIFN,                   "Fix Vendor
            IRPRS LIKE EINE-NETPR,                   "Info record price
            PEINH LIKE EINE-PEINH,                   "Price unit
            EBELN LIKE EIPA-EBELN,                   "PO header
            EBELP LIKE EIPA-EBELP,                   "PO item
            BEDAT LIKE EIPA-BEDAT,                   "PO date
            POPRS LIKE EIPA-LPREI,                   "PO price
            LPEIN LIKE EIPA-LPEIN,                   "Price unit
            MENGE LIKE EKPO-MENGE,                   "PO quantity
            MEINS LIKE EKPO-MEINS,                   "PO unit of measure
          END OF MAT_PRICE.
    DATA: BEGIN OF MAT_SEL OCCURS 0,
            MATNR LIKE EINA-MATNR,
          END OF MAT_SEL.
    DATA: T_EORD LIKE EORD OCCURS 0 WITH HEADER LINE.
    DATA: CURSORFIELD(15),                           "Fieldname of Cusor pos
          INV_DATE LIKE SY-DATUM,                    "Inverted date
          W_EFFPR  LIKE EINE-EFFPR.                  "Hiwi price
    DATA: W_FILE TYPE STRING.                        "JAN29NOV05
    CONSTANTS: C_0(01)    TYPE C VALUE '0',
               C_F(01)    TYPE C VALUE 'F',
               C_I(01)    TYPE C VALUE 'I',
               C_K(01)    TYPE C VALUE 'K',
               C_X(01)    TYPE C VALUE 'X'.
    CONSTANTS: C_ASC(10) TYPE C VALUE 'ASC'.           "JAN29NOV05
    *eject
    Definition of selection screen -------------------------------------+
    SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-B01.
    PARAMETERS:     P_DBASE RADIOBUTTON GROUP R01.   "Read mat's via select.
    SELECT-OPTIONS: S_MATNR FOR EINA-MATNR.          "Material
    SELECTION-SCREEN ULINE.
    PARAMETERS:     P_XFILE RADIOBUTTON GROUP R01,   "Read mat's via PC file
                    P_DATEI LIKE RLGRAP-FILENAME.    "PC file with MATNR's
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS: S_MATKL FOR  EINA-MATKL,         "Material group
                    S_WERKS FOR  EINE-WERKS,         "Plant
                    S_EKORG FOR  EINE-EKORG,         "Purch. organization
                    S_BEDAT FOR  EIPA-BEDAT.         "PO price date
    PARAMETERS:     P_WAERS LIKE EINE-WAERS          "Output currency
                            OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B01.
    *eject
    Process after input ------------------------------------------------+
    AT SELECTION-SCREEN ON P_WAERS.
      PERFORM READ_TCURC.
    AT SELECTION-SCREEN ON P_DATEI.
      IF NOT P_XFILE IS INITIAL
         AND P_DATEI IS INITIAL.
        MESSAGE E999(ZZ) WITH 'Please sepcify PC file name'.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DATEI.
      PERFORM CALL_WS_EXPLORER.
    *eject
    Start of main program ----------------------------------------------+
    START-OF-SELECTION.
       IF NOT P_XFILE IS INITIAL.
         PERFORM UPLOAD_MATERIAL_SELECTION.          "Read mat's from file
         IF MAT_SEL[] IS INITIAL.
           MESSAGE E999(ZZ) WITH
                  'No records were found in file'(E01) P_DATEI(40).
         ELSE.
           PERFORM GET_MATERIAL_SELECTION.           "Process upload file
         ENDIF.
       ENDIF.
       PERFORM SOME_REWORK.
       PERFORM PROCESS_MATERIALS.                    "Process mat. selection
    END-OF-SELECTION.
    End of Main program ------------------------------------------------+
      SET PF-STATUS 'LIST'.
      SORT MAT_PRICE BY MATNR WERKS EKORG POPRS.
      PERFORM AUSGABE.
      IF SY-SUBRC EQ 0.
        MESSAGE I999(ZZ) WITH TEXT-002.
        MESSAGE S999(ZZ) WITH TEXT-001
                'Material/Plant/PurchOrg/PO Price'(003).
      ENDIF.
    *eject
    User commands - interactive reporting ...
      AT USER-COMMAND.
        IF SY-UCOMM EQ 'ORDR'.
          PERFORM DISPLAY_ORDER.
        ENDIF.
      AT LINE-SELECTION.
        PERFORM CHANGE_SORT_SEQUENCE.
    *eject
    +
          TOP-OF-PAGE
    +
    TOP-OF-PAGE.
      PERFORM LIST_HEADER.
    *eject
    +
          TOP-OF-PAGE during line-selection.
    +
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM LIST_HEADER.
    *eject
          Form  CALL_WS_EXPLORER
    FORM CALL_WS_EXPLORER.
      CALL FUNCTION 'WS_FILENAME_GET'
         EXPORTING
            DEF_FILENAME     = '*.txt,'  "JAN29NOV05
              DEF_FILENAME     = '*.txt'   "JAN29NOV05
              DEF_PATH         = 'D:\'
              MASK             =
                  Block Changed From Here JAN29NOV05
                  'Text files,.txt,Data files,.dat,All files,.,.'(MSK)
                    ' Text files,.txt,Data files,.dat,All files,.,.'(MSK)
                  Block Changed Till Here JAN29NOV05
              MODE             = 'O'
              TITLE            = 'Upload Materials to be processed'(004)
         IMPORTING
              FILENAME         = P_DATEI
         EXCEPTIONS
              INV_WINSYS       = 1
              NO_BATCH         = 2
              SELECTION_CANCEL = 3
              SELECTION_ERROR  = 4.
    ENDFORM.                    " CALL_WS_EXPLORER
    *eject
          Form  PROCESS_MATERIALS
          Read source list for specified materials and then process
          either PIR or contracts.
    FORM PROCESS_MATERIALS.
      PERFORM READ_MATERIAL_SOURCE_LIST.
      LOOP AT T_EORD.
        CLEAR W_EFFPR.
        TRANSLATE T_EORD-VRTYP USING ' I'.           "Set I = Infor record
        IF T_EORD-VRTYP EQ C_I.
          PERFORM GET_PIR_INFORMATION.
        ELSE.
          T_EORD-FLIFN = T_EORD-FEBEL.
          PERFORM GET_CONTRACT_INFORMATION.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " PROCESS_MATERIALS
    *eject
          Form  GET_MATERIAL_SELECTION
    FORM GET_MATERIAL_SELECTION.
      SORT MAT_SEL.
      CLEAR S_MATNR.
      S_MATNR-OPTION = 'EQ'.
      S_MATNR-SIGN   = 'I'.
      LOOP AT MAT_SEL WHERE
           MATNR CO ' 0123456789'.
        SHIFT MAT_SEL-MATNR RIGHT DELETING TRAILING ' '.
        TRANSLATE MAT_SEL-MATNR USING ' 0'.
        S_MATNR-LOW = MAT_SEL-MATNR.
        APPEND S_MATNR.
      ENDLOOP.
    ENDFORM.                    " GET_MATERIAL_SELECTION
          Form  READ_EIPA
    FORM READ_EIPA.
      SELECT EBELN EBELP BEDAT
             INTO CORRESPONDING FIELDS OF EIPA
             FROM EIPA
             UP TO 1 ROWS
             WHERE INFNR EQ EINA-INFNR
             AND   WERKS EQ T_EORD-WERKS
             AND   EKORG EQ T_EORD-EKORG
             AND   BEDAT IN S_BEDAT
             ORDER BY BEDAT DESCENDING.
        PERFORM READ_ADDITIONAL_PO_DATA
                USING EIPA-EBELN EIPA-EBELP.
        CHECK SY-SUBRC EQ 0.
        PERFORM FILL_MAT_PRICE USING 'X' EINA-INFNR
                EINE-EFFPR EINE-PEINH EINE-WAERS.
        APPEND MAT_PRICE.
      ENDSELECT.
    ENDFORM.                    " READ_EIPA
    *eject
          Form  FILL_MAT_PRICE
    FORM FILL_MAT_PRICE USING
    *ID X_EBELN X_EFFPR X_PEINH X_WAERS                  "JAN29NOV05
       Block added from here JAN29NOV05
                               ID      TYPE C
                               X_EBELN TYPE C
                               X_EFFPR TYPE EINE-EFFPR
                               X_PEINH TYPE EINE-PEINH
                               X_WAERS TYPE EINE-WAERS.
       Block added till here JAN29NOV05
      CLEAR MAT_PRICE.
      IF X_WAERS NE P_WAERS.
        PERFORM CONVERT_TO_OTHER_CURRENCY USING
                X_EFFPR X_WAERS P_WAERS.
      ENDIF.
      MAT_PRICE-VRTYP = T_EORD-VRTYP.                "PIR / Contract no.
      MAT_PRICE-INFNR = X_EBELN.                     "PIR / Contract no.
      MAT_PRICE-MATNR = T_EORD-MATNR.                "Material
      MAT_PRICE-LIFNR = T_EORD-LIFNR.                "Vendor
      MAT_PRICE-FLIFN = T_EORD-FLIFN.                "Fix Vendor
      MAT_PRICE-WERKS = T_EORD-WERKS.                "Plant
      MAT_PRICE-EKORG = T_EORD-EKORG.                "Purch. organization
      MAT_PRICE-IRPRS = X_EFFPR.                     "PIR / Contract price
      MAT_PRICE-PEINH = X_PEINH.                     "PIR / Contract pr.unit
      CHECK ID NE SPACE.                             "PO history found ?
    latest PO data ...
      IF EKKO-WAERS NE P_WAERS.
        PERFORM CONVERT_TO_OTHER_CURRENCY USING
                EKPO-EFFWR EKKO-WAERS P_WAERS.
      ENDIF.
      MAT_PRICE-EBELN = EKPO-EBELN.                  "PO number
      MAT_PRICE-EBELP = EKPO-EBELP.                  "PO item
      MAT_PRICE-BEDAT = EKKO-BEDAT.                  "PO date
      IF EKPO-MENGE NE 0.
        MAT_PRICE-POPRS = EKPO-EFFWR / ( EKPO-MENGE  "Last PO price = value
    EKPO-BPUMZ / EKPO-BPUMN ). " / Qty. in sales unit
      ELSE.
        MAT_PRICE-POPRS = EKPO-EFFWR.                "Last PO value
      ENDIF.                                         "PO price unit
      MAT_PRICE-LPEIN = EKPO-PEINH.                  "PO price unit
      MAT_PRICE-MENGE = EKPO-MENGE.                  "PO quantity
      MAT_PRICE-MEINS = EKPO-MEINS.                  "PO unit of measure
    ENDFORM.                    " FILL_MAT_PRICE
    *eject
          Form  CONVERT_TO_OTHER_CURRENCY
    FORM CONVERT_TO_OTHER_CURRENCY USING
                           XVALUE FR_CURR TO_CURR.     "JAN29NOV05
       Block added from here JAN29NOV05
                               XVALUE  TYPE ANY
                               FR_CURR TYPE EKKO-WAERS
                               TO_CURR TYPE EINE-WAERS.
       Block added till here JAN29NOV05
      CALL FUNCTION 'MS_CONVERT_TO_OTHER_CURRENCY'
           EXPORTING
                DATE             = SY-DATUM
                FROM_CURRENCY    = FR_CURR
                FROM_AMOUNT      = XVALUE
                TO_CURRENCY      = TO_CURR
                COMPANY_CURRENCY = 'EUR'
           IMPORTING
                TO_AMOUNT        = XVALUE
           EXCEPTIONS
                OTHERS           = 1.
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH 'Currency conversion error from'(E02)
                              FR_CURR 'to' TO_CURR.
      ENDIF.
    ENDFORM.                    " CONVERT_TO_OTHER_CURRENCY
    *eject
          Form  UPLOAD_MATERIAL_SELECTION
    FORM UPLOAD_MATERIAL_SELECTION.
       Block commented from here JAN29NOV05
    CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
               FILENAME            = P_DATEI
               FILETYPE            = 'DAT'
          TABLES
               DATA_TAB            = MAT_SEL
          EXCEPTIONS
               CONVERSION_ERROR    = 1
               FILE_OPEN_ERROR     = 2
               FILE_READ_ERROR     = 3
               INVALID_TABLE_WIDTH = 4
               INVALID_TYPE        = 5
               NO_BATCH            = 6
               UNKNOWN_ERROR       = 7
               OTHERS              = 8.
       Block commented till here JAN29NOV05
       Block added from here JAN29NOV05
      MOVE P_DATEI TO W_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      =  W_FILE
       FILETYPE                      =  C_ASC
       HAS_FIELD_SEPARATOR           =  C_X
      TABLES
        DATA_TAB                     = MAT_SEL
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17.
       Block added till here JAN29NOV05
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH 'Error uploading from file'
                         P_DATEI(40).
      ENDIF.
    ENDFORM.                    " UPLOAD_MATERIAL_SELECTION
    *eject
          Form  AUSGABE
    FORM AUSGABE.
      LOOP AT MAT_PRICE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE: /01 MAT_PRICE-VRTYP,                  "Document type
                03 MAT_PRICE-INFNR,                  "Info record / Contract
                14 MAT_PRICE-MATNR,                  "Material
                23 MAT_PRICE-WERKS,                  "Plant
                28 MAT_PRICE-EKORG,                  "Purch. organization
                33 MAT_PRICE-LIFNR,                  "Vendor
                44 MAT_PRICE-FLIFN,                  "Fixed Vendor
                46 MAT_PRICE-IRPRS NO-SIGN,          "Info record price
                61 MAT_PRICE-PEINH NO-SIGN.          "IR price unit
        FORMAT COLOR 2 INTENSIFIED.
        IF NOT MAT_PRICE-EBELN IS INITIAL.
          WRITE:  68 MAT_PRICE-POPRS NO-SIGN,        "PO price
                  83 MAT_PRICE-LPEIN NO-SIGN,        "PO price unit
                  90 MAT_PRICE-MENGE,                "PO quantity
                 107 MAT_PRICE-MEINS,                "PO unit of measure
                 111 MAT_PRICE-EBELN,                "PO number
                 123 MAT_PRICE-BEDAT.                "PO date
        ELSE.
          WRITE:  74 'No PO price was found'(005),
                 132 ' '.
        ENDIF.
        HIDE MAT_PRICE-VRTYP.
        AT END OF MATNR.
          SKIP.
        ENDAT.
      ENDLOOP.
      CLEAR MAT_PRICE.
    ENDFORM.                    " AUSGABE
    *eject
          Form  READ_TCURC
    FORM READ_TCURC.
      CLEAR TCURC.
      TCURC-WAERS = P_WAERS.
      READ TABLE TCURC.
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH P_WAERS 'Currency code invalid'(E03).
      ENDIF.
    ENDFORM.                    " READ_TCURC
    *eject
          Form  LIST_HEADER
    FORM LIST_HEADER.
      FORMAT INTENSIFIED.
      WRITE: /01 'Output currency'(006), 25 ': ', P_WAERS,
             122 'Page'(007), SY-PAGNO,
             /01 'Plant'(008), 25 ':  from '(009), S_WERKS-LOW,
              46 'to '(010), S_WERKS-HIGH,
             /01 'Purchasing Organization'(011),
              25 ':  from '(009), S_EKORG-LOW,
              46 'to '(010), S_EKORG-HIGH,
             /01 'PO date'(012), 25 ':  from '(009), S_BEDAT-LOW,
              46 'to '(010), S_BEDAT-HIGH.
      ULINE.
      FORMAT COLOR 1.
      WRITE: /01 TEXT-T01.
      ULINE.
    ENDFORM.                    " LIST_HEADER
    *eject
          Form  CHANGE_SORT_SEQUENCE
    FORM CHANGE_SORT_SEQUENCE.
      GET CURSOR FIELD CURSORFIELD.
      CASE CURSORFIELD+10(5).
        WHEN 'EKORG'.
          SORT MAT_PRICE BY MATNR EKORG POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Purch.Organization/Info Rec.Price'(013).
        WHEN 'BEDAT'.
          SORT MAT_PRICE BY MATNR BEDAT POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/PO Date/Info Rec.Price'(014).
        WHEN 'IRPRS'.
          SORT MAT_PRICE BY MATNR IRPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/Info Rec.Price'(015).
        WHEN 'POPRS'.
          SORT MAT_PRICE BY MATNR POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/PO Price'(016).
        WHEN 'LIFNR'.
          SORT MAT_PRICE BY MATNR LIFNR POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Vendor/PO Price'(017).
        WHEN OTHERS.
          SORT MAT_PRICE BY MATNR WERKS EKORG POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/PurchOrg/PO Price'(018).
      ENDCASE.
      SY-LSIND = 0.
    ENDFORM.                    " CHANGE_SORT_SEQUENCE
    *eject
          Form  DISPLAY_ORDER
    FORM DISPLAY_ORDER.
      DATA: X_BELNR(10) TYPE C.
      CLEAR CURSORFIELD.
      GET CURSOR FIELD CURSORFIELD.
      IF CURSORFIELD+10(5) NE 'EBELN' AND
         CURSORFIELD+10(5) NE 'INFNR'.
        MESSAGE I999(ZZ) WITH 'Invalid cursor position'.
        EXIT.
      ENDIF.
      GET CURSOR FIELD CURSORFIELD  VALUE X_BELNR.
      CASE CURSORFIELD+10(5).
        WHEN 'EBELN'.                                "Purchase order
          SET PARAMETER ID 'BES' FIELD X_BELNR.
          CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
        WHEN 'INFNR'.                                "Info rec. / Contract
          IF MAT_PRICE-VRTYP EQ C_I.                 "Info Record ...
            SET PARAMETER ID 'INF' FIELD X_BELNR.
            CALL TRANSACTION 'ME13' AND SKIP FIRST SCREEN.
          ELSE.                                      "Contract ...
            SET PARAMETER ID 'VRT' FIELD X_BELNR.
            CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
      CLEAR MAT_PRICE.
    ENDFORM.
    *eject
          Form  SOME_REWORK
    FORM SOME_REWORK.
       IF NOT S_BEDAT-LOW IS INITIAL AND             "Align date for output
          S_BEDAT-HIGH IS INITIAL.
         S_BEDAT-HIGH = S_BEDAT-LOW.
         MODIFY S_BEDAT INDEX 1.
       ENDIF.
       CONVERT DATE SY-DATUM INTO INVERTED-DATE      "today's inverted date
               INV_DATE.
    ENDFORM.                    " SOME_REWORK
    *eject
          Form  READ_ADDITIONAL_PO_DATA
    FORM READ_ADDITIONAL_PO_DATA USING
                                  X_EBELN X_EBELP.  "JAN29NOV05
       Block added from here JAN29NOV05
                                    X_EBELN TYPE EIPA-EBELN
                                    X_EBELP TYPE EIPA-EBELP.
       Block added till here JAN29NOV05
      SELECT SINGLE WAERS BEDAT
             INTO CORRESPONDING FIELDS OF EKKO
             FROM EKKO
             WHERE EBELN EQ X_EBELN.
      SELECT SINGLE EBELN EBELP MENGE MEINS
                    PEINH EFFWR BPUMZ BPUMN
             INTO CORRESPONDING FIELDS OF EKPO
             FROM EKPO
             WHERE EBELN EQ X_EBELN
             AND   EBELP EQ X_EBELP
             AND   LOEKZ NE 'L'.
    ENDFORM.                    " READ_ADDITIONAL_PO_DATA
    *eject
          Form  READ_MATERIAL_SOURCE_LIST
          Read source list entries for specified materials
    FORM READ_MATERIAL_SOURCE_LIST.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE T_EORD
             FROM EORD
             WHERE MATNR IN S_MATNR
             AND   WERKS IN S_WERKS
             AND   EKORG IN S_EKORG
             AND   VDATU LE SY-DATUM
             AND   BDATU GE SY-DATUM
             AND ( VRTYP EQ SPACE
             OR    VRTYP EQ C_K ).
      IF SY-SUBRC NE 0 OR
         T_EORD[] IS INITIAL.
        MESSAGE S999(ZZ) WITH 'No data found for this selection'(S01).
      ENDIF.
    ENDFORM.                    " READ_MATERIAL_SOURCE_LIST
    *eject
          Form  GET_PIR_INFORMATION
          Process purchase info records --> purchase order history
    FORM GET_PIR_INFORMATION.
      SELECT INFNR
             INTO EINA-INFNR
             FROM EINA
             WHERE LIFNR EQ T_EORD-LIFNR
             AND   MATNR EQ T_EORD-MATNR
             AND   MATKL IN S_MATKL
             AND   LOEKZ EQ SPACE.
        SELECT SINGLE EFFPR PEINH WAERS
               INTO CORRESPONDING FIELDS OF EINE
               FROM EINE
               WHERE INFNR EQ EINA-INFNR
               AND   EKORG EQ T_EORD-EKORG
               AND   ESOKZ EQ C_0
               AND   WERKS EQ T_EORD-WERKS
               AND   LOEKZ EQ SPACE.
        CHECK SY-SUBRC EQ 0.
        PERFORM READ_EIPA.                           "Read PO history
        IF SY-SUBRC NE 0.
          PERFORM FILL_MAT_PRICE USING ' ' EINA-INFNR
                  EINE-EFFPR EINE-PEINH EINE-WAERS.
          APPEND MAT_PRICE.
        ENDIF.
      ENDSELECT.
    ENDFORM.                    " GET_PIR_INFORMATION
    *eject
          Form  GET_CONTRACT_INFORMATION
          text
    FORM GET_CONTRACT_INFORMATION.
      SELECT SINGLE WAERS
             INTO *EKKO-WAERS
             FROM EKKO
             WHERE EBELN EQ T_EORD-EBELN
             AND   LOEKZ EQ SPACE.
      SELECT SINGLE EBELN EBELP EFFWR PEINH
                    KTMNG BPUMZ BPUMN
             INTO CORRESPONDING FIELDS OF *EKPO
             FROM EKPO
             WHERE EBELN EQ T_EORD-EBELN
             AND   EBELP EQ T_EORD-EBELP
             AND   LOEKZ EQ SPACE.
      CHECK SY-SUBRC EQ 0.
    Get effective price in sales unit ...
      IF *EKPO-KTMNG EQ 0 OR
         *EKPO-BPUMN EQ 0.
        W_EFFPR = *EKPO-EFFWR.
      ELSE.
        W_EFFPR = *EKPO-EFFWR / *EKPO-KTMNG
    *EKPO-BPUMZ / *EKPO-BPUMN.
      ENDIF.
      PERFORM READ_EKAB.
      IF SY-SUBRC NE 0.
        PERFORM FILL_MAT_PRICE USING ' ' *EKPO-EBELN
                W_EFFPR *EKPO-PEINH *EKKO-WAERS.
        APPEND MAT_PRICE.
      ENDIF.
    ENDFORM.                    " GET_CONTRACT_INFORMATION
    *eject
          Form  READ_EKAB
          Read released document (PO's) of contract
    FORM READ_EKAB.
      SELECT EBELN EBELP BEDAT
             INTO CORRESPONDING FIELDS OF EKAB
             FROM EKAB
             UP TO 1 ROWS
             WHERE KONNR EQ T_EORD-EBELN
             AND   KTPNR EQ T_EORD-EBELP
             AND   WERKS EQ T_EORD-WERKS
             AND   EKORG EQ T_EORD-EKORG
             AND   BEDAT IN S_BEDAT
             AND   BSTYP EQ C_F
             ORDER BY BEDAT DESCENDING.
        PERFORM READ_ADDITIONAL_PO_DATA
                USING EKAB-EBELN EKAB-EBELP.
        CHECK SY-SUBRC EQ 0.
        PERFORM FILL_MAT_PRICE USING 'X' T_EORD-EBELN
                W_EFFPR *EKPO-PEINH *EKKO-WAERS.
        APPEND MAT_PRICE.
      ENDSELECT.
    ENDFORM.                    " READ_EKAB

  • Error while releasing Billing document in Subcontract process

    Hi All,
    We are working on Subcontract process as explained below:
    Company code X purchases the component A and sends it to Company code Y on Subcontract. Company codes X and Y belongs to one company using single operative chart of Accounts, Controlling area & operating concern. FI configuration has been maintained in OBYA by treating above company codes Inter company GLs. The component A is sent to company code Y as non value added item. Through 501 movement type, as the component is sent by Company code X.
    Company code Y will add some components (like B,C and charges some expenses as service component D for preparing Finished good) and send this FG to Company code X. For this company code Y will raise a Sales order and followed by MRP run and Production order is created.
    In VA02 of above Sales Order, while entering Item details, where the Settlement rule is asking for PA Transfer structure (in Account assignment tab of Item details) and giving the following error analysis:
    Enter a PA transfer structure
    Message no. KD 044
    Diagnosis
    A PA transfer structure is required for settlement to profitability analysis.
    System Response
    You cannot save this settlement rule.
    Procedure
    Enter a PA transfer structure. To do this, choose the "Parameters" function in the settlement rule. As part of customizing, you can also store a default value for the PA analysis structure, in the settlement profile. The system then uses this default value when you enter a settlement rule.
    In addition to above, another issue has raised while releasing the Billing document after doing PGI. Accounting document is not getting generated and while releasing the Billing document (VF02) it is throwing an error as
    “Enter profitability segment as cost object for Revenue and COGS posting”
    Message no. ZC 001.
    MM,PP,SD & FICO configuration settings maintained:
    1. All required OBYC settings
    2. All cost element and Cost element categories have been maintained
    3. From MM side the system is generating FI & CO documents
    4. Settlement profile in Production Order type is maintained (in KOT2). Allocation structure and PA transfer structure were maintained in (OK06, OK07 & KEI1).  In PA transfer structure we have assigned the required Sources and Value fields and settlement cost elements.
    5. In VKOA condition types KOFI and KOFK were maintained for relevant Customer & Material Account Assignment groups.
    6. Required settings have maintained in OKB9.
    Movement types 501 (sub contract), Received back to Company code X through Movement  type 101. In spite of these settings still we are getting the above mentioned errors.
    Could any one help to provide some inputs on the above issue as early as possible.
    Thanks in advance.

    Hi,
    check  in the sales order line item procurement tab . u can get the requirement type. in SPRo check the requiremnt class for the requirement type. in that requirement clas u will get settrlemnt profile for the sales order. Check that settlemnt profile there u have to maintain the PA transfer structure.
    I think both problem will get solved by maintaing the PA structure..
    You are doing sales order costing right....and i hope it is non vsaluated sales order costing .....
    If help ful please assign points.
    cheers
    Prabhat

  • Its urgent:plz tel me what is the steps move to produection oaf page.

    Hi All,
    I developed one oaf page.that page move to production.
    i already move to produection but its not working fine.
    its throw an error.
    plz tell me what is the steps follow when move to production.
    oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_NO_REGION_DATA. Tokens: REGIONCODE = /wnsgs/oracle/apps/ap/agingbuckets/webui/AgingBucketsPG;
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:529)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1005)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    Exception:
    oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /wnsgs/oracle/apps/ap/agingbuckets/webui/AgingBucketsPG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository.
         at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
         at oracle.adf.mds.MElement.findElement(MElement.java:97)
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1005)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    Exception:
    oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /wnsgs/oracle/apps/ap/agingbuckets/webui/AgingBucketsPG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository.
         at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350)
         at oracle.adf.mds.MElement.findElement(MElement.java:97)
         at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719)
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1005)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
         at oa_html._OA._jspService(_OA.java:85)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
         at oa_html._RF._jspService(_RF.java:102)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    thanks
    Seshu.
    Edited by: its urgent on Feb 8, 2012 2:31 AM

    Deployement steps:
    1) Copy the Class files and move to into server
    We can get class file >>F:\OAF\jdevhome\jdev\myclasses\imp
    \myprojects
    (imp) Load into server (java TOP) >>D:\oracle\viscomn\java\
    2) Run the XML import Scripts in Command Prompt
    F:\OAF\jdevbin\jdev\bin
    For every Page and every Lov region
    3) Next Go to apps
    System administrator Create Function for a page
    Description tab:
    Function Name : IMP_STUDENT_REGISTRATION
    User Function Name: Imp Student Registration
    Description : Imp Student Registration
    Properties Tab:
    Type: SSWA JSP function
    WebHTML Tab
    Function:
    HTML call: OA.jsp?page=/imp/oracle/apps/po/student/webui/ImpStudentResitrationPG
    Note: DO the same for all the pages
    4) Attach these Functions to Imp Student Operations menu to Imp Student Operations responsibility to User.
    5) Bounce the apache.
    Regards
    Meher Irk

  • PLZ ITS URGENT!!!!!!!!!!

    hi i developed a smartforms......
    in it i am using 'SSF_OPEN' and 'SSF_CLOSE' functions to suppress the print preview box which was coming again n again.....
    firstly it was working properly bt i made some changes in my smartforms and then it started giving me the problem n giving the error after executing'Previous Output Request was not finished'...
    plz help me out how to solve this problem....
    PLZ ITS URGENT!!!!!!!!!!!!!!!!!
    plz tell me anyone...........
    Edited by: Pardeep Sharma on Dec 24, 2007 11:38 AM
    Edited by: Pardeep Sharma on Dec 24, 2007 11:57 AM
    Edited by: Pardeep Sharma on Dec 24, 2007 12:12 PM

    Hi,
    Is the requirement to supress the print preview or the dailog box containing the parameters for the print?
    Regards,
    Kk

  • How to Fix the row in sap script, its urgent......

    Hi Experts,
    first i explain my sap script, i have print void check in my script client give readymade format means box are there, lines are there. i have to fix in box and line data form database table. everthing is working fine. i got all data. i have total 6 window in my script .but i have one issue  In my sap script in header window total five rows... like below
    Check voucher no:8888
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    now sometime check voucher is balnk....
    Check voucher no: BLANK/NULL
    check No: 1234
    Date:1/28/2007
    Bank:xyz
    Batch no: 5678
    because of that all rows are move up side and all window also move up side and so script not fix to the box and line all data are seen not perfectly... so guru`s how to fix the row and window in script....
    its urgent...
    Waiting for ur reply
    Thanks & regards
    Jigar

    Hi,
    Follow the below steps . Definately your issue will bve resolved.
    Let us suppose you are printing following fields
    PH &v_text&
    PH &v_text1&
    PH &v_text2&
    you will get the output as you expected.
    and if you have any conditions  for these fileds
    /: if v_text is not initial.
    PH &v_text&
    /: endif
    PH &v_text1&
    PH &v_text2&
    if you have data in each field then you will get output as expected .
    But when v_text is initial.
    the data will be moved up wnhich is happening in your case.
    so what you need to do is?
    /: if v_text is not initial.
    PH &v_text&
    /: else
    PH  (Here you need to mention empty line with same paragraph format
    /: endif.
    PH &v_text1&
    PH &v_text2&
    Reward points if useful
    Regards,
    Nageswar

  • Goods Receipt in Subcontracting process

    Hi,
    I am beginner in SAP.
    This is regarding Goods Receipt in Subcontracting process.
    I have provided raw material Quantity = 100 Nos. to subcontracting vendor.
    Subcontracting vendor done machining on 80 Quantity, and we have done Goods Receipt for 80 Quantity as Finished Parts.
    Subcontracting vendor found 20 Quantity as Defected.
    Shall I take back 20 Quantity by Movement Type 542.
    OR
    Shall I do Goods Receipt of 20 Quantity as Finished Product and price = 0. & then stock transfer of Finished to Raw Material.
    Please reply.

    Hi,
    It depends on what you want your subcontractor to do with the faulty raw material stock - if you want them to scrap it you can scrap stock from subcontractor stock using movement type 551 and special stock "O" (the system should prompt you to enter the vendor code). If you want it returned for you to scrap it - movement 542 to return it then scrap it from your own stock.
    You shouldn't receive an additional 20 of the finished parts - as you only received 80 not 100. Close the purchase order off to close off the balance of 20 remaining.
    Thanks

Maybe you are looking for

  • Custom Label on webform

    Hello, I'm using Planning 11.1.2.1 and I want to know if theres a way of having a custom label on a webform without having to customize the JSP files? I just want a heading or a label preferably on top of the form or around the page section. Regards,

  • Lync user is not able to connect to Lync online.

    Hi Friends, I am going to share you a strange issue..... Actually we have brought some Lync online accounts from Microsoft. So when we try to login in mentioned below scenarios then we got the output like this :- 1) When we login the machine by domai

  • Crurrency Field Issue

    Hi All, There is a user defined domain ZWRBTR which is currency field (Length 13,Decimal 3 and sign On,O/P length 18).We have used this domain in a Z-table and inserting data from Module pool. Suppose if we enter 70 for this field,and after saving in

  • Should I render a looping movie in After Effects or in Flash Pro?

    Hello. I am using Flash Pro CS6. Right now I am trying to make a simple SWF file that can play three looping clips via individual play buttons. I made three FLV movies in After Effects. They are  80 frames , 30 fps clips, but those clips have lots of

  • I can't get my ringtone to work.

    It says my ringtone is set to be what I want, my vibration is off, but when people call me it's just silent.