Mathamatical Operations in Scripts

Dear Experts,
In scripts ,I am fasing a problem.
I want to do some calculation in scripts.For that , by using Perform & endperform, I created a form in a progrm & doing.
But my issue is I am passing two currency fields(data type wrshb)  from script to form program.
but the structure ITCSY is character type.
so while allocating the itcsy-value to wa_curr1 (Currency field in form) it is giving a dump.
because in the field itcst-value it is showing the value with , & ..(Commas & dots,currency separators).
again I want to export this calculated currency field(data type wrshb) to script.
so how to handle the currency fields in this form & perform.
Please help me to sort this issue.
Thanks in advance,
Regards,
Rahul.

hi
Use this in the Subroutine Pool
CONDENSE in_tab-value.
REPLACE ',' WITH '.' INTO in_tab-value.-----> based on ur User Settings.
CALL FUNCTION 'MOVE_CHAR_TO_NUM'
  EXPORTING
    chr                   = in_tab-value
IMPORTING
    num                   = l_dmbtr .
  READ TABLE out_tab INDEX 1.
  WRITE:l_rwbtr TO out_tab-value.
  CONDENSE out_tab-value.
  MODIFY out_tab INDEX 1.
Surya

Similar Messages

  • Executing a Operating System command from Stored Procedure ??

    I want to execute a Operating System command from a PL/SQL Stored Procedure, can anyone suggest me how can I do this ??
    I am on Sun-Solaris with Oracle 8.1.7 database.
    Please do email me at [email protected]
    Thanks in Advance,
    Ramesh L.

    Are you using a webserver? If so, you could make your operating system script into a CGI program, then execute it from pl/sql using utl_http.request.

  • UNIX scripting with id and password in clear text

    Hi
    I have a shell script to connect and do several PLSQL.
    how can the script doing it without the ID password in cleartext?
    i.e.
    #!/bin/sh
    conn id/password ....

    If you create an operating system authenticated user, you connect to the database without a password, i.e.
    sqlplus / is sufficient (assuming the script is running as the appropriate operating system user). Tom Kyte talks about this here
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1477204811604
    There are examples of using DBMS_SCHEDULER to invoke operating system scripts on Tim Hall's site
    http://www.oracle-base.com/articles/10g/Scheduler10g.php
    Justin

  • Issue with executing diff scripts.

    Hi,
    I have an sql file which we run thru sqlplus. The file has list of scripts to be compiled. Now based on environment i wanna choose which script to be compiled. How should i achieve that?
    schema_changes.sql file
    def dw_user =&1
    def env =&2
    alter session set current_schema=&dw_user._staging;
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA.SQL
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    @EDW/dbscripts/DW/SCHEMA/STAGING_TRG.SQL
    /If the user inputs env as QA, it should compile BUILD_DW_SCHEMA_QA.SQL or else it should compile BUILD_DW_SCHEMA.SQL. I'm not sure SQL block IF END IF will do as we have to have to execute scripts kept on server. Please advice.
    Will the below work:
    def dw_user =&1
    def env =&2
    alter session set current_schema=&dw_user._staging;
    BEGIN
    IF (env = 'QA') then
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    ELSE
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    END IF;
    END;
    @EDW/dbscripts/DW/SCHEMA/STAGING_TRG.SQL
    /

    GR wrote:
    Hi,
    I have an sql file which we run thru sqlplus. The file has list of scripts to be compiled. Now based on environment i wanna choose which script to be compiled. How should i achieve that?
    schema_changes.sql file
    def dw_user =&1
    def env =&2
    alter session set current_schema=&dw_user._staging;
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA.SQL
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    @EDW/dbscripts/DW/SCHEMA/STAGING_TRG.SQL
    /If the user inputs env as QA, it should compile BUILD_DW_SCHEMA_QA.SQL or else it should compile BUILD_DW_SCHEMA.SQL. I'm not sure SQL block IF END IF will do as we have to have to execute scripts kept on server. Please advice.
    Will the below work:
    def dw_user =&1
    def env =&2
    alter session set current_schema=&dw_user._staging;
    BEGIN
    IF (env = 'QA') then
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    ELSE
    @EDW/dbscripts/DW/SCHEMA/BUILD_DW_SCHEMA_QA.SQL
    END IF;
    END;
    @EDW/dbscripts/DW/SCHEMA/STAGING_TRG.SQL
    No, that won't work, as you cannot embed SQL*Plus commands into the PL/SQL language, they are two seperate languages. PL/SQL does not support SQL*Plus commands.
    What you are trying to achieve would be more easily implemented using operating system scripting languages, though the exact script would depend on whether you are using a Windows based o/s or Unix based o/s. The o/s script would be able to prompt for input from the user and has the ability to do conditional processing, thus you can get it to call SQL*Plus with the relevant scripts as the input.

  • Background Script if database get disconnect Re open an application

    Dear Sir,
    we prepare a shell script to Re open an application if database get disconnect,
    and the details as showing below:
    *#  -1-to check if we are not connecting to Database Re-open*
    tnsping80 tnsname > c:\test.txt
    FOR /F "skip=6" %%A IN (C:\test.txt) DO IF %%A NEQ OK GOTO reset
    del c:\test.txt
    *#  -2- to check if there is any job waiting on database Re-open*
    sqlplus -s username/password@tnsname @jobWaiting.sql
    FOR /F "skip=3" %%A IN (C:\test.txt) DO IF %%A EQU 1 GOTO reset
    del C:\test.txt
    My problem is when the database get disconnecting after calling statement-1-, statement -2- failed and the background process stop working,
    so how i can catch the error when I'm calling sqlplus -s username/password@tnsname.
    Regards,

    First try to sqlplus -l option to ask sqlplus to exit after first connection failure otherwise sqlplus retries to connect and prompts for new connect string:
    >
    -L[OGON]
    Specifies not to reprompt for username or password if the initial connection does not succeed. This can be useful in operating system scripts that must either succeed or fail and you don't want to be reprompted for connection details if the database server is not running.
    >
    Then on Windows use %errorlevel% to check sqlplus return code. If sqlplus connection fails, errorlevel should be set to a non zero value.

  • CSS custom script - is this possible?

    Hi, I'm trying to determine if it's posible to write a script that will retrieve an html page, return some user credentials (login) to the server, and upon successful authentication, download a small text file. The service will be declared active if these three steps are successful
    I have seen that it's not recommended to use disk I/O operations in scripts, which is something I will take into consideration, but is the scripting language capapble of performing these three functions within one script?
    Many Thanks in advance

    With NTLM this is not possible.
    Because the server sends some kind of challenge that is different each time.
    The response of the client will depend on the challenge and again it will also be different.
    So, you first would need to know the NTLM protocol which is Microsoft proprietary so it's hard to find info, and implementing this in a script will be even harder.
    So, the answer is no way.
    Gilles.

  • Need Export script

    i want to schedule the export of full database on daily basis.
    DB is on windows2003 server.
    can any expert provide me the script to automate this job eiter by operating system script
    or by using SQL script.
    Thankx in Advance...

    You can get answers in Google for this
    from cmd
    cmd>exp username/pwd@hoststring file=c:\dbbackup\SID.dmp full=y buffer=671000864
    create a batch file
    set the oracle_sid in the batch file before issuing the export command
    Should help
    shedule this batch job in windows scheduling options
    Message was edited by:
    Maran.E

  • Subroutines in script

    hi friends...
    i need to know where we use  subroutines in scripts..... further is it really necessary to use the same ...since using subroutines reduces performance!!!!!

    Hi..,
    <b>
    In some case we need to do some mathematical operations in scripts !! Those things we cant do in Script Editor !! thats y the subroutines are there in scripts !!</b>
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    <b>Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.</b>
    regards,
    sai ramesh

  • Error while creating Document Templates

    Hi Experts,
    Am getting an ActiveX error while trying to create a document template designer using a webservice I created in the WST. I have consulted note 1018674 and ensured that the following browser settings are activated but still I keep getting the error.
    - Active Scripting
    - Run Active X Controls and plug-ins
    - Initialize and script ActiveX controls not marked as safe
    Also, since I had been trying to create a microsoft word type of template the system does open an instance of the word doc. Can anyone pls advice?
    How can we ensure that the webservice we have created is working. When I try to test the service in the WST tool, I keep getting the message - URL cannot be retrieved. Does it mean that the service has not been created correctly?

    Check if you done all the following settings...
    .NET Framework-reliant components:
    ○     Run components not signed with Authenticode ® Enable
    ○     Run components signed with Authenticode ® Enable
    ActiveX controls and plug-ins:
    ○     Download signed ActiveX controls ® Enable
    ○     Initialize and script ActiveX controls not marked as safe ® Enable
    ○     Run ActiveX controls and plug-ins ® Enable
    ○     Script ActiveX controls marked safe for scripting ® Enable
    Downloads:
    ○     File download ® Enable
    Miscellaneous:
    ○     Installation of desktop items ® Disable
    Scripting:
    ○     Active scripting ® Enable
    ○     Allow paste operations via script ® Enable
    ○     Scripting of Java applets ® Disable
    ●     To enable groupware integration, adjust the browser settings under Tools ® Internet Optionsu2026 ® Security ® Custom Levelu2026 as follows:
    ActiveX controls and plug-ins:
    ○     Download unsigned ActiveX controls ® Prompt.
    ○     Initialize and script ActiveX controls not marked as safe ® Enable
    ○     Run ActiveX controls and plug-ins ® Enable

  • OS level command before message processing

    Hello
    I am getting the files from the SFTP server through the shell script and expecting to be processed by my File sender adapter.
    I have configured my File adapter which will poll the directory into which the shell script gets the file and it is scheduled at say 60 sec duration and i had configured OS level command before message processing.
    But when i monitored my communication channel and also my directory I found out that its not executing the OS level command. I tried dropping the dummy file into the directory. This time when checked in comm channel monitoring, it executes the OS  level command and gets the file from the SFTP server and adapter polls the SFTP file as well. But i don't want to use dummy file each time.
    Is there any way by which we can always make adapter to execute OS level command. I tried various options like Process Empty files etc etc but no luck.
    Thanks in advance.
    regards
    rajeev

    Rajeev
    How about placing a dummy file of 0 bytes, setting up the 'Handling of Empty Files = Don't create message', Processing mode = 'Test' and then writing a post operating command script as well, to move all the files to archive directory except the dummy file.
    Not a clean solution but just a thought.
    http://help.sap.com/saphelp_nw70/helpdata/en/e1/69a740aa053a13e10000000a155106/frameset.htm

  • Why doesn't Photoshop always generate a layer mask

    I believe it was in CS4 that Adobe expanded the use of automatic layer masks ... perhaps it was with adjustment layers (I'm not quite sure)
    I don't know about others, but it would save me considerable time in the long run if every new layer, (whether it is generated as a copy, from a plug-in, as a cut, or as a new blank layer) recevied an automatic layer mask. It takes no file space, but more often than not I find myself needing one. It sure would be nice to jump right into masking rather than having to first create the layer mask. Why did they stop at adjustment layers?
    Am I alone in this?
    thanks

    Adding layers like Text, Raster and smart objects never have had automatic layers mask added.  Adding adjustment layers always came with an automatic layer mask until CS4.  Adode introduced bugs in CS4 when they added the adjustment panel these bugs have been carried forward into CS5 and CS6. Adobe added two options in the adjustment panels fly-out panel.  These options are designed to be global, not just adjustment panel options.  These options only work sometimes when changed from their default settings.  When changed from their default settings they try to change Photoshop historic default operation.  When you change Photoshop default operation Action, Scripts and Plug-ins that add adjustment layers may not work correctly.  Adobe should fix Photoshop and remove the two bad Adjustment Panel fly-out options. The Adjustment Panel fly-out menu option to not add Layer masks can not be safely set, same goes for the option to always clip added layer mask, if you use Actions, Scripts and Plug-ins that add adjustment layers.

  • Stack-A-Matic Broken in CS-4

    Using PhotoShop CS 4 on Windows XP.  Have updated via Adobe for current files.  Running CS 4 Version 11.01
    Installed Dr. Brown's Services 2.02 and installer.
    When selecting Tools > Dr. Brown's Services 2.02 > Stack-A-Matic in bridge, the script will NOT display the menu to select "create stack, stack mode, auto aligh and force 16 bi"t. Script should run in both Photoshop CS4 and CS4 Extended as stated in Adobe information.
    The script will run, but takes all of the images and places them into PS as individual layers.  When viewing the tutorial "Combining Multiple Exposures With Dr. Brown's Stack-A-Matic" posted on 5/9/09 the information shows a smart object should be listed in the layers palette.  There is no smart object or menu.  It is like the script is running one of the other Dr. Brown services such as merge in place of stack.
    Any suggestion for a fix?  Either operator or script?
    Thanks,
    Jim

    Stack-A-Matic is not intended to work in the non extended version of CS-4.  It is an application designed for CS-4 Extended. Thus it will fail if used in the incorrect version of CS-4.

  • Standby DB on Standard Edition

    Hi,
    I've just created standby database using Oracle DBMS 10.2.0.2 Standard Edition on IBM AIX 5L. Because it's Standard Edition, I had to use a operating system scripts for log shipping and log apply operations. My log apply script looks like that:
    #!/bin/sh
    export ORACLE_SID=ORCL
    sqlplus "/ as sysdba" <<EOF
    set echo on
    spool /oracle/standby/logs/logapply_ORCL.log
    alter database recover automatic standby database until cancel;
    alter database recover cancel;
    spool off
    EOF
    in the logapply_ORCL.log file i always find a message like that listed below:
    SQL> alter database recover automatic standby database until cancel;
    alter database recover automatic standby database until cancel
    ERROR at line 1:
    ORA-00279: change 8029736 generated at 03/17/2006 11:33:45 needed for thread 1
    ORA-00289: suggestion : /oracle/archlog/ORCL/1_232_579584255.dbf
    ORA-00280: change 8029736 for thread 1 is in sequence #232
    ORA-00278: log file '/oracle/archlog/ORCL/1_232_579584255.dbf' no longer
    needed for this recovery
    ORA-00308: cannot open archived log
    '/oracle/archlog/ORCL/1_232_579584255.dbf'
    ORA-27037: unable to obtain file status
    IBM AIX RISC System/6000 Error: 2: No such file or directory
    Additional information: 3
    SQL> alter database recover cancel;
    Database altered.
    SQL> spool off
    I know that this error is ok, and it means that Oracle couldn't find file which probably doesn't exist. Is it possible to have that information more friendly or presented in more pleasant way?
    Thanks,
    Tim

    since, you are on unix, you can do anything you want with the logfile. Just cut out the message and replace it with a new one.

  • Javascript help needed (confirmation for cancel button )

    Hi guys!
    I am not good at javascript but am going to improve shortly :-). Now i need very quick fix.
    I'm using <html:cancel> button in Struts 1.1 and I'm using without thinking the following code:
    <html:cancel onclick="bCancel=true;" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    It is not that important though. I would like very much to alert user on possible loss of data (long multipaged form - could press mistakingly, who knows).
    Would you, please post the javascript code that is needed to accomplish this - just alert and if yes - cancel, no - leave alone?
    I'll really appreciate this.

    Thank you for your response.
    I also manage to write this. Is this correct?
    <script language="JavaScript">
    function ensure() {
    return confirm("Are you sure that you want to cancel this operation?");
    </script>
    <td colspan="3" align="center">
    <html:cancel onclick="bCancel=ensure();" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    </td>

  • Sending Attachments using Oracle Alerts

    Hi All,
    I am working on Oracle Alerts. I have to send an output of the report to the client, is it possible to send using Oracle Alerts.
    Thanks in Advance,
    Venky.

    Hi,
    To send attachments using Oracle Alert, you can follow below mentioned steps:
    1) While defining Oracle alert Action, Select 'Action Level' as 'Summary'
    2) In Action Details, select 'Action Type' as 'Operating System Script'
    3) Select 'Text' radio button
    4) Write following code : uuencode <Name of the file along with the path> <Name of the attachment in the mail>|mailx -c &cc_mail_id,&to_mail_id -s "<Subject of the Mailer>" &to_mail_id.
    5) You can use mail or sendmail command also instead of mailx command.
    6) Save Alert details
    Thanks and regards,
    Indira

