I need urgent help for the logic

hi all,
Initially, the requirement was to create PO regardless the Purchase Requisition based on the formula
If (Open Qty + Current Stock) < Safety Stock ==>> THEN A PO NEEDS TO BE CREATED
This is absolutely fine, this created the PO as per the above condition.
OUR REQUIREMENT
Modify the same program to create PO's only if there is any PR for that material . Meaning, turn all the PR's into PO. Also, when creating PO, the delivery date should be = (Current date - 7 days) when creating a PO for an PR(I think the table name is VETVG.)  Nothing else. We need to change the  IF condition in the following code .
so can any one let me that what modification i need to do ie what logic i should use to get the requirement fullfilled.
*Report  Z_STO_SAFETY_STOCK                                            *
Program Name : Z_STO_SAFETY_STOCK                                    *
Date         : 09.03.2007                                            *
Programmer   : Rajdeep Kumar
Last Change  : Van Tran                22/03/2007                    *
Specification:                                                       *
Program Type : Report                                                *
Description  : Create STO requirement for Plant
Transaction  : None                                                  *
Input Files  : None                                                  *
Output Files : None                                                  *
Scheduling Issues :                                                  *
Run Frequency :                                                      *
Mod#    Date          By            Description                      *
New   09.03.2007   Rajdeep Kumar     Created                         *
                   DEVK905890                                        *
M01   20.03.2007   Rajdeep Kumar     Material Group Added to         *
                   DEVK905892        Selection Screen                *
*Update 05.04.2007   DEVK906082        Added two new selection         *
                                     fields beskz and sobsl          *
                                     and is select statement         *
REPORT  z_sto_safety_stock NO STANDARD PAGE HEADING.
*&                       TABLES
TABLES:
        t001w,
      marc.                                               " M01
        marc,                                               " M01
        mara.                                               " M01
*&                     DATA DECLARATION
DATA: BEGIN OF it_marc OCCURS 0,
        matnr LIKE marc-matnr,
        werks LIKE marc-werks,
        eisbe LIKE marc-eisbe,
      bstmi LIKE marc-bstmi,
        bstrf LIKE marc-bstrf,
        beskz LIKE marc-beskz,
        sobsl LIKE marc-sobsl,
      END OF it_marc.
DATA: BEGIN OF it_mard OCCURS 0,
        matnr LIKE mard-matnr,
        werks LIKE mard-werks,
        labst LIKE mard-labst,
      END OF it_mard.
DATA: BEGIN OF it_po OCCURS 0,
        ebeln LIKE ekko-ebeln,
        werks LIKE ekpo-werks,
        ebelp LIKE ekpo-ebelp,
        loekz LIKE ekpo-loekz,
        etenr LIKE eket-etenr,
        matnr LIKE ekpo-matnr,
        menge LIKE eket-menge,
        wemng LIKE eket-wemng,
      END OF it_po.
DATA: BEGIN OF it_po_2 OCCURS 0,
        matnr LIKE ekpo-matnr,
        werks LIKE ekpo-werks,
        ebeln LIKE ekko-ebeln,
        ebelp LIKE ekpo-ebelp,
        loekz LIKE ekpo-loekz,
        etenr LIKE eket-etenr,
        menge LIKE eket-menge,
        wemng LIKE eket-wemng,
      END OF it_po_2.
DATA: BEGIN OF it_po_pend OCCURS 0,
        matnr LIKE ekpo-matnr,
        werks LIKE ekpo-werks,
        pendi LIKE eket-menge,
      END OF it_po_pend.
DATA: BEGIN OF wa_join OCCURS 0,
        ebeln LIKE ekko-ebeln,
        werks LIKE ekpo-werks,
        ebelp LIKE ekpo-ebelp,
        loekz LIKE ekpo-loekz,
        etenr LIKE eket-etenr,
        matnr LIKE ekpo-matnr,
        menge LIKE eket-menge,
        wemng LIKE eket-wemng,
      END OF wa_join.
DATA : BEGIN OF itab_marc_mard OCCURS 0,
         werks  LIKE marc-werks,
         matnr  LIKE marc-matnr,
         eisbe  LIKE marc-eisbe,
       bstmi  LIKE marc-bstmi,
         bstrf  LIKE marc-bstrf,
         beskz  LIKE marc-beskz,
         sobsl  LIKE marc-sobsl,
         labst  LIKE mard-labst,
         menge  LIKE ekpo-menge,
         ordqty LIKE ekpo-menge,
       END OF itab_marc_mard.
DATA: BEGIN OF it_sto OCCURS 0,
      werks LIKE mard-werks,
      matnr LIKE mard-matnr,
      orqty LIKE ekpo-menge,
      eisbe LIKE marc-eisbe,
    bstmi LIKE marc-bstmi,
      bstrf LIKE marc-bstrf,
      beskz LIKE marc-beskz,
      sobsl LIKE marc-sobsl,
      labst LIKE mard-labst,
      pendi LIKE eket-menge,
      END OF it_sto.
DATA: ws_poheader            LIKE   bapimepoheader.
DATA: ws_poheaderx           LIKE   bapimepoheaderx .
DATA: ws_ebeln               TYPE   mepoheader-ebeln.
DATA: ws_posnr               LIKE   ekpo-ebelp.
DATA: ws_etenr               LIKE   eket-etenr VALUE '0001'.
DATA: ws_purchaseorder       LIKE   ekko-ebeln.
DATA: ws_flg1                TYPE   c. " VALUE 'X'.
DATA: ws_flg2                TYPE   c.
DATA: ws_flg3                TYPE   c.
*-- For Handling Error Messages in BAPI
DATA: tbl_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
*-- For Item Details
DATA: tbl_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: tbl_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: tbl_posched LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE.
DATA: tbl_poschedx LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE.
*&                       CONSTANTS
CONSTANTS:   ws_flg            TYPE   c   VALUE 'X'.
CONSTANTS:   c_unistruct(2)    TYPE   c   VALUE 'Z3'. "For UNISTRUCT STO
*&                      SELECTION-SCREEN
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_werks FOR t001w-werks,
              s_matnr FOR marc-matnr.                     " M01
                s_matnr FOR marc-matnr,                     " M01
                s_matkl FOR mara-matkl,                     " M01
                s_beskz FOR marc-beskz,
                s_sobsl FOR marc-sobsl.
