Delete is not working properly

I modified the Delete server behavior to delete associated
records from the child tables and then delete the parent table as
follows:
if ((isset($_POST['peereduid'])) &&
($_POST['peereduid'] != "")) {
$deleteTPRSQL = sprintf("DELETE FROM TEENPEERRELATIONSHIP
WHERE PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteTPRSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteCRBSQL = sprintf("DELETE FROM CONTACTREFERREDBY WHERE
PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteCRBSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteCTSQL = sprintf("DELETE FROM CONTACTTOPIC WHERE
PEEREDU_OWNS_ID=%s
AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteCTSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteCMSQL = sprintf("DELETE FROM CONTACTMATERIAL WHERE
PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteCMSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteCSSQL = sprintf("DELETE FROM CONTACTSERVICE WHERE
PEEREDU_OWNS_ID=%s
AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteCSSQL, $cnPeer_Outreach) or
die(mysql_error());
$deletePRTSQL = sprintf("DELETE FROM PEERRECOMMENDSTALK
WHERE PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deletePRTSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteTPASQL = sprintf("DELETE FROM TEENPROMISESACTION
WHERE PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteTPASQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteTPTSQL = sprintf("DELETE FROM TEENPROMISESTALK WHERE
PEEREDU_OWNS_ID=%s AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteTPTSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteTPMVSQL = sprintf("DELETE FROM
TEENPROMISESMEDICALVISIT WHERE PEEREDU_OWNS_ID=%s AND TEEN_ID=%s
AND PEEREDU_TALKS_ID=%s AND CONTACT_DATE=str_to_date(%s,
'%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteTPMVSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteSQL = sprintf("DELETE FROM CONTACT WHERE
PEEREDU_OWNS_ID=%s
AND TEEN_ID=%s AND PEEREDU_TALKS_ID=%s AND
CONTACT_DATE=str_to_date(%s, '%%Y-%%c-%%e')",
GetSQLValueString($_POST['peereduid'], "int"),
GetSQLValueString($_POST['teenid'], "int"),
GetSQLValueString($_POST['peeredutalksid'], "int"),
GetSQLValueString($_POST['contactdate'], "date"));
mysql_select_db($database_cnPeer_Outreach,
$cnPeer_Outreach);
$Result1 = mysql_query($deleteSQL, $cnPeer_Outreach) or
die(mysql_error());
$deleteGoTo = "peerselect.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $deleteGoTo));
The problem is that the deleteGoTo is not working. After the
delete, I am shown the original page again. Can anyone tell me what
I need to do to get it working?

Hi paramu
I think you didn't get my question
The new row is not saved into DB, user add a new record simply he change his mind half way and need
to delete new record in form (As I understand this row only created in related iterator)
So he expect after delete form goes back to previous state
Thanks
Mohsen

Similar Messages

  • Wireless Keyboard Delete Key not working properly

    Recently, my wireless keyboard's delete key has been malfunctioning. Instead of erasing right to left, it deletes left to right. This is without pressing other buttons such as the fn key. Also, the left and right keys do not move the cursor properly such as in the address bar. They only move the page up and down. It works normally right at start up and after I restart the computer but after a few minutes it goes back. Is there a problem with my settings or the keyboard itself? Thank you for your help!

    Hello:
    I do not know of a setting that would do that - especially intermittently.
    I would suspect the KB is failing/has failed.
    Barry

  • I am new to mac air. Today i installed (unsuccessfully!) MAPLE16 on my mac book air. Now since it does not work properly (it also does not appear in  applications) i decide to delete it. I could not remove it from launchpad . i need urgent help

    i am new to mac air. Today i installed (unsuccessfully!) MAPLE16 on my mac book air. Now since it does not work properly (it also does not appear in  applications) i decide to delete it. I could not remove it from launchpad . i need urgent help from your side.

    Any third-party software that doesn't install by drag-and-drop into the Applications folder, and uninstall by drag-and-drop to the Trash, is a system modification.
    Whenever you remove system modifications, they must be removed completely, and the only way to do that is to use the uninstallation tool, if any, provided by the developers, or to follow their instructions. If the software has been incompletely removed, you may have to re-download or even reinstall it in order to finish the job.
    I never install system modifications myself, and I don't know how to uninstall them. You'll have to do your own research to find that information.
    Here are some general guidelines to get you started. Suppose you want to remove something called “BrickMyMac” (a hypothetical example.) First, consult the product's Help menu, if there is one, for instructions. Finding none there, look on the developer's website, say www.brickmyrmac.com. (That may not be the actual name of the site; if necessary, search the Web for the product name.) If you don’t find anything on the website or in your search, contact the developer. While you're waiting for a response, download BrickMyMac.dmg and open it. There may be an application in there such as “Uninstall BrickMyMac.” If not, open “BrickMyMac.pkg” and look for an Uninstall button.
    You generally have to reboot in order to complete an uninstallation.
    If you can’t remove software in any other way, you’ll have to erase and install OS X. Never install any third-party software unless you're sure you know how to uninstall it; otherwise you may create problems that are very hard to solve.
    You may be advised by others to try to remove complex system modifications by hunting for files by name, or by running "utilities" that purport to remove software. I don't give such advice. Those tactics often will not work and maymake the problem worse.

  • Hi ALL i have a BDC code  it is not working properly

    this BDC code is not working properly , when ever the file is transfering BDC is aborting in the case of   invalid material/batch comes into teh picture... so please could you ''Check for invalid material/batch combinations so they are not processed by the BDC in the program and correctly output in an exception report''
    *****************************CODE HERE*****************************
    S E L E C T I O N S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_file LIKE rlgrap-filename,
    p_arch LIKE rlgrap-filename. "RM080107
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    I N C L U D E S
    INCLUDE zwm_np_stock_recon_top.
    INCLUDE zwm_np_stock_recon_f01.
    I N I T I A L I Z A T I O N
    INITIALIZATION.
    PERFORM get_interface_filename USING c_interface_file p_file.
    PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
    S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    PERFORM read_file USING p_file.
    PERFORM pre_processing.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    PERFORM process_checks.
    IF w_no_change = 'X'.
    WRITE: / text-b03.
    WRITE: / sy-uline(34).
    ELSE.
    PERFORM bdc_mi09.
    PERFORM file_check_report.
    PERFORM bdc_report.
    ENDIF.
    PERFORM post_process_checks.
    *-- Move the processed file to archive directory
    PERFORM move_file.
    ...*************.........first include...................************
    INCLUDE ZWM_NP_STOCK_RECON_TOP *
    Data declaration ----------------------------------------------
    TYPES: st_rawdata(2000) TYPE c.
    TYPES: BEGIN OF st_stck_cnt,
    werks TYPE iseg-werks, "plant
    lgort TYPE iseg-lgort, "storage location
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    vfdat TYPE mch1-vfdat, "Sell by date
    lwedt TYPE mch1-lwedt, "Manufacture date
    quarn(8) TYPE n, "qaunrantine quantity
    menge(8) TYPE n, "quantity on hand
    message(1), "Message Type (E/W/I)
    msg_txt TYPE t100-text, "Message Text
    zerostck(1), "Zero stock identifier "RM220307
    END OF st_stck_cnt.
    TYPES: BEGIN OF st_batch_errors,
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    clabs TYPE mchb-clabs, "Stock Balance
    END OF st_batch_errors.
    DATA:
    t_rawdata TYPE TABLE OF st_rawdata,
    w_rawdata TYPE st_rawdata,
    t_stck_cnt TYPE TABLE OF st_stck_cnt,
    d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
    w_stck_cnt TYPE st_stck_cnt,
    t_batch_errors TYPE TABLE OF st_batch_errors,
    w_batch_errors TYPE st_batch_errors,
    t_messtab LIKE bdcmsgcoll OCCURS 0,
    w_messtab LIKE LINE OF t_messtab,
    w_no_change.
    CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
    c_archive_file(26) TYPE c
    VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
    .*************................second include..........************
    ***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
    *& Form read_file
    reads NextPharma file sent through via webmethods
    -->P_FILENAME
    FORM read_file USING p_filename.
    CLEAR: t_rawdata,
    w_rawdata.
    REFRESH: t_rawdata.
    OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
    IF sy-subrc <> 0.
    MESSAGE e720(01).
    ENDIF.
    DO.
    READ DATASET p_filename INTO w_rawdata.
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    APPEND w_rawdata TO t_rawdata.
    ENDIF.
    ENDDO.
    CLOSE DATASET p_filename.
    ENDFORM. " read_file
    *& Form pre_processing
    Read file values into internal table
    FORM pre_processing.
    DATA: lw_matnr TYPE iseg-matnr.
    LOOP AT t_rawdata INTO w_rawdata.
    lw_matnr = w_rawdata+21(20). "RM031006
    lw_matnr = w_rawdata+22(18). "RM031006
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    input = lw_matnr
    IMPORTING
    output = lw_matnr
    EXCEPTIONS
    length_error = 1
    OTHERS = 2.
    MOVE: lw_matnr TO w_stck_cnt-matnr.
    w_stck_cnt-werks = w_rawdata+14(4).
    w_stck_cnt-lgort = w_rawdata+18(4).
    w_stck_cnt-charg = w_rawdata+84(25).
    w_stck_cnt-vfdat = w_rawdata+109(8).
    w_stck_cnt-lwedt = w_rawdata+117(8).
    w_stck_cnt-quarn = w_rawdata+141(8).
    w_stck_cnt-menge = w_rawdata+125(8).
    APPEND w_stck_cnt TO t_stck_cnt.
    CLEAR w_stck_cnt.
    ENDLOOP.
    SORT t_stck_cnt BY werks
    lgort
    matnr
    charg.
    DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
    ENDFORM. " pre_processing
    *& Form bdc_mi09
    Run file data via BDC TCODE: MI09
    FORM bdc_mi09.
    DATA: t_bdcdata TYPE TABLE OF bdcdata,
    w_bdcdata TYPE bdcdata,
    lw_datum(10) TYPE c,
    lw_count(2) TYPE n.
    WRITE sy-datum TO lw_datum DD/MM/YYYY.
    Front Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0700'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Enter
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '/00'.
    APPEND w_bdcdata TO t_bdcdata.
    Count Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-ZLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Document Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-BLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Plant
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-WERKS'.
    w_bdcdata-fval = w_stck_cnt-werks.
    APPEND w_bdcdata TO t_bdcdata.
    Storage Location
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-LGORT'.
    w_bdcdata-fval = w_stck_cnt-lgort.
    APPEND w_bdcdata TO t_bdcdata.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    Do not submit items with Errors against them
    CHECK w_stck_cnt-message NE 'E' AND
    w_stck_cnt-zerostck NE 'X'.
    "RM220307
    lw_count = lw_count + 1.
    Input Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Page Down
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=P+'.
    APPEND w_bdcdata TO t_bdcdata.
    Material
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-MATNR(01)'.
    w_bdcdata-fval = w_stck_cnt-matnr.
    APPEND w_bdcdata TO t_bdcdata.
    Batch
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-CHARG(01)'.
    w_bdcdata-fval = w_stck_cnt-charg.
    APPEND w_bdcdata TO t_bdcdata.
    IF w_stck_cnt-menge NE 0.
    Quantity
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
    w_bdcdata-fval = w_stck_cnt-menge.
    APPEND w_bdcdata TO t_bdcdata.
    *-- Begin RM220307 - We need to create an item when the quantity is zero
    *-- in file and is non-zero in SAP
    ELSE.
    Zero Stock indicator
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-XNULL(01)'.
    w_bdcdata-fval = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    *-- End RM220307
    ENDIF.
    ENDLOOP.
    CHECK lw_count NE 0.
    After all line items have been input
    Final Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Save Document
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=BU'.
    APPEND w_bdcdata TO t_bdcdata.
    CALL TRANSACTION 'MI09' USING t_bdcdata
    MODE p_mode
    MESSAGES INTO t_messtab.
    ENDFORM. " bdc_mi09
    *& Form bdc_report
    Write BDC Messages.
    FORM bdc_report.
    DATA: lw_text TYPE t100-text.
    SKIP.
    WRITE: / text-b01.
    WRITE: / sy-uline(21).
    SKIP.
    Write BDC Messages
    LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
    MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
    NUMBER w_messtab-msgnr
    WITH w_messtab-msgv1
    w_messtab-msgv2
    w_messtab-msgv3
    w_messtab-msgv4
    INTO lw_text.
    WRITE: / lw_text.
    ENDLOOP.
    ENDFORM. " bdc_report
    *& Form process_checks
    Perform process check before creating BDC Session
    FORM process_checks.
    DATA: lw_clabs LIKE mchb-clabs,
    lw_menge LIKE mchb-clabs,
    lw_matnr LIKE mara-matnr,
    lw_charg LIKE mch1-charg,
    lw_fail,
    lw_vfdat TYPE mch1-vfdat,
    lv_sell TYPE c, "RM191006
    lv_qty(8) TYPE c. "RM191006
    CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
    Check if any of the stock figures differ from current stock figures
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    lw_menge = w_stck_cnt-menge.
    SELECT SINGLE clabs INTO lw_clabs
    FROM mchb
    WHERE matnr = w_stck_cnt-matnr
    AND werks = w_stck_cnt-werks
    AND lgort = w_stck_cnt-lgort
    AND charg = w_stck_cnt-charg.
    IF sy-subrc = 0.
    IF lw_clabs NE lw_menge.
    lw_fail = 'X'.
    *-- Begin RM220307 - Do not create PI item if the stock is zero in the
    *-- file and is zero in SAP
    EXIT.
    ELSEIF lw_clabs = 0 AND lw_menge = 0.
    w_stck_cnt-zerostck = 'X'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM220307
    ELSE.
    lw_fail = 'X'.
    ERROR
    ENDIF.
    ENDLOOP.
    If no differences are found set NO CHANGE Flag
    IF lw_fail NE 'X'.
    w_no_change = 'X'.
    EXIT.
    ENDIF.
    Check for Errors in file data
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    CLEAR lv_sell. "RM191006
    SELECT SINGLE matnr INTO lw_matnr
    FROM mara
    WHERE matnr = w_stck_cnt-matnr.
    IF sy-subrc NE 0.
    Invalid Material (E)
    w_stck_cnt-message = 'E'.
    w_stck_cnt-msg_txt = 'Invalid Material'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ENDIF.
    SELECT SINGLE charg vfdat
    INTO (lw_charg, lw_vfdat)
    FROM mch1 "KOB01 - changed from MCHA
    WHERE matnr = w_stck_cnt-matnr
    AND charg = w_stck_cnt-charg.
    AND werks = w_stck_cnt-werks.
    IF sy-subrc NE 0.
    Invalid Material Batch (E)
    w_stck_cnt-message = 'E'.
    CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ELSE.
    IF w_stck_cnt-vfdat <> lw_vfdat.
    Sell by dates do not match (W)
    w_stck_cnt-message = 'W'.
    w_stck_cnt-msg_txt =
    'Sell by Date does not match Shelf life Expiry Date'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    lv_sell = 'X'. "RM191006
    CONTINUE. "RM191006
    ENDIF.
    ENDIF.
    IF w_stck_cnt-quarn > 0.
    Quarantine balance not Zero (W)
    w_stck_cnt-message = 'W'.
    *-- Begin RM191006
    *-- We do want all warning messages on the report
    lv_qty = w_stck_cnt-quarn.
    CONDENSE lv_qty NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    input = lv_qty
    IMPORTING
    output = lv_qty.
    w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
    CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    IF lv_sell = 'X'.
    APPEND w_stck_cnt TO d_stck_cnt.
    CLEAR lv_sell.
    ELSE.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM191006
    ENDIF.
    ENDLOOP.
    *-- Begin RM191006
    *-- Finally get all the records into dummy table to report
    APPEND LINES OF t_stck_cnt TO d_stck_cnt.
    SORT d_stck_cnt.
    DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
    *-- End RM191006
    ENDFORM. " process_checks
    *& Form file_check_report
    Write warning and Error messages from File checks
    FORM file_check_report.
    WRITE: /2 'Material',
    22 'Batch',
    32 'Sell By',
    45 'Message Text'.
    WRITE: /2 sy-uline(115).
    SKIP.
    LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
    LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
    CHECK w_stck_cnt-message NE ' '.
    WRITE: /2 w_stck_cnt-matnr,
    22 w_stck_cnt-charg,
    32 w_stck_cnt-vfdat,
    43 w_stck_cnt-message,
    45 w_stck_cnt-msg_txt.
    ENDLOOP.
    ENDFORM. " file_check_report
    *& Form post_process_checks
    Check Material Batches in SAP against NP File
    FORM post_process_checks.
    RANGES: r_matnr FOR mchb-matnr,
    r_lgort FOR mchb-lgort,
    r_werks FOR mchb-werks.
    SORT t_stck_cnt.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    AT END OF matnr.
    r_lgort-sign = 'I'.
    r_lgort-option = 'EQ'.
    r_lgort-low = w_stck_cnt-lgort.
    APPEND r_lgort.
    r_werks-sign = 'I'.
    r_werks-option = 'EQ'.
    r_werks-low = w_stck_cnt-werks.
    APPEND r_werks.
    r_matnr-sign = 'I'.
    r_matnr-option = 'EQ'.
    r_matnr-low = w_stck_cnt-matnr.
    APPEND r_matnr.
    ENDAT.
    ENDLOOP.
    Select all material batches for NP Materials
    SELECT matnr charg clabs
    INTO TABLE t_batch_errors
    FROM mchb
    WHERE werks IN r_werks
    AND lgort IN r_lgort.
    IF sy-subrc EQ 0.
    Check if the Material Batches are in the NP file
    LOOP AT t_batch_errors INTO w_batch_errors.
    Disregard Batches without positive unrestricted stock
    IF w_batch_errors-clabs LE 0.
    DELETE t_batch_errors.
    CONTINUE.
    ENDIF.
    READ TABLE t_stck_cnt INTO w_stck_cnt
    WITH KEY matnr = w_batch_errors-matnr
    charg = w_batch_errors-charg.
    IF sy-subrc = 0.
    DELETE t_batch_errors.
    ENDIF.
    ENDLOOP.
    ENDIF.
    CHECK NOT t_batch_errors[] IS INITIAL.
    Write Batch chak results to report
    SKIP.
    WRITE: / text-b02.
    WRITE: / sy-uline(74).
    WRITE: /2 'Material',
    22 'Batch'.
    WRITE: /2 sy-uline(32).
    SKIP.
    LOOP AT t_batch_errors INTO w_batch_errors.
    WRITE: /2 w_batch_errors-matnr,
    22 w_batch_errors-charg.
    ENDLOOP.
    ENDFORM. " post_process_checks
    G E T _ I N T E R F A C E _ F I L E N A M E
    FORM get_interface_filename USING filename lw_path.
    DATA: i_file TYPE filename-fileintern,
    out_filename LIKE v_path-pathextern.
    CLEAR: out_filename.
    i_file = filename.
    get the interface filename to be used when creating file
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    logical_filename = i_file
    IMPORTING
    file_name = out_filename
    EXCEPTIONS
    file_not_found = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MOVE out_filename TO lw_path.
    IF filename NE c_archive_file. "RM080107
    CONCATENATE lw_path 'NP_StockBalance.dat'
    INTO lw_path.
    *-- Begin RM080107 - Add timestamp to the archived file
    ELSE.
    CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
    INTO lw_path.
    ENDIF.
    *-- End RM080107
    ELSE.
    ENDIF.
    ENDFORM. "get_interface_filename
    *& Form move_file RM080107
    Move the processed file to archive directory
    FORM move_file.
    *-- At last move the file to archive directory
    OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
    IF sy-subrc = 0.
    LOOP AT t_rawdata INTO w_rawdata.
    TRANSFER w_rawdata TO p_arch.
    ENDLOOP.
    ENDIF.
    CLOSE DATASET p_arch.
    DELETE DATASET p_file.
    ENDFORM. " move_file

    Hi,
    S E L E C T I O N S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p_file LIKE rlgrap-filename,
    p_arch LIKE rlgrap-filename. "RM080107
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    I N C L U D E S
    INCLUDE zwm_np_stock_recon_top.
    INCLUDE zwm_np_stock_recon_f01.
    I N I T I A L I Z A T I O N
    INITIALIZATION.
    PERFORM get_interface_filename USING c_interface_file p_file.
    PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
    S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    PERFORM read_file USING p_file.
    PERFORM pre_processing.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    PERFORM process_checks.
    IF w_no_change = 'X'.
    WRITE: / text-b03.
    WRITE: / sy-uline(34).
    ELSE.
    PERFORM bdc_mi09.
    PERFORM file_check_report.
    PERFORM bdc_report.
    ENDIF.
    PERFORM post_process_checks.
    *-- Move the processed file to archive directory
    PERFORM move_file.
    ...*************.........first include...................************
    INCLUDE ZWM_NP_STOCK_RECON_TOP *
    Data declaration ----------------------------------------------
    TYPES: st_rawdata(2000) TYPE c.
    TYPES: BEGIN OF st_stck_cnt,
    werks TYPE iseg-werks, "plant
    lgort TYPE iseg-lgort, "storage location
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    vfdat TYPE mch1-vfdat, "Sell by date
    lwedt TYPE mch1-lwedt, "Manufacture date
    quarn(8) TYPE n, "qaunrantine quantity
    menge(8) TYPE n, "quantity on hand
    message(1), "Message Type (E/W/I)
    msg_txt TYPE t100-text, "Message Text
    zerostck(1), "Zero stock identifier "RM220307
    END OF st_stck_cnt.
    TYPES: BEGIN OF st_batch_errors,
    matnr TYPE iseg-matnr, "material number
    charg TYPE iseg-charg, "batch
    clabs TYPE mchb-clabs, "Stock Balance
    END OF st_batch_errors.
    DATA:
    t_rawdata TYPE TABLE OF st_rawdata,
    w_rawdata TYPE st_rawdata,
    t_stck_cnt TYPE TABLE OF st_stck_cnt,
    d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
    w_stck_cnt TYPE st_stck_cnt,
    t_batch_errors TYPE TABLE OF st_batch_errors,
    w_batch_errors TYPE st_batch_errors,
    t_messtab LIKE bdcmsgcoll OCCURS 0,
    w_messtab LIKE LINE OF t_messtab,
    w_no_change.
    CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
    c_archive_file(26) TYPE c
    VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
    .*************................second include..........************
    ***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
    *& Form read_file
    reads NextPharma file sent through via webmethods
    -->P_FILENAME
    FORM read_file USING p_filename.
    CLEAR: t_rawdata,
    w_rawdata.
    REFRESH: t_rawdata.
    OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
    IF sy-subrc <> 0.
    MESSAGE e720(01).
    ENDIF.
    DO.
    READ DATASET p_filename INTO w_rawdata.
    IF sy-subrc <> 0.
    EXIT.
    ELSE.
    APPEND w_rawdata TO t_rawdata.
    ENDIF.
    ENDDO.
    CLOSE DATASET p_filename.
    ENDFORM. " read_file
    *& Form pre_processing
    Read file values into internal table
    FORM pre_processing.
    DATA: lw_matnr TYPE iseg-matnr.
    LOOP AT t_rawdata INTO w_rawdata.
    lw_matnr = w_rawdata+21(20). "RM031006
    lw_matnr = w_rawdata+22(18). "RM031006
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    input = lw_matnr
    IMPORTING
    output = lw_matnr
    EXCEPTIONS
    length_error = 1
    OTHERS = 2.
    MOVE: lw_matnr TO w_stck_cnt-matnr.
    w_stck_cnt-werks = w_rawdata+14(4).
    w_stck_cnt-lgort = w_rawdata+18(4).
    w_stck_cnt-charg = w_rawdata+84(25).
    w_stck_cnt-vfdat = w_rawdata+109(8).
    w_stck_cnt-lwedt = w_rawdata+117(8).
    w_stck_cnt-quarn = w_rawdata+141(8).
    w_stck_cnt-menge = w_rawdata+125(8).
    APPEND w_stck_cnt TO t_stck_cnt.
    CLEAR w_stck_cnt.
    ENDLOOP.
    SORT t_stck_cnt BY werks
    lgort
    matnr
    charg.
    DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
    ENDFORM. " pre_processing
    *& Form bdc_mi09
    Run file data via BDC TCODE: MI09
    FORM bdc_mi09.
    DATA: t_bdcdata TYPE TABLE OF bdcdata,
    w_bdcdata TYPE bdcdata,
    lw_datum(10) TYPE c,
    lw_count(2) TYPE n.
    WRITE sy-datum TO lw_datum DD/MM/YYYY.
    <b>select single MATNR
                       WERKS
                       CHARG
               from MCHA
               into (l_matnr, l_werks, l_charg)
               where matnr = w_stck_cnt-matnr
                  and werks = w_stck_cnt-werks.
                  and charg =  w_stck_cnt-charg.
    if sy-subrc ne 0.
    continue.
    endif.</b>
    Front Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0700'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Enter
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '/00'.
    APPEND w_bdcdata TO t_bdcdata.
    Count Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-ZLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Document Date
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'RM07I-BLDAT'.
    w_bdcdata-fval = lw_datum.
    APPEND w_bdcdata TO t_bdcdata.
    Plant
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-WERKS'.
    w_bdcdata-fval = w_stck_cnt-werks.
    APPEND w_bdcdata TO t_bdcdata.
    Storage Location
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'IKPF-LGORT'.
    w_bdcdata-fval = w_stck_cnt-lgort.
    APPEND w_bdcdata TO t_bdcdata.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    Do not submit items with Errors against them
    CHECK w_stck_cnt-message NE 'E' AND
    w_stck_cnt-zerostck NE 'X'.
    "RM220307
    lw_count = lw_count + 1.
    Input Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Page Down
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=P+'.
    APPEND w_bdcdata TO t_bdcdata.
    Material
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-MATNR(01)'.
    w_bdcdata-fval = w_stck_cnt-matnr.
    APPEND w_bdcdata TO t_bdcdata.
    Batch
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-CHARG(01)'.
    w_bdcdata-fval = w_stck_cnt-charg.
    APPEND w_bdcdata TO t_bdcdata.
    IF w_stck_cnt-menge NE 0.
    Quantity
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
    w_bdcdata-fval = w_stck_cnt-menge.
    APPEND w_bdcdata TO t_bdcdata.
    *-- Begin RM220307 - We need to create an item when the quantity is zero
    *-- in file and is non-zero in SAP
    ELSE.
    Zero Stock indicator
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'ISEG-XNULL(01)'.
    w_bdcdata-fval = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    *-- End RM220307
    ENDIF.
    ENDLOOP.
    CHECK lw_count NE 0.
    After all line items have been input
    Final Screen
    CLEAR w_bdcdata.
    w_bdcdata-program = 'SAPMM07I'.
    w_bdcdata-dynpro = '0731'.
    w_bdcdata-dynbegin = 'X'.
    APPEND w_bdcdata TO t_bdcdata.
    Save Document
    CLEAR w_bdcdata.
    w_bdcdata-fnam = 'BDC_OKCODE'.
    w_bdcdata-fval = '=BU'.
    APPEND w_bdcdata TO t_bdcdata.
    CALL TRANSACTION 'MI09' USING t_bdcdata
    MODE p_mode
    MESSAGES INTO t_messtab.
    ENDFORM. " bdc_mi09
    *& Form bdc_report
    Write BDC Messages.
    FORM bdc_report.
    DATA: lw_text TYPE t100-text.
    SKIP.
    WRITE: / text-b01.
    WRITE: / sy-uline(21).
    SKIP.
    Write BDC Messages
    LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
    MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
    NUMBER w_messtab-msgnr
    WITH w_messtab-msgv1
    w_messtab-msgv2
    w_messtab-msgv3
    w_messtab-msgv4
    INTO lw_text.
    WRITE: / lw_text.
    ENDLOOP.
    ENDFORM. " bdc_report
    *& Form process_checks
    Perform process check before creating BDC Session
    FORM process_checks.
    DATA: lw_clabs LIKE mchb-clabs,
    lw_menge LIKE mchb-clabs,
    lw_matnr LIKE mara-matnr,
    lw_charg LIKE mch1-charg,
    lw_fail,
    lw_vfdat TYPE mch1-vfdat,
    lv_sell TYPE c, "RM191006
    lv_qty(8) TYPE c. "RM191006
    CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
    Check if any of the stock figures differ from current stock figures
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    lw_menge = w_stck_cnt-menge.
    SELECT SINGLE clabs INTO lw_clabs
    FROM mchb
    WHERE matnr = w_stck_cnt-matnr
    AND werks = w_stck_cnt-werks
    AND lgort = w_stck_cnt-lgort
    AND charg = w_stck_cnt-charg.
    IF sy-subrc = 0.
    IF lw_clabs NE lw_menge.
    lw_fail = 'X'.
    *-- Begin RM220307 - Do not create PI item if the stock is zero in the
    *-- file and is zero in SAP
    EXIT.
    ELSEIF lw_clabs = 0 AND lw_menge = 0.
    w_stck_cnt-zerostck = 'X'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM220307
    ELSE.
    lw_fail = 'X'.
    ERROR
    ENDIF.
    ENDLOOP.
    If no differences are found set NO CHANGE Flag
    IF lw_fail NE 'X'.
    w_no_change = 'X'.
    EXIT.
    ENDIF.
    Check for Errors in file data
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    CLEAR lv_sell. "RM191006
    SELECT SINGLE matnr INTO lw_matnr
    FROM mara
    WHERE matnr = w_stck_cnt-matnr.
    IF sy-subrc NE 0.
    Invalid Material (E)
    w_stck_cnt-message = 'E'.
    w_stck_cnt-msg_txt = 'Invalid Material'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ENDIF.
    SELECT SINGLE charg vfdat
    INTO (lw_charg, lw_vfdat)
    FROM mch1 "KOB01 - changed from MCHA
    WHERE matnr = w_stck_cnt-matnr
    AND charg = w_stck_cnt-charg.
    AND werks = w_stck_cnt-werks.
    IF sy-subrc NE 0.
    Invalid Material Batch (E)
    w_stck_cnt-message = 'E'.
    CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    ELSE.
    IF w_stck_cnt-vfdat <> lw_vfdat.
    Sell by dates do not match (W)
    w_stck_cnt-message = 'W'.
    w_stck_cnt-msg_txt =
    'Sell by Date does not match Shelf life Expiry Date'.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    lv_sell = 'X'. "RM191006
    CONTINUE. "RM191006
    ENDIF.
    ENDIF.
    IF w_stck_cnt-quarn > 0.
    Quarantine balance not Zero (W)
    w_stck_cnt-message = 'W'.
    *-- Begin RM191006
    *-- We do want all warning messages on the report
    lv_qty = w_stck_cnt-quarn.
    CONDENSE lv_qty NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    input = lv_qty
    IMPORTING
    output = lv_qty.
    w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
    CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
    INTO w_stck_cnt-msg_txt SEPARATED BY space.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    CONTINUE.
    IF lv_sell = 'X'.
    APPEND w_stck_cnt TO d_stck_cnt.
    CLEAR lv_sell.
    ELSE.
    MODIFY t_stck_cnt FROM w_stck_cnt.
    ENDIF.
    *-- End RM191006
    ENDIF.
    ENDLOOP.
    *-- Begin RM191006
    *-- Finally get all the records into dummy table to report
    APPEND LINES OF t_stck_cnt TO d_stck_cnt.
    SORT d_stck_cnt.
    DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
    *-- End RM191006
    ENDFORM. " process_checks
    *& Form file_check_report
    Write warning and Error messages from File checks
    FORM file_check_report.
    WRITE: /2 'Material',
    22 'Batch',
    32 'Sell By',
    45 'Message Text'.
    WRITE: /2 sy-uline(115).
    SKIP.
    LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
    LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
    CHECK w_stck_cnt-message NE ' '.
    WRITE: /2 w_stck_cnt-matnr,
    22 w_stck_cnt-charg,
    32 w_stck_cnt-vfdat,
    43 w_stck_cnt-message,
    45 w_stck_cnt-msg_txt.
    ENDLOOP.
    ENDFORM. " file_check_report
    *& Form post_process_checks
    Check Material Batches in SAP against NP File
    FORM post_process_checks.
    RANGES: r_matnr FOR mchb-matnr,
    r_lgort FOR mchb-lgort,
    r_werks FOR mchb-werks.
    SORT t_stck_cnt.
    LOOP AT t_stck_cnt INTO w_stck_cnt.
    AT END OF matnr.
    r_lgort-sign = 'I'.
    r_lgort-option = 'EQ'.
    r_lgort-low = w_stck_cnt-lgort.
    APPEND r_lgort.
    r_werks-sign = 'I'.
    r_werks-option = 'EQ'.
    r_werks-low = w_stck_cnt-werks.
    APPEND r_werks.
    r_matnr-sign = 'I'.
    r_matnr-option = 'EQ'.
    r_matnr-low = w_stck_cnt-matnr.
    APPEND r_matnr.
    ENDAT.
    ENDLOOP.
    Select all material batches for NP Materials
    SELECT matnr charg clabs
    INTO TABLE t_batch_errors
    FROM mchb
    WHERE werks IN r_werks
    AND lgort IN r_lgort.
    IF sy-subrc EQ 0.
    Check if the Material Batches are in the NP file
    LOOP AT t_batch_errors INTO w_batch_errors.
    Disregard Batches without positive unrestricted stock
    IF w_batch_errors-clabs LE 0.
    DELETE t_batch_errors.
    CONTINUE.
    ENDIF.
    READ TABLE t_stck_cnt INTO w_stck_cnt
    WITH KEY matnr = w_batch_errors-matnr
    charg = w_batch_errors-charg.
    IF sy-subrc = 0.
    DELETE t_batch_errors.
    ENDIF.
    ENDLOOP.
    ENDIF.
    CHECK NOT t_batch_errors[] IS INITIAL.
    Write Batch chak results to report
    SKIP.
    WRITE: / text-b02.
    WRITE: / sy-uline(74).
    WRITE: /2 'Material',
    22 'Batch'.
    WRITE: /2 sy-uline(32).
    SKIP.
    LOOP AT t_batch_errors INTO w_batch_errors.
    WRITE: /2 w_batch_errors-matnr,
    22 w_batch_errors-charg.
    ENDLOOP.
    ENDFORM. " post_process_checks
    G E T _ I N T E R F A C E _ F I L E N A M E
    FORM get_interface_filename USING filename lw_path.
    DATA: i_file TYPE filename-fileintern,
    out_filename LIKE v_path-pathextern.
    CLEAR: out_filename.
    i_file = filename.
    get the interface filename to be used when creating file
    CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
    logical_filename = i_file
    IMPORTING
    file_name = out_filename
    EXCEPTIONS
    file_not_found = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MOVE out_filename TO lw_path.
    IF filename NE c_archive_file. "RM080107
    CONCATENATE lw_path 'NP_StockBalance.dat'
    INTO lw_path.
    *-- Begin RM080107 - Add timestamp to the archived file
    ELSE.
    CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
    INTO lw_path.
    ENDIF.
    *-- End RM080107
    ELSE.
    ENDIF.
    ENDFORM. "get_interface_filename
    *& Form move_file RM080107
    Move the processed file to archive directory
    FORM move_file.
    *-- At last move the file to archive directory
    OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
    IF sy-subrc = 0.
    LOOP AT t_rawdata INTO w_rawdata.
    TRANSFER w_rawdata TO p_arch.
    ENDLOOP.
    ENDIF.
    CLOSE DATASET p_arch.
    DELETE DATASET p_file.
    ENDFORM. " move_file
    Best regards,
    Prashant

  • Mouse is not working properly on a one month old HP Pavillion 15-NO28US

    I'm sure it's already been talked about on here, but I haven't found a successful fix or the same exact problem as I'm having. I went thru the latest Windows 8.1 update recently (at least I think it was the update) and when I restarted my computer yesterday the mouse was not working properly. Like a lot of other people who are complaining about it, the two-finger scrolling and other similar features are not working, but what really bothers me is the the mouse is almost acting like it was changed to a left handed mouse. I've checked the settings and it is still set on right-handed, but when I click the left mouse button the small window opens up next to where I clicked, which has the copy, delete and paste options (and other regular options) in it. When I click the right mouse button, nothing happens. Double tapping on the touchpad doesn't do anything either. I downloaded and install the latest synaptic drivers and nothing happened. I even performed a system recovery last night to reset all setting and it's still not working. This really sucks because I've only had this computer for about a month and I've already lost everything I've put on it...most importantly all of my school work and music apps. Is there anything to fix this or can anyone tell me what's going on with this stuff, before I have to call into HP and have a melt down?

    Hi Kevin3047,
    Thank you for your query, I will do my best to assist you!!
    I understand that after updating from Windows 8 to 8.1 your mouse is not performing correctly. You have tried the built in troubleshooter but to no avail.
    You checked the settings and they appear ok, but when you click the left mouse button the small window opens up next to where you  clicked, which has the copy, delete and paste options (and other regular options) in it. When you click the right mouse button, nothing happens. Double tapping on the touchpad doesn't do anything either. I grasp that you did a recovery but it did not help.  You also stated you lost your data once, and that in itself is extremely aggravating, I agree.
    Here is a step that may help.
    Go to the Command Prompt and right click on it to run as Administrator
    type sfc /scannow and press enter.  This will scan for corrupted files and try to repair them.
    Here are links to two documents that may aid with this process.
    Troubleshooting Mouse Problems (Windows 8)
    Using and Troubleshooting the TouchPad or ClickPad (Windows 8)
    Would you also please try a clean boot to see if it persists. Here is  a Windows document to assist you.
    How to perform a clean boot in Windows
    If none of this has alleviated the issue, I suggest you do a  Refresh Your PC to Resolve Problems (Windows 8).
    If the issue still pesists, I would do a recovery again.  You will be prompted during the recovery to backup your personal files to prevent data loss. I would suggest you choose yes, to prevent data loss.
    Performing an HP System Recovery (Windows 8)
    Restoring Files that were Backed Up Using HP Recovery Manager (Windows 8)
    This will take it back to factory. Here is a document on Updating Windows 8 to 8.1 to assist you with doing the update again.
    If you are still experiencing the issue, as @visruth stated I would contact HP support for assistance.  They are able to remotely log onto your system to help with this difficulty.
    Please call HP technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region HP Technical Support Sitemap.
    Good Luck!!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • XFCE4 not working properly display X as cursor not arrow pointer

    Hi all
    I have recently installed arch and XFCE4 as my desktop environtment everything went well for a few days.
    But all sudenl 2 days ago thing appeared not working properly. Things displayed on my desktop are out of proporion mainly the X as cursor instead of an arrow, newly opened windows default to top right cornner overlap my taskbar panel not able to move this. I've tried to re-install xfce4 but weren't sure I did it correctly.
    tried :
    pacman -Rdd xfce4 xfce4-goodies
    rm -R ~/.config/xfce4
    then reinstall problem still occurs.
    Any suggests and help would be greatly appreciated.
    thx
    Last edited by archlux (2013-06-23 14:29:01)

    Be sure you cursor theme is complete. Which one are you trying to use? Did you try setting it up from directly X confs?
    There must be an option in window manager or window manager tweaks about overlapping taskbar. You can use alt+left mouse to move your windows till it is configured.
    Reinstalling is as meaningless as deleting system32. If you are out of options, just delete your .config folder then reinstall.?
    Last edited by Gulver (2013-06-23 17:59:47)

  • FaceTime not working properly

    Hi,
    I just recently upgraded to 13" i5 MBP with Lion OS. I noticed that my FaceTime is not working properly. I have an iPad 2 also and I used it most of the time for my FaceTime which is why I didn't notice that the FaceTime of my new MBP is not working properly. I was able to sign in and I tried calling my contacts with FaceTime. On my end it's ringing but on their side it's not. I asked them to call me and it would go to my iPad 2 only. With my old MBP (2009 model), whenever i get a FaceTime call, both my MBP and iPad 2 would starting ringing but with this new MBP, it's not. I can't even connect with anyone. I tried deleting the app and installing it with the lower version but i think the lower version won't work with Lion (there was a camera error). Good thing I was still able to install the FaceTime back to my MBP but I still have the same problem. Is this a hardware or software problem? Please help...I just had this MBP for barely 2 months....
    thanks in advance...

    There's a whole section on Facetime. If you don't find your answer there, post a new thread in that section.
    https://discussions.apple.com/community/mac_app_store/facetime_for_mac

  • Aluminum Wireless Keyboard not working properly after Firmware update 1.1

    Hi,
    Well, as the subject says, my keyboard is not working properly after I updated the firmware. The problem is that several keys (delete, down arrow, brackets and apostrophe) stopped working right after I installed the update. I never dropped it or hit it. And I did not stop or interrupt or did anything during the install. I take very good care of it.
    I have already tried toubleshooting with the support page, restarting the iMac, taking off the batteries, setting it up with bluetooth again, going back a week with time machine and to reinstall the firmware. So, if you have something new for me to try, I will really apreciate it.
    Thanks in advance.
    Franco.

    I have 24" iMac with the Apple wireless M&KB - I know this is basic but have you tried a fresh set of batteries? My KB will refuse to establish connection when batteries are on the weak side the firmware update may just be a co incidents. If your wireless mouse is working OK then I would guess the blue tooth is functioning.
    Not sure about the 10.49 download - are your other file downloads completing properly? Are there any error messages?
    Steve

  • Hi there, Fn + F1 to F12 special features are not working properly in bootcamp Windows

    Hi there, I m just wondering recently my keyboard special features keys are not working properly(fn   F1 to F12). Is there any solutions for this?? For example I cant switch the brightness with fn   F1.. THis is so troublesome.... Please help! thanks
    This was working fine in the early stage until recently which is not functioned properly.. ANy way to fix this up?? Thanks!

    I had tried them...but its all good now... Guess RegPro must be delete my bootcamp item..So I just redownload them n reinstall...all back to normal!...THANKS!

  • Gadgets not working properly in windows 7

    For some reason the gadgets in windows 7 are not working properly. I can open the gadget gallery and select a gadget, but it doesn't show the entire thing. For example i select the clock, and all it shows is a black square with the red ticking hand frozen. Another example is the CPU meter. All it shows when i click on it is a little white square where the meter should be. I can still close the gadgets by way of the close button on each gadget though (the calendar doesn't appear at all).  UAC is turned on and i have rebooted the pc, same thing still happening. (It is Enterprise edition if that makes any difference). If anyone could help that would be great!

    Have you come across the problem where some of the Gadgets that you added to the Sidebar/Desktop are not displayed correctly? For example, the clock gadget may be displayed as a black square containing only the "seconds" hand. Other gadgets may show up as
    white rectangles with an information (i) icon and a plus sign. The settings button next to the gadget does not work, but the
    x to close does. Here are some screenshots:
    The above-mentioned behavior is caused due to the following reasons:
    A subkey with foreign/ASCII character exists under the "Zones" registry key.
    XML registration is missing in the system.
    Use these steps to fix the problem:
    Fix for Case 1
    1. Click Start, type Regedit.exe and press {ENTER}
    2. Navigate to the following branch:
    HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones
    3. Under the Zones key, delete the subkey shown with an ASCII character:
    4. Exit the Registry Editor.
    5. Logoff and login back to your user account.
    Fix for Case 2
    1. Open an
    elevated Command Prompt window. To open an elevated (admin) Command Prompt, click Start, click All Programs, click Accessories,
    right-click Command Prompt, and then click Run as administrator.
    2. In the Command Prompt window, type the following command and press ENTER:
    regsvr32 msxml3.dll
    3. Similarly, run these commands:
    regsvr32 scrrun.dll
    regsvr32 jscript.dll
    You should see the DllRegisterServer in <filename> succeeded message for each command executed.
    4. Logoff and login back to your user account and see if the Gadgets display correctly.

  • Help! My Mouse pad is not working properly. The arrow cannot be controlled, it just keeps jumping all over the page. How can I stop this?

    Help! My Mouse pad is not working properly. The arrow cannot be controlled, it just keeps jumping all over the page. How can I stop this?

    There are several possible causes for this issue. Please take each of the following steps that you haven't already tried until it's resolved. Some may not apply in your case.
    1. Follow the instructions in this support article, and also this one, if applicable. A damaged or defective AC adapter could be the cause, even if it's the right kind.
    2. Press down all four corners of the trackpad at once and release. If there's any effect, it's likely to be temporary, and in that case the unit must be serviced or replaced.
    3. Open the Bluetooth preference pane in System Preferences and delete all pointing devices other than the trackpad, if applicable. Disconnect any USB pointing devices. By a "pointing device," I mean a peripheral that moves the cursor, such as a trackpad, mouse, trackball, or graphics tablet. A plain keyboard is not a pointing device.
    4. Start up in safe mode and test, preferably without launching any third-party applications. If you don't have the problem in safe mode, but it comes back when you restart as usual, stop here and post your results. Do the same if you can't start in safe mode. If there was no difference in safe mode, go on to the next step.
    5. Reset the System Management Controller.
    6. If you're using a Bluetooth trackpad, investigate potential sources of interference, including USB 3 devices.
    7. A swollen battery in a portable computer can impinge on the trackpad from below and cause erratic behavior. If you have trouble clicking the trackpad, this is likely the reason. The battery must be replaced without delay.
    8. There's a report that a (possibly defective) Thunderbolt Ethernet adapter can cause the built-in trackpad of a MacBook to  behave erratically. If you're using such an adapter, disconnect it and test.
    9. There's also a report of erratic cursor movements caused by an external display that was connected but not turned on.
    10. If none of the above applies, or if you have another reason to think that your computer is being remotely controlled, remove it from the network by turning off Wi-Fi (or your Wi-Fi access point), disconnecting from a Bluetooth network link, and unplugging the Ethernet cable or USB modem, whichever is applicable. If the cursor movements stop at once, you should suspect an intrusion.
    11. Make a "Genius" appointment at an Apple Store to have the machine and/or external trackpad tested.

  • Shuffle not working properly

    My Itunes library is not working properly. The main problem is the shuffle function. Clicking the shuffle icon to turn it blue and shuffle the play order of the songs does not work. If I sort by name, some of the songs are shuffled where as others will play one after the other (all the tracks in an album).
    Also, the start and stop times no longer work, nor does the volume adjustment.
    Uninstalling and reinstalling does not fix the problem.
    Any ideas?

    Possible Cause:
    It sounds like the affected songs are encoded in a format that the iPod shuffle cannot read. Here is a knowledge base article that list the compatible formats:
    http://docs.info.apple.com/article.html?artnum=300464
    Troubleshoot:
    To check the format of a song, right click it, and select Get Info. A window will come up giving details like, Kind, Size, Bit Rate.
    It seems there are multiple songs with this problem so it may be quicker to add a new column to your Song list that will show 'Kind' Follow:
    http://docs.info.apple.com/article.html?artnum=165165
    For instructions on how to do this.
    Solution:
    If this is the case, then I would suggest saving a copy of the song to a compatible format. Instructions for doing this can be found at:
    http://docs.info.apple.com/article.html?artnum=165172
    Note: You are saving a COPY of the song. It does not convert the song, but duplicates the song and the converts the duplicate. So if you do not wish to keep the original (incompatible formated) song then I would suggest deleting it, so you don't get the two songs confused.

  • SPOTLIGHT NOT WORKING PROPERLY

    Hello all---
    I have noticed for the past few weeks that my Spotlight is not working properly. I can put in a search term for a file I **KNOW** is on my HD but it returns no results. During a search for a fix on this site, I found one person's fix by going into the Terminal utility and manually turning on the indexing for Spotlight. I did this; got a "indexing turned on message" but my Spotlight is still NOT indexing or finding on either my internal HD or either of my two external HD's. I've just never run into a problem like this and don't know where to start to look. Can someone please give me a suggestion on how to reset Spotlight or somehow manually ask it to index my HD's so it works better?? THANK YOU VERY MUCH!
    PDUBOKC

    You can force Spotlight to reindex by going to system preferences>spotlight>privacy and add the drive you want to reindex. Close everything and then delete that drive.
    Close everything? What does that mean? Quit all apps? Reboot? Delete the drive you just added to Privacy list?
    I don't get it. The Privacy panel says to add drives you DON'T want index. I cannot search my external HD which is where all the production files for our company reside. No matter how many times I select it.
    Searching seriously ***** in Leopard. In Tiger, I select the drive I want, the folder or document name, dates if I want to limit search and I am done.

  • Touchpad not working properly

    I Have HP Pavilion 15-n003tx Notebook PC (ENERGY STAR touchpad is not working properly when i tried to zoom in or out then it doesnot occurs i have all latest drivers installed please  help thanx
    This question was solved.
    View Solution.

    Hi @Mandeep2000 ,
    Thank you for your inquiry, I will do my best to assist you!
    I grasp that your touchpad is not functioning correctly as you are unable to use the zoom.  You have the latest driver installed.
    Have you ran  The HP Support Assistant to aid with HP updates and resolving issues?
    Have you tried Using Automated Troubleshooting (Windows 8) to help overcome this difficulty.
    Here is a link to Using and Troubleshooting the TouchPad or ClickPad (Windows 8) that may also be of benefit.
    Have you tried deleting the driver and reinstalling it?
    Please let me know the results.
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • Accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    accidentally removed from,sharing and permissions the admin user,and now i do not when i find the home icon at my computer i do not have permmission,and the mac does not works properly,lots of question mark at the dock ,please help

    I'm going to assume that since you deleted your hard drive and all its files, you had a backup, yes? If the backup has an OS (bootable clone), then you can boot into it by holding down the option key when you start up you iMac and choose the backup drive. Then use Carbon Copy Cloner or Super Duper to copy the files back to your iMac.

Maybe you are looking for