Combining entries with matching fields

Hi,
I need help with creating for the following situation:
For example:
I have an internal tables with 10 entries.
I need to combine entries that have the same cost element (KSTAR), accounting indicator and service bulletin. For example, if 2 different entries have those fields match, create 1 entry with that data and sum up the quantity. So if the 1st entry has 1 quantity, and the 2nd entry had 3 quantity, then the combined entry will have 4 quantity.
How do I do this?
Please help.
Thanks,
Laura

I created a quick test but its not working:
REPORT  YTEST_COMBINE                           .
TYPES: BEGIN OF Z_TABLE,
  NAME(10) TYPE C,
  VAL1(10) TYPE C,
  VAL2(10) TYPE c,
  MENGE(5) TYPE N,
END OF Z_TABLE.
DATA: IT_TABLE TYPE TABLE OF Z_TABLE WITH HEADER LINE.
DATA: COLLECT_TABLE TYPE TABLE OF Z_TABLE WITH HEADER LINE.
START-OF-SELECTION.
IT_TABLE-NAME = 'STAN'.
IT_TABLE-VAL1 = 'A'.
IT_TABLE-VAL2 = 'B'.
IT_TABLE-MENGE = '5'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'STAN'.
IT_TABLE-VAL1 = 'A'.
IT_TABLE-VAL2 = 'B'.
IT_TABLE-MENGE = '5'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'JOE'.
IT_TABLE-VAL1 = 'C'.
IT_TABLE-VAL2 = 'C'.
IT_TABLE-MENGE = '9'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'JAMES'.
IT_TABLE-VAL1 = 'D'.
IT_TABLE-VAL2 = 'D'.
IT_TABLE-MENGE = '17'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'TIM'.
IT_TABLE-VAL1 = 'E'.
IT_TABLE-VAL2 = 'E'.
IT_TABLE-MENGE = '19'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'LAW'.
IT_TABLE-VAL1 = 'F'.
IT_TABLE-VAL2 = 'F'.
IT_TABLE-MENGE = '29'.
APPEND IT_TABLE.
IT_TABLE-NAME = 'TIM'.
IT_TABLE-VAL1 = 'E'.
IT_TABLE-VAL2 = 'E'.
IT_TABLE-MENGE = '1'.
APPEND IT_TABLE.
LOOP AT IT_TABLE.
COLLECT_TABLE-NAME = IT_TABLE-NAME.
COLLECT_TABLE-VAL1 = IT_TABLE-VAL1.
COLLECT_TABLE-VAL2 = IT_TABLE-VAL2.
COLLECT_TABLE-MENGE = IT_TABLE-MENGE.
COLLECT COLLECT_TABLE.
ENDLOOP.