PARAMETERS:     p_test  TYPE check.
SELECTION-SCREEN : END OF BLOCK b1.
*&                      START OF SELECTION EVENT
START-OF-SELECTION.
Get the Safety Stock & Minimum Lot Size for the materials
  PERFORM get_plant_data.
Get the Quantities in stock
  PERFORM get_stock_data.
Determine the open quantities for the materials concerned
[EKKO, EKET, EKPO]
  PERFORM get_open_quantities.
PERFORM open_quantities.
Determine overall the quantities required for each material
  PERFORM determine_mat_qty_required.
Print the details
  PERFORM print_details.
  IF p_test EQ space.
  PO is created for each plant.
  Create the PO required.
    PERFORM create_po.
  Create the PO's for each plant with the materials required
   PERFORM create_header_item.
  Bapi call to create a Purchase order
   PERFORM create_purhase_order.
  ENDIF.
END-OF-SELECTION.
TOP-OF-PAGE.
  PERFORM print_header.
*&      Form  get_plant_data
      To get the Safety Stock
-->  p1        text
<--  p2        text
FORM get_plant_data .
start                                                     " M01
SELECT      matnr werks eisbe bstmi
INTO TABLE  it_marc
FROM        marc
WHERE       matnr IN s_matnr AND
            werks IN s_werks AND
            eisbe GT 0.
end                                                       " M01
start                                                     " M01
  SELECT      marc~matnr werks eisbe bstrf beskz sobsl
                                                          " bstmi
  INTO TABLE  it_marc
  FROM        marc AS marc
  INNER JOIN  mara AS mara
  ON          maramatnr EQ marcmatnr
  WHERE       marc~matnr IN s_matnr AND
              werks      IN s_werks AND
              matkl      IN s_matkl AND
              beskz      IN s_beskz AND
              sobsl      IN s_sobsl AND
              eisbe      GT 0.
end                                                       " M01
ENDFORM.                    " get_plant_data
*&      Form  get_stock_data
     To get the Current Stock
-->  p1        text
<--  p2        text
FORM get_stock_data .
  DATA: BEGIN OF lt_mard OCCURS 0,
          matnr LIKE mard-matnr,
          werks LIKE mard-werks,
          lgort LIKE mard-lgort,
          labst LIKE mard-labst,
        END OF lt_mard.
  CHECK NOT it_marc[] IS INITIAL.
  SELECT      matnr werks lgort labst
  INTO TABLE  lt_mard
  FROM        mard
  FOR         ALL ENTRIES IN it_marc
  WHERE       matnr EQ it_marc-matnr AND
              werks EQ it_marc-werks.
  SORT lt_mard BY matnr werks.
  LOOP AT lt_mard.
    AT NEW werks.
      it_mard-matnr = lt_mard-matnr.
      it_mard-werks = lt_mard-werks.
    ENDAT.
    it_mard-labst = it_mard-labst + lt_mard-labst.
    AT END OF werks.
      APPEND it_mard.
      CLEAR  it_mard.
    ENDAT.
  ENDLOOP.
ENDFORM.                    " get_stock_data
*&      Form  open_quantities
      text
-->  p1        text
<--  p2        text
FORM open_quantities .
Storing MARC and MARD data in an internal table to find the open
quantities
  LOOP AT it_marc.
    itab_marc_mard-matnr = it_marc-matnr.
    itab_marc_mard-werks = it_marc-werks.
    itab_marc_mard-eisbe = it_marc-eisbe.
  itab_marc_mard-bstmi = it_marc-bstmi.
    itab_marc_mard-bstrf = it_marc-bstrf.
    itab_marc_mard-beskz = it_marc-beskz.
    itab_marc_mard-sobsl = it_marc-sobsl.
    READ TABLE it_mard WITH KEY matnr = it_marc-matnr.
    IF sy-subrc EQ 0.
      itab_marc_mard-labst = it_mard-labst.
    ENDIF.
    APPEND itab_marc_mard.
    CLEAR itab_marc_mard.
  ENDLOOP.
  CHECK NOT itab_marc_mard[] IS INITIAL.
Join EKKO EKPO
  SELECT a~ebeln
         b~ebelp
         b~werks
         b~matnr
         b~menge
         c~etenr
         c~wamng
         INTO CORRESPONDING FIELDS OF TABLE it_po
  FROM ekpo AS b
  INNER JOIN ekko AS a
  ON aebeln = bebeln
  INNER JOIN eket AS c
  ON bebeln = cebeln AND bebelp = cebelp
  FOR ALL ENTRIES IN itab_marc_mard
  WHERE b~matnr = itab_marc_mard-matnr AND
        b~werks IN s_werks .
  DATA : t_menge TYPE ekpo-menge . "local variable
*Store the contents of it_po to the work area to get the minimum order
*quantity
  wa_join[] = it_po[].
  LOOP AT it_po.
delete the entries where MENGE = WAMNG
    DELETE it_po WHERE menge = it_po-wemng.
    LOOP AT wa_join WHERE matnr = it_po-matnr
                           AND werks = it_po-werks.
      t_menge = t_menge + wa_join-menge.
    ENDLOOP.
    it_po-menge = t_menge.
    MODIFY TABLE it_po TRANSPORTING menge.
    CLEAR  :t_menge.
  ENDLOOP.
Once you get the quantities delete the repeating materials for the
plant.
  DELETE ADJACENT DUPLICATES FROM it_po COMPARING werks matnr.
  SORT it_po BY matnr.
  LOOP AT itab_marc_mard.
    READ TABLE it_po WITH KEY matnr = itab_marc_mard-matnr
        APPEND it_sto.
    ELSE.
      WRITE:/ 'There are no open quantities to create Purchase order'.
    ENDIF.
    CLEAR it_sto.
  ENDLOOP.                         werks = itab_marc_mard-werks BINARY
SEARCH.
    itab_marc_mard-ordqty = itab_marc_mard-labst + it_po-menge .
     If Open quantiy + Current Stock < Safety Stock
    IF itab_marc_mard-ordqty LE itab_marc_mard-eisbe.
     Minimum order qty = Safety Stock - (Open qty + current stock)
      itab_marc_mard-ordqty = itab_marc_mard-eisbe - ( it_po-menge +
itab_marc_mard-labst )  .
       Move all the contents to the internal table it_sto ie Plant,
Material and the Min Order Qty
       so that we can create PO based on this internal table
      it_sto-matnr = itab_marc_mard-matnr.
      it_sto-werks = itab_marc_mard-werks.
      it_sto-orqty = itab_marc_mard-ordqty.
