Transfer Rule Routine: Assign Date Value into Blank Field

Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can assign "99991231" value into a date characteristics if it is blank?
Many thanks for advance.

I would like to check if the value of EXPIRYDATE is blank in data source. If its value is blank, assign '99991231' to it. Otherwise, it will get the value of EXPIRYDATE in transfer rule. I have rewritten the routine as follows. But there is no effects on the result.
if TRAN_STRUCTURE-EXPIRYDATE IS INITIAL.
  RESULT = '99991231'.
else.
  RESULT = TRAN_STRUCTURE-EXPIRYDATE.
endif.
Many thanks in advance.

Similar Messages

  • Transfer Rule Routine: Change date format

    Can anyone help me with regards to writing some ABAP code in a transfer rule so that I can change the format of a date (from 04/01/06 in the PSA) so that it's wrtitten as 01.04.06 into the cube?
    Many thanks in advance,
    Matt
    Message was edited by:
            Matt Potts
    Message was edited by:
            Matt Potts

    Hi Matt,
    so you are not using a standard date field or any other characteristic that refers to 0date, aren't you? If that is the case, just do the following in a routine:
    replace all occurrences of '/' in tran_structure-<your date field> with '.' into result.
    If you are using a standard date field which is always displayed as dd.mm.yy you need to convert it into the internal sap value which is yyyymmdd. You can achieve that by calling the fm CONVERT_DATE_TO_INTERNAL in a routine:
    call function 'CONVERT_DATE_TO_INTERNAL'
    exporting date_external = tran_structure-<your date field>
    importing date_internal = result
    exceptions date_external_is_invalid = 1.
    if sy-subrc <> 0.
    a action needs to be done, because the date was not valid.
    clear result.
    endif.
    kind regards
    Siggi

  • Error in creating RSDS using transfer rules for master data datasources

    Hi ,
    when i am creating the transfermations(RSDS) using transfer rules for master data datasources while i want to migrate datasource.it is giving the error message saying that INITIAL ERROR OCCURED DURING GENERATION OF THE TRANSFERMATION.AND in the taskbar it is giving the message LOG IS BEING LOADED.
    MY QUESTION IS HOW CAN WE SEE THE LOG? AND
    PLEASE GIVE ME THE STEPS TO MIGRATE MASTER DATASOURCES.
    THANKS IN ADVANCE .

    Hi Ankit,
                  Yoy have to load data to the cube.For that you need update rules.
    Steps to load data to the cube
    1.Replicate the datasource.
    2.Assign Infosource
    3.Create transfer rules
    4.Maintain the update rules to the cube.
    5.Right click on the datasource and schedule an infopackage for it.
    Execute the Infopackage and pull the data to the cube.
    Hope this helps
    Regards
    Karthik

  • How CallableStatement in JSP use setDate() method to insert the date value into DB?

    Dear all,
    I met a strange error message when i insert a date value into DB via JSP call PL/SQL procedures.
    The error seems caused by the setDate(index, date) method with CallableStatement.
    The message is: Can not find the setDate(int, java.util.Date) method in the CallableStatement interfaces.
    Any ideas?
    Thanks advanced.

    Thank you!:)
    I solved it using this:
    String name="david";
                stmt = con1.createStatement();
                String prikaz1 = "INSERT INTO table (id,age,surname,name) IN 'C:\\Users\\David\\Desktop\\db.mdb' SELECT id,age,surname,' " + name + " ' FROM table2";
                stmt.executeUpdate(prikaz1);

  • Assigning a value to a field-symbol (workarea of type any)

    Dear forumers,
    I'm having a bit of difficulty in assigning a value to a field-symbol (it should be treated as a workarea of type any), but I'm given a syntax error instead:-
    The data object "<LFS_WORKAREA>" has no structure and therefore no component called "LFMON".
    What could have gone wrong and how may I resolve this (I must have missed something out)? I will still need <LFS_WORKAREA> to be defined as TYPE ANY.
    Please help. I'd appreciate any inputs at all. Thanks.
    *&      Form  FORMAT_POST_PERIOD
    *       Subroutine to format the posting period data
    *      --> PI_MBEW     Material valuation data (internal table)
    FORM format_post_period  CHANGING    pi_mbew TYPE ANY TABLE.
    " Create local field symbols
      FIELD-SYMBOLS:
      <lfs_workarea> TYPE ANY,
      <lfs_lfmon>    TYPE ckmlcr-poper.
    " Create local variables
      DATA: lv_index TYPE sy-tabix.
      DATA: lv_lfmon TYPE ckmlcr-poper.
    " Format posting periods
      LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
        lv_index = sy-tabix.
        ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
        PERFORM convert_lfmon USING    <lfs_lfmon>
                              CHANGING lv_lfmon.
        MOVE lv_lfmon TO <lfs_workarea>-lfmon.   " the syntax error occurs here  :(
        MODIFY pi_mbew FROM <lfs_workarea>
          INDEX lv_index
          TRANSPORTING lfmon.
        CLEAR: <lfs_workarea>,
               <lfs_lfmon>
               lv_lfmon,
               lv_index.
      ENDLOOP.
    ENDFORM.                    " FORMAT_POST_PERIOD

    Most of us aren't in it for the points in any case...
    For your solution you've redundant code:
    *&      Form  FORMAT_POST_PERIOD
    *       Subroutine to format the posting period data
    *      --> PI_MBEW     Material valuation data (internal table)
    FORM format_post_period  CHANGING    pi_mbew TYPE ANY TABLE.
      FIELD-SYMBOLS:
      <lfs_workarea> TYPE ANY,
      <lfs_lfmon>    TYPE ckmlcr-poper.
      DATA: lv_lfmon TYPE ckmlcr-poper.
    *  DATA: lo_workarea TYPE REF TO data.   "<--Not needed, because the LOOP AT ASSIGNING below does the work
    *  CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
    *  ASSIGN lo_workarea->* TO <lfs_workarea>.
      LOOP AT pi_mbew ASSIGNING <lfs_workarea>.
        ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
        PERFORM convert_lfmon USING    <lfs_lfmon>
                              CHANGING lv_lfmon.
        <lfs_lfmon> = lv_lfmon.
        CLEAR lv_lfmon.
      ENDLOOP.
    ENDFORM.                    " FORMAT_POST_PERIOD
    Here's a couple of more efficient solutions, using LOOP AT INTO.
    FORM format_post_period  CHANGING    pi_mbew TYPE INDEX TABLE. " <-- Table type a little more specific
                                                                   "<--now you can use index operations
      FIELD-SYMBOLS:
      <lfs_workarea> TYPE ANY,
      <lfs_lfmon>    TYPE ckmlcr-poper.
      DATA: lv_lfmon TYPE ckmlcr-poper,
            lv_index TYPE sytabix.
      DATA: lo_workarea TYPE REF TO data.
      CREATE DATA lo_workarea LIKE LINE OF pi_mbew.
      ASSIGN lo_workarea->* TO <lfs_workarea>.
    ASSIGN COMPONENT 'LFMON' OF STRUCTURE <lfs_workarea> TO <lfs_lfmon>.
      LOOP AT pi_mbew INTO <lfs_workarea>.
        lv_index = sy-tabix.    
        PERFORM convert_lfmon USING    <lfs_lfmon>
                              CHANGING lv_lfmon.
        <lfs_lfmon> = lv_lfmon.
        MODIFY pi_mbew FROM <lfs_workarea>
           INDEX lv_index. " <--INDEX TABLE, so this is permitted.
        CLEAR lv_lfmon.
      ENDLOOP.
    ENDFORM.                    " FORMAT_POST_PERIOD

  • To populate values into single field in an internal table

    Hi Friends,
    How we need to populate values into single field in an internal table.
    E.g itab consits of single field ( name)
           i need to assign values to this field name .like
          peter,
          john,
          abrahm,
          daneyal
    Pls tell me i how i need to code for this
    Thanks ,
    Parnith

    Hi,
    Please look at the below code :
    DATA : BEGIN OF itab OCCURS 0 ,
             name(20) TYPE c,
           END OF itab.
    START-OF-SELECTION.
      itab-name = 'Peter'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'John'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Abrahm'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Daneyal'.
      APPEND itab.
      CLEAR itab.
      LOOP AT itab.
        WRITE : / itab.
      ENDLOOP.
    Thanks,
    Sriram Ponna.

  • Assigning a value to screen field

    Hi,
      Anybody knows how to assign a value to a field in a standard transaction without using parameter ID.
    Pionts will be awarded.
    Thanks,
    lakshmi.

    Thank you so much Rich & eswar. here is my problem.
    Actually I am updating this field based on the contract starts date and material group using one user exit.But this field is geting updated whenever there is a change to this field.it is not geting updated in other cases that is "it is geting updated if you are changing the contents of the filed or giving a new value".
    But I want this field updated all the times.
        So I thought I will assign a dummy value to this filed before I update it.For this We need a parameter id. but it is not there. So I am searching for other solution.
      Can you please help me.
    Regards,
    Lakshmi

  • How to put the SQL-statement returned value into the field (as a default)

    Hi,
    I am using Developer/2000 (Forms Designer) under windows 98.
    Please tell me how to put the SQL-statement value (as a default value) into the field before enter-query mode. Noted that I have tried the following ways but still some problems:-
    1) Place the SQL-statement into PRE_QUERY trigger in the form/block level.
    There is a message box which ask 'Do you want to save the changes?'.
    2) Place the SQL-statement before execute enter_query. There is still a
    message box which ask 'Do you want to save the changes?'.
    Any hints? Thanks. Urgent.

    solved it!
    1) Suppress DEFAULT save message
    if form_failure then
    raise form_trigger_failure;
    end if;
    2) Place the default value before enter-query.
    Ref: Title='Default value in query field in ENTER_QUERY mode' in designer forum by CVZ
    form level trigger
    ============
    WHEN-NEW-ITEM-INSTANCE
    =======================
    if :system.mode = 'ENTER-QUERY' then
    :block.item := 'default waarde';
    end if;
    3) Suppress the changes whenever leaving the default field.
    if :block.item is null then
    -- assign statement
    end if;

  • Fix a data value in a field (to be by default)

    Dear all,
    Does anyone knows how can I fix a data value in a field, i.e, to be by default when I first execute a transaction?
    Another thing, in version ECC 6.0, can I export a excel document directly without using the option "save as"? My user just want to visualize the xls document, and not saving the file to some directory. Is this possible in 6.0?
    Thanks for your help.
    Regards,
    CCT

    Hi,
    For default values, you can default only certain field. For example for Company Code you can maintain the parameter BUK value in your user master in SU3 transaction. (You can find the parameter name in the technical discription (F1> Technical Data) of that field.)
    For excccel, if the output is in ALV format, then in ALV toolbar, there is a button "Speadsheet" available. You can use that.
    However the data updation in excel is not actually updated in database table (Except for certain planning tools given in SAP.)
    Regards,
    SDNer

  • How to set default date value to a field on screen

    How to set default date value to a field on screen and allow users to modify it ....

    Hello,
    In the PAI module, you need to save the changes to the database using the command MODIFY.
    Follow an example:
    Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.
    DATA message_wa TYPE t100.
    message_wa-sprsl = 'EN'.
    message_wa-arbgb = 'MYMSGCLASS'.
    message_wa-msgnr =  '100'.
    message_wa-text =  'Some new message ...'.
    MODIFY t100 FROM message_wa.
    Regards.

  • Multiple Checkbox Values Into One Field

    Hopefully someone can help me with this issue I'm having.
    I'm trying to save the values of multiple selected checkboxes into one field separated by commas through ADDT's Insert Transaction code. I can do this easily with DW's standard insert record wizard by using the PHP implode() function but I haven't been able to figure it out with ADDT's code.
    <form>
    <input type="checkbox" value="1" name="program[]" /> Program One
    <input type="checkbox" value="2" name="program[]" /> Program Two
    <input type="checkbox" value="3" name="program[]" /> Program Three
    <input type="checkbox" value="4" name="program[]" /> Program Four
    </form>
    THIS IS ADDT'S CODING
    $ins_quoteManager->addColumn("programs", "STRING_TYPE",  "POST", "programs");
    THIS WORKS VIA DREAMWEAVER'S INSERT RECORD WIZARD
    Original: GetSQLValueString($_POST['programs'], "text"),
    Modified: GetSQLValueString(implode(',',$_POST['programs']), "text"),
    Anyone know how to modify the ADDT code with the implode function to get this to work?

    Have you tried ADDT´s "comma-separated checkboxes" form control, which will also store the values into a field of your choice (and of course retrieve them from there on update record - pages) ? The only possible drawback might be, that the checkboxes can´t be defined statically, means that the array of value/label - pairs will be retrieved from another table by establishing an additional recordset.
    Cheers,
    Günter

  • Add and/or subract data values in form fields

    I'm trying to have a date value in one field calculated from another. For example Issue date field plus 90 days = Contract Due data field. Is there a way, maybe javascript to do this in a ADD form?
    Thanks for any help,
    Tony

    Hi Tony,
    instead of trying that with javascript, I´d rather create a Custom Trigger
    (type: AFTER) which updates your table´s "contract_due" column by applying MySQL´s DATE_ADD function to ADDT´s transaction value
    ($tNG->getColumnValue("column_name")), like this:
    "UPDATE tablename SET contract_due = DATE_ADD(".$tNG->getColumnValue("issue_date").",INTERVAL 90 DAY) WHERE primary_key_column = ".$tNG->getPrimaryKeyValue()."";
    That should work, although I´m not sure if you would first have to convert the value of $tNG->getColumnValue("issue_date") back to a valid MySQL date format
    (YYYY-MM-DD), in case the field "issue_date" displays the date in a different format, like e.g. DD.MM.YYYY
    However I think that a javascript based approach should be avoided whenever possible, because even if that works, the user might modify the "contract_due" field value before submitting the data.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Challenge - Defining "global" variable accessible in Transfer Rules Routine

    Hi,
    Is there a way to define a global variable in BW which is accessible via all the "Routines" in the Transfer Rules in the Info Source.
    Scenario:
    1) I have a field called ZTEXT in the transfer rules.
    2) I am adding code in the Routine to manipulate this data in the Transfer Rules for the Info Source.  Ultimately the RESULT will be populated with a value.
    RESULT = .
    returncode <> 0 means skip this record
      RETURNCODE = 0.
    abort <> 0 means skip whole data package !!!
      ABORT = 0.
    $$ end of routine - insert your code only before this line   
    3) In the Routine Code, the value of the RESULT will be derived based on what's in a field called "g_value".  I don't want to derive the value in the "g_value" field in each Routine for each record that gets processed as it will take a performance hit. I am looking for a way that "g_value" can be populated once e.g. in a START Routine or another alternative and then "g_value" can be used throughout the Routine for any field in the transfer Rules.
    Is there a way to define and populate "g_value" as a global variable so its VALUE can be retained and used in all the Routines in the same transfer rules.  Note that there will be a fair amount of logic to derive "g_value" and hence the need to avoid deriving it each time.
    Could someone advise me if this is even possible?  If so, could you give me a ABAP code sample for it please? 
    Thank you very much,
    Haritha

    if you create the variable as global and in your start routine, calculate and give it a value, you can use that value in all your individual routines.

  • Creating an Incremental Unique Key in Transfer Rules Routine

    Hello Experts,
    In my Infosource, I have created a routine in the transfer rules on my infoobject.  I am trying to load my data from a flat file and create a unique key by autonumbering a field in my infosource/datatarget. 
    I am new to ABAP and can not figure out why my code will not return a value...
    Under "Use of Transfer Structure Fields" I chose my field to change only, and entered the following code:
    Under Global Code I declared my counter because I want it to maintain its value during the entire load:
      DATA: COUNTER TYPE I VALUE 0.
    Then in my routine I have the following code:
      COUNTER = COUNTER + 1.
      RESULT = COUNTER.
      RETURNCODE = 0.
      ABORT = 0.
    I expect this to return 1 for the first record, 2 for the second, and so on - therefore giving me a unique key.  Any assistance in my code or other ways to automate this process in BW would be greatly appreciated.
    Thank you.

    Sean,
    It looks like your routine is basically correct.  Have you tried using single quotes around the S instead?  Also - you may want to add a statement to indicate what 0AMOUNT should be in the instance where your condition isn't true.  Something like this:
    IF tran_structure-shkzg  = 'S'.
    RESULT = tran_structure-wrbtr * -1.
    ELSE.
    result = ???
    ENDIF.
    Good luck!  The syntax check in the transfer rules leaves a bit to be desired, doesn't it?

  • Querying and Assigning Date Value

    Hello, this query is not working. I am trying to assign the date value to the from_date variable.
    set result_list [execsql "select TCM_DATE_BEGIN_REQD into: TO_CHAR(from_date, 'YYYY/MM/DD') from tcm_tau_component where tcm_reference_number = $tau_reference_number" ]
    This is the error I get:
    The following bind variable(s) are not defined:
    Please help.

    I don't know what language this is but you're trying to select into a format mask. That looks suspicious. Try this:
    select TO_CHAR(TCM_DATE_BEGIN_REQD, 'YYYY/MM/DD') into :from_date ...

