How to declare variables in the script

My total data is coming from standard print  program.
i copied standard form into zform.
i am dispaying regup-skfbt and regud-wrshb in my layout set.
now i want to deduct regup-skfbt and regud-wrshb and display in layout set only.
for the above issue how to solve.

Hiiii
write the subroutine in the layout
ex: perform (performname) in program(program name)
     using (regup-skfbt )
     changing(regup-skfbt )
goto se38 in the attributes types select the subroutine pool
in tht write as follows:
form <perform name> using in_par
                                changing out_par
read table in_par index 1.
write ur code depends on ur business process
modify out_par index sy-tabix.
endform
reward points if useful
regards
Jaipal

Similar Messages

  • How to declare variable in the scipt

    data is coming from standard program .
    rf140-stida key entry date.
    bsik-bldat posting date
    i want to display difference between  rf140-stida and bsik-bldat in scipt form it will give number of days.
    how can i declare variables for this.
    how to write code in my form.

    Hi
    U need to create a routine to calculate the difference:
    /: DEFINE &DELTA& = SPACE
    /: PERFORM <FORM NAME> IN PROGRAM <PROGRAN NAME>
    /: USING &RF140-STIDA&
    /: USING &BSIK-BLDAT&
    /: CHANGING &DELTA&
    &DELTA&
    The routine has to be defined in your Z-PROGRAM and to have these interface:
    FORM <FORM NAME>  TABLES IN_TAB_EM     STRUCTURE ITCSY
                                                       OUT_TAB_EM STRUCTURE ITCSY.
      DATA: DELTA TYPE I.
      DATA: DATE1 LIKE SY-DATUM,
                 DATE2 LIKE SY-DATUM.
    * ---> Rembember the date has the ouput format, so it has to be converted in the
    * input format
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'RF140-STIDA'.
      IF SY-SUBRC = 0.
         DATE1(4)     = IN_TAB_EM-VALUE+6(4).
         DATE1+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE1+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'BSIK-BLDAT'.
      IF SY-SUBRC = 0.
         DATE2(4)     = IN_TAB_EM-VALUE+6(4).
         DATE2+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE2+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      DELTA = DATE1 - DATE2.
      READ TABLE  OUT_TAB_EM WITH KEY NAME = 'DELTA'.
      IF SY-SUBRC = 0.
         WRITE DELTA TO OUT_TAB_EM-VALUE.
         MODIFY OUT_TAB_EM INDEX SY-TABIX.
      ENDIF.
    ENDFORM.
    Max

  • How to declare variables in standard text  - so10 t.code

    Hello Friends,
             How to declare variables in standard text  - so10 t.code? Your response will be appreciated much.
    Thanks
    Sri

    For Script & Smartform  Text - &VAR&

  • Reg:How to add fields to the scripts in detail

    How to add fields to the scripts in detail.
    Plz give me one example help me out.

    Hi
    add fields to the scripts by sending that field between  two &s.
    for example if u want to add lifnr of lfa1 table then pass field like this.
    &wa_lfa1-lifnr&.here wa_lfa1 is work area for internal table it_lfa1.
    if name1 then &wa_lfa1-name1&
    in this way you can add fields to the script under any window.
    i am sending one example program for scripts.
    &--structure declaration--
    TYPES:BEGIN OF ST_LFA1,
          LIFNR TYPE LFA1-LIFNR,
          NAME1 TYPE LFA1-NAME1,
          LAND1 TYPE LFA1-LAND1,
          ORT01 TYPE ORT01,
          REGIO TYPE REGIO,
          END OF ST_LFA1.
    TYPES:BEGIN OF ST_EKKO,
          EBELN TYPE EKKO-EBELN,
          BUKRS TYPE EKKO-BUKRS,
          AEDAT TYPE EKKO-AEDAT,
          ERNAM TYPE EKKO-ERNAM,
          BSTYP TYPE EKKO-BSTYP,
          LIFNR TYPE EKKO-LIFNR,
          END OF ST_EKKO.
    TYPES:BEGIN OF ST_EKPO,
          EBELN TYPE EKPO-EBELN,
          EBELP TYPE EKPO-EBELP,
          LOEKZ TYPE EKPO-LOEKZ,
          AEDAT TYPE EKPO-AEDAT,
          MATNR TYPE EKPO-MATNR,
          NETWR TYPE EKPO-NETWR,
          END OF ST_EKPO.
    &--internal table,work area declaration--
    DATA:WA_LFA1 TYPE ST_LFA1,
         IT_LFA1 TYPE STANDARD TABLE OF ST_LFA1,
         WA_EKKO TYPE ST_EKKO,
         IT_EKKO TYPE STANDARD TABLE OF ST_EKKO,
         WA_EKPO TYPE ST_EKPO,
         IT_EKPO TYPE STANDARD TABLE OF ST_EKPO.
    &--data declaration--
    DATA:TOTAL TYPE EKPO-NETWR,
          V_EBELN TYPE EKKO-EBELN.
    data: v_item(20) type c.
    &--parameter for purchase document number--
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS P_PURDOC LIKE V_EBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA_FROM_EKKO.
      PERFORM GET_DATA_FROM_LFA1.
      PERFORM GET_DATA_FROM_EKPO.
    &--grand total--
      LOOP AT IT_EKPO INTO WA_EKPO.
        TOTAL = TOTAL + WA_EKPO-NETWR.
        CLEAR WA_EKPO.
      ENDLOOP.
    &--open form--
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
        DEVICE                            = 'PRINTER'
        FORM                              = 'Z_50886_VENDOR'
        LANGUAGE                          = SY-LANGU
       EXCEPTIONS
         CANCELED                          = 1
         DEVICE                            = 2
         FORM                              = 3
         OPTIONS                           = 4
         UNCLOSED                          = 5
         MAIL_OPTIONS                      = 6
         ARCHIVE_ERROR                     = 7
         INVALID_FAX_NUMBER                = 8
         MORE_PARAMS_NEEDED_IN_BATCH       = 9
         SPOOL_ERROR                       = 10
         CODEPAGE                          = 11
         OTHERS                            = 12
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for header details--
      READ TABLE IT_EKKO INTO WA_EKKO INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'HEAD'
         WINDOW                         = 'HEADER'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for item details--
      LOOP AT IT_EKPO INTO WA_EKPO.
      concatenate wa_ekko-ebeln wa_ekpo-ebelp into v_item.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           ELEMENT                        = 'ITEM'
           WINDOW                         = 'MAIN'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
    &--write form for vendor details--
      READ TABLE IT_LFA1 INTO WA_LFA1 INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'VENDOR'
         WINDOW                         = 'ADDRESS'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for grand total--
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        WINDOW                         = 'TOTAL'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    &--close form--
      CALL FUNCTION 'CLOSE_FORM'
       EXCEPTIONS
         UNOPENED                       = 1
         BAD_PAGEFORMAT_FOR_PRINT       = 2
         SEND_ERROR                     = 3
         SPOOL_ERROR                    = 4
         CODEPAGE                       = 5
         OTHERS                         = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  get_data_from_ekko
    FORM GET_DATA_FROM_EKKO .
      SELECT EBELN
             BUKRS
             AEDAT
             ERNAM
             BSTYP
             LIFNR
          FROM EKKO INTO TABLE IT_EKKO WHERE EBELN = P_PURDOC.
    ENDFORM.                    " get_data_from_ekko
    *&      Form  get_data_from_lfa1
    FORM GET_DATA_FROM_LFA1 .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT LIFNR
               NAME1
               LAND1
               ORT01
               REGIO
               FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_EKKO WHERE
                    LIFNR = IT_EKKO-LIFNR.
      ENDIF.
    ENDFORM.                    " get_data_from_lfa1
    *&      Form  get_data_from_ekpo
    FORM GET_DATA_FROM_EKPO .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT EBELN
               EBELP
               LOEKZ
               AEDAT
               MATNR
               NETWR
               FROM EKPO INTO TABLE IT_EKPO
               WHERE EBELN = P_PURDOC.
      ENDIF.
    ENDFORM.                    " get_data_from_ekpo

  • How to include variable in the text column in report painter?

    Dear Expert,
    Would like to seek for your help to include How to include variable in the text column in report painter?Please advice.
    Thank you.
    Regards,
    Karen
    Edited by: Karen Swee Ping Ho on Jun 17, 2011 2:48 AM

    Hi,
    Thank you for the promt reply.
    1) How I include the variable in the column header to display fiscal year which I have selected from the selection screen?
    which variable should i use?
    2) Where can i find more information about the characteristic and which variable to be use base on the characteristic?
    For example: I would like to display the fiscal year from the selection screen/input screen when execute the report which also will reflected to the element definition and will display the fiscal year also in the column text?
    3) Kindly advise base on question 2, the variable that i use in element definition it will also display  in selection screen?
    4) When execute the report the first selection screen input parameter it obtain from where it is from element definition?
    5) Please advice how to be done when report execute with first screen input selection will also reflect the element definition of column and rom with the selection of the fiscal year?
    Please help.
    many thanks
    Edited by: KH on Jun 18, 2011 7:18 AM

  • How to create Variables for the Key Figures

    Hi All,
    How to create Variables for the Key Figures
    Thanks
    Bhaskar

    Hi,
    It is not possible to create the variables on Key figures directly. But we can create a formula variable with processing type 'User Entry' ,SO that the user entered value can be used in the calculations of the query.
    With rgds,
    Anil Kumar Sharma .P

  • Error 1047 in LabVIEW 8.2: LabVIEW failed to send variable to the script server. Server:""

    I am working with the evaluation version of labVIEW as well and I have run into another error.  I am using a MATLAB script node within a for loop and attempting to pass the for loop counter variable into the script.  When I run the code it brings up a 1047 error and says "LabVIEW failed to send variable to the script server. Server:"" ".  I looked up the error online which seems to have roots in a failed auto initialization of MATLAB.  Is there something that I can do in labVIEW to fix the problem or is it strictly a MATLAB error?  
    I really appreciate your help.

    I'm using Labview 8.6 and Matlab 7.9 2009b on windows 7 (64bit)
    when I tried to open the Lorenz Diff Eq.vi....it woes not work and gives the error
    Error 1047 occurred at LabVIEW:  LabVIEW failed to send variable to the script server. Server:"" in MATLAB script node - Lorenz Diff Eq.vi
    I think there is no inital communication for opening the MATLAB server
     any can help?
    A.Hakim

  • How to specify a variable in the script logic

    I want to pass a variable from the process chain using the prompt statement.
    I  want to refer to the variable name in the script. When I used the following statement in the script file, I got an error when validating the statement below:
    //Increase Wage and Salary & Personnel Exp. by entered percentage
    [P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Syntax error:Reference Error: $WS_PERCT$  is not defined
    One of the how-to guides indicated that I should use the dollar sign before and after the variable name.
    Can someone explain how to specify a variable name in the script.
    Thanks.

    Thanks, Pravin.
    I tried using the syntax with the # sign (as shown below) but when I validate the code I get an error. The message indicates there is an issue with $WS_PERCT$.
    Syntax error:Reference Error: $WS_PERCT$ is not defined
    P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Can you please advise if am missing something here in the code.
    Edited by: Sanjay Kumar on Sep 24, 2009 10:06 PM
    Edited by: Sanjay Kumar on Sep 24, 2009 10:08 PM

  • Declaring a variable in the Script?.

    Hi,
    Will it be possible to define the variable in the form?..
    I have used the DEFINE statement, will the define statement behave as a constant?...Please see the below code:
    Defined the variable - 'l_barcode_flag' with the SPACE.
    In the perform am changing the variable to X. will it work?.
    /:          Define & l_barcode_flag&  =  u2018  u2018.
    /:          perform get_barcode_for_shop_papers in ZPPPF01
    /:           using      &WWORKPAPER-WORKPAPER&
    /:           changing &l_barcode_flag&
    /:          endperform
    /:           IF & l_barcode_flag & eq u2018Xu2019.
    /          <BW> &CAUFVD-AUFNR&</>.          u201D Barcode
    /:          ENDIF.
    I can't use the Driver program to define the variables.
    Thanks,
    Neslin.
    Edited by: neslin on Sep 15, 2008 8:07 AM

    Jyothi,
    This is wht u mean?...without assigning anything and defieningn a variable
    Define &L_BARCODE_FLAG& .
    Oki,,
    U mean the space in the variable...& L_BARCODE_FLAG&..thnks, Neslin.
    Neslin.
    Edited by: neslin on Sep 15, 2008 8:38 AM

  • How to use variable in rule script in HFM

    I'm now writing VB script for HFM rule, and have something to ask about the use of variables in rule.
    The script below generates the following error.
    -Error description-
    Line: 4, Error: Invalid Expression
    HS.Exp "S#Actual.A#77300.I#[ICP None] = cur"
    An error has occurred in Hyperion Financial Management.
    -Rule script-
    Sub Allocate()
    Dim cur
    cur = 500
    HS.Exp "S#Actual.A#77300.I#[ICP None] = cur"
    End Sub
    On the other hand, the script below works properly.
    -Rule script-
    Sub Allocate()
    HS.Exp "S#Actual.A#77300.I#[ICP None] = 500"
    End Sub
    Probably I'm not using variables in proper way, but have no idea how to correct it.
    Does anyone have any idea?
    Thanks in advance.

    Hello,
    try this in the sub calculate:
    HS.Exp "S#Actual.A#77300.I#[ICP None]=" & cur
    For the sub allocate, I suppose that you do not have the issue because the allocate is not launch during the consolidation process. Allocate is launched separatly by a right click, and can only be done when calculation status = "OK", which means that all calculation have been done (that could not be the case if you have an error like this in sub calculate).
    Hope it helps

  • How can I include all the scripts in a folder?

    I've been using CFAJAXIMPORT to import all the scripts from
    CFIDE. I need to include this folder to get things like CFWINDOW to
    work properly. I'm attaching how I've been trying to import all the
    scripts but I get an error when I use CFAJAXIMPORT. It says
    "Invalid usage of AJAX tag" "Use cfajaximport tag to specify
    SCRIPTSRC or make sure all ajax controls are inside a single cfform
    tag that has SCRIPTSRC". The leads me to think that CFAJAXIMPORT is
    not the correct way to load all the scripts from a specified
    directory. This how I call that CFAJAXIMPORT tag:

    here's from the cfml reference:
    quote:
    scriptSrc attribute:
    Specifies the *URL, relative to the web root*, of the
    directory that
    contains the client-side script files used by ColdFusion.
    This directory
    includes the JavaScript files and the default location of the
    CSS files
    used for all AJAX features.
    If you use this attribute, the *cfajaximport tag must precede
    all other
    ColdFusion AJAX tags on the page*; that is, all tags that
    rely on the
    scripts.
    *You can have only one scriptsrc attribute on a page*, in a
    cfajaximport
    tag or a cfform tag. You can use a scriptsrc attribute in a
    cfajaximport
    tag to apply its value to all forms on a page.
    make sure you meet all 3 conditions marked with * *.
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • How create a variable in the TVARVC that calculate the last week

    Hi Gurus,
    i need create a Variable in the table TVARVC that calculate which was the last week to run a Program in BW,  i have no idea how can i do it, where do i must start? please can you tell me step by step, i will really appreciate it

    This blog should help you create a variable in TVARVC table:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9075b11a-6e43-2c10-b7be-cfa0e97ec0cc?quicklink=index&overridelayout=true
    you can leave out the information broadcasting part. But can you elaborate what exactly is the requirement.

  • How to declare variable Forms Personalization

    Hi
    I want to use a variable in a form to assign it to a procedure which I am calling in the form itself?
    How can i define such a variable
    I wanted to use global variable but i read somewhere global variable can only be used when passing parameters between several forms
    so is there any other way?

    Hi,
    Is your procedure a database procedure or attached as a library to the Form? If its in the database, you cannot use a global variable - however, if its attached to the form itself, yes, you can define a global variable and refer it in the procedure. (Its preferable to initialize such a variable in the WHEN-NEW-FORM-INSTANCE trigger to avoid any issues arising out of transactional problems).
    Rgds,
    Rakesh.

  • How to pass variables to shell script?

    I have a shell script which uses the touch command to change the date of a file.  To run the command on the command line the syntax is:
    set-file-date.sh <file> <date>
    I'm trying to run it from an automator workflow, so I'm prompted for the date, then the workflow iterates over the finder items, i.e., files, and changes the date of each files.
    The problem is in the "Run Shell Script" action.  The $@ is substituted with the file names selected in finder, so this will echo the file names:
    for i in "$@"; do
         echo "$i"
    done
    What I want to do is something like this:
    for i in "$@"; do
         set-file-date.sh <DATE VARIABLE> "$i"
    done
    But I can't prompt for the date value, and pass it to the script.  I've tried using the "Get Value of Variable" and the "Ask For Text" actions.  I can either get the file names from finder OR the text input in the "Ask for Text" action, but not both.
    Is what I'm trying to do possible with a shell script?
    -Thanks

    This is standard AppleScript text concatenation...
    set howManyWords to do shell script "wc -w /path/to/file | awk '{print $1}'"
    do shell script "/usr/local/bin/growlnotify -t 'Corpus' -m '" & howManyWords & " words were added to the corpus.'"
    in other words, just use the & to concatenate the parts of your text together.

  • How to declare webservice in the application's xml file

    Hi
    Is there a way by which we can declare webservice in the application's xml file.if yes how..?
    please help

    I'm no expert, but I find that if you generate Java from a WSDL, the resulting code is fairly ugly and difficult to control. (Similarly, if you generate a WSDL from a Java class, the WSDL is pretty ugly).
    One way to encode "contants" in a WSDL is in a referenced schema, using an enumeration restriction, viz:
          <simpleType name="SuccessCode">
            <restriction base="string">
              <enumeration value="FAILURE"/>
              <enumeration value="SUCCESS"/>
            </restriction>
          </simpleType>Now, that would result in an enumeration-style class in your generated source. That's the best I can think of, others may be able to suggest something better. If you wrap the web service in an adapter that hides its ugliness, maybe you can map the constants across there.
    Like I say, I'm far from an expert, these are just my first thoughts.
    -Tim

Maybe you are looking for

  • Wrong GL  has been assigned  to invoice how to change or update?

    Dear Expert, Some of transaction are wrongly assign to different GL, Customer have to correction in  the some transaction which are in Closed status and some are Open AP and AP invoices MY Actual GL is in Expenditure basket but mistakenly it transfer

  • Question about host identifier definition

    Hi, I've created a webgate and define the "Preferred HTTP Host" as the hostname where the web app is deployed. It seems ok that the webgate will protect the URL containing the hostname. But after I've authenticated, when I change the hostname to the

  • How to change the View Type

    Hi All, I have created a view of type "List" . can i change it to Form view by any method? Regards Ashim

  • NSU error on 6220 classic - lost connection

    Hi, I'm new on the forum but not a newbie on computers. I've bought a Nokia 6220 Classic with fw 3.06, and installed NSU on Windows Vista SP1. During the update to fw 3.23, I get a white screen on the cell phone with "03.23 Local Mode" and Nokia logo

  • RDI Output from Sap Script

    Hello , I would like to know whether it is possible to generate RDI with some additional variables and at the same time hide them in SAP Script. Regards Amruta