Pass value in SAP Script

How can u pass value in SAP Script?& where?

Hi,
PASSING TABLE VALUES AS AN ARGUMENT TO SAPSCRIPT:
In the line editor, specify the table field arguments enclosed by '&' symbol as follows:
/E  ELEMENT
     &KNA1-KUNNR& ,, &KNA1-NAME1& ,, &KNA1-LAND1&
Save -> Activate.
In the Print Program, specify following code:
TABLES KNA1.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
   FORM                              = 'ZSHABFORM1'
   LANGUAGE                          = SY-LANGU.
SELECT * FROM KNA1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'ELEMENT'
   WINDOW                         = 'MAIN'.
ENDSELECT.
CALL FUNCTION 'CLOSE_FORM'.
Save -> Activate -> Execute.
Regards,
Priya.

Similar Messages

  • Passing Value to Java Script Code in a BSP

    Hi Guys,
    In order to use BSP Extension in my BS i need to specify the "ID" for the field / Text area / Table i want to work with.
    Now these elements (Field / Text Area / Table) are created by SAP CRM automatically and i am not sure how i can get the name of the ID for such a element.
    I tried using FIREBUG in firefox to get this ID but the problem is that this ID changes dynamicaly and i cant hardcode it in my BSP application.
    Can anybody point help me taht how can i determine the ID dynamically at runtime and then use it in my BSP application.
    Thanks in advance.

    Hi,
           You can pass data from SAP to javascript in the following way. Suppose I have created an input field like
    <thtmlb:inputField id      = "IF1"
                       type    = "string"
                       visible = "false"
                       value   = "//mynode/myattr" />
    Note that I have bound the input field to a context node attribute. This is only necessary if you wish to access this field inside your controller methods.
    Now, you can access this input field in your javascript in the following way. Inside the script, setting th evalue or reading, whatever,
    document.all("<%= controller->component_id %>_IF1").value = "some text" ;
    Regards,
    Arun Prakash

  • Comma not seen in the amount value in SAp Script

    Hi,
    I am printing the folllowing values which contain amounts in SAP Script.
    <Z>Sum total,,,,,,&REGUD-SWRBT(13)&,,&REGUD-SWABZ(9)&,, &regud-swnet(13)&</>
    Both the values are printed as the following
    REGUD-SWRBT  = 20000,000.00
    regud-swnet         = 20000,000.00
    I want the same to be printed as below.
    (ie the comma seperator to be printed in the second set of 3 zeroes as well)
    REGUD-SWRBT  = 20,000,000.00
    regud-swnet         = 20,000,000.00
    Can any one suggest me please.
    Thanks !!
    Regards

    Hi Adarsh,
    Actually the problem here is that the field length of the field SWRBT is only 13 and the extra comma you want, can not be accommodated there.
    You will have to declare a variable of about 14-15 field length and then
    pass this value in it. Definitely the comma will appear.
    Hope this is Useful.
    Thanks,
    Daya.

  • Floating value in sap script

    Hi Experts,
    How can i display a floating field having value  '8.5000000000000000E+01'
    as '85' in SAP-SCRIPT.
    Please suggest.
    Rajiv Ranjan

    Hi,
    Data : l_temp type i.
    Move l_float_value to l_temp.
    Pass the value of l_temp to SAP SCript.
    Best regards,
    Prashant

  • How To Display Minus value in SAP SCript

    Hello Guys.
    I am working on a Script. My Problem is that For a fields BSAD-DMBTR.
    I have to show this fields value as minus or plus as per condition with fields
    <b>bsad-shkzg</b>. In my Internal table it's update as minus but when  I am calling  Write form with loop.  the value is not display with minus sign.
    How can I display value with minus sign in SAP script.
    Regards
    Swati,,

    Hello Guys..
    Thanks for Reply. But I am doing that thing already. My Internal table is updated with minus value. My Problem is not That.
    let's suppose.
    itab-name  =  'xyz'.
    itab-value   =   100.
    append itab.
    itab-name  =  'xyz1'.
    itab-value   =   -1 * 100.
    append itab.
    loop at itab.
    CALL FUNCTION 'WRITE_FORM'
        EXPORTING
            element                  = 'LINE'
            function                 = 'SET'
            type                     = 'BODY'
            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.
    Now when value is printed in SAP Script both value is display as plus .I want to display secound value as minus.
    Please reply it's urgent.
    Thanks
    Swati....

  • How to calculate a value in sap script?

    Hi friends i have to do addition and then display the added value in grandtotal like
    total amount + late fee = grand total
    i have to do this in sap script can anyone tell me the procedure where to declare wheather in abap aditor if yes how?

    Hi ...
    Its easy to add up two values...
    u can do it in a subpool program...
    Refer the following code:
    Code the following in the Script...
    /:   PERFORM TOTAL_SUM  IN PROGRAM 'ZTEST_ADDITION'
    /:   USING    &VAL1&
    /:   USING    &VAL2&
    /:   CHANGING &TOTAL&
    In the EDitor..create a program ' ZTEST_ADDITION'..
    FORM TOTAL_SUM  TABLES in_tab  STRUCTURE itcsy
                                                 out_tab STRUCTURE itcsy.
    Read in_tab index 1.
    Here u will get the val1...
    Read in_tab index 2.
    here u will get val2.
    l_v_total = val1 + val2.
    read out_tab index 1.
    out_tab-value = l_v_total.
    modify out_tab index 1.
    Write the changing paramets in the form
    to Output the values...
    Thanx,
    navin..!

  • Rounding off to a variable value to 4 decimal values in sap script ouput

    Hi All,
    I have a value getting displayed in sap script output as 235.6789 i want to Round off this variable value to 4 decimal values!
    What is the formatting option need to be used & how!
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    1.In layout just call that variable, where you need like:
    &variable(.4)&.
    Just see these:
    &symbol(Z)&  Omit Leading Zeros 
    &symbol(S)&  Omit Leading Sign 
    &symbol(<)&  Display Leading Sign to the Left 
    &symbol(>)&  Display Leading Sign to the Right 
    &symbol(C)&  Compress Spaces 
    &symbol(.N)&  Display upto N decimal places 
    &symbol(T)&  Omit thousands separator 
    &symbol(R)&  Right justified 
    &symbol(I)&  Suppress output of the initial value
    Regards,
    If helpful reward with points(Don't forget).

  • Problem passing texts into sap-script

    Dear Experts,
    I have a requirement, where I have to pass some text-lines from my selection-screen of the driver-program to the sap-script,i.e. whatever I write in those text fields that should be displayed(printed) on the specified place of my script. Another specification is  that,
    those lines will get printed only if the checkbox on my selection-screen is checked.
    What should be the procedure,please help me.

    The text lines on the selection screen will be in a variable. Pass the variable to the SAPScript. I don't see the problem.
    Rob

  • Passing data to SAP script from print program-VF03

    Hi All,
    I have a stand alone print program which ahs the invoice number in its selection screen which when entered displays the layout of invoice by using a sap script.
    Now since I have to get this layout displayed from VF03, I have added the program, sap script name and a subroutine which contains the code which was initially there under the start-of-selection event in the stand alone program, in NACE. I have replaced the selection screen parameter for invoice number in my program with nast-objky which contains the invoice entered in vf03.
    But when I am entering the invoice in vf03 and selecting print preview, the data is getting captured in the internal table defined in my program but the same is not getting reflected in the layout displayed. So I am always getting the blank values in the output though I did not modify the original sap script at all. Pls help.

    Keep a breakpoint in your print program and see if your program is being triggered indeed. Do not forget to start Update debugging, otherwise it will not stop in your print program.
    Regards,
    Ravi

  • Pass value of Java script variable to ABAP variable (in BSP)

    Hi,
    I have a Javascript variable declared in the SCRIPT tag of BSP layout page.
    I want to pass its value to ABAP variable, so that later I can do some computations using the ABAP variable.
    (ABAP variable is also declared in the same SCRIPT tag of BSP page)
    Would request to post a sample code, if possible.
    Would appreciate quick replies.
    Thanks & Regards,
    Nisha Vengal.

    just check this
    https://forums.sdn.sap.com/click.jspa?searchID=16240444&messageID=1191305

  • Issue in Passing Value from SAP Portal through Open Doc

    Hi
    I am  trying to pass the variables through open doc link from SAP portal.
    I am trying to pass four variables.
    OrganisationHierarchy
    FiscalPeriodFrom
    FiscalPeriodTo
    Business
    OrganisationHierarchy  and Business are hierarchy variables.
    I am testing few scenarios.Scenario1 and Scenario 2 are working fine.
    But I am facing with Scenario3 and Secnario4.
    Scenario1
    Only two levels are passed to OrganisationHierarchy
    http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA++++++++++++++++++++++++++0HIER_NODE]&sRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010
    Result: Report is refreshed
    Status: Passed
    Scenario2
    Only two levels are passed to Business
    http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&sRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010&lsMBusiness=[0MAT_PLANT__ZBUSINESS++++++++RKEG_WWBUS_0MATPLANT].[ATV+++++++++++++++++++++++++++0HIER_NODE];[0MAT_PLANT__ZBUSINESS+++++++RKEG_WWBUS_0MATPLANT].[TPS++++++++++++++++++++++++++++0HIER_NODE]
    Result: Report is refreshed
    Status: Passed
    Scenario3
    When two levels are passed  for both OrganisationHierarchy,Business
    http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA+++++++++++++++++++++++++0HIER_NODE]&lsRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010&lsMBusiness=[0MAT_PLANT__ZBUSINESS+++++++RKEG_WWBUS_0MATPLANT].[ATV++++++++++++++++++++++++++++0HIER_NODE]
    Result: Report is  never refreshed and its keep on running
    Status: Failed
    Scenario4
    Only three levels are  passed for OrganisationHierarchy,
    No values are passed for Business
    http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA+++++++++++++++++++++++++0HIER_NODE]; [ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[ASEAN++++++++++++++++++++++++++0HIER_NODE]&lsRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010
    Result: Report is  never refreshed and its keep on running
    Status: Failed
    Thanks
    Arun

    Hello Rupachandran,
    the memory id won't work as it is within the current session only.
    you have two main options:
    1) pass parameters in URL
    2) persist the parameters somehow ( shared memory area, database table )  and pass a GUID in the URL which refers to these.
    strangely enough although this is a mirror of most of the posts here, which want to launch WDA apps from standard GUI based code, the techniques are very very similar.
    you might get some help from looking at this recent post Calling webdypro through R3 Function module

  • Passing values between eCATT scripts

    I have 3 scripts
    XD01 create a Sold to 
    FD32 Add Credit and A/R
    VA01 create Sale order.
    Those three scripts are then ran from a 4th script using the Ref command for each script.
    The first script stores the new customer number in a export Parameter called E_Soldto.    How do I pass this parameter on to the next to scripts.   Note both other scripts already have I_customer inport parmeters in them.  I need to pass the E_Soldto value to the I_Customer parameter. 
    Hope I explained that right
    Thanks
    Rudy

    Hi all,
    regarding STORE/RETRIEVE:
    STORE writes a eCATT variable into eCATT log similar like LOG does. Additionally a special STORE-index is written to remember the position in the eCATT log together with a couple of attributes for future selection.
    RETRIEVE accesses that index to provide reading for that previously stored value by selection on a couple of selection criteria.
    Imagine multiple STORE on the same eCATT variable in loops or in multiple script executions. A RETRIEVE on this does always return the latest stored value with additional respect to provided selection criteria, BUT with one exception: if a value for selection parameter LOGID is left out, RETRIEVE returns the eCATT parameter stored in the LOG for the scripts execution PREVIOUS to the current one.
    The consequence of the technical realisation:
    - STORE/RETRIEVE involves database access, this can be time consuming, so avoid it at REF
    - RETRIEVE offers comprehensive selection criteria allowing a couple of different scenarios but also enforcing correct maintainance of these selection especially with respect to logid
    - RETRIEVE works fine as long as the log of the corresponding STORE is available, so regular log deletion can influence parameter exchange
    Best regards
    Jens

  • Problem in Printing the values in SAP Script

    Hi,
    I have to print the material, description, quantity and value in the invoice.. the problem i face is.. the variables which is of size 40 characters. only prints the data and gets trimmed because of which the data displayed in the invoice not in order.
    can any one tell me how to find the length of the variable or is there any way to protect the variable from getting trimmed.
    Advance Thanks..
    Guhapriyan S

    Hi again,
    1. what problem are u facing ?
      (there is no sapscript symbol / system symbol
       for finding out the length )
      (In abap u can use strlen)
    2.  data and gets trimmed
       what is the meaning of it ?
    3. do u mean to say that  !
      ABCDEF                     123 45
      GEF                        123 45
      is getting pritned like
      ABCDEF 123 45  ?
      GEF  123 45
    4. If so , then use TABS
    5. This happens because SPACE
       is different in different varlues of
       ABCDEF and GEF !
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • Calculated value for SAP Scripts

    Hi All,
    I have made changes to two seperate print programs which are used to print Invoice and Packing Slip respectively. However, I'm using the dimension details from VEKP in both. When I calculate volume multiplying the length, breadth and height (data fetched from VEKP) table, in one of the programs, the calculated value appears correctly while in the other it is not.
    The Issue:
    While calculating volume in one of the programs the system does not recognize the decimal point and considers it as a thousand separator and hence it arrives at wrong calculated value. Whilst in the other program it is working fine. This appears weird to me since it is the same system, the data being the same, the variable declarations also being the same.
    Please let me know if there is some thing I need to do to make sure I get the correct calculated value.
    You suggestions will be appreciated. Thanks.
    - Niranchan.

    Hi,
    There is no code required for this,
    Volume = Length * Width * Height.
    This data comes from VEKP table from the corresponding fields.
    Thank you.

  • Bold the hard code value in sap-script

    Hi friends,
        Could anyone tell me how to display 1st half of hard code text in bold and 2nd half in unbold of a line of hardcode text ?
    Pls treat it urgent
    I will reward for every useful responses.
    Thx in Adv.
    Bobby

    hi,
    Create a character format for bold using Se72.
    let the charcter format is c1.
    Then call the style as
    /: Style <STYLE NAME>
    then In the editor Write like this
    <c1>Hi How</c1> r u
    it will display Hi How as bold and r u as simple.
    regards
    Sandipan

Maybe you are looking for

  • How to delete the bookmarks in chm lite apps in iPad air

    How to delete the bookmark in chm lite apps in iPad air

  • How do you set up Mail without a mobile me account?

    I am trying to set up my sister's new Macbook so she can send and receive mail. She does not have a mobile me or .mac account. She had been using an older powerbook, using Safari and a yahoo account. Now, with this new Macbook in Snow Leopard, I want

  • File to Idoc Nodes mapping

    My sender File structure is like this.. MT_Sender -Recordset 0 to Unbound --Header 1 to 1 ---field1 ---field2 ---fieldx --GL_Account 0 to Unbound ---field1 ---field2 ---fieldx ---Cust_Item 0 to Unbound field1 field2 fieldx Curr_Item 0 to Unbound fiel

  • Would like to change email

    Hi I would like to change my email but keep my username (hakask). But as this is impossible at Oracle.com (shame on you) I ask you to: 1. Delete my records completely (including any trace of hakask) 2. Notify me by email so I can create a new account

  • DVD attaching but not reading data

    Upgraded my Host servers from server 2012 to server 2012 R2. Created new guest image with ISO which is datacenter 2012 R2 operation system for guest. When I tried from the virtual server I had to first install a DVD on SCSI. These are generation 2 Hy