BPS: Create records from reference data in FOX

As writed in "How to Loop over Reference Data in Fox Formulas", I create FOX Function with DO statements, but unfortunetely if I have no data yet in the subset my fox formulas can't be executed at all.
It's write "0 data records were read, 0 of them were changed, 0 generated". Even if I put Break-point in fox formula, it doesn't take place. When I input somehow one or so "test" record, it works perfect, and creates new lines from reference as I want.
How can I execute fox formula at list one time with empty subset?

Hello,
use a copy function to create one (dummy) record. Then call your FOX function (and delete the dummy record). You can combine them in a sequence.
Also see SAP Note <a href="http://service.sap.com/sap/support/notes/646618">646618</a> for looping over reference data.
Regards,
Marc
SAP Techology RIG

Similar Messages

  • NEED HELP!! creating a method to search records from a data.dat file

    i am having a lot of trouble trying to create a method for searching records from a data.dat file as a contacts application i am using (for) and (if) together and getting the same error messages saying a ")" is needed when it doesn't and illegal start of expression can anyone help! on letting me know how you create search methods! thanks

    public static void search_records()
              System.out.println("Please Enter a Surname (* for all):");
              user_surname = data_input.next();
              System.out.println("Please Enter a firstname (* for all):");
              user_firstname = data_input.next();
              for (int i = 0; i < number_of_records; i++)
                   if(user_surname.compareTo(lastName) || user_surname.compareTo(*));
                             if(user_firstname.compareTo(firstName[i]) || user_firstname.compareTo(*));
                                  system.out.print("Result:",number_of_records);

  • Creating XML from raw data

    I am trying to create xml from raw data. It works well in the format builder but
    when I instanciate the MFLObject and run convert to xml, the output only contains
    wrappers for my first field described in the mfl. Are there any known issues
    using this progmattic conversion to XML.
    My mfl is the following:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE MessageFormat SYSTEM 'mfl.dtd'>
    <!-- Enter description of the message format here. -->
    <MessageFormat name='BossRecord' version='2.01'>
    <FieldFormat name='Header' type='String' length='102' codepage='windows-1252'/>
    <StructFormat name='TransactionControlRecord' delim='999'>
    <FieldFormat name='TransactionTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='TransactionData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <StructFormat name='Generic' repeat='*'>
    <FieldFormat name='GenericTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='GenericData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <FieldFormat name='IgnoreTheRest' type='Filler' optional='y' length='1' repeat='*'>
    <!--
    This field is useful for testing partially constructed formats. Adding
    this field to the
    end of a format will cause any leftover bytes on the end of a binary file to be
    ignored when the data is converted to XML.
    -->
    </FieldFormat>
    </MessageFormat>
    Are there any issues with this that are easy to spot?
    Here is some sample output:
    _BossRecordDoc : <BossRecord>
    <Header>0601uskyloupw7vu0 IBVRTR 000006RSQ1010246000000000000020436000001-01-01-00.00.00.00000000000100170</Header>
    <Header>90100581D4EBC00AA3C18629ACA0004AC02E54BD289357023141961111F1111 99900207141D4EBC00AA3C18629ACA0004AC0</Header>
    <Header>2E54BD2893570231RIBBONS & BUTTONS 9 00000000000010.50CAD00000000000000.5</Header>
    <Header>0USD00000000000000.00USD00000000000077.00CAD 0CAUS00000000000000.91KGSA215D100CF3C18619AC</Header>
    <Header>90004AC02E54B 01 0001-0</Header>
    <Header>1-012003-04-072003-06-2501P/P03003984196000010100000000000000.00CAD 00
    FR00000000000000</Header>
    <Header>.0000000000000000000.00KGS00000000000000.00USD 00UPS T1</Header>
    <Header>0001-01-010001-01-01 0 000000000000000.00000000000000000.00USD0</Header>
    <Header>000000000000000.00 1 22222222222220 0100304061DC30500AA3C18629ACA</Header>
    <Header>0004AC02E54B1D4EBC00AA3C18629ACA0004AC02E54B</Header>
    <Header> 0010001-01-01 00000000000000.00USD00</Header>
    <Header>000000000000.00CAD00000000000010.00CAD</Header>
    <Header> 00000000000010.00CAD000000000000000010001-01-01K00404862A8D2C00AA3C186</Header>
    <Header>29ACA0004AC02E54B1DC30500AA3C18629ACA0004AC02E54B001 PURPLE RIBBONS</Header>
    It just keeps finding my first record instead of finding the remaing structure.
    I appreciate any help.
    Thanks,
    Michael

    Okay, I've got some coding off a site that looks like it will do what I want. It's quite a robust applications which will do more than I need but as long as it does at least what I want, i could care less. As it will extract files from the datastream for me, it is going to save them to disk.
    I believe I have to specify a directory to save it to. I believe this is the line I'm going to modify, so assuming that's the case, how do I specify a directory here:
    private File fileOutPutDirectory = null;
    Do I have to use absolute paths or can I use relative. Also, what directory construct is expected by java? Anyone with an example of what urls are supposed to look like in this case?
    Thanks,
    destin

  • Is there any way to name the records from a data merge?

    I have a spreadsheet, that has all the names for the images I'm using for a data merge. What I want to do is name the resulting records after the filenames in one of the columns in the spreadsheet. Is there anyway to do this? Or is there some other way to individually name the records from a data merge? I don't have any scripting prowess, so I can't really mess with that. Any help is greatly appreciated! Thanks!

    You merge it along with the others, just like any field. ID cannot do the naming for you during the merge, but most spreadsheets have lots of logic capabilities that should allow you to extract a name for the record from the filename in the column of your choice. The only reason ID knows to find the image instead of writing the filename is that you've used a special name for the field.

  • Deleting duplicate records from different data packets in BI data source.

    Hi,
    I am getting same (duplicate) records from different data packets in BI data source, after completion of extraction.
    I tried to store key fields of the first data packet in an internal table. But this internal table is not carrying the previous data at the time of extraction of second data packet.
    Is there any other way to remove duplicate records after completion of extraction.
    Thanks in advance.

    I did not extensively worked in BI routenes. But I recon there will be routene which will het executed before data mapping part there will be a start routene in which you can validate the existense of data before beeing passed from data source to cube.
    Hope this helps,
    Regards,
    Murthy.

  • Create material from reference material for all org.levels

    Hi,
    i want to create a material from a reference material with all MARA, MAKT, MARC, MBEW, MARD, MARM, MVKE, MLAN, MLGN and MLGT content for all organizational levels of the reference material.
    For instance, my reference material has 200 MARC entries. All these entries should also be created for the new material.
    Transaction MM01 will copy from reference but only for 1 organizational level. To create 200 plants manually with MM01 is not an option.
    I have to develop a copy from reference transaction, where i select the new material number, the reference material number and the required tables (MARA, MAKT, etc)
    I can read the current tablevalues and insert new entries into the required SAP standard tables, but that is not nice.
    Is there another option to do the job ?
    I know there are bapi's, but these are related to one org.level. For 200 plants, i have to execute 200 bapi to get the data from the reference material and another 200 bapi's to create the new material.
    with kind regards,
    Hans

    Hi Goutam,
    You can use the BAPI BAPI_MATERIAL_SAVEDATA, which will create/update the material. You can pass the reference material in the filed BAPI_MARA-PL_REF_MAT. And you can pass reference material for all view like this.

  • Deleting a record from Master data

    Hi all,
    I need some help with deleting a record from the master data.I did go to the master dta maintenance screen and selected the record to be deleted. I saved it. I received the message, "master Data record cannot be deleted".
    I then went into transaction slg1 to check for the details of the record. A message stating " Master data record XXX is being used in the cube /BIC/Dzzzyyy312.
    This record is no longer needed by the end user and was requested to be deleted. Could some one tell me if there is a possibility to delete this unused masterdata record. Your suggestions are appreciated.
    Regards!

    Hi Sumana,
       Check this...Similar Post..
    MAster data deletion throws a dump
    Hope it helps
    Srini

  • Create Tree from Preordered data

    Here is a quick summary of what I'm trying to do:
    I have a file with formatted like this
    Does it have legs?
    Dog
    Fish
    and the resulting tree for it should look like this
         Does it have legs?
         Dog        Fishand I'm trying to write a function that takes in a Scanner object that should already be tied to the data file and create a tree from this data that is already listed in Preorder fashion. I know tha recurison is probably the best way to go about this but everything that I have written hasn't worked. Also, I cant really figure out a way to use recursion when the function is taking in a Scanner I dont know how it would work.
    Any help would be greatly appreciated.
    Here is what I have now:
         public BinaryTree<String> readTree(Scanner data)
              BinaryTree<String> temp = new BinaryTree<String>();
              temp.attachLeft(data.next());
              temp.attachRight(data.next());
              return temp;
         }I know this function wont go through the whoel file, but I've tried many loops but I cant figure out how to get it to work so I'm convinced that I need to figure out how to make it recursive
    (yes I know that everything that can be done through recursion can be done with a loop)

    @OP:
    Here's how you could do it:
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.Scanner;
    import java.util.Stack;
    class Main {  
        public static void main(String[] args) throws FileNotFoundException {
            Scanner file = new Scanner(new File("data.txt"));
            BinTree tree = new BinTree(file);
            System.out.println(tree);
    class BinTree  {
        private BinNode root;
        public BinTree(Scanner file) {
            // create the root (first line in the file)
            root = new BinNode(file.nextLine());
            // create a stack
            Stack<BinNode> stack = new Stack<BinNode>();
            // push the root on the stack: we need it to add nodes to the left and right of it
            stack.push(root);
            // call the insert method to build the tree
            insert(stack, file);
        private void insert(Stack<BinNode> stack, Scanner file) {
            IF 'file' has no more lines left
                stop this method
            END IF
            BinNode 'next' <- the next line in 'file'
            IF the left node of the last node on the 'stack' equals null
                the left child of last node of the stack <- 'next' (but leave the stack in tact)
            ESLE
                the right child of last node of the stack <- 'next' (remove the last node of the stack)
            END IF
            IF 'next' is a question
                push 'next' on the stack
            END IF
            recursively call the insert(...) method here
    class BinNode {
        String data;
        BinNode right, left;
        public BinNode(String data) { this.data = data; }
        public String toString() { return this.data; }
    }

  • Create Report from HFM Data Grid

    Hi All,
    I need to create a report out of the Data Grid created in HFM and then publish that as a PDF. I found the Reporting feature in Manage Documents that uses system reports.
    And if I want a report from a data grid the Data Explorer option has to be selected for Report Type.But in this case I guess I need to create a Report Definition File and then upload it which seems to be complex.
    But am not able to figure out how I can directly take a HFM Data Grid as the source and generate a PDF Report out of it.
    Can this be done using BI Publisher? If so can anyone please provide the steps?
    Or, can it be done using the Financial Reporting Studio ?
    I sincerely appreciate any help!
    Thanks in advance!
    Chella

    select
    decode( abs((sysdate - end_time)-1), (sysdate - end_time)-1, 'TOO LONG AGO', '-' ) "Check" ,
    b.database_name , t.type_qualifier1 , b.host ,
    to_char(b.end_time, 'YYYYMMDD-HH24:MI:SS') , b.time_taken_display , b.output_bytes_display
    from mgmt$ha_backup b, mgmt$target t
    where b.target_guid = t.target_guid
    order by type_qualifier1, end_time;

  • Create Spool From OTF Data

    Hi all,
    Is there any way of creating a spool request or printing OTF data directly from an internal table.
    Scenario is that I have read a spool request with multiple pages into OTF format and now have an internal table with OTF data. I have then split the spool data at page level into another internal table.
    This table also contains OTF data . Is there anyway of printing this internal table directly to printer. If not is there any way of creating a spool request from this internal table?
    Regards,
    Preet

    May be i can help to some extent. I will just tell you how to convert a internal table into spool. I have done the coding
    REPORT  zpmm_pdf                                .
    TYPES : BEGIN OF itab,
            name(20) TYPE c,
            age TYPE i,
            *** TYPE c,
            END OF itab.
    DATA : gt_itab TYPE STANDARD TABLE OF itab,
           gw_itab TYPE itab.
    DATA : counter  TYPE i.
    ********************Data declaration for use in converting to pdf
    DATA : pripar LIKE pri_params.
    DATA : lw_space VALUE ''.
    DATA : itab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    <b>*To get spool info</b>
    DATA : rqident LIKE tsp01-rqident ,
           rqcretime LIKE tsp01-rqcretime .
    <b>DATA: spool_id LIKE tsp01-rqident.</b>
    DATA : numbytes TYPE i,
           cancel.
    DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
    ********************END of Data declaration for use in converting to pdf
                           START-OF-SELECTION
    DO 20 TIMES.
      gw_itab-name = 'swetabh_shukla'.
      gw_itab-age = counter + 1.
      gw_itab-***  = 'M'.
      counter = counter + 1.
      APPEND gw_itab TO gt_itab.
      CLEAR : gw_itab.
    ENDDO.
    <b>* Gt_itab is the internal table that we will write to spool</b>
    *Start
    SET PARAMETER ID 'ZPDF' FIELD lw_space.
    <b>CALL FUNCTION 'GET_PRINT_PARAMETERS'</b>
      EXPORTING
        in_parameters          = pripar
        line_size              = 255
        layout                 = 'X_65_132'
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = pripar
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    <b>*********To write data in spool</b>
    NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
    RESERVE 5 LINES.
    <b>*********From here data will be written in spool</b>
    WRITE : 'Name',
            'Age',
    LOOP AT gt_itab INTO gw_itab.
      WRITE : / gw_itab-name,
                gw_itab-age,
                gw_itab-***.
    ENDLOOP.
    <b>*****To switch off spool writing</b>
    NEW-PAGE PRINT OFF.
    ************End of spool writing
    <b>******To get the latest spool id of spool written by us</b>
    SELECT  rqident  rqcretime FROM tsp01
                 INTO (rqident,rqcretime)
                 WHERE rqowner = sy-uname
                 ORDER BY rqcretime DESCENDING.
      EXIT.
    <b>********  It will just read the latest spool id and exit</b>
    ENDSELECT.
    MOVE  rqident TO spool_id. <b>" We get the spool id here of the spool we wrote</b>
    <b>*Now  spool_id contains the spool id. We can convert this spool to pdf also as given *below</b>
    ****************************************************To convert spool to pdf
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid = spool_id
          NO_DIALOG =
          DST_DEVICE =
          PDF_DESTINATION =
          IMPORTING
             pdf_bytecount = numbytes
          PDF_SPOOLID =
          LIST_PAGECOUNT =
          BTC_JOBNAME =
          BTC_JOBCOUNT =
           TABLES
             pdf = itab_pdf
          EXCEPTIONS
            err_no_abap_spooljob = 1
            err_no_spooljob = 2
            err_no_permission = 3
            err_conv_not_possible = 4
            err_bad_destdevice = 5
            user_cancelled = 6
            err_spoolerror = 7
            err_temseerror = 8
            err_btcjob_open_failed = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed = 11
            OTHERS = 12.
                           END-OF-SELECTION
    To download the pdf file as local file
    CALL FUNCTION 'DOWNLOAD'
               EXPORTING
                    bin_filesize     = numbytes
                    filename         = gv_filename
                    filetype         = 'BIN'
                    filetype_no_show = 'X'
               IMPORTING
                    act_filename     = gv_filename
                    filesize         = numbytes
                    cancel           = cancel
               TABLES
                    data_tab         = itab_pdf.
    <b> I think i gave a lot of extra code, but i just gave it for proper understanding.
    Only a few days ago i came across this concept. So had the ready made code.</b>
    <b>Please do reward point if helpful</b>
    Regards
    swetabh

  • Create Control From Reference

    Using the type parameter of the Terminal is the best way to get the type of a control. If you try to do something like "get the value of the control and then ask for the type of that", you run into problems with LV classes and refnum types where the type of the value might be a child class of the type of the control.
    Solved!
    Go to Solution.

    Using the Create from Reference method seems easier:
    Try to take over the world!

  • Error when creating record from portal into MDM using MDM API's

    Hi All,
    When trying to create a new record from Portal we are getting the below error. It is working fine till yesterday.
    We are using MDM API's from webdynpro java for creating.
    What could be the reason for this. Not sure whether this error is ocuring for all the users or for single user.
    "Exception: CommandException com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Database command execution error. A SQL statement failed to execute. The actual error may have been written to a log file."
    Please help to resovle this.
    Thanks
    Satish

    Hello Satish
    Suppose your Portal was upgrated
    if it right -  search and deploy new mdm packages
    Regards
    Kanstantsin

  • Retrieving records from a Data Block same as retrieving records from cursor

    Dear Gurus,
    Is it possible to retrieve records from a datablock same as retrieving records from a cursor,
    Eg:
    I am having two data blocks in two different tabs, Say B1 in Tab1, B2 in Tab2
    B1 is filled with two records, now when I switch to Tab2,
    I want all records of B1 in B2, assuming that blocks are having the same structure.
    The code I wish to write is,
    Goto B1,
    Take all the records like a cursor,
    Goto B2,
    loop
    insert
    end loop;
    Is this possible???

    I need to show it before saving,
    I tried this and it is successful somehow, do not know about any further problems,
    I took the record count of both blocks
    if :B1.reccount <> :B2.reccount
                   then
                   go_block('B1');
                   first_record;
                   for i in 1..:B1.reccount
                   loop
                        go_block('B1');
                        go_record(i);
              assign values from B1 to variables.
              go_block('B2');
              assign values from variables to B2
              next_record;
                   end loop;
                   clear_record;
              end if;
    This is working, Now I just want to know, if my block is having numerous fields, say more than 100 (may not be a value for large databases)
    how can I replace these variables here.
    I mean is it possible to declare something like a cursor record type.
    For eg : r1 cursor%rowtype

  • Selecting records from multiple dates but specific time

    Hi:
    I've to select records of multiple dates but the time should be 00:00:00 to 06:00:00 (i.e. 12 AM - 6 AM)
    For date part this can be done:
    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    But how can I fix the time mentioed above.
    Please let me know.
    Thanks/Tanvir

    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    and start_time - trunc(start_time) between 0 and 6/24start_time - trunc(start_time) will give you the fraction of a day. So 6/24 means 06:00.
    (When you use to_char(trunc(sysdate,'hh'),'hh24') between 0 and 6 you will also retrieve records with start_time 06:01 for example. So this would not meet your requirements as far as I understood.)
    Edited by: hm on 10.04.2012 01:26

  • Having difficulty creating pdf from XML data source

    I have a 'rpt' file built with a classic install of Crystal 10, using xml as a data source. I have tried using both ADO.NET(XML) connection and ODBC CR ODBCXML Driver 4.20.
    The rpt file was built on Windows2000 NT platform. The report runs, and displays data from the sample xml file in the preview tab.
    I am attempting to feed xml data into the rpt file with the intent to create pdf formatted output. I am using java with the Crystaldecisions packages. I am running this app out of an Apache server on an Ubuntu VM Hardy Heron release. This does not have any version of Crystal Reports installed on it.
    I have followed the examples and I am comfortable that I have the correct package imports, I am able to open the rpt file, and convert both the xml and xsd to byte arrays. When I issue the command
    reportClientDocument.getDatabaseController().setDataSource(xmlDataSet, '', '')
    I get the response
    Cannot find corresponding table information in the XML file
    Set data source failed: The table 'criminal_case' could not be found.
    Request failed and JRC Command failed to be undone
    JRCAgent1 detected an exception: The table 'criminal_case' could not be found.
    at com.crystaldecisions.reports.reportdefinition.datainterface.g.a(Unknown Source)
    The xsd does validate the xml which contains a noNamespaceSchemaLocation pointer to the xsd.
    The xml is the same data that was used to design the report on the NT box. This means that I see the same elements being byte streamed as were used to create the rpt file.
    Is this as simple as I am running my webserver on Linux? I do see the connection attribute properties reference a Database DLL that is clearly windows based. What can I do?

    So why develop a report if there is no data? I can only think that you have a bunch of static text, maybe an instruction page you want to publish? If so, you still need a data source, it can be a dummy source
    <?xml version="1.0"?>
    <ROOT/>
    ie no data per se. BIP needs a source even if there is not data to merge.
    Cheers
    Tim

Maybe you are looking for

  • Best authentication method for controlling DEVICE access to wlan

    Hello, I have a similar question to this thread ( https://supportforums.cisco.com/message/3927713 ) but I'm interested about device control on top of user control. Just like that thread, we are using WPA2-AES Enterprise with PEAP MSCHAPv2, which allo

  • Separating images within a photo

    I have many birding photos with several birds in one image, such as 3 terns flying.  I want to be able to move one bird closer to another bird. Is that possible?

  • In 1.4, for a local URL, spaces show up as %20

    This code: String className = this.getClass().getName(); className = new String( className.substring( className.lastIndexOf( '.' ) + 1 ) + ".class" ); URL url = this.getClass().getResource( className ); File file = new File( url.getPath() );is suppos

  • Adobe Photoshop Element 12 FREEZING on a Mac! HELP!

    I have Adobe Photoshop Element 12. I am trying to select a portion of a photo and drag it onto another but everything I try to select it my photoshop completely freezes. Also, when I try to move a layer it just bounces back to it's original position

  • Wifi disconnect at sleep mode

    After upgrade ipad to ios6.1 Wifi disconnect at sleep mode   Whay?????????!!!!!!