Maybe you are looking for

  • Can't open Dawsonera protected file on latest version of Adobe

    Everytime I try it says 'An error occurred while performing the operation. Contact and administrator if the problem persists' I tried uninstalling it and reinstalling it but to no avail. Please help as I need to look at this ebook for coursework.

  • Automatic Creation of Planned Order in PPDS Horizon

    Dear Experts, Kindly answer my following query. I have created PIRs before/inside my PPDS Horizon (its also falling outside horizon as SNP horizon is shorter than PPDS Horizon). If I check the PIRs created by me in /SNPAPO/RRP3, it also shows me plan

  • How to convert Oracle to SQL (Dual)

    Hello everyone, Thanks in advance for your time and help. I am using an application to try to generate a report, and it relies on SQL in the syntax that the database back-end is using. In my case, this is SQLServer. I have a colleague who is using th

  • Module-pool edit mode to non edit mode

    Dear friends , I am working with module-pool, In that  when i enters value that field should become Visible mode   and should  not allow user to edit amount  Please guide me . thanks & regards

  • Photoshop script to export to Edge not working on mac?

    Hi Have any PhotoShop CC 2014 v15.2.2 mac users used the script supplied by Adobe on Sep 18, 2014 successfully?  blogs.adobe.com/edge/2014/edge/2014/09/18/export-sprite-sheet-from-adobe-photoshop/ Please, I've started this thread again, I really need