Similar Messages

  • Combining items with different fields

    I have users that want to built a report that shows all the products in the same table. Problem is certain fields will only be populated for certain products.
    For example, a table with 15 fields, first 5 are constant across both products, 2nd 5 only for product A, 3rd 5 only for product B.
    When you select product A from a drop down they want the table to only show the first 10 fields, when you select product B they want the table to only show the first and last 5. If no product is selected all fields should show.
    Am I right in thinking this could be achieved with the union to combine results?
    Thanks

    Assuming that you have the same total number of columns for each product (in your example product A and B both have 10) then yes, you could use a UNION. The first part of the UNION would include the 5 common fields and the additional 5 that pertain to product A. The second part would have the common ones and also those that belong to B. You could include an extra column into which you'd store a string, either 'productA' or 'productB'. Then could then filter on this extra column to show the product you're interested in.
    But if the number of columns isn't the same for both products that won't work. You could pull all the columns into the analysis and then create a separate table view for each product. You could exclude out whatever columns that don't make sense and then use a view selector to move between the different tables.
    I guess it depends upon how you want to display the data. How many different products are there?
    JB

  • Howto select all entries with two fields value

    Hi all,
    I have the following SELECT stmt:
          SELECT SUM( betrw )
            INTO l_real_t
            FROM dfkkop
           WHERE opbel = l_opbel
             AND hvorg <> gc_hvorg_dun_fee
             AND tvorg <> gc_tvorg_dun_fee.
    Now I get no lines, where hvorg = gc_hvorg_dun_fee OR tvorg = gc_tvorg_dun_fee.
    But my intention is to get no lines, where BOTH conditions are met.
    What am I doing wrong here?
    Kind Regards, Matthias

    Check this..
    SELECT SUM( betrw )
            INTO l_real_t
            FROM dfkkop
           WHERE opbel = l_opbel
             AND NOT ( hvorg EQ gc_hvorg_dun_fee
             AND tvorg EQ gc_tvorg_dun_fee).

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • How to delete duplicate entries in match code

    I want to delete duplicate entries in match code.

    If you go down the search exit route, using function module F4_IF_SHLP_EXAMPLE or function module F4_IF_SHLP_EXIT as a template you want it where callcontrol-step = 'DISP'.  You would sort the table: SORT RECORD_TAB BY STRING and then delete adjacent duplicates. If this does not wok because of the fields you have in your search help, you will need to select the data into another internal table and match the relevant entries from your internal table  with the relevant position in field STRING of RECORD_TAB.  The positions in STRING will be as per the order of the parameters  you have defined in the search help.
    Hope this helps.
    Regards
    Larissa

  • Need to setup Premiere CS6 sequence for two file types with different field orders

    I have a client who has shot video for me using two cameras, one camera was set to progressive, and the other to interlaced upper field first. I need to use both file types in the edit and have been struggling to set up the sequence to get the best look for the end product, a DVD. I have several videos to do for her that were all shot in the same way, so I need a solution!
    I would appreciate help figuring out how to set up this work flow from beginning to end.
    Should I convert one of the files from the beginning so they match field orders before going into a sequence? Or do I just need to do some adjusting of the files once they are in the sequence? Is it just as simple as changing the transcode settings to favor the upper field first? I'm definitely having issues once the video is transcoded in Encore and you can see a lot of jagged edges and lines especially during movement. My client isn't happy and I've tried several workarounds, but to no avail.
    Here are the two file types I have:
    File extension: .MOV
    H.264, 1920x1080, Linear PCM, 16 bit little-endian signed integer, 48000 Hz, stereo
    FPS 29.97
    No Fields: Progressive Scan
    File extension: .MTS (my Mac finder can't read these files, but they are read in Premiere)
    Image Size: 1920 x 1080
    Frame Rate: 29.97
    Source Audio Format: 48000 Hz - compressed - 6 channels
    Pixel Aspect Ratio: 1.0
    Upper Field First
    I am using Adobe Premiere CS 6.0.2
    Encore 6.0.1
    Media Encoder 6.0.2.81
    I am running it on an iMac 27-inch, Mid 2011
    with Mac OS X Lion 10.7.5
    Processor  3.4 GHz Intel Core i7
    Graphics  AMD Radeon HD 6970M 1024 MB
    I've just been setting the sequence to match the .MOV files since they look much better than the .MTS files. I've done the opposite as well, setting the sequence to match the .MTS files and it doesn't seem to help. I've also changed the field order of the files once they are in the sequence by changing the field options and have tried converting the .MTS files in the Media Encoder, but nothing I've done has worked.
    Any help would be so appreciated! The client I have is a photographer, so she wasn't aware of this issue when she first shot these videos. So I have 10 videos with these issues I need to get back to her, hopefully issue free! I'm struggling as an editor because my last job I was using FCP and was working with videographers who knew what they were doing, so I've never faced such problems before. Plus I'm new to the Adobe software. Not a good combination. Please forgive me if I didn't give all the information you need. I will happily respond with whatever more information you may need to help me out!
    ~KTrouper

    I wonder if you could do your edit ignoring any visual issues of the interlaced footage but keeping the different sources separate ( checkerboard edit Vid 1/ Vid 2 )
    Lock it down then export the interlaced part of the edit as a Digital Intermediate.
    Maybe Export the other source as well to the same codec. DI
    Bring them back together in a New Sequence. You wold have to deal with the black spacing.

  • Combing PDF forms with identical field names while retaining unique values.

    I have several PDF files of the same form that has been filled out by multiple users. I need to create a combined file of all the responses for reporting purposes. However, the forms (obviously) all have the same field names, and when I combine them the values of the first form autofill the values of the matched fields on the other forms. I need a way to combine the forms while retaining the unique field values. I thought I could write a js to rename the fields, but that isn't possible.
    *EDIT: The fields need to retain editability because some contain long, scrolling text. Flattening or read-only isn't an option, not that either fixes the above problem.
    Suggestions?

    UPDATE:
    I solved this problem, at least for my own needs. Following try67's advice in a related post, I had to delete the existing fields and create new ones with new names. Given my desired outcome, this meant collecting all of the field properties of the fields (with some variation by field type), storing it, erasing the existing fields, and using that stored information to create new, identical fields (again with some variation by field type). Since I didn't want to retain actions or javascript, this was a perfect solution. I also no longer needed the buttons to function (since I wasn't retaining their javascript), so I made them read-only. I'm listing my working code below, in case anyone else could benefit from some or all of it.
    My question to the community is this: Why doesn't Adobe allow for fields to be renamed via javascript? Is it a security issue? My life would have been a lot easier the last few days if I could simply rename existing fields.
    The following script is used in a Combine Files action via the Action Wizard. The PDF optimizer is also used to strip out or flatten additional items.
    //This script is used to rename all the fields in a document while also removing any javascript or actions associated with those fields. Makes buttons read only without renaming.
    //Function to create a random alphanumeric ID.
    function makeid(n) {
        var text = "";
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for( var i=1; i <=n; i++ )
            text += possible.charAt(Math.floor(Math.random() * possible.length));
        return text;
    //List variables for collecting arrays of field properties.
    var fieldNum = this.numFields;
    var fieldNameArray = new Array();
    var fieldTypeArray = new Array();
    var pageNumArray = new Array();
    var fieldRectArray = new Array();
    var fieldValueArray = new Array();
    var borderStyleArray = new Array();
    var borderColorArray = new Array();
    var borderThicknessArray = new Array();
    var fillColorArray = new Array();
    var textColorArray = new Array();
    var textFontArray = new Array();
    var textSizeArray = new Array();
    var textAlignmentArray = new Array();
    var textMultilineArray = new Array();
    var checkmarkStyleArray = new Array();
    var radiowidgetNumArray = new Array();
    var radiowidgetRectArray = new Array();
    var radiowidgetPageNumArray = new Array();
    //Get the properties of all the current fields, including widgets.
    for (var i = 0; i < fieldNum; i++) {
        var currentField = this.getNthFieldName(i);
        fieldNameArray[i] = makeid(5);
        fieldTypeArray[i] = this.getField(currentField).type;
        borderStyleArray[i] = this.getField(currentField).borderStyle;
        borderColorArray[i] = this.getField(currentField).strokeColor;
        borderThicknessArray[i] = this.getField(currentField).lineWidth;
        fillColorArray[i] = this.getField(currentField).fillColor;
        textColorArray[i] = this.getField(currentField).textColor;
        textFontArray[i] = this.getField(currentField).textFont;
        textSizeArray[i] = this.getField(currentField).textSize  
        if (this.getField(currentField).type == "text") {
            fieldRectArray[i] = this.getField(currentField).rect;
            pageNumArray[i] = this.getField(currentField).page;
            fieldValueArray[i] = this.getField(currentField).value;
            textAlignmentArray[i] = this.getField(currentField).alignment;
            textMultilineArray[i] = this.getField(currentField).multiline;
        if (this.getField(currentField).type == "checkbox") {
            fieldRectArray[i] = this.getField(currentField).rect;
            pageNumArray[i] = this.getField(currentField).page;
            fieldValueArray[i] = this.getField(currentField).value;
            checkmarkStyleArray[i] = this.getField(currentField).style;
        if (this.getField(currentField).type == "radiobutton") {
            checkmarkStyleArray[i] = this.getField(currentField).style;
            fieldValueArray[i] = this.getField(currentField).value;
            var n = 0;
            while (this.getField(currentField + "." + n) != null) {
                radiowidgetNumArray[n] = this.getField(currentField + "." + n).name;
                n++;
            for (x = 0; x < radiowidgetNumArray.length; x++) {
                radiowidgetRectArray[x] = this.getField(radiowidgetNumArray[x]).rect;
                radiowidgetPageNumArray[x] = this.getField(radiowidgetNumArray[x]).page;
    //Delete all the current fields, except for buttons, which become read-only.
    for (var i = (fieldNum - 1); i > -1; i--) {
        var currentField = this.getNthFieldName(i);
        if (this.getField(currentField).type != "button") {
            this.removeField(currentField);
        } else {
            this.getField(currentField).readonly = true;
    //Using the stored arrays of field properties, generate new, identical fields.
    for (var i = 0; i < fieldNum; i++) {
        if (fieldTypeArray[i] == "text") {
            var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]);
            newField.value = fieldValueArray[i];
            newField.borderStyle = borderStyleArray[i];
            newField.strokeColor = borderColorArray[i];
            newField.lineWidth = borderThicknessArray[i];
            newField.fillColor = fillColorArray[i];
            newField.textColor = textColorArray[i];
            newField.textFont = textFontArray[i];
            newField.textSize = textSizeArray[i];
            newField.alignment = textAlignmentArray[i];
            newField.multiline = textMultilineArray[i];
            newField.doNotSpellCheck = true;
        if (fieldTypeArray[i] == "checkbox") {
            var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]); 
            newField.value = fieldValueArray[i];
            newField.borderStyle = borderStyleArray[i];
            newField.strokeColor = borderColorArray[i];
            newField.lineWidth = borderThicknessArray[i];
            newField.fillColor = fillColorArray[i];
            newField.textColor = textColorArray[i];
            newField.textFont = textFontArray[i];
            newField.textSize = textSizeArray[i];
            newField.style = checkmarkStyleArray[i];
            newField.readonly = true;
        if (fieldTypeArray[i] == "radiobutton") {
            for (y = 0; y < radiowidgetNumArray.length; y++) {
                var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], radiowidgetPageNumArray[y], radiowidgetRectArray[y]);
                newField.value = fieldValueArray[i];
                newField.borderStyle = borderStyleArray[i];
                newField.strokeColor = borderColorArray[i];
                newField.lineWidth = borderThicknessArray[i];
                newField.fillColor = fillColorArray[i];
                newField.textColor = textColorArray[i];
                newField.textFont = textFontArray[i];
                newField.textSize = textSizeArray[i];
                newField.style = checkmarkStyleArray[i];
                newField.readonly = true;           
    //End script.

  • Understanding logminer results -- inserting row into table with CLOB field

    In using log miner I have noticed that inserts into rows that contain a CLOB (I assume this applies to other LOB type fields as well, have only tested with CLOB so far) field are actually recorded as two DML entries.
    --the first entry is the insert operation that inserts all values with an EMPTY_CLOB() for the CLOB field
    --the second entry is the update that sets the actual CLOB value (+this is true even if the value of the CLOB field is not being set explicitly+)
    This separation makes sense as there may be separate locations that the values are being stored etc.
    However, what I am tripping over is the fact the first entry, the Insert, has a RowId value of 'AAAAAAAAAAAAAAAAAA' which is invalid if I attempt to use it in a flashback query such as:
    SELECT * FROM PERSON AS OF SCN #####'  where RowId = 'AAAAAAAAAAAAAAAAAA'The second operation, the Update of the CLOB field, has the valid RowId.
    Now, again, this makes sense if the insert of the new row is not really considered "+done+" until the two steps are done. However, is there some way to group these operations together when analyzing the log contents to know that these two operations are a "+matched set+"?
    Not a total deal breaker, but would be nice to know what is happening under the hood here so I don't act on any false assumptions.
    Thanks for any input.
    To replicate:
    Create a table with CLOB field:
    CREATE TABLE DEVUSER.TESTTABLE
            ID NUMBER
           , FULLNAME VARCHAR2(50)
          , AGE NUMBER  
          , DESCRIPTION CLOB
           );Capture the before SCN:
    SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Insert a new row in the test table:
    INSERT INTO TESTTABLE(ID,FULLNAME,AGE) VALUES(1,'Robert BUILDER',35);
         COMMIT;Capture the after SCN:
    SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Start logminer session with the bracketing scn values and options etc:
    EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTSCN=>2619174, ENDSCN=>2619191, -
               OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE + -
               DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.NO_ROWID_IN_STMT + DBMS_LOGMNR.NO_SQL_DELIMITER)Query the logs for the changes in that range:
    SELECT
           commit_scn, xid,operation,table_name,row_id
           ,sql_redo,sql_undo, rs_id,ssn
           FROM V$LOGMNR_CONTENTS
        ORDER BY xid asc,sequence# ascResults:
    2619178     0C00070028000000     START                  AAAAAAAAAAAAAAAAAA     set transaction read write
    2619178     0C00070028000000     INSERT     TESTTABLE     AAAAAAAAAAAAAAAAAA     insert into "DEVUSER"."TESTTABLE" ...
    2619178     0C00070028000000     UPDATE     TESTTABLE     AAAFEXAABAAALEJAAB     update "DEVUSER"."TESTTABLE" set "DESCRIPTION" = NULL ...
    2619178     0C00070028000000     COMMIT                  AAAAAAAAAAAAAAAAAA     commitEdited by: 958701 on Sep 12, 2012 9:05 AM
    Edited by: 958701 on Sep 12, 2012 9:07 AM

    Scott,
    Thanks for the reply.
    I am inserting into the table over a database link.
    I am using the new version of HTML Db (2.0)
    HTML Db is connected to an Oracle 10 database I think, however the table I am trying to insert data into (via the database link) is in an Oracle 8 database - this is why we created a link to it as we couldn't have the HTML Db interacting with the Oracle 8 database directly due to compatibility problems (or so I've been told)
    Simon

  • DPS6: hiding attributes for entries not matching a specific objectclass

    I'd like to be able to hide some attributes, but only for entries not matching a given objectclass.
    DPS 6 allows data hiding rules to apply to a specific subset of entries, but the subset can not
    be defined thanks to a negative filter such like (!(objectclass=MyAuxiliaryObjectClass)).
    If I hide the attributes at the view level, then it takes precedence over any "allow rules", so I don't see how
    I can achieve this.
    Any idea ? support plan ?

    Just to add some more details, I've tried to use a virtual ACI in order to define my filter but there's no "targetfilter" support in DPS, and with different other ACI combinations, it can not work because there's no implicit deny ACI in DPS:
    Even with only "allow dpsaci's" , attributes not specified in those dpsaci's are still allowed by the viewable-attr parameter of the view. Moreover, if I use the viewable-attr/non-viewable-attr view parameters, then the not explicitly allowed/explicitly denied attributes defined at the view level take precedence over the dpsaci's .

  • Select For all entries with multiple keys

    Dear Developers,
    im writing a program which reads the last the last mseg entry with bwart 101 and bwart 201 an writes it into different fields of a table. In dependance of the bwart the max-value of mkpf-budat should be moved into field wedat or wadat.
    At the moment i use this coding:
    loop at gt_daten assigning <fs_daten>.
        select distinct max( budat ) from wb2_v_mkpf_mseg2 into <fs_daten>-wedat
          where matnr_i = <fs_daten>-matnr
            and werks_i = <fs_daten>-werks
            and lgort_i = <fs_daten>-lgort
            and bwart_i = '101'.
        select distinct max( budat ) from wb2_v_mkpf_mseg2 into <fs_daten>-wadat
        where matnr_i = <fs_daten>-matnr
          and werks_i = <fs_daten>-werks
          and lgort_i = <fs_daten>-lgort
          and bwart_i = '201'.
      endloop.
    wb2_v_mkpf_mseg2 is a view combining mkpf an mseg by primary keys.
    Searching the internet i read, using FOR ALL ENTRIES should be prefered to selectstatements in loops.
    So i tried:
    *selectstatement
    select budat matnr_i werks_i lgort_i bwart_i from wb2_v_mkpf_mseg2 into table lt_mseg for all entries in gt_daten
        where matnr_i = gt_daten-matnr
          and werks_i = gt_daten-werks
          and lgort_i = gt_daten-lgort
          and ( bwart_i = '101' or bwart_i = '201' )
    *Substitute the MAX( )-Function
      sort lt_mseg descending by matnr werks lgort bwart budat.
      delete adjacent duplicates from lt_mseg comparing matnr werks lgort bwart.
    *Differ between wedat and wadat
      loop at gt_daten assigning <fs_daten>.
        loop at lt_mseg assigning <fs_mseg>
          where matnr = <fs_daten>-matnr
            and werks = <fs_daten>-werks
            and lgort = <fs_daten>-lgort.
          case <fs_mseg>-bwart.
            when '101'.
              <fs_daten>-wedat = <fs_mseg>-budat.
            when '201'.
              <fs_daten>-wadat = <fs_mseg>-budat.
          endcase.
        endloop.
    Even in the dev-system this takes twice the time of the "nested" selects.
    Imho this is because of the internal OR interpretation of the FOR ALL ENTRIES-statement and the size of the result.
    Can somebody give me a hint, how to tune this code?
    Select Inner join should be difficult because the target field differs, dependent of the value in bwart...
    Thanks in advance!

    I understand that you are trying to capture the maximum value of posting date MKPF-BUDAT for movement types 101 and 201 for each combination of material, plant and storage location.
    Few things, that makes the below coding more efficient at both application and database level and I confirmed this on an IDES sandbox
    1. Along with MKPF and MSEG, there is another table WBGT, in the view WB2_V_MKPF_MSEG join and also WBGT has select condition restrictions imposed on its fields. So if this restriction impacts your selection you may want to do a INNER JOIN of MSEG with MKPF only (with MSEG as leading table, as it has an active secondary index with MATNR, WERKS, LGORT and BWART ) and also there won't be overhead from the unnecessary join with WBGT table whose fields you are not using.
    2. The below SORT on lt_mseg will ensure that the record having greatest BUDAT will be at the top of all rows (least index) for each combination of MATNR, WERKS, LGORT and BWART.
    3. DELETE ADJACENT DUPLICATES will ensure that only the top row (having greatest BUDAT) remains in the table lt_mseg for each combination of MATNR, WERKS, LGORT and BWART. This will ensure that subsequent READs with BINARY SEARCH will always and efficiently read the row with maximum value of BUDAT for each unique combination of MATNR, WERKS, LGORT and BWART.
    4. The below logic will require more memory (even though it is more efficient performance wise) compared to direct SELECT with MAX for each MATNR, WERKS, LGORT and BWART in a LOOP the way you were doing before. So if the size of lt_mseg is causing memory issues, your logic with aggregate function MAX at database level will be your only option.
    So, I propose you revise your coding like below for most optimal results
    CHECK NOT gt_daten[] IS INITIAL.
    *selectstatement
    *SELECT budat matnr_i werks_i lgort_i bwart_i
    *  FROM wb2_v_mkpf_mseg2
    *  INTO TABLE lt_mseg
    *    FOR ALL ENTRIES IN gt_daten
    *    WHERE matnr_i = gt_daten-matnr
    *      AND werks_i = gt_daten-werks
    *      AND lgort_i = gt_daten-lgort
    *      AND ( bwart_i = '101' OR bwart_i = '201' ).
    * The below SELECT is more economical than the one commented above
    SELECT mkpf~budat mseg~matnr mseg~werks mseg~lgort mseg~bwart
      FROM mseg INNER JOIN mkpf
        ON mseg~mblnr = mkpf~mblnr AND
           mseg~mjahr = mkpf~mjahr
        INTO TABLE lt_mseg
          FOR ALL ENTRIES IN gt_daten
            WHERE mseg~matnr = gt_daten-matnr
              AND mseg~werks = gt_daten-werks
              AND mseg~lgort = gt_daten-lgort
              AND ( mseg~bwart = '101' OR mseg~bwart = '201' ).
    *Substitute the MAX( )-Function
    SORT lt_mseg BY matnr werks lgort bwart DESCENDING budat.
    DELETE ADJACENT DUPLICATES FROM lt_mseg COMPARING matnr werks lgort bwart.
    *Differ between wedat and wadat
    LOOP AT gt_daten ASSIGNING <fs_daten>.
      READ TABLE lt_mseg ASSIGNING <fs_mseg>
        WITH KEY matnr = <fs_daten>-matnr
                 werks = <fs_daten>-werks
                 lgort = <fs_daten>-lgort
                 bwart = '101' BINARY SEARCH.
      IF sy-subrc = 0.
        <fs_daten>-wedat = <fs_mseg>-budat.
      ENDIF.
      READ TABLE lt_mseg ASSIGNING <fs_mseg>
        WITH KEY matnr = <fs_daten>-matnr
                 werks = <fs_daten>-werks
                 lgort = <fs_daten>-lgort
                 bwart = '201' BINARY SEARCH.
      IF sy-subrc = 0.
        <fs_daten>-wadat = <fs_mseg>-budat.
      ENDIF.
    ENDLOOP.

  • Match fields from the same table

    Hi,
    I have a table:
    ID|TEXT1 |TEXT2
    ----------|------|---------------
    1|1 |1
    2|1 |0
    3|1 |1
    4|1 |0
    5|1 |0
    I want to match fields with the same text1 value bu without duplicates
    I tried this:
    select t1.id, t2.id from dane_testowe t1 left join dane_testowe t2 on t1.text1 = t2.text1 where t1.id <> t2.id;
    but I got 20 rows (should be 10)
    ID| ID
    ----------|----------
    5| 1
    4| 1
    3| 1
    2| 1
    5| 2
    4| 2
    3| 2
    1| 2
    5| 3
    4| 3
    2| 3
    1| 3
    5| 4
    3| 4
    2| 4
    1| 4
    4| 5
    3| 5
    2| 5
    1| 5
    I'm new at pl/sql (sql), so could You explain me where is mistake?
    Thanks in advance

    I want to get only one combination like this
    ID| ID
    ----------|----------
    5| 1
    4| 1
    3| 1
    2| 1
    5| 2
    4| 2
    3| 2
    5| 3
    4| 3
    For ex I don't want 2| 1 and 1| 2

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • Create a Procedural ALV Report with editable fields and save the changes

    Hi,
    I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDIT_02
    BCALV_TEST_GRID_EDIT_04_FORMS
    BCALV_TEST_GRID_EDITABLE
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    BCALV_FULLSCREEN_GRID_EDIT
    But all these are using OO Concepts.
    Please help.
    Regards,
    Smruthi

    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      line_color(4) TYPE c,     "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
    fieldcatalog-edit             = 'X'
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_pf_status_set = 'STATUS'
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           TABLES
                t_outtab                = it_ekko
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      DATA: ld_color(1) TYPE c.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      LOOP AT it_ekko INTO wa_ekko.
        ld_color = ld_color + 1.
        IF ld_color = 8.
          ld_color = 1.
        ENDIF.
        CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
        MODIFY it_ekko FROM wa_ekko.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM top-of-page                                              *
    FORM top-of-page.
      WRITE:/ 'This is First Line of the Page'.
    ENDFORM.
          FORM status                                                   *
    FORM status USING rt_extab TYPE slis_t_extab.  .
      SET PF-STATUS 'ALV'.
    ENDFORM.
          FORM USER_COMMAND                                          *
    -->  RF_UCOMM                                                      *
    -->  RS                                                            *
    FORM user_command USING rf_ucomm LIKE sy-ucomm
                             rs TYPE slis_selfield.            
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      CASE rf_ucomm.
    when 'SAVE'.
    get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
    endcase.
    endform.
    ENDFORM.
    here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
    create a custom PF status and create push buttons and assign your ok codes in your PF status.
    if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
    Hope this will help you.
    Regards,
    phani.

  • How do you get a line with MULTIPLE fields to WRAP ?

    How do you get a line with MULTIPLE fields to WRAP ?
    Good afternoon everyone...
    THE PROBLEM: Why doesn’t a line with multiple fields WRAP?
    HYPOTHETICAL EXAMPLE/WHAT I”D LIKE TO SEE
    If I have 2 fields on a line (this is now a hypothetical example and nothing to do with my actual report)….let’s call them field A and field B. And if field A has values of all ‘X’ and field B has values of all ‘Y’…then….the normal case would be (ignore dots – only for spacing):
    A……………………… B
    XXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYY
    But what if A is too long? I would want to see B wrap onto the next line like this:
    A……………………………………………………B
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX YYYYYY
    YYYYYYYYYYYYY
    And similarly….if B is extra long, can the line print as:
    A………………………. B
    XXXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    I don’t want the case where B is long and I get:
    A………………… …B…
    XXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYY
    ………………………..YYYYYYYYYYYYYYYYYYYYY
    I can see how you can wrap an individual field like that…but how can you WRAP a line of[b] fields within the frame so it wraps to the BEGINNING of the frame on next line?
    My SPECIFIC CASE
    I have a report that I have stripped down to a simple structure for the purposes of this explanation.
    My DATA MODEL has the main QUERY (for plant family and species data). The columns of the query are divided into 2 groups. The 1st GROUP contains the family data. Below that is the rest of the species data in a 2nd GROUP.
    Linking from the 2nd species group (above) is a new QUERY to extract REGION data based on the common key field. Under this 2nd query is another group with all the REGION columns.
    The LAYOUT MODEL has a group frame (the main , base one)
    On top of this is a repeating frame based on the 1st group (family data).
    On top of this is another repeating frame for the 2nd group (species data).
    On top of this is 2 Frames on the same line line. The 1st frame contains columns from the species group .
    The 2nd frame on this line is a repeating frame. The PRINT DIRECTION for this frame is ACROSS/DOWN. It repeats details of the REGION where the species is found. These columns come from this group come from the REGION QUERY and GROUP.
    All fields on the report line have variable horizontal elasticity.
    The problem is that when there is too much data on the line, it does NOT WRAP to the 2nd line.. It TRUNCATES.
    Can the line be made to WRAP????..
    In my current report, 1 of 2 things is happening:
    1) All fields print on the line until it hits the page boundary and then it just stops. Truncated!
    2) All fields print on the current line, then Oracle Reports throws a new page to print the REMAINDER of the long, input line
    But I would like a LONG line to continue printing onto the following line of the same page.
    I have tried all combinations of the elasticity fields and the ‘ADVANCED LAYOUT’ properties.
    I have been focussing my attention with this problem on the frames .
    We are using REPORT BUILDER V 6.0.8.26.0
    Thankyou to anyone who may offer assistance.
    Tony Calabrese.

    Steve,
    you gain 1 thing, but you lose something else!
    This thing is SO frustrating!
    Hey Steve! Good afternoon.
    I've done as you suggested....I have a long text boilerplate item - the only 1 on the line...and it has all the column in it.
    So it looks like:
    &col1 &col2 &col3 &col4 &col5 etc etc etc
    And the line expands nicely to each field's requirements.
    And when it gets to the right page boundary...it WRAPS to the next line! Beautiful!!!
    The only thing is that...when I had individual fields across the line I was able to create format triggers for those fields. And in doing so I was able to reduce the font and change the justification. I had to do that because some of the fields had to appear superscripted.
    So I wanted something like (ignore the dots):
    ...................................ppppp
    AAAA BBBB CCCCC DDDD EEEE FFFFFF
    So the field of 'ppppp' appeared slightly higher on the line than the other fields...
    I can't see how I can do this with a single TEXT field containing all the &COL values.
    Have you ever come across anything like this?
    Thankyou again,
    Tony Calabrese 12/4/2007

  • Maintenance View with Subset Fields

    Hi All,
    I have created a maintenance view based on a single DB table. Two key fields are defined to be as subset fields. No selection conditions are added to the view. I have used table maintenance genrator to define the screen (one step) along with the events.
    In SM30, i get the popup to fill the subset fields.
    I have created an event for AA (to replace default read). I am filling total attribute here.
    a) Is there some other attribute that i need to fill apart from total?
    I receive following dump
    " Exception condition "NO_VALUE_FOR_SUBSET_IDENT" is raised"
    When i set <status>-sbsid_rcvd = 'R' in read routine along with total, then the above exception doesn't appear.
    But filtering based on the subset values doesn't happen automatically.
    b) I also need have to have routines to perform insert, copy and validation.
    c) Would the contents displayed be automatically filtered based on the subset values or we need to process this in user routines for read and so on?
    As i find very limited documentation available for maintenance views with subset fields, could you suggest me some example to do the above?
    Thanks in Advance,
    Regards,
    Rekha

    Hello Rekha,
    Yes I've same idea, documentation for maintenance screens is inadequate.
    But there is way to find examples for all events,
    table TVIMF is storing the Table name - Event - Form name columns.
    For example when u want to  do something about  "creating a new entry"
    Just go se11 > Table maintenance generator and find related event : 05
    - Then go to TVIMF and display a record for event = 05
    - than go to function group of  maintenance screen of the TABLE in that record
    - find the subroutine form ( TVIMF-FORMNAME) in that function group
    This is a working example for that event, try or copy & use.
    I hope it helps you for the coding for all the events.
    Bulent
    Edited by: Bulent Balci on Aug 5, 2010 11:28 PM
    Edited by: Bulent Balci on Aug 5, 2010 11:29 PM

Maybe you are looking for

  • Cfmail spool sending one message at a time

    I have mx7 standard installed on win 2003 server a cfmail page sends files to the spool corectly. The spool is only sending out one message every 60 seconds or so. Changing the spool interval has no effect. these need to go out a lot faster than this

  • Creating Support Messages from Satellite System without SolMan user account

    Hi We are having some problems with users "creating support message" from our ECC system  to SolMan, if the user does not have a user account in Solution Manager. It is not correct, that users from Satellite systems can create support messages from t

  • Automatic Payment not possible due to Period Close

    Dear Experts, We have faced one issue, during last day of month our AP guys created payment proposal , before treasury run the payment the period was closed, the system status is stuck, not able to delete proposal or not even proceed for payment. Doc

  • Landing in SAP SD job

    Hello Guys, I'm SAP Certified in SD, and also have experience working in SAP for about 5 years in the entire Order to Cash cycle. I'm facing difficulty in landing a job, as employers expect project experience working as a functional consultant. It's

  • How to extract Chinese text from font embedded text PDF?

    This is actually font embedded text PDF (Used: type 1 fonts & custom encoding) and not scanned PDF, however I am unable to extract the "Chinese language" text properly and found only the garbled text when "Copy & Paste" (or save as RTF). Kindly refer