ENDFORM.                    " open_quantities
*&      Form  CREATE_HEADER_ITEM
      text
FORM create_header_item.
  LOOP AT it_sto.
*--- Document date with flag
    ws_poheader-doc_date             = sy-datum.
    ws_poheaderx-doc_date            = ws_flg.
*--- Document type with flag
    ws_poheader-doc_type             = 'Z3'(c01).
    ws_poheaderx-doc_type            = ws_flg.
*--- Purchasing group with Flag
    ws_poheader-pur_group            = '005'.   " hardcoded
    ws_poheaderx-pur_group           =  ws_flg.
*--- Purchasing Organization with flag
    ws_poheader-purch_org            = '2000'.
    ws_poheaderx-purch_org           = ws_flg.
*--- Supply plant with flag
    ws_poheader-suppl_plnt           = '2000'.
    ws_poheaderx-suppl_plnt          = ws_flg.
*--- Company Code with flag
    ws_poheader-comp_code            = '2000'.
    ws_poheaderx-comp_code           = ws_flg.
*<--- assinging new item No.
    ws_posnr = ws_posnr + 10.
*POPULATE ITEM DATA.
    tbl_poitem-po_item                 = ws_posnr.
    tbl_poitem-material                = it_sto-matnr.
    tbl_poitem-item_cat                = 'U'(c02).
    tbl_poitem-plant                   = it_sto-werks.
    tbl_poitem-quantity                = it_sto-orqty.
    APPEND tbl_poitem.
    CLEAR  tbl_poitem.
*POPULATE ITEM FLAG TABLE
    tbl_poitemx-po_item                = ws_posnr.
    tbl_poitemx-po_itemx               = ws_flg.
    tbl_poitemx-material               = ws_flg.
    tbl_poitemx-plant                  = ws_flg.
    tbl_poitemx-item_cat               = ws_flg.
    tbl_poitemx-quantity               = ws_flg.
    APPEND tbl_poitemx.
    CLEAR  tbl_poitemx.
  ENDLOOP.
ENDFORM.                    "CREATE_PO
*&      Form
      text
-->  p1        text
<--  p2        text
FORM create_purhase_order .
  CLEAR:  tbl_poitem,
          tbl_poitemx,
          ws_poheader,
          ws_poheaderx.
  REFRESH:  tbl_poitem,
            tbl_poitemx.
  CLEAR  : tbl_return.
  REFRESH: tbl_return.
*<--- Bapi to create Purchase order
  IF NOT tbl_poitem[] IS INITIAL.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        poheader         = ws_poheader
        poheaderx        = ws_poheaderx
      IMPORTING
        exppurchaseorder = ws_purchaseorder
      TABLES
        return           = tbl_return
        poitem           = tbl_poitem
        poitemx          = tbl_poitemx.
    READ TABLE tbl_return WITH KEY type = 'E'.
*<--- Bapi to commit the changes
    IF sy-subrc <> 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
  ENDIF.
  LOOP AT tbl_return.
*<--- Ignore the warning messages
    IF tbl_return-type = 'W'.
      CONTINUE.
    ENDIF.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    IF tbl_return-type = 'S'.
      FORMAT COLOR COL_POSITIVE ON.
    ELSEIF tbl_return-type = 'W'.
      FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
    ELSEIF tbl_return-type = 'E'.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED OFF.
    ENDIF.
    WRITE:/3 tbl_return-type,12 tbl_return-id,20(85)  tbl_return-message
           86(10) tbl_return-field,95(20) tbl_return-system.
    FORMAT COLOR OFF.
  ENDLOOP.
ENDFORM.                    " create_purhase_order
*&      Form  get_open_quantities
      text
-->  p1        text
<--  p2        text
FORM get_open_quantities .
  CHECK NOT it_mard[] IS INITIAL.
  SELECT      ekkoebeln ekpoebelp ekpowerks ekpomatnr
              ekpomenge eketetenr eket~wemng
              INTO CORRESPONDING FIELDS OF TABLE it_po
  FROM        ekko AS ekko
  INNER JOIN  ekpo AS ekpo
  ON          ekpoebeln EQ ekkoebeln
  INNER JOIN  eket AS eket
  ON          eketebeln EQ ekpoebeln AND
              eketebelp EQ ekpoebelp
  FOR         ALL ENTRIES IN it_mard
  WHERE       ekko~bstyp EQ 'F'             AND
              ekko~bsart EQ 'Z3'            AND
              ekko~bsakz EQ 'T'             AND
              ekko~loekz EQ space           AND
              ekpo~matnr EQ it_mard-matnr   AND
              ekpo~werks EQ it_mard-werks   AND
              ekpo~loekz EQ space           AND
              ekpo~elikz EQ space.
  SORT it_po BY ebeln ebelp etenr.
delete entries where the schedule is complete, else copy to new table
  LOOP AT it_po.
    IF it_po-wemng GE it_po-menge.
      DELETE it_po.
    ELSE.
      MOVE-CORRESPONDING it_po TO it_po_2.
      APPEND it_po_2.
      CLEAR  it_po_2.
    ENDIF.
  ENDLOOP.
  SORT it_po_2 BY matnr werks.
To determine the pending quantities of the materials at plant level
  LOOP AT it_po_2.
    AT NEW werks.
      it_po_pend-matnr = it_po_2-matnr.
      it_po_pend-werks = it_po_2-werks.
    ENDAT.
    it_po_pend-pendi = it_po_pend-pendi + it_po_2-menge - it_po_2-wemng.
    AT END OF werks.
      APPEND it_po_pend.
      CLEAR  it_po_pend.
    ENDAT.
  ENDLOOP.
ENDFORM.                    " get_open_quantities
*&      Form  determine_mat_qty_required
      text
