Sap script: Printing the values got from work area in a row

Hi ,
I need to print the values which I m getting from a work area like
A1     A2
A3     A4
and so on
but I m getting it as
A1
A2
A3
A4.
Any solutions to this will be highly appreciated.
Regards,
Vivek

Dear vivek,
how is your work are structure - is it only with single field ?
In your script after the each value give an extended line comman "=" which will take first and second values for print and after the second value give "line feed" or "carriage return"  command.
Hope this solves your problem
Thanks
venugopal
Reward accordingly

Similar Messages

  • Script- problem in printing the values in from internal table

    Hi all,
    I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
    The problem is i should take the invoice number, invoice date, number of days  from TABLE <b>BSEG</b> and  inovice amount and start date, end date from table<b> INTITIT</b>.  for a particular document number there are diffent invoce numbers in both the table.
    i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
    data:   begin of hbseg occurs 10.
            include structure hsortp.
            include structure bseg.
    data:   end of hbseg.
    data: begin of hsortp,
            sortp1 like sortp1,
            sortp2 like sortp2,
            sortp3 like sortp3,
            sortp4 like sortp4,
            sortp5 like sortp5,
            EKVBD  LIKE KNB1-EKVBD,
          end   of hsortp.
    loop at hbseg.
            WHERE BUKRS = SAVE_BUKRS.
              save_bukrs  = hbseg-bukrs.
              if  ( hbseg-kunnr = save_kunnr
              and   not save_kunnr is initial )
              or  ( hbseg-lifnr = save_lifnr
              and   not save_lifnr is initial ).
               clear bseg.
                move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
                  perform curr_document_convert_bseg
                              using
                                 bkpf-budat
                                 *bkpf-waers
                                 *bkpf-hwaer
                                 bkpf-waers
                              changing
                                 bseg.
                  if not bseg-pycur is initial.
                    alw_waers = bseg-pycur.
                    perform currency_get_subsequent
                                using
                                   save_repid
                                   bkpf-budat
                                   bkpf-bukrs
                                changing
                                   alw_waers.
                    if alw_waers ne bseg-pycur.
                      bseg-pycur = alw_waers.
                      perform convert_foreign_to_foreign_cur
                                  using
                                     bkpf-budat
                                     *bkpf-waers
                                     *bkpf-hwaer
                                     bseg-pycur
                                  changing
                                     bseg-pyamt.
                    endif.
                  endif.
                endif.
                perform fill_waehrungsfelder_bseg.
                perform fill_waehrungsfelder_bseg_2.
                if bseg-sgtxt(1) ne '*'.
                  bseg-sgtxt = space.
                else.
                  bseg-sgtxt = bseg-sgtxt+1.
                endif.
                clear save_bschl.
                clear save_umskz.
                clear tbslt.
                save_bschl = bseg-bschl.
                save_umskz = bseg-umskz.
                perform read_tbslt.
    ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
               v_gsaldf = rf140-gsaldf + rf140-wrshb.
               rf140-gsaldf = v_gsaldf.
               clear v_gsaldf.
    SUNIL *********************
                 *rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
                if  xmultk is initial
                and xactiv is initial
                and linecnt = '1'
                and not      xumsst is initial
                and not save_xumstn is initial.
                  if bkpf-bstat = 'V'.
                    perform read_vbset.
                  else.
                    perform read_bset.
                  endif.
                  describe table hbset lines linecnt.
                  if linecnt = '1'.
                    loop at hbset.
                      move-corresponding hbset to bset.
                       *bset = bset.
                      if bkpf-waers ne *bkpf-waers.
                        perform curr_document_convert_bset
                                    using
                                       bkpf-budat
                                       *bkpf-waers
                                       *bkpf-hwaer
                                       bkpf-waers
                                    changing
                                       bset.
                      endif.
                      clear rf140-msatz.
                      clear rf140-vtext.
                      save_ktosl = bset-ktosl.
                      perform read_t687t.
                      rf140-msatz = bset-kbetr / 10.
                       *rf140-msatz = rf140-msatz.
                      rf140-vtext = save_vtext.
                       *rf140-vtext = rf140-vtext.
                      if bset-shkzg = 'H'.
                        rf140-mwshb = bset-fwste.
                         *rf140-mwshb = *bset-fwste.
                        rf140-mdshb = bset-hwste.
                         *rf140-mdshb = *bset-hwste.
                      else.
                        rf140-mwshb = 0 - bset-fwste.
                         *rf140-mwshb = 0 - *bset-fwste.
                        rf140-mdshb = 0 - bset-hwste.
                         *rf140-mdshb = 0 - *bset-hwste.
                      endif.
                      exit.
                    endloop.
                    rf140-wrshb = rf140-wrshb - rf140-mwshb.
                     *rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
                    rf140-dmshb = rf140-dmshb - rf140-mdshb.
                     *rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
                  endif.
                endif.
    *****************Begin of Change by Karthikeyan J********************
                i_count = i_count + 1.
                clear rf140-element.
                clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
    comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
                select single * from bseg into
                corresponding fields of it_bseg where belnr = bseg-rebzg  anD GJAHR = BSEG-GJAHR.
                select single * from intitit into corresponding fields of  it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
    added by Jayshree on 09/01/2007
                MOVE ' ' TO it_kna1-name1.
                SELECT SINGLE name1
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
                WHERE a~vbeln = it_bseg-vbeln
                  AND a~parvw = 'zd'.
                SELECT SINGLE fkdat
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM vbrk
                WHERE vbrk~vbeln = it_bseg-vbeln.
    added by Jayshree on 01/02/2007
              CONCATENATE  it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
                INTO vfkdat SEPARATED BY '.'.
              CONCATENATE  it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
                INTO vaugdt SEPARATED BY '.'.
                i_wrbtr = i_wrbtr + it_bseg-wrbtr.
    added as on 29.06.2007 by jayshree again transport  on 21.07.2007
                tot_wrbtr = tot_wrbtr + i_wrbtr.
                i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
                CALL FUNCTION 'fima_date_create'
                  EXPORTING
                    i_date                        = it_bseg-zfbdt
                 I_FLG_END_OF_MONTH            = ' '
                 I_YEARS                       = 0
                 I_MONTHS                      = 0
                   i_days                        = i_totday
                 I_CALENDAR_DAYS               = 0
                 I_SET_LAST_DAY_OF_MONTH       = ' '
                 IMPORTING
                   e_date                        = i_bday
                 E_FLG_END_OF_MONTH            =
                 E_DAYS_OF_I_DATE              =
    added by JAYSHREE 01.02.2007
                CONCATENATE  i_bday6(2) i_bday4(2) i_bday+2(2)
                INTO vbday SEPARATED BY '.'.
                i_day = it_bseg-augdt - i_bday.
            CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
              EXPORTING
                date1                         = it_bseg-zfbdt
                date2                         = it_bseg-augdt
               OUTPUT_FORMAT                 = '01'
             IMPORTING
               YEARS                         =
               MONTHS                        =
               DAYS                          = i_day
             EXCEPTIONS
               INVALID_DATES_SPECIFIED       = 1
               OTHERS                        = 2
            IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *added by sunil 5.11.07 ***********
    *read table it_intitit with key BELNR_TO = BSEG-BELNR  .
    *LOOP AT IT_INTITIT.
                rf140-element = '521'.
                CALL FUNCTION 'write_form'
                  EXPORTING
                    window  = 'main'
                    element = '521'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
                IF sy-subrc = 1.
                  window = 'main'.
                  PERFORM message_window.
                ENDIF.
                IF sy-subrc = 2.
                  window = 'main'.
                  ereignis = '521'.
                  PERFORM message_element.
                ENDIF.
                IF save_xumstn IS INITIAL.
    *-------Umsatzsteuer -
                  IF xactiv IS INITIAL.
                    save_waers = rf140-waers.
                    PERFORM tax_data.
                    CLEAR taxlines.
                    DESCRIBE TABLE atax LINES taxlines.
                    IF NOT taxlines IS INITIAL.
                      LOOP AT atax.
                        CLEAR ereignis.
                        CLEAR rf140-msatz.
                        CLEAR rf140-vtext.
                        rf140-msatz = atax-msatz.
                         *rf140-msatz = atax-msatz.
                        rf140-vtext = atax-vtext.
                         *rf140-vtext = atax-vtext.
    *******begin of change by karthikeyan on 10.03.06*********************
                        IF sy-tabix = '1'.
                          ereignis = '522'.
                          v_stax = rf140-msatz * rf140-gsaldf / 100.
                        ELSE.
                          ereignis = '523'.
                          v_ecs = rf140-msatz * v_stax / 100.
                          v_total = rf140-gsaldf + v_stax + v_ecs.
                        ENDIF.
                        CALL FUNCTION 'hr_in_chg_inr_wrds'
                          EXPORTING
                            amt_in_num               = v_total
                          IMPORTING
                            amt_in_words             = v_spell
                        EXCEPTIONS
                          DATA_TYPE_MISMATCH       = 1
                          OTHERS                   = 2
                        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                        ENDIF.
    ***************************end of change******************************
                        CLEAR rf140-element.
                        rf140-element = ereignis.
                        IF NOT ereignis IS INITIAL.
                          CALL FUNCTION 'write_form'
                            EXPORTING
                              window  = 'main'
                              element = ereignis
                            EXCEPTIONS
                              window  = 1
                              element = 2.
                          IF sy-subrc = 1.
                            window = 'main'.
                            PERFORM message_window.
                          ENDIF.
                          IF sy-subrc = 2.
                            window = 'main'.
                            PERFORM message_element.
                          ENDIF.
                        ENDIF.
                      ENDLOOP.
                    ENDIF.
                  ENDIF.
                ENDIF.
               ENDLOOP.
              ENDIF.
            ENDLOOP.
    '521' is the element name in the main  window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT.  Belnr is the document no with ref to that
    there are number  of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT  in belnr only it is taking single value it is not getting refreshed.
       move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
    this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
    How to write the syntax for INTITIT? As per invoice number it is giving new values.
    The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
    it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE)  rf140-wrshb(INTREST AMOUNT).
    THE VALUE OF IT_BESG-REBZG IS CHANGING  BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
    ONLY SINGLE RECORD.
    for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
    here in bseg-rebzg is chaning but in INTITIT-BELNR IS  not changing.
    If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
    a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
    Please help me out it is very urgent.
    <b>USEFUL ANSWERS WILL BE REWARDED.</b>
    regards,
    Sunil kumar.

    assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
    try with AT NEW - ENDAT.
    AT NEW belnr.
    here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
    ENDAT.
    pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
    thanq
    Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM

  • SAP Script: Printing the signature on main window at the end

    Hi,
    I am working on a SAP Script (Benefits enrollment form HR_BEN_ENRO).  I copied the HR_BEN_ENRO into ZHR_BEN_ENRO and making the necessary changes without modifying the driver program.
    The problem I am facing is as follows:
    In the main window there are so many Text elements.  At the end of the main window, after the last text element, I have put some text using Include statement.  The last text element is getting triggered for some employees and hence the text underneeth that is printing, but for some employees the last element is not triggering and hence nothing is printing underneeth that.
    Is there any solution to print the this text at the end of main window after printing all the remaining information.
    I also tried using BOTTOM & ENDBOTTOM. But in this case I don't know how to check that I am in last page of the main window.  I tried the following way:
    /: BOTTOM
    /: IF &PAGE& = SAPSCRIPT-FORMPAGES&
    SIGNATURE:__________   Date:__________
    /: ENDIF
    /: ENDBOTTOM
    In this case the value I am getting for &SAPSCRIPT-FORMPAGES& is 0 (zero).
    Any solution..please.
    Appreciate.

    How to link the ZHR_BEN_ENROL instead of HR_BEN_ENRO?
    I mean when I execute the TCODE: HRBEN0001 and select particular employee and click on Print form under Offer Selection area. Then standard program calls HR_BEN_ENRO. How to replace it with Zform?
    Thanks in advance.
    Regards,
    Krishna

  • Sap Scripts-printing the text in a single line

    In Sap Scripts I would like to have my text in a single line. For that I have used the extended line (=) tag. But It is not working.
    Can anyone help me how can I achieve this.
    Actually how many characters I can put in a single line. I think it is 72. But my text is less than 72 characters.
    Can anyone Please help me.
    Regards
    Meshack Appikatla.

    A Text Symbol in Script or Smartform can take lenght of Maximum 80 characters. Any thing more than that will be truncated even if the window is long enoguh to hold more than 80 characters. Si your character formated need to be have the PROTECTED option checked.
    At Topic:
    Try increasing the window size in lenght or width, If that is not possible pratically, you can try by decreasing the font size.

  • The value returned from the load function is not of type numeric  errors after migration to Coldfusion 11

    I am currently testing our website with CF11. It is currently working with CF8 however after migrating it to a new server running CF11 I have encountered the following error.
    The value returned from the load function is not of type numeric.
    The error occurred in
    D:/Applications/CFusion/CustomTags/nec/com/objects/address.cfc: line 263
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/contact.cfc: line 331
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 510
    Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 1675
    Called from D:/website/NECPhase2/action.validate.cfm: line 54
    261 : <cfif isNumeric(get.idCountry)>
    262 : <cfset rc = this.objCountry.setID(get.idCountry)>
    263 : <cfset rc = this.objCountry.load()>
    264 : </cfif>
    265 : <cfset this.sPostcode = get.sPostcode>
    Have there been any changes between CF8 and CF11 that could  cause this error?
    Does anyone have ideas?

    This is the code in file object file country.cfc (nec.com.objects.country):
    <cfcomponent displayname="Country object" hint="This is a Country object, it allows you to access and set values in the Country.">
    <!---
    // Construct this object
    --->
    <cfset this.objFunctions = CreateObject( 'component', 'nec.com.system.functions' )>
    <cfscript>
      this.idCountryID = 0;
      this.sCountryName = "";
      this.sISOCode = "";
      this.sDHLCode = "";
      this.iErrorID = "";
    </cfscript>
    <!---
    // The following functions are the setters and getters. offering us a better way to get
    // at the contents of the object
    --->
    <!---
    // Getters
    --->
    <cffunction name="getID" displayname="Get ID" returntype="numeric" output="false" hint="This returns the ID of the current item.">
      <cfreturn this.idCountryID>
    </cffunction>
    <cffunction name="getsCountryName" displayname="Get sCountryName" returntype="string" output="false" hint="This gets the sCountryName value of this item.">
      <cfreturn this.sCountryName>
    </cffunction>
    <cffunction name="getsISOCode" displayname="Get sISOCode" returntype="string" output="false" hint="This gets the sISOCode value of this item.">
      <cfreturn this.sISOCode>
    </cffunction>
    <cffunction name="getsDHLCode" displayname="Get sDHLCode" returntype="string" output="false" hint="This gets the sDHLCode value of this item.">
      <cfreturn this.sDHLCode>
    </cffunction>
    <cffunction name="iError" displayname="Get iError" returntype="numeric" output="false" hint="This returns the iError of the current item.">
      <cfreturn this.iError>
    </cffunction>
    <!---
    // Setters
    --->
    <cffunction name="setID" displayname="Set ID" returntype="boolean" output="false" hint="This sets the ID value of this item.">
      <cfargument name="idCountryID" required="true" type="numeric" displayname="ID" hint="The ID to use.">
      <cfset this.idCountryID = arguments.idCountryID>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsCountryName" displayname="Set sCountryName" returntype="boolean" output="false" hint="This sets the sCountryName value of this item.">
      <cfargument name="sCountryName" required="true" type="string" displayname="sCountryName" hint="The sCountryName to use.">
      <cfset this.sCountryName = arguments.sCountryName>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsISOCode" displayname="Set sISOCode" returntype="boolean" output="false" hint="This sets the sISOCode value of this item.">
      <cfargument name="sISOCode" required="true" type="string" displayname="sISOCode" hint="The sISOCode to use.">
      <cfset this.sISOCode = arguments.sISOCode>
      <cfreturn true>
    </cffunction>
    <cffunction name="setsDHLCode" displayname="Set sDHLCode" returntype="boolean" output="false" hint="This sets the sDHLCode value of this item.">
      <cfargument name="sDHLCode" required="true" type="string" displayname="sDHLCode" hint="The sDHLCode to use.">
      <cfset this.sDHLCode = arguments.sDHLCode>
      <cfreturn true>
    </cffunction>
    <!---
    // Clear, to empty out the contents of this object
    --->
    <cffunction name="clear" displayname="Clear items Details" returntype="boolean" output="false" hint="Clears out all of the items details.">
      <cfscript>
       this.sCountryName = "";
       this.sISOCode = "";
       this.sDHLCode = "";
       this.iErrorID = "";
      </cfscript>
      <cfreturn true>
    </cffunction>
    <!---
    // The following functions deal with the load, save and deleting of objects
    --->
    <!---
    // Load
    --->
    <cffunction name="load" displayname="Load items details" returntype="numeric" output="false" hint="This loads in all the information about an item.">
      <cfset rc = this.clear()>
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Check to see if it exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: checkID: '#this.idCountryID#' #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         if(isDefined("session.afr")){
          whichOne = "#session.afr.getsAFRNumber()#";
         } else {
          whichOne = "";
         iErrorID = objError.addError("A Country with that id doesn't exists.[#this.idCountryID#][#whichOne#]");
        </cfscript>
       <cfset this.iErrorID = iErrorID>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // If we got past all then then load in the details
      --->
      <cftry>
       <cfquery name="get" datasource="#sDatasource#">
        SELECT idCountryID, RTRIM(sCountryName) as sCountryName, RTRIM(sISOCode) as sISOCode, RTRIM(sDHLCode) as sDHLCode
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("load: get: #cfcatch.detail#");
        </cfscript>
        <cfset this.iErrorID = iErrorID>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfset this.idCountryID = get.idCountryID>
      <cfset this.sCountryName = get.sCountryName>
      <cfset this.sISOCode = get.sISOCode>
      <cfset this.sDHLCode = get.sDHLCode>
      <cfset this.iErrorID = "">
      <cfreturn true>
    </cffunction>
    <!---
    // Save
    --->
    <cffunction name="save" displayname="Save items Details" returntype="numeric" output="false" hint="Saves (to some source) the current details for the ID of the item.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("save: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <!---
      // If it doesn't exist, then add the record, otherwise update the record
      --->
      <cfif not checkID.recordCount>
       <cfreturn this.add()>
      <cfelse>
       <cfreturn this.update()>
      </cfif>
    </cffunction>
    <!---
    // Add
    --->
    <cffunction name="add" displayname="Add Country" returntype="numeric" output="false" hint="This adds a Country.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#'
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that name or ISO code already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <cftry>
       <cfquery name="add" datasource="#sDatasource#">
        SET nocount on
        INSERT INTO tblCountry(sCountryName, sISOCode, sDHLCode)
        VALUES('#this.objFunctions.scrubText(this.sCountryName)#','#this.objFunctions.scrubText(t his.sISOCode)#','#this.objFunctions.scrubText(this.sDHLCode)#')
        SELECT @@identity as autoID
        SET nocount off  
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("add: add: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn add.autoID>
    </cffunction>
    <!---
    // Update
    --->
    <cffunction name="update" displayname="Update Country" returntype="numeric" output="false" hint="This updates a Country record.">
      <!---
      // Check to see if that a different item isn't already using the same unique details
      --->
      <cftry>
       <cfquery name="checkUnique" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE (sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
        OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#')
        AND idCountryID <> #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: checkUnique: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkUnique.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("Another Country with that name already exists. idCountryID=#checkUnique.idCountryID#");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Attempt to update the record to the datasource
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="update" datasource="#sDatasource#">
        UPDATE tblCountry
        SET sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#',
        sISOCode = '#this.objFunctions.scrubText(this.sISOCode)#',
        sDHLCode = '#this.objFunctions.scrubText(this.sDHLCode)#'
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("update: update: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID> 
    </cffunction>
    <!---
    // Delete
    --->
    <cffunction name="delete" displayname="Delete Country" returntype="numeric" output="false" hint="This deletes a Country record.">
      <!---
      // First of all we need to get the name of the data source we are going to be using
      --->
      <cfscript>
      objDS = CreateObject("component","nec.com.system.settings");
      sDatasource = objDS.getDatasource();
    </cfscript>
      <!---
      // Now check to see if ithat ID exists
      --->
      <cftry>
       <cfquery name="checkID" datasource="#sDatasource#">
        SELECT idCountryID
        FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkID: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif not checkID.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("A Country with that id doesn't exists, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now check to see if there are any dependancies, if so we can't delete the item
      --->
      <cftry>
       <cfquery name="checkDependancies" datasource="#sDatasource#">
        SELECT idCountry
        FROM tblAddress
        WHERE idCountry = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: checkDependancies: idCountry: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfif checkDependancies.recordCount>
       <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("That Country is being used by an address, delete failed.");
        </cfscript>
       <cfreturn iErrorID>
      </cfif>
      <!---
      // Now attempt to remove the record.
      // if this fails for any reason then we submit an error message
      // to the error component and return the ID of the error
      --->
      <cftry>
       <cfquery name="delete" datasource="#sDatasource#">
        DELETE FROM tblCountry
        WHERE idCountryID = #this.idCountryID#
       </cfquery>
       <cfcatch>
        <cfscript>
         objError = CreateObject("component","nec.com.system.errors");
         iErrorID = objError.addError("delete: delete: #cfcatch.detail#");
        </cfscript>
        <cfreturn iErrorID>
       </cfcatch>
      </cftry>
      <cfreturn this.idCountryID>
    </cffunction>
    </cfcomponent>

  • Can I use the value returned from a Text Function in another Formula?

    I'm writing a report in Hyperion System 9 BI + Financial Reporting Studio version 9.2. I have 2 grids in my report.
    Grid1 Column A is set up as a text function using the function type - <<GetCell("Grid2", 1, a, 1)>>. I would like to use the values returned from this text function in Column A (Grid 1) in a formula in Column B (Grid 1).
    Is it possible to use the values returned in Column A of the text function in another formula? My report does not seem to recognize Column A as numerical values, even though the values to be returned are numerical.
    If so, how do I recognize the values in Column A Grid 1 as numerical values and not text?
    Thanks for any help you can offer!

    Hi Edson,
    Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
    You can use a macro similar to the following:
    IF
      CALC_ERROR( )
      = 'X'
          DO SOMETHING HERE
    ENDIF
    Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
    data: g_flg_calc_error type /SAPAPO/FLAG.
    * SAP will pass g_flg_calc_error variable to all macro
    * functions. When SAP calls a macro function, it does
    * something like this.
    call function '/SAPAPO/MACRO_FUNCTION_HERE'
            exporting
              plob_values      = i_s_adv_plob_values
              sdp_book         = g_c_advf_sdp_book
              sdp_view         = g_c_advf_sdp_view
            tables
              cols_index       = i_t_cols
              value_tab        = l_t_value_tab
            changing
              f_calc_error     = g_flg_calc_error
    As you can see, the g_flg_calc_error variable
    is passed in the "changing" part of the call. The macro  function being called can then use the f_calc_error
    variable to change the value of the global
    g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error.  The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
    Hope this helps in clearing things out

  • List of standard sap scripts/print programs in SAP MM and SD modules ??

    Hi,
    I have worked in medruck only. Can anyone give me a list of other standard sap scripts/print program names in SAP MM, FI/CO and SD modules, which often needs to be  modified by the client ?
    thanks

    press f4 in SE71
    then press application heirarchy, expand the modules which ever u want.
    regards.
    santhosh reddy
    Reward if useful

  • Script printing changes when transport from QTY to Production.

    Hi all,
    i m having a problem with sap script printing. i have a report which prints well in a perticular printer when it is in Quality server. but when i transport it to Production it gets different fonts style and the alignment of the fonts gets disturb, like out of 10 values in amount fields 1 or 2 amounts alignments gets changed.
    what could be the reason for this. and what could be its solution.
    plzz help me to solve this problem..
    thanx...

    Hi,
    Please check the printers in both the Servers. The printer settings will do the change. Contact the Basis guys or the hardware guys there and check the printer settings.
    Check the request numbers of the FORMS so that any other code replaces that old code you are telling.
    But i strongly believe that it will be the printer settings.
    Regards,
    SUBBU.

  • How to Print the Value of a variable inside a PL/SQL package

    Hi Friends,
    Here is my Scenario
    I have a PL/SQL Package. Let us call it Baseline Package.
    This Package includes a dynamically built merge Statement.
    Execute Immediate v_merge_query.
    I have a procedure which replaces which few Keywords from the Package Text and Creates a new one depending on Inputs I provide. (This is something like a Code generator)
    Now while Creating the new package, I need to print the Value of v_merge_query.... I Need s Static Query to be Printed inside the new package and not a dynamic query.
    My Question is "Is there a way to print the value of the variable inside a different PL/SQL package?
    Thanks in Advance,
    Mohit

    Print where?
    That PL/SQL code is server-side code. It runs in an Oracle server process.
    That server process does not have a keyboard. Or a screen/monitor. Or display canvas. Or an attached printer.
    That server process is incapable of "printing" as that is not its job or responsibility and not part of its environment.
    What is can do is record data for the client to look at afterwards. This can be done using static PL/SQL session variables. Or a SQL table.
    The former is done by DBMS_OUTPUT - a very primitive interface for writing text into a static PL/SQL string array. That btw resides in expensive private process server memory. The client can query the array after a database call and render the contents.
    PS. Also keep in mind that bind variables are critical for performance and server robustness - especially when (ab)using dynamic SQL.

  • Client automatically cache the data got from cache server?

    Hi expert,
    I have 2 questions about the client local cache. Would you please help to give me some suggestion?
    1. Will client automatically locally cache the data got from cache server the first time and automatically update the data in local cache when getting the same data from cache server again? I go through the API reference but cannot find any API to query the data currently cached in the local cache.
    2. If client will automatically cache the data got from cache server. Is there any way for a client to get the data event that happens to its local cache, such as entry created in local cache, entry deleted from local cache and entry updated in local cache? In my opinion, when getting an entry from cache server the first time, the MapListener's entry create event should be triggered. When getting the same entry again, the entry update event should be triggered.
    However, I have tried a client with replicated cache, a client with partitioned cache, an extend client with remote cache and a client with local cache(front cache part of near cache), the client (the NamedCache object has been set the MapListener) cannot get any event notification after getting data from cache server. By the way, my listener is OK since when putting data the entry create event and entry update event will be triggered.
    Your suggestion is very appreciated. :)

    Hi
    If I were you I would read this http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/toc.htm
    and particularly the section about Near Caching here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/nearcache.htm#CDEFEAJG
    which is what you are asking about in your question.
    Near Caching is how Coherence stores data in the locally - which is the answetr to your first question. How Near Caching works is explained in the documentation.
    Events, which you ask about in your second question are explained here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/delivereventsjava.htm#CBBIIEFA
    It might be that ContinuousQueryCache is closer to what you want. This is explained here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/queryabledatafabric.htm#sthref38 A ContinuousQueryCache is like having a sub-set of the underlying cache on the local client which you can then listen to etc...
    JK

  • How can i add the value inputted from the prompt box to the mysql database?

    Hey guyz help me pls with this problem... im only new to javascript and also to the opensource like(php and mysql). I tried to use a prompt box and store the value into the textbox. But now I want to know how to insert/add the value inputted from a prompt box directly into the database if it is possible.

    Java is not JavaScript, they've got almost nothing in common (apart from superficial syntax similarities and the first 4 letters of their names).
    If indeed your question is about JavaScript, then please find a JavaScript forum, as we can't help you here.

  • SAP Script Printing

    Hi,
    Can we have 'Collate' functionality as in Word document in SAP script printing.

    Hi Rathakrishnan,
    It's not a functionality of SAP script, but you have to set an attribute of the output device. Use transaction SPAD, select your printer and hit button Output Device. Then go to Tab 'Output attributes' and set 'Copies as separate output requests (in SAP System)'. This is similar to the collate functionality.
    Does this solve your problem?
    Regards,
    John.

  • How to print the value of a field of  type FLTP

    hi experts,
    pls tell me how to print the value of a field of  type FLTP. i.e in decimal format not in exponential format.
    thankyou.
    krishna

    Hi ,
    I dont think in Floating point u can able to go for the decimal point display as it is for the minimum precission display..
    Define the variable as the 'packed' type and then u can able to define the decimal point...
    Cheers,
    SImha.

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • Printing the value exactly in a pertticular position

    Dear Friends,
    In smart forms how can i print the value of a field in a exact desired position in a window.
    For example if a value is printing like
    Sales Tax :
                                500.00
    I want it to print like
    Sales Tax :                      500.00
    How to maintain space between Sales Tax : and 500 and how can i print the value in a exact position.
    Regards,
    Farook.
    Edited by: farook shaik on Nov 7, 2008 10:52 AM

    Hi USha I have created one paragraph format
    and In a text element of a window if i want to give ,, to maintain rab space i have to edit that text element right.
    When i click on edit its giving change field pop up
    i want to give Sales Tax :,, &wa_header-salestax&
    How and where to give dat ,, plz let me clear.
    Regards.
    Farook.

Maybe you are looking for