Maybe you are looking for

  • Install OSX 10.4.7 on iMac G3 creates panic messages, someone plz help me?!

    Hi, I got this iMac G3 with OS 9.1 installed on the hdd. I first updated the firmware and then swapped the hdd for an empty one (with was once used on a windows system) I try to install OSX 10.4.7 (original grey cd's for iMac) on my iMac G3 Short aft

  • Hp Printer Control App

    I have got a HP ENVY 4502 priner, i installed the hp printer control app it has quit workin and the store cant repair it so i went to uninstall it from the apps and all it says there is remove from start its not givin me choice to uninstall what do i

  • Case statement in OWB mapping

    I am trying to use a case statement in an OWB mapping. I am attempting to use it in expression builder within a filter object. Each time I try to validate the expression in the expression builder I get an error: Line 4, Col 6: PL/SQL: ORA-00920: inva

  • Logical dictinary got deleted in a model.

    Plz tell me how to resolve it. Unknowningly i deleted a SRC dictionary folder how to get it back. Is any othe way except reverting the activity [Error]   org.wb.operations.get.model.STLGetModel --> Model STLGetModel [logicalDictionary]: Inconsistent

  • Adobe Acrobat XI crashes when creating PDF from webpage.

    I need to create quite a few pdfs from webpages and all of a sudden, after being completely functional, my Acrobat has begun crashing nearly 100% of the time when trying to do so.  I'm defining crashing as either completely crashing ('...has stopped