-->  p1        text
<--  p2        text
FORM determine_mat_qty_required .
  DATA: lv_eisbe LIKE marc-eisbe,
        lv_labst LIKE mard-labst,
        lv_menge LIKE eket-menge,
      lv_bstmi_old LIKE marc-bstmi,
        lv_bstrf_old LIKE marc-bstrf,
        lv_beskz_old LIKE marc-beskz,
        lv_sobsl_old LIKE marc-sobsl,
        lv_pendi LIKE eket-menge,
        lv_total_conf     LIKE ekpo-menge,
      lv_bstmi          LIKE marc-bstmi,
      lv_min_qty        LIKE marc-bstmi,
        lv_bstrf          LIKE marc-bstrf,
        lv_min_qty        LIKE marc-bstrf,
        lv_qty_req        LIKE mard-labst,
        lv_remainder      TYPE i.
  LOOP AT it_marc.
  safety stock
    lv_eisbe = it_marc-eisbe.
   lv_bstmi_old = it_marc-bstmi.
     lv_bstrf_old = it_marc-bstrf.
     lv_beskz_old = it_marc-beskz.
     lv_sobsl_old = it_marc-beskz.
    READ TABLE it_mard
    WITH KEY matnr = it_marc-matnr
             werks = it_marc-werks
             BINARY SEARCH.
    IF sy-subrc EQ 0.
    qty onhand
      lv_labst = it_mard-labst.
    ELSE.
      CLEAR lv_labst.
    ENDIF.
    READ TABLE it_po_pend
    WITH KEY matnr = it_marc-matnr
             werks = it_marc-werks
             BINARY SEARCH.
    IF sy-subrc EQ 0.
    PO pending qty
      lv_pendi = it_po_pend-pendi.
    ELSE.
      CLEAR lv_pendi.
    ENDIF.
  Total qty on hand & PO qty pending
    lv_total_conf = lv_labst + lv_pendi.
  Now determine if a PO is required for the material concerned.
    IF lv_total_conf < lv_eisbe.
      it_sto-matnr = it_marc-matnr.
      it_sto-werks = it_marc-werks.
      it_sto-eisbe = lv_eisbe.
    it_sto-bstmi = lv_bstmi_old.
      it_sto-bstrf = lv_bstrf_old.
      it_sto-beskz = lv_beskz_old.
      it_sto-sobsl = lv_sobsl_old.
      it_sto-labst = lv_labst.
      it_sto-pendi = lv_pendi.
    Actual Qty Required
      lv_qty_req = lv_eisbe - lv_total_conf.
     IF it_marc-bstmi IS INITIAL.
       IF it_marc-bstrf IS INITIAL.
        it_sto-orqty = lv_qty_req.
      ELSE.
       lv_bstmi = it_marc-bstmi.
       lv_min_qty = it_marc-bstmi.
         lv_bstrf = it_marc-bstrf.
         lv_min_qty = it_marc-bstrf.
        DO.
          IF lv_qty_req <= lv_min_qty.
            lv_qty_req = lv_min_qty.
            it_sto-orqty = lv_qty_req.
            EXIT.
          ELSE.
           lv_min_qty = lv_min_qty + lv_bstmi.
             lv_min_qty = lv_min_qty + lv_bstrf.
          ENDIF.
        ENDDO.
      ENDIF.
      APPEND it_sto.
      CLEAR  it_sto.
    ENDIF.
  ENDLOOP.
  SORT it_sto BY werks matnr.
ENDFORM.                    " determine_mat_qty_required
*&      Form  print_details
      text
-->  p1        text
<--  p2        text
FORM print_details .
  LOOP AT it_sto.
    WRITE:/ it_sto-werks UNDER text-h01,
            it_sto-matnr UNDER text-h02,
            it_sto-orqty UNDER text-h03,
            it_sto-eisbe UNDER text-h04,
          it_sto-bstmi UNDER text-h05,
            it_sto-bstrf UNDER text-h05,
            it_sto-labst UNDER text-h06,
            it_sto-pendi UNDER text-h07.
  ENDLOOP.
ENDFORM.                    " print_details
*&      Form  print_header
      text
-->  p1        text
<--  p2        text
FORM print_header .
  WRITE:  AT 001 text-h01,
             015 text-h02,
           030 text-h03,
           050 text-h04,
           070 text-h05,
           090 text-h06,
           110 text-h07.
             030 text-h03 RIGHT-JUSTIFIED,
             050 text-h04 RIGHT-JUSTIFIED,
             070 text-h05 RIGHT-JUSTIFIED,
             090 text-h06 RIGHT-JUSTIFIED,
             110 text-h07 RIGHT-JUSTIFIED.
  NEW-LINE.
ENDFORM.                    " print_header
*&      Form  create_po
      text
-->  p1        text
<--  p2        text
FORM create_po .
*-Document date with flag
  ws_poheader-doc_date             = sy-datum.
  ws_poheaderx-doc_date            = ws_flg.
*-Document type with flag
  ws_poheader-doc_type             = 'Z3'(c01).
  ws_poheaderx-doc_type            = ws_flg.
*-Purchasing group with Flag
  ws_poheader-pur_group            = '005'.   " hardcoded
  ws_poheaderx-pur_group           =  ws_flg.
*-Purchasing Organization with flag
  ws_poheader-purch_org            = '2000'.
  ws_poheaderx-purch_org           = ws_flg.
*-Supply plant with flag
  ws_poheader-suppl_plnt           = '2000'.
  ws_poheaderx-suppl_plnt          = ws_flg.
*-Company Code with flag
  ws_poheader-comp_code            = '2000'.
  ws_poheaderx-comp_code           = ws_flg.
  LOOP AT it_sto.
    AT NEW werks.
      CLEAR  tbl_poitem.
      CLEAR  tbl_poitemx.
      CLEAR  tbl_return.
      CLEAR  tbl_posched.
      CLEAR  tbl_poschedx.
      REFRESH tbl_poitem.
      REFRESH tbl_poitemx.
      REFRESH tbl_return.
      REFRESH tbl_posched.
      REFRESH tbl_poschedx.
      CLEAR ws_posnr.
    ENDAT.
    ws_posnr = ws_posnr + 10.
  Item Data
    tbl_poitem-po_item                 = ws_posnr.
    tbl_poitem-material                = it_sto-matnr.
    tbl_poitem-item_cat                = 'U'(c02).
    tbl_poitem-plant                   = it_sto-werks.
    tbl_poitem-quantity                = it_sto-orqty.
    APPEND tbl_poitem.
    CLEAR  tbl_poitem.
  Item X Data
    tbl_poitemx-po_item                = ws_posnr.
    tbl_poitemx-po_itemx               = ws_flg.
    tbl_poitemx-material               = ws_flg.
    tbl_poitemx-plant                  = ws_flg.
    tbl_poitemx-item_cat               = ws_flg.
    tbl_poitemx-quantity               = ws_flg.
    APPEND tbl_poitemx.
    CLEAR  tbl_poitemx.
  Schedule Data
    tbl_posched-po_item = ws_posnr.
    tbl_posched-sched_line = '0001'.
    tbl_posched-delivery_date = sy-datum.
    tbl_posched-quantity = it_sto-orqty.
    APPEND tbl_posched.
    CLEAR  tbl_posched.
  Schedule Data X
    tbl_poschedx-po_item = ws_posnr.
    tbl_poschedx-po_itemx = ws_flg.
    tbl_poschedx-sched_line = '0001'.
    tbl_poschedx-sched_linex = ws_flg.
    tbl_poschedx-delivery_date = ws_flg.
    tbl_poschedx-quantity = ws_flg.
    APPEND tbl_poschedx.
    CLEAR  tbl_poschedx.
    AT END OF werks.
    Create the PO
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader         = ws_poheader
          poheaderx        = ws_poheaderx
        IMPORTING
          exppurchaseorder = ws_purchaseorder
        TABLES
          return           = tbl_return
          poitem           = tbl_poitem
          poitemx          = tbl_poitemx
          poschedule       = tbl_posched
          poschedulex      = tbl_poschedx.
      LOOP AT tbl_return WHERE type EQ 'E' OR type EQ 'A'.
        EXIT.
      ENDLOOP.
    If Loop is false - then no error occurred
      IF sy-subrc NE 0.
      No Errors - Commit
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      ENDIF.
      SKIP.
      LOOP AT tbl_return.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        IF tbl_return-type = 'E' OR tbl_return-type = 'A'.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED OFF.
        ELSEIF tbl_return-type = 'W'.
          FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
        ELSE.
          FORMAT COLOR COL_POSITIVE ON.
        ENDIF.
        WRITE:/3 tbl_return-type,12 tbl_return-id,20(85)
tbl_return-message,
               86(10) tbl_return-field,95(20) tbl_return-system.
        FORMAT COLOR OFF.
      ENDLOOP.
    ENDAT.
  ENDLOOP.
ENDFORM.                    " create_po

Hi,
first you can store these 2 dates into some internal table sat it_sobid  and it_ObjectID.Now
sort  it_sobid ascending.
loop at  it_ObjectID.
Read date from  it_sobid  binary search index sy-index.
it_ObjectID-date =  it_sobid-date.
flag = 'y'.
endloop.
you can write some logic like this. Its just a rough idea you can modify according to ur need.
Regards,
Ravi

Similar Messages

  • Need ABAP help for the logic in C_T_DATA

    Hi
    I have a scenario where I need to write ABAP in CMOD for the c_t_data which  appears as below:
    St Dt(sobid)    Enddt(sobid)    Sobid    ObjectID   St Dt(ObjectID)     Enddt(ObjectID)
    21.08.09            27.08.09         34567    40001        23..09.09                 29.09.09
    21.08.09            27.08.09         34567    40002        24..09.09                 29.09.09
    21.08.09            27.08.09         34567    40003        25..09.09                 29.09.09
    21.08.09            27.08.09         34567    40004        26..09.09                 29.09.09
    21.08.09            27.08.09         34567    40005        27..09.09                 29.09.09
    I need to compare all the Start dates of the object ID for every  Sobid with the start date of  Sobid field  and need to set the flag if any of the start dates of  object id is different from the Sobid Start date.
    Please advise what would be the best way to write the ABAP.
    Thanks in advance.

    Hi,
    first you can store these 2 dates into some internal table sat it_sobid  and it_ObjectID.Now
    sort  it_sobid ascending.
    loop at  it_ObjectID.
    Read date from  it_sobid  binary search index sy-index.
    it_ObjectID-date =  it_sobid-date.
    flag = 'y'.
    endloop.
    you can write some logic like this. Its just a rough idea you can modify according to ur need.
    Regards,
    Ravi

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • Need urgently help for OBIEE Installation (11g)

    Hi all,
    I am having problems trying to install Oracle Business Intelligence 11g on Windows 7.
    The Installation Wizard hangs on the step: Domain Configuration (0%). The Creating Domain shows In progress.
    The log under the Inventory directory shows me only following:
    INFO: Ending the inventory Session
    INFO: Using an existing InstallAreaControl for this Inventory Session with existing access level 1
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    INFO: The ORACLE_CONFIG_HOME env var is set to
    I really don't know what to do. I am searching for a solution on Internet, but I don't find it.
    I need urgently help. I would appreciate someone could help me.
    We can do together via Webex or something similar. It doesnt worth it for me to type here and wait till someone give me an answer (if any), trying to find out how I did.
    I hope to find the help I need. I am desperated :-(

    Can I install the OBIEE 10g version?I am not sure but i think OBIEE is not certified with windows 7. i could not find any MOS doc confirming same. Please log a call with oracle to confirm this.
    would it work fine with the Oracle Database 11g and the RCUs?. Yes OBIEE 10g will work with oracle database 11g.
    Thanks,
    JD

  • Needed urgent help for user creation in security manager in ODI 11g

    Hi Gurus,
    I have an urgent requirement in ODI security manager and i am completely helpless. We need specific steps for the user creation with sufficient priviledges. The detailed requirements are:
    1. There is a group of users under the framework team and these users should be able to edit the Knowledge modules only. All other objects (e.g. projects, interface, procedures or development related objects) should only be in read only mode for them.
    2. There is a group of users under the development team. The priviledges of these users should be mutually exclusive to that of the framework team users. i.e. the development team should be able to edit or delete all development related objects (e.g. projects, interface, proc etc.) but the knowledge modules should only be in read only mode for them.
    Now I will explain what i have tried out:
    I am working on ODI 11.1.1.5.
    I have created a user with NG DESIGNER and CONNECT profile. Dragged and dropped all the projects on the user and selected all methods in all repositories (check sign). However when i connect with that user i cannot open the KMs (as far as development team is concerned its fine) but i can also not open interfaces as well as procedures (which is not acceptable from development point of view).
    Also when i tried creating a user from the framework team point of view i could not see any option related to KMs (To give edit priviledge).
    Please help me out guys. I have also searched oracle documentation and believe me the security manager section is not very good. If you guys can help me out with specific steps it would be great (I have tried the hints given in oracle documentation and they dont work, the ODI security manager behaves strangely :-(
    Thanks in advance,
    SB

    Similar requirement here guys. Any pointers. I was able to achieve this by restricting development user from supervisor access. In that case the development user can not edit the interfaces. Any known defefct?

  • Need urgent Help for Kernel upgrade......

    Hi Gurus,
    I have recently upgraded SAP kernel from  Release 6.40 Patch 109 to Release 6.40 Patch 175. My System is SAP ERP Central Component 5.0 and Release is 6.40 and Kernel Stataus is showing below details:
    Kernel release    640
    Compilation       SunOS 5.8 G
    Patch Level       175
    ABAP Load         1521
    CUA load          16
    Mode              opt
    ~
    I have total 8 Application servers. today I have genereated EWA report and in that report, for SAP kernel section it has reported that <b>"You are running different SAP kernel releases on your instances. This situation may lead to severe problems and is not supported by SAP.
    Recommendation: Use only one kernel release for all instances."</b>
    Actaully I have updated kernel in my central instance (/sapmnt/<SID>/exe) and this directory is NFS mount in all the application server. So I am not sure why the SAP EWA is repoting this that you are running difference SAP Kerenl release.
    If this is correct then how to rectify it ? what action I need to take to resolve this ?
    Appreciate your help.
    Thanks & Regards
    Basis

    I will plan to do that as early as possible. Even I
    am going to write to SAP to release that note in
    english for better understanding.
    yes - that note should be translated giving the importance.
    My question is: Am I on HIGH ALERT for this issue ?
    Since it is production server, will it going to
    affect my system in any aspect ??
    No, you will just see a slightly higher usage of "nfsd" when you start the application servers for the first time since they will all copy parts of the kernel locally.
    2nd thing, This is applicable only to NW ? Because I
    have upgraded SAP Kernel to Patch 175 to other R/3
    system having more application server, but I didn't
    get this comment in my EWA report ?
    The comment isn´t related to to usage of sapcpe. The comment means, that you have at least one application server, that uses local binaries with a different patchlevel instead of those on the central instance. I would consider that more critical. Maybe you installed one of the servers later and used a newer installation CD set which creates that new structure for using sapcpe by default... don´t know, just a guess. To check, go to SM51 and select each server and press on "Release Information", you will see which one is affected.
    This week I am planning to upgrade kernel for 4.6D
    release to Patch 2307. Will this be gona issue for
    that also ?
    Kernels lower than 6.10 use a different approach (the "ctrun directory" mentioned in that note) - technically it´s the same. The installation guides for 4.6c should tell you how to set that up.
    Markus

  • I need urgent help with the GPS

    i've ask my family to buy Nokia n 97 from syria,while i live in cyprus,how ever i got the phone with a card inside the box says:
    this nokia device has been specially designed and manufactured for this market.the satandard GPS features have been disabled in accordance with market regulations.
    im using this mobile for the second day,i can't send it back to syria and i don't know what to do,i can't connect with the gps system in cyprus and i can't connect with the internet,please help me to find a way to enable the GPS system in my phone.
    THanks a lot

    As I explained in an earlier post, you WILL NOT be able to do it yourself.
    If the hardware is just disabled (the error message may be misleading), a Nokia service point may be able to reactivate it, though you'd have to pay because the phone only has warranty in Syria and because this wouldn't be a warranty fix anyway.
    If the hardware is removed, then you are more than likely stuck.

  • Need urgent Help for setting up iCal Server

    I will move the iCal portion here, maybe I will get some help.
    Okay first my setup:
    Two XServe with the latest 10.5 (one is the backup)
    Six Mac Pros with Leopard
    Three Macbook Pros with Snow Leopard
    All Macs are on an Windows 2003 Active Directory network. Also we have our accounts locally (on each workstation and laptop).
    *So I have installed the advanced settings for the Server OS.
    *Created a account for every user on the server
    *The FTP, Web (for the local webpage), Open Directory and iCal services are on. (iCal would only activate with Open Directory service??)
    *The iCal server destination (for the calendars) are on a separate drive with +Ignore Permissions+
    Still can not link a account through iCal with the server!
    Could somebody give me a walkthrough how to setup the iCal server?
    Oh yeah another issue I had I can't get the calendaring checkbox in the user account to stick! Is this just a bug?

    Hi Umesh,
    I would not use the repository on a database that was cloned. In my experience this leads to problems.
    A better way is to clone the database and then create a new repository on the clone:
    1. export the repository on the windows server to an mdl file
    2. unregister all target users on solaris
    3. drop the repository on solarais
    4. create a new repository on solaris
    5. Import the data from the mdl file you exported in step 1
    6. register target users
    7. configure and register the locations
    This way requires some manual work, but I do not see another way.
    Regards,
    Carsten.

  • NEED Urgent help from the group re: comparing 2 columns thru EXCEL VBA

    Hi there,
    I'm a newbie in vba programming and wld appreciate so much for any advice on how to program my daily task in the ofc.
    In Excel, how to compare and match data of 2 columns that will return TRUE (means there's a match) or FALSE (if no match)
    If TRUE, returns the same value on column B
    if FALSE, column B will be blank (and vice versa)
    EXAMPLE:
    Column1 :  GROUP1
    Column2 :  GROUP2
    GROUP1     GROUP2
    ana     ana
    gloria     gloria
    sofia     grace
    grace     celine
    mona     jackie
    jackie     flor
    eve     eve
    RESULT:
    COLUMN1:  GROUP2
    COLUMN2:  COMPARISON
    COLUMN3:  GROUP2
    GROUP1        COMPARISON     GROUP2
    ana             TRUE       ana
    gloria             TRUE       gloria
    sofia             FALSE     
    grace             TRUE       grace
    mona             FALSE     
                 FALSE       celine
    jackie             TRUE       jackie
                 FALSE       flor
    eve             TRUE       eve
    Thank you so v much for your time....

    Myles, the comparison in excel is pretty simple..
    See below
    group1     group2     Result
    ana     ana     true
    gloria     gloria     true
    sofia     grace     false
    grace     celine     false
    mona     jackie     false
    jackie     flor     false
    eve     eva     false
    In the Result Column have a formula set up and copy the formula for the entire column to be compared :eg To compare B30 and C30 =>  =IF(B30=C30,"true","false")
    HTH

  • Hi friends need your help for the following !

    How to populate an idoc type.
    Is it only by writting a report program like
    "master idoc distribute"  or also by NACE.
    When i am using NACE then i must have the baic idoc type cretaed  with ALE configured ??

    Hi,
      It is not always by using NACE. If ur making use of standard IDOC types Like
    ORDERS05
    MATMAS06
    DEBMAS etc for the salesorder and purchase orders etc then u can go for the
    T.codes : BD10 for MATMAS05,
                   BD12 for CREMAS06,
                   BD14 for DEBMAS04 for the MM01, VD01 and MK01/XK01  T.codes Respectively.
    If u r dealing with NACE then u should know the basic idoc for which u r using NACE and Messgae type .
    There u will cofigure and assign the OUTPUTYPE and assign those outputtype to the respective T.code.
    Regards.

  • Need urgent help with the query - Beginer

    Hello - I need help with a query to populate data in a table.Here is the scenario.
    Source1
    MnthID BranchCod CustID SegCode FXStatus ProfStatus Profit
    200712 B1 C1 20 Y Y 100
    Source2
    MnthID BranchCod CustID ProdCode ProdIndex
    200712 B1 C1 12 1
    200712 B1 C2 12 0
    Destination
    MnthID BranchCod SegCode ProdCode CountSegCust CountProdCust ProfitProdCust
    Condition and Calculations:
    1)Source1 customer are base customers.If Source2 has customers who is not in source1 then that customer's record should not be fetched.
    2)SegCode, FX Status, ProfStatus is one variable in destination table. [ SegCode = SegCode+ FXStatus (if FXStatus = Y)+ ProfStatus (if FXStatus = Y) ]
    3)CountSegCust = CountCustID Groupby MnthID,BranchCod,SegCode Only.
    4)CountProdCust = CountCustID Groupby MnthID,BranchCod,SegCode,ProdCode (when ProdIndex = 1)
    5)ProfitProdCust = Sum of Profit of Customers Groupby MnthID,BranchCod,SegCode,ProdCode (when ProdIndex = 1)
    Apologies for bad formatting.
    Thanks in advance!!

    A total guess indeed.
    It's not clear whether some aggregation can be done (summing counts of grouped data might cause some customers being counted more than once)
    insert into destination
    select mnthid,branchcod,segcode,prodcode,countsegcust,countprodcust,profitprodcust
      from (select s1.mnthid,
                   s1.branchcod,
                   s1.segcode || case s1.fxstatus when 'Y' then s1.fxstatus || s1.profstatus end segcode,
                   s2.prodcode,
                   count(s1.custid) over (partition by s1.mnthid,
                                                       s1.branchcod,
                                                       s1.segcode || case s1.fxstatus when 'Y' then s1.fxstatus || s1.profstatus end
                                              order by null
                                         ) countsegcust,
                   count(case proindex when 1
                                       then custid
                         end
                        ) over (partition by s1.mnthid,
                                             s1.branchcod,
                                             s1.segcode || case s1.fxstatus when 'Y' then s1.fxstatus || s1.profstatus end
                                             s2.prodcode
                                    order by null
                               ) countprodcust,
                   sum(case proindex when 1
                                     then profit
                       end
                      ) over (partition by s1.mnthid,
                                           s1.branchcod,
                                           s1.segcode || case s1.fxstatus when 'Y' then s1.fxstatus || s1.profstatus end
                                           s2.prodcode
                                  order by null
                             ) profitprodcust,
                   row_number() over (partition by s1.mnthid,
                                                   s1.branchcod,
                                                   s1.segcode || case s1.fxstatus when 'Y' then s1.fxstatus || s1.profstatus end
                                                   s2.prodcode
                                          order by null
                                     ) the_row
              from source1 s1,source2 s2
             where s1.mnthid = s2.mnthid
               and s1.branchcod = s2.branchcod
               and s1.custid = s2.custid
    where the_row = 1Regards
    Etbin

  • Need Urgent help on the HR ABAP

    Hi Gurus;
                  I am new to the HR ABAP, i need some material so that i can build up my concepts in this area.
    Thanks

    Hi,Check the following links :
    http://www.esnips.com/_t_/abaphttp://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.sap-img.com
    Also have a look at the following links-
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://planetsap.com/index.htm
    http://www.atomhr.com/library_full.htm
    http://www.sap-basis-abap.com/saphr.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/60/d8d8c7576311d189270000e8322f96/frameset.htm
    http://www.sapfriends.com/sapstuff.html
    http://www.atomhr.com/know_preview/Reading_Payroll_Results_with_ABAP.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Payroll
    http://www.sap-press.com/product.cfm?account=&product=H967
    http://www.sapdevelopment.co.uk/hr/payres_abap.htm
    http://www.sapdevelopment.co.uk/hr/payres_tcode.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    you can see some Standard Program examples in this one..
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    These are the FAQ's that might helps you
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.sapgenie.com/sapfunc/index.htm
    http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm
    http://www.sap-img.com/hr021.htm
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sap-img.com/human/finding-the-list-of-hr-module-tables.htm
    Check this thread :
    ABAP HR Tutorials
    /message/322224#322224 [original link is broken]
    reward If Found Helpful

  • Need urgent help for solving issue with my audio output.

    It seems that all of sudden my integrated speakers started to make buzzing sound for a minute of a sec. and the sound comes randomly only during playback.  Same thing also happens even on headphone. So any suggestions? Why it is happening?? 

    Hi
    Try to update the driver from hp.com website for Audio & Bios.
    Last step is to run a recovery on the unit before this please back up your data as it will be lost.
    If still does not work speaker on the unit has gone bad needs to be replaced.
    If your notebook is still under warranty, contact HP and arrange to have the speaker replaced.
    Let us know how it goes!
    *Although I am an HP employee, I am speaking for myself and not for HP.
    ****Click the White Kudos star to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • Need urgent help for (Message file sp1 lang .msb not found)

    sir
    c:\oracle9i this is my database folder name
    c:\oraform this is my form folder name
    which one my oracle_home name
    sir i test this command
    c:\ set ORACLE_HOME=c:\ORACLE9I
    c:\ set ORACLE_SID=AAMIR
    c:\ sqlplus / as sysdba
    AND RUN SQL PLUS THEN SYSTEM GIVE ME THIS ERROR
    incorrect environment variable plus_dflt program execution error
    please give me idea how i run my system
    thank

    Duplicate post:
    ''Urgent'' incorrect environment variable plus_dflt program execution erro

  • Need urgent help with Ifs1.1 on Solaris

    We have installed IFS 1.1 with Oracle 8.1.7 on a three tier System (two Suns). We use JWS as WebServer. When we start IFS and JWS everything seems to work fine. But after some time (irregulary) we are not able to contact the JSP-Sites via a bowser. After restarting JWS, everything works fine for some time.
    Sometimes it happens (about one times a day), that the whole JWS crashes (JWS-Admin doesn't work). So we have to restart the whole IFS.
    What can be the problem? We need urgent help, because the deadline for our project is Wednesday.
    By the way:
    Where do I have to start CTX on the IFS- or the Oracle-Side?
    null

    Yes, we tried the Oracle HTTP - Server, but we weren4t able to get it to work. We didn4t get our JSP-Files to work with it. But that is another issue. I think it4s not a problem of JWS, but IFS.
    Additionally it is strange, that we are still able to connect to the database via SqlPlus.
    IFS works fine for about 15 minutes, than it crashes, nothing works anymore. We found following errors in the IfsAgents.log:
    maybe it can help?!
    Mon Dec 04 23:12:20 CET 2000
    Server STARTED: IfsAgents(19944) not managed
    Attempting to load agent EventExchangerAgent
    Agent EventExchangerAgent loaded
    Server STARTED: IfsProtocols(19945) not managed
    Attempting to start agent EventExchangerAgent
    EventExchangerAgent: Start request
    Agent EventExchangerAgent started
    Attempting to load agent ExpirationAgent
    Agent ExpirationAgent loaded
    EventExchangerAgent: starting timer
    Attempting to start agent ExpirationAgent
    ExpirationAgent: Start request
    Agent ExpirationAgent started
    Attempting to load agent GarbageCollectionAgent
    Agent GarbageCollectionAgent loaded
    ExpirationAgent: computed initial delay (in ms) is: 10024504
    ExpirationAgent: starting timer
    Attempting to start agent GarbageCollectionAgent
    GarbageCollectionAgent: Start request
    Agent GarbageCollectionAgent started
    Attempting to load agent ContentGarbageCollectionAgent
    Agent ContentGarbageCollectionAgent loaded
    GarbageCollectionAgent: computed initial delay (in ms) is: 11816890
    GarbageCollectionAgent: starting timer
    Attempting to start agent ContentGarbageCollectionAgent
    ContentGarbageCollectionAgent: Start request
    Agent ContentGarbageCollectionAgent started
    Attempting to load agent DanglingObjectAVCleanupAgent
    Agent DanglingObjectAVCleanupAgent loaded
    ContentGarbageCollectionAgent: starting timer
    Attempting to start agent DanglingObjectAVCleanupAgent
    DanglingObjectAVCleanupAgent: Start request
    Agent DanglingObjectAVCleanupAgent started
    Attempting to load agent OutboxAgent
    Agent OutboxAgent loaded
    DanglingObjectAVCleanupAgent: computed initial delay (in ms) is: 5500105
    DanglingObjectAVCleanupAgent: starting timer
    Attempting to start agent OutboxAgent
    OutboxAgent: Start request
    Agent OutboxAgent started
    Attempting to load agent ServiceWatchdogAgent
    Agent ServiceWatchdogAgent loaded
    OutboxAgent: Done processing
    Attempting to start agent ServiceWatchdogAgent
    ServiceWatchdogAgent: Start request
    Agent ServiceWatchdogAgent started
    Attempting to load agent QuotaAgent
    Agent QuotaAgent loaded
    ServiceWatchdogAgent: Initializing ServerWatchdogTable with 9 entries
    ServiceWatchdogAgent: starting timer
    Server STARTED: FtpServer(20082) managed by IfsProtocols(19945)
    ServiceWatchdogAgent: New Server being watchdogged
    Attempting to start agent QuotaAgent
    QuotaAgent: Start request
    Agent QuotaAgent started
    QuotaAgent: starting timer
    Server STARTED: CupServer(20124) managed by IfsProtocols(19945)
    ServiceWatchdogAgent: New Server being watchdogged
    Server STARTED: ImapServer(20130) managed by IfsProtocols(19945)
    ServiceWatchdogAgent: New Server being watchdogged
    Server STARTED: SmtpServer(20150) managed by IfsProtocols(19945)
    ServiceWatchdogAgent: New Server being watchdogged
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server Detected in checkServer
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Unlocked Server being investigated
    ServiceWatchdogAgent: Freeing unlocked server 19687
    ServiceWatchdogAgent: Freeing unlocked server 19666
    Server STOPPED: CupServer(19687) managed by IfsProtocols(19519)
    ServiceWatchdogAgent: Freeing unlocked server 19723
    ServiceWatchdogAgent: Freeing unlocked server 19520
    Server STOPPED: FtpServer(19666) managed by IfsProtocols(19519)
    Server STOPPED: SmtpServer(19723) managed by IfsProtocols(19519)
    ServiceWatchdogAgent: Freeing unlocked server 19519
    Server STOPPED: IfsAgents(19520) not managed
    ServiceWatchdogAgent: Freeing unlocked server 19712
    Server STOPPED: IfsProtocols(19519) not managed
    Server STOPPED: ImapServer(19712) managed by IfsProtocols(19519)
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    ServiceWatchdogAgent: Freed Server removed from watchdog list
    QuotaAgent: Timer event: 0 active; 0 exceeded
    ContentGarbageCollectionAgent: Freed 5 unreferenced ContentObjects
    QuotaAgent: Timer event: 0 active; 0 exceeded
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-11012: Unable to get events from other services
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException in checkForDeadServices():
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException in handle loop; continuing:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    ServiceWatchdogAgent: IfsException publishing timer details:
    ServiceWatchdogAgent: oracle.ifs.common.IfsException: IFS-10651: Unable to begin transaction
    oracle.ifs.common.IfsException: IFS-10603: Unable to set database savepoint
    java.sql.SQLException: ORA-03114: not connected to ORACLE
    null

Maybe you are looking for

  • Error in BPM: FIle to RFC

    Hi friends,    I  am working on File --> RFC ---> File Scenario using BPM ... Here I am getting system error in BPM and showing broken red brick in workflow at  sender1 ... I have given like this... Start --> Receiver ->sender1>Sender2 ---> Stop. I h

  • SOAP receiver / SSL

    Hello, I have the following scenario : R/3 -> XI -> SOAP with SSL. When accessing the target URL with a browser I don't have any problems. The SSL handshake is working correctly,I can download all certifcates from the chain and they are all valid. I

  • Ipod shuffle issue

    the message is ipod is corrupted so need to restore it but cannot restore through itunes

  • Ipod nano wheel not turning

    Hi  I have a I Pod nano 5th generation and just recently the wheel has stopped turning, has anyone any advice on how this can be fixed?

  • Very Urgent for Template

    Hi all, Its very urgent for me to develop RTF template so please any one have templates for the following reports. 1.AR invoice. 2.Customer Statements. 3.Dunning Letter Print. please any one have templates for the above reports please send immediatel