Merging 2 Columns into 1 in ALV

Hi Experts,
I am using ALV grid to display data.
I have two fields for icon in my internal table. if i concatenate the fields into one in the internal table
itself then the second icon is displayed like @8O@ -> internal representation.
Is there any way that i can show the two icons in one column of the ALV.
Like if there is any way to remove the dividing line between the two columns only (not the whole ALV)
Thanks
Rajat

Hi Naveen,
I dont want to merge two different table of structure.
I want to merge two icon fields into one column to display..
Thanks
Rajat

Similar Messages

  • ALV report: How to merge 2 columns into 1 column?

    Hello,
    I have a list of data which I would like format the header to look as below:
    | -
    Quater 1---- | -
    Quater 2 -
    | -
    Quater 3---- | -
    Quater 4---- |  <--- header 1
    | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | <--- header 2
    | -
    F---- | -
    S- | -F-- | -
    S- | -F-- | -
    S- | -F-- | -
    S- | <- header 3
    xxxxxxx | xxxxxx | xxxxx | xxxxx | xxxxxx | xxxxx | xxxxxx | xxxxx |  <--- data lines start here....
    Is there anyway I able to achieve this layout?
    I found quite a numerous of "cell_merge" information on ALV but I do not know how exactly it work and how to modify it?
    Would be appreaciate if anyone of you able to guide me with sample code.
    Thanks in advance,
    Aish :P

    Hi,
    U can do this by using Row position in FIELD CATALOG.
    Steps are:
    u2022     First we have to declare an internal table of output type with few dummy character type fields.
    u2022     Use this structure when populating field catalog.
    u2022     When populating field catalog we have to change row position, column position, offset value, field length, text, reference table and field name (if required), justification etc.
    u2022     Pass this field catalog as exporting parameter into function module u2018REUSE_ALV_LIST_DISPALYu2019.
    Type declaration for Output table
         TYPES: BEGIN OF ty_address,
             add_detl(1)     TYPE c,            u201CDummy field
             add_init(1)     TYPE c,            u201CDummy field
             pers_detl(1)    TYPE c,            u201CDummy field
             res_detl(1)     TYPE c,            u201CDummy field
             off_detl(1)     TYPE c,            u201CDummy field
             addrnumber      TYPE ad_addrnum,   "Address number
             name1           TYPE ad_name1,     "First Name
             name2           TYPE ad_name2,     "Middle Name
             name3           TYPE ad_name3,     "Last Name
             home_city       TYPE ad_city3,     "Residential City
             city2           TYPE ad_city2,     "District
             post_code1      TYPE ad_pstcd1,    "Residential postal code
             city1           TYPE ad_city1,     "Office City
             post_code2      TYPE ad_pstcd2,    "Office postal code
             tel_number      TYPE ad_tlnmbr1,   "First telephone no.
             tel_extens      TYPE ad_tlxtns1,   "First Telephone No.: Extension
             fax_number      TYPE ad_fxnmbr1,   "First fax no.
           END OF ty_address.
    In the above type declaration first five fields are used to populate field catalog only for the first and second line headings. These fields do not contain any data.
    Main processing:
    To get multiple line ALV layout we have to declare few dummy fields. When we build field catalog, then we have to put those dummy fields in proper places. In our example last 12 fields are known as valid fields with data and first 5 fields (1 at first line and 4 at second line) are knows as invalid or dummy variables containing no data.
    When we build field catalog, we call a perform name CREATE_CATALOG using
                                                    Column position          Row position
                                         Field name                   Table name
                                         Justification             Text heading
                                         Reference table         Reference field
                                         Output length       Offset value
    For the first row, we have to set row position 1, column position 1. When we call the perform we have to pass, these two values in addition with dummy field name (ADD_DETL), table name (I_ADDRESS), justification (left or right), text (Address Details), Reference table and Reference field name (we can pass SPACE, if not required), Output length and Offset value (Length from left margin or last field, for the first row it is 225. Means the text u201CAddress Detailsu201D  will be printed at 225th char position).
      l_off    = 225.        "Offset Value
      l_pos    = 1.          "Column position
      l_row    = 1.          "Row position
      l_just   = u2018Lu2019.        "Allignment (u2018Lu2019 for Left)
      l_outlen = 50.         "Field length
    Address Details *****************
      PERFORM    create_catalog USING
      l_pos l_row 'ADD_DETL' 'I_ADDRESS' l_just text-002 space space l_outlen  
      l_off.
    Perform CREATE_CATALOG is used to append the field catalog table with the passing parameters.
    SUBROUTINE ***************************************
    FORM create_catalog  USING    p_pos     TYPE sycucol
                                  p_row     TYPE sycurow
                                  p_field   TYPE any
                                  p_tab     TYPE any
                                  p_just    TYPE char1
                                  p_text    TYPE reptext
                                  p_reftab  TYPE any
                                  p_reffld  TYPE any
                                  p_outlen  TYPE outputlen
                                  p_off     TYPE outputlen.
      s_fieldcat-col_pos            = p_pos.     "Column position
      s_fieldcat-row_pos            = p_row.     "Row position
      s_fieldcat-fieldname          = p_field.   "Field name
      s_fieldcat-tabname            = p_tab.     "Table name
      s_fieldcat-just               = p_just.    "Justification
      s_fieldcat-reptext_ddic       = p_text.    "Text heading
      s_fieldcat-ref_tabname        = p_reftab.  "Reference table
      s_fieldcat-ref_fieldname      = p_reffld.  "Reference field
      s_fieldcat-outputlen          = p_outlen.  "Output length
      s_fieldcat-offset             = p_off.     "Offset value
      APPEND s_fieldcat TO i_fieldcat.
      CLEAR  s_fieldcat.
    ENDFORM.                    " create_catalog
    Regards,
    Joy.

  • Merging various columns into 1 field

    Hi,
    I would like to merge the address columns(e.g. Address Line 1, Address Line 2, Zipcode, Country) into 1 field but at the same time each column will appear on a new line. How is it possible to do that without using separate fields? Thank you.

    Hi
    You can create a formula column like this:
    return addr_line1 || '
    ' addr_line 2 || '
    ' zipcode || '
    ' country;
    (note the line break between each pair of single quotes)
    hth

  • Merge multiple columns into single column?

    Hi,
    I need to execute queries dynamically and return the values. I need to fetch the values of the queries in single column only by concatenating the multiple columns. I cannot use PL/SQL in my scenario.
    is there any way to execute a query and the result will be fetched in single column (values of multiple columns needs to be concatenated)?
    Thanks,
    Raja.

    hi,
    do you mean this??
      1* select EMPNO||' '||ENAME||' '||JOB||' '||MGR||' '||HIREDATE||' '||SAL||' '||COMM||' '||DEPTNO||
    SQL> /
    MULTIPLE_COL
    100 JDF DIR  05-SEP-09 200 1000 10
    7497 MILLER CLERK 7782 23-JAN-82 25000 195 35
    7566 JONES MANAGER 7839 02-APR-81 3175 446.25 20
    7654 RAR SALESMAN 7698 28-SEP-81 1450 1587.5 30
    7698 BLAKE MANAGER 7839 01-MAY-81 3050 427.5 30
    7782 CLARK MANAGER 7839 09-JUN-81 2650 367.5 10
    7788 SCOTT ANALYST 7566 09-DEC-82 3200 450 20
    7839 KING PRESIDENT  17-NOV-81 5200 8250 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1700 225 30
    7876 ADAMS CLERK 7788 12-JAN-83 1300 165 20
    7900 JAMES CLERK 7698 03-DEC-81 1150 85.5 30 [email protected]
    MULTIPLE_COL
    7902 FORD ANALYST 7566 03-DEC-81 3200 450 20
    8000 KINGBABA PRESIDENT  17-NOV-81 5200 8250 10
    8001 TURNER RAV SALESMAN 8000 08-SEP-81 1700 450 30
    1001 KITTU DOR  05-SEP-09 1200 100 40
    15 rows selected.Or
    Mean this??
    SQL> ed
    Wrote file afiedt.buf
      1  With T As
      2     ( Select Level col1 From dual Connect By Level<=10
      3     )
      4     Select Max(SYS_CONNECT_BY_PATH(COL1||',',' ')) Multi_col
      5       From
      6     ( Select COL1, Lag(COL1) Over (Order By COL1) As Lag
      7             From   T  )
      8      Start With Lag Is Null
      9        Connect By
    10*    Prior col1 = LAG
    SQL> /
    MULTI_COL
    1, 2, 3, 4, 5, 6, 7, 8, 9, 10,Edited by: user291283 on Sep 8, 2009 10:10 PM

  • Merging data from 2 columns into a single cell

    How can I get 2 lines of data in one cell? I want to merge 2 columns, so that the data in the cell in one column fits under the data in the adjoining cell in the other column. If I just merge the cells, the column would make the spreadsheet to wide to fit on the page needed to print it on.

    enaid,
    Let's say you want to merge Col A and Col B into Col C, with the Col A text over the Col B text.
    In Col C you would use: =A&CHAR(8232)&B
    Don't forget to increase the row heights so you can see both lines in Col C.
    Best regards,
    Jerry

  • Merge multiple rows into single row (but multiple columns)

    How to merge multiple rows into single row (but multiple columns) efficiently.
    For example
    IDVal IDDesc IdNum Id_Information_Type Attribute_1 Attribute_2 Attribute_3 Attribute_4 Attribute_5
    23 asdc 1 Location USA NM ABQ Four Seasons 87106
    23 asdc 1 Stats 2300 91.7 8.2 85432
    23 asdc 1 Audit 1996 June 17 1200
    65 affc 2 Location USA TX AUS Hilton 92305
    65 affc 2 Stats 5510 42.7 46 9999
    65 affc 2 Audit 1996 July 172 1100
    where different attributes mean different thing for each Information_type.
    For example for Information_Type=Location
    Attribute_1 means Country
    Attribute_2 means State and so on.
    For example for Information_Type=Stats
    Attribute_1 means Population
    Attribute_2 means American Ethnicity percentage and so on.
    I want to create a view that shows like below:
    IDVal IDDesc IDNum Country State City Hotel ZipCode Population American% Other% Area Audit Year AuditMonth Audit Type AuditTime
    23 asdc 1 USA NM ABQ FourSeasons 87106 2300 91.7 46 85432 1996 June 17 1200
    65 affc 2 USA TX AUS Hilton 92305 5510 42.7 46 9999 1996 July 172 1100
    Thanks

    Hi,
    That's called Pivoting . The forum FAQ has a section on this subject: {message:id=9360005}
    I hope this answers your question.
    If not, post your best attempt, along with a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data. (You did post the results you wanted, but they're very hard to read because they're not formatted. Use \ tags, as described in the forum FAQ, below.)
    Explain, using specific examples, how you get the results you want from the data given.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).  This is always important, but especially so with pivots.
    See the forum FAQ {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Merging values of CKFs in two columns into single column

    Hi ,
    I want to merge values present in two different columns.The values present in rows of one column are not present in rows of other column, I have to merge the values into a single column.so that in the single column i can get all the values.how to do it in BEx.
    regards ,
    man.

    Hi,
    Dear murali , the solution you gave has helped me a bit as i am able to get the values for both the formula KF's in the same column,But another problem has arisen.
       For both the formula KF's I had to choose 'New Selection' (and not 'New formula')after R-cllick on the structure, as I had to use a Characteristic as restriction for Each of the KF's, and also to use the Characteristic I had to associate it with some KF so that the Characteristic wil be used as a KF in the formula.
       Now what is happening is that I am getting the values of that associated KF also in the empty rows.(i.e. the rows where the value of both the KF1 and KF2 is not present)
       What has to be done to remove them and keep the empty rows empty and not show the value of the KF taken with the Characteristic for restriction. Also its value is summing up with KF1 and KF2 in the coulmn which is having both KF1 and KF2 together.
    Regards
    man

  • How to make a entire column editable in an ALV grid

    Hi all,
             I am trying to make a column editable in an ALV grid. For that I wrote the following code. In the below code I have set the 'edit' field of ls_fcat to 'X'. But Iam getting Runtime error. Can anyone help in resolving this problem or suggest any method to make a column editable in an ALV grid.
    form prepare_fc  changing go_fieldcat type lvc_t_fcat.
    data: ls_fcat type lvc_s_fcat.
    refresh: go_fieldcat.
    clear: ls_fcat.
    ls_fcat-reptext   = ' Safety Stock Figures'.
      ls_fcat-coltext    = 'Safety Stock Figures'.
      ls_fcat-fieldname  = 'EISBE'.
    ls_fcat-ref_table  = 'IMAT'.
      ls_fcat-edit = 'X'.
    modify go_fieldcat from ls_fcat.
      APPEND LS_FCAT TO GO_FIELDCAT.
    endform.
    Thanks & Regards,
    Vishnu Priya.

    ls_fcat-edit = 'X'.
    is correct only.
    have a look into this code
    struct_grid_lset  TYPE lvc_s_layo,
    i_grid_fcat    TYPE lvc_t_fcat
    DATA ls_fcat TYPE lvc_s_fcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'MONTH'.
      ls_fcat-ref_table = 'TYPE'.
      ls_fcat-ref_field = 'C'.
    <b>  ls_fcat-edit      = 'X'.</b>
      ls_fcat-coltext   = text-030."Month
      ls_fcat-seltext   = text-030.
      APPEND ls_fcat TO p_i_grid_fcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'YEAR'.
      ls_fcat-ref_table = 'TYPE'.
      ls_fcat-ref_field = 'C'.
      ls_fcat-coltext   = text-031."Year
      ls_fcat-seltext   = text-031.
      APPEND ls_fcat TO p_i_grid_fcat.
    CALL METHOD o_grid->set_table_for_first_display
          EXPORTING
            i_bypassing_buffer    =  space
            is_variant            =  ws_f_grid_disvar
            i_save                =  ws_c_grid_save
            is_layout             =  struct_grid_lset
          CHANGING
            it_outtab             =  i_grid_outs[]
            <b>it_fieldcatalog       =  i_grid_fcat[]</b>
            it_sort               =  i_sort_fcat.      " Period
    Also Check this code.Another way using field symbols.
    i_fieldcat    TYPE lvc_t_fcat,
           w_layout TYPE lvc_s_layo ,
           w_variant TYPE disvariant.
    FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.
    *Default display
      LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.
        CASE <lfs_fieldcat>-fieldname.
          WHEN 'GL_ACCT'.
            <lfs_fieldcat>-coltext = text-050.
            <lfs_fieldcat>-no_out = ' '.
            <lfs_fieldcat>-scrtext_l = text-050.
           <b> <lfs_fieldcat>-edit    = 'X'.</b>
    WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    Hope this helps.

  • Writing BLOB column into a csv or txt or sql  files

    Hi All,
    I am having a requirement where i have to upload a file from user desktop and place that file into a unix directory. For this i am picking that file into a table using APEX and then writing that file in unix directory using UTL_FILE.
    The problem which i am facing is that after this every line in my file is having ^M character at the end.
    For this i modified my BLOB column into a CLOB column and then also i am facing the same problem.
    Is there any way to get rid of this as i have to upload these csv or txt files into tables using sql loader programs. i can;t write any shell script to remove ^M character before uploading as this program will be merge with existing programs and then it will require lots of code change.
    Kindly Help.
    Thanks
    Aryan

    Hi Helios,
    Thanks again buddy for your reply and providing me different ways.... but still the situation is i can;t write any shell script for removing the ^M. I will be writing into a file from CLOB column.
    Actually the scenrio is when i am writing a simple VARCHAR columns with 'W' mode then it is working fine, but i have a BLOB column which stores the data in binary format so i am converting that column into CLOB and then writing it into file with 'W' mode but then i am getting ^M characters. As per your suggestion i have to then again run a program for removing ^M or i have to modify all my previous programs for removing ^M logic.
    I want to avoid all these, and just wanted a way so that while writing into a file itself it should not have ^M. Else i have to go for a java stored procedure for running a shell script from sql, and in this still i am having some problem.
    Thanks Again Helios for your time and help.
    Regards
    Aryan

  • Merging a collection into a table

    I have a table with some blank columns.
    I take all the data from the table in a collection and then process the data to fill those empty columns.
    Now i have the collection with all the valid data.
    Is it possible to cast this same collection into a table and merge it again into the original table?
    I am trying to do so, but there is an error saying "cant use local collection"...
    Any help on this would be appreciated.

    Thanks a lot for your suggestion.
    I would like to give you an elaborate process.
    I have a table ABC. Some columns of that table are empty. I need to get those filled using some other tables.
    Firstly, using a cursor I fetch the records in a collection say V_ABC.
    Now in a FOR loop, I am fetching the missing data from other tables for every record in the collection and setting it in the empty places in the collection V_ABC itself.
    So finally i have the collection V_ABC which has complete data.
    The FOR loop is now ended.
    Now i try to merge this V_ABC into tale ABC like this:
    MERGE INTO ABC abc
    USING TABLE(CAST(V_ABC AS TT_ABC)) z
    ON (abc.random_column_name = z.random_column_name)
    WHEN MATCHED THEN
    UPDATE
    SET abc.initially_empty_column = z.initially_empty_column
    The exact error is "Error: PLS-00642: local collection types not allowed in SQL statements".
    I am forced to use PL-SQL because of performance issues.
    Could you provide an alternate way?
    I guess one way would be to create another empty collection and EXTENDing it and creating a replica of V_ABC. Then probably it will allow me to merge. But i m not sure.

  • Add Extra Columns into Multi-Level Explode BOM (List Report)  - CS12

    Hi Experts,
    I wish to add extra columns into the list report generated from program RCS12001 (calling from t-code: CS12). The current layout will be AS-IS and the only way i wish is to add-in few new columns in the report.

    Hi
    declare select-options instead of parameters
    for converting a report to ALV
    create a field catalog.
    for this two option declare a itab with       
    fcat    TYPE slis_t_fieldcat_alv
    and pass the field name,descr etc to fcat and append the same.
    or create structur same as your itab and pass the same with FM
    'REUSE_ALV_FIELDCATALOG_MERGE'
    use either <b>reuse_alv_grid_display or reuse_alv_list_display</b> .
    and pass the itab.
    thanks
    Shiva

  • Reports - merging data columns in matrix

    Hi, 
    I need help with merging columns in matrix. I use MS SQL 2012. I need merge data columns, here is example:
    matrix:
    +-----------+----------+
    |               |  [time]  |
    +-----------+----------+
    |               |  [step]  |
    | [project] +----------+
    |               | [action] |
    +-----------+----------+
    current output:
    +-----------+----------+----------+----------+----------+
    |               |   00:00 |   00:05  |   00:10  |  00:15  |
    +-----------+----------+----------+----------+----------+
    |               |  step 1  |  step 1  |          |  step 2  |
    | project 1 +----------+----------+----------+----------+
    |               |  start     | running  |          |  start   |
    +-----------+----------+----------+----------+----------+
    |               |              |  step 1  |  step 1  |  step 1  |
    | project 2 +----------+----------+----------+----------+
    |                |             | start    | running  |  running |
    +-----------+----------+----------+----------+----------+
    demanded output:
    +-----------+----------+----------+----------+----------+
    |               |   00:00  |   00:05  |   00:10  |   00:15  |
    +-----------+----------+----------+----------+----------+
    |               |        step 1          |              |  step 2  |
    | project 1 +----------+----------+----------+----------+
    |                |  start    | running  |            |  start    |
    +-----------+----------+----------+----------+----------+
    |                |             |            step 1                     |
    | project 2 +----------+----------+----------+----------+
    |                |              | start    |       running       |
    +-----------+----------+----------+----------+----------+
    Thanks in advance :-)
    Regards

    Hi  Katamarucz,
    According to your description and the sample matrix, you want to merge the columns in the same steps into one column, right? In this case, on some rows the columns that have the same steps should be merged, however, the column should not be merge on other
    row that the columns have different steps. 
    In Reporting Services, if we merger the columns when designing the report, then the columns will be merged on all the rows. So you requirement cannot be achieved. And I am afraid there is no other approach to work around this issue.
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • MailMerge Directory - Split one Excel Data column into three Seperate columns in Word MailMerge

    This seems like something so simple to accomplish but I am having extreme issues just getting this correct.
    Here is what my Data looks like
    Name                      ClassID
    Jeff Probst                Intro
    Kevin Douglas           Intro
    Jen Taylor                Intro
    Master Chief             Intro
    I want these to print out in three separate columns (Static) with dynamic rows with how many names are in the data
    Example:
    Jeff Probst                     Kevin Douglas                   
    Jen Taylor
    Master Chief                  Next Name
    I have tried to use Many to One, but I cannot get it to work correctly. I have tried setting it up as a directory and using If statements, but I cannot get them to print correctly or in column order before moving on to the next record.
    Thank you for your help in advanced.

    You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
    http://windowssecrets.com/forums/showthread.php/154370-Microsoft-Word-Catalogue-Directory-Mailmerge-Tutorial
    or:
    http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip
    The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.
    For some worked examples, see the attachments to the posts at:
    http://www.msofficeforums.com/mail-merge/9180-mail-merge-duplicate-names-but-different-dollar.html#post23345
    http://www.msofficeforums.com/mail-merge/11436-access-word-creating-list-multiple-records.html#post30327
    and especially:
    http://windowssecrets.com/forums/showthread.php/157725-Word-2010-Merge-from-excel-into-Table-Directory?p=928391&viewfull=1#post928391
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Merging multiple rows into a string without loop

    Hi,
    Wanted to know if there is a way we can merge the result set for a query(single column) into a string ?
    For example, I have the following query which returns multiple rows:
    SELECT organization_code
    FROM mtl_parameters
    WHERE oganization_id IN ( 1,2,3)
    Lets say the result set for this is :
    A
    B
    C
    I want the data as A,B,C
    Basically I will be fetching the organization_ID from a diff sub query. I know I can do it using for loop and keep appending the values.
    But wanted to know if there is any easier way of doing it.

    Try this
    SELECT ''||SUBSTR (SYS_CONNECT_BY_PATH (organization_code , ','), 2)||'' csv
          FROM (SELECT organization_code
    , ROW_NUMBER () OVER (ORDER BY organization_code
    ) rn,
                       COUNT (*) OVER () cnt
                  FROM mtl_parameters
    WHERE oganization_id IN ( 1,2,3)
         WHERE rn = cnt
    START WITH rn = 1
    CONNECT BY rn = PRIOR rn + 1;

  • Merging two rows into a single row

    Hi ,
    I wish to merge few columns of tow rows into a single row.
    if i use union it gives two rows as o/p.
    What is the exact sql statement for that?
    Thanks

    Hi Sridhar,
    This is my code for merging and i used union.
    Suggest me good solution.
    CREATE OR REPLACE VIEW INSPECTINT.INSPECT_LOC_TRACKING_RPT_VIEW AS
    SELECT
    VEN_COMPANY_NAME VEN_COMPANY_NAME,
    VEN_COMPANY_NAME_2 VEN_COMPANY_NAME_2,
    VEN_CONTACT_FIRST_NAME VEN_CONTACT_FIRST_NAME,
    VEN_CONTACT_MIDDLE_NAME VEN_CONTACT_MIDDLE_NAME,
    VEN_CONTACT_LAST_NAME VEN_CONTACT_LAST_NAME,
    VEN_ADDRESS_LINE_1 VEN_ADDRESS_LINE_1,
    VEN_ADDRESS_LINE_2 VEN_ADDRESS_LINE_2,
    VEN_CITY VEN_CITY,
    VEN_CNT_COUNTY_CODE VEN_CNT_COUNTY_CODE,
    VEN_STC_STATE_CODE VEN_STC_STATE_CODE,
    VEN_ZIP_CODE VEN_ZIP_CODE,
    VEN_PHONE_NO_1 VEN_PHONE_NO_1,
    VEN_PHONE_EXTN_1 VEN_PHONE_EXTN_1,
    VEN_PHONE_NO_2 VEN_PHONE_NO_2,
    VEN_PHONE_EXTN_2 VEN_PHONE_EXTN_2,
    VEN_FAX_NO_1 VEN_FAX_NO_1,
    VEN_VENDOR_NO VEN_VENDOR_NO,
    VEN_APV_AP_VENDOR_ID VEN_APV_AP_VENDOR_ID,
    VEN_EMAIL_ADDRESS VEN_EMAIL_ADDRESS,
    --all these should be null
    to_number(NULL) PHY_LCN_PARAMETER_ID,
    to_char(NULL) PHY_LCN_CURRENT_ADDRESS_IND,
    to_char(NULL) PHY_LCN_STATUS_CODE,
    to_char(NULL) PHY_LCN_LTY_LOCATION_TYPE,
    to_char(NULL) PHY_LCN_ADT_ADDRESS_TYPE,
    to_char(NULL) PHY_LCN_HOUSE_NO,
    to_char(NULL) PHY_LCN_ADDRESS_LINE_1,
    to_char(NULL) PHY_LCN_ADDRESS_LINE_2,
    to_char(NULL) PHY_LCN_CITY,
    to_char(NULL) PHY_LCN_STC_STATE_CODE,
    to_char(NULL) PHY_LCN_ZIP_CODE,
    to_char(NULL) PHY_LCN_CNT_COUNTY_CODE,
    to_date(NULL) PHY_END_DATE,
    to_number(NULL) PHY_LCN_VEN_VENDOR_ID_GTA,
    to_char(NULL) PHY_LCN_SUB_LOCATION_GTA,
    to_char(NULL) PHY_LCN_DIRECTION_GTA,
    ---all these should be null
    to_char(NULL) LOW_LCN_PARAMETER_ID,
    to_char(NULL) LOW_LCN_CURRENT_ADDRESS_IND,
    to_char(NULL) LOW_LCN_STATUS_CODE,
    to_char(NULL) LOW_LCN_LTY_LOCATION_TYPE,
    to_char(NULL) LOW_LCN_ADT_ADDRESS_TYPE,
    to_char(NULL) LOW_LCN_HOUSE_NO,
    to_char(NULL) LOW_LCN_ADDRESS_LINE_1,
    to_char(NULL) LOW_LCN_ADDRESS_LINE_2,
    to_char(NULL) LOW_LCN_CITY,
    to_char(NULL) LOW_LCN_STC_STATE_CODE,
    to_char(NULL) LOW_LCN_ZIP_CODE,
    to_char(NULL) LOW_LCN_CNT_COUNTY_CODE,
    to_char(NULL) LOW_LCN_LANDLORD,
    to_number(NULL) LOW_LCN_LANDLORD_PHONE,
    to_date(NULL) LOW_END_DATE,
    to_char(NULL) LOW_LCN_SUB_LOCATION_GTA,
    to_char(NULL) LOW_LCN_DIRECTION_GTA
    FROM LOCATIONS LOC , VENDORS VEN
    WHERE LOC.LCN_VEN_VENDOR_ID_GTA IS NOT NULL
    AND LOC.LCN_VEN_VENDOR_ID_GTA = VEN_VENDOR_ID
    AND LOC.LCN_LTY_LOCATION_TYPE ='AS'
    UNION ALL
    SELECT
    to_char(NULL) VEN_COMPANY_NAME,
    to_char(NULL) VEN_COMPANY_NAME_2,
    to_char(NULL) VEN_CONTACT_FIRST_NAME,
    to_char(NULL) VEN_CONTACT_MIDDLE_NAME,
    to_char(NULL) VEN_CONTACT_LAST_NAME,
    to_char(NULL) VEN_ADDRESS_LINE_1,
    to_char(NULL) VEN_ADDRESS_LINE_2,
    to_char(NULL) VEN_CITY,
    to_char(NULL) VEN_CNT_COUNTY_CODE,
    to_char(NULL) VEN_STC_STATE_CODE,
    to_char(NULL) VEN_ZIP_CODE,
    to_number(NULL) VEN_PHONE_NO_1,
    to_number(NULL) VEN_PHONE_EXTN_1,
    to_number(NULL) VEN_PHONE_NO_2,
    to_number(NULL) VEN_PHONE_EXTN_2,
    to_number(NULL) VEN_FAX_NO_1,
    to_char(NULL) VEN_VENDOR_NO,
    to_char(NULL) VEN_APV_AP_VENDOR_ID,
    to_char(NULL) VEN_EMAIL_ADDRESS,
    decode(lcn_adt_address_type,'P',to_number(LCN_PARAMETER_ID),to_number(NULL)) PHY_LCN_PARAMETER_ID,
    decode(lcn_adt_address_type,'P',LCN_CURRENT_ADDRESS_IND,to_char(NULL)) PHY_LCN_CURRENT_ADDRESS_IND,
    decode(lcn_adt_address_type,'P',LCN_STATUS_CODE,to_char(NULL)) PHY_LCN_STATUS_CODE,
    decode(lcn_adt_address_type,'P',LCN_STATUS_CODE,to_char(NULL)) PHY_LCN_LTY_LOCATION_TYPE,
    decode(lcn_adt_address_type,'P',LCN_ADT_ADDRESS_TYPE,to_char(NULL)) PHY_LCN_ADT_ADDRESS_TYPE,
    decode(lcn_adt_address_type,'P',LCN_HOUSE_NO,to_char(NULL)) PHY_LCN_HOUSE_NO,
    decode(lcn_adt_address_type,'P',LCN_ADDRESS_LINE_1,to_char(NULL)) PHY_LCN_ADDRESS_LINE_1,
    decode(lcn_adt_address_type,'P',LCN_ADDRESS_LINE_2,to_char(NULL)) PHY_LCN_ADDRESS_LINE_2,
    decode(lcn_adt_address_type,'P',LCN_CITY,to_char(NULL)) PHY_LCN_CITY,
    decode(lcn_adt_address_type,'P',LCN_STC_STATE_CODE,to_char(NULL)) PHY_LCN_STC_STATE_CODE,
    decode(lcn_adt_address_type,'P',LCN_ZIP_CODE,to_char(NULL)) PHY_LCN_ZIP_CODE,
    decode(lcn_adt_address_type,'P',LCN_CNT_COUNTY_CODE,to_char(NULL)) PHY_LCN_CNT_COUNTY_CODE,
    decode(lcn_adt_address_type,'P',END_DATE,to_char(NULL)) PHY_END_DATE,
    decode(lcn_adt_address_type,'P',LCN_VEN_VENDOR_ID_GTA,to_char(NULL)) PHY_LCN_VEN_VENDOR_ID_GTA,
    decode(lcn_adt_address_type,'P',LCN_SUB_LOCATION_GTA,to_char(NULL)) PHY_LCN_SUB_LOCATION_GTA,
    decode(lcn_adt_address_type,'P',LCN_DIRECTION_GTA,to_char(NULL)) PHY_LCN_DIRECTION_GTA,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_PARAMETER_ID,to_char(NULL)) LOW_LCN_PARAMETER_ID,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CURRENT_ADDRESS_IND,to_char(NULL)) LOW_LCN_CURRENT_ADDRESS_IND,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_STATUS_CODE,to_char(NULL)) LOW_LCN_STATUS_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LTY_LOCATION_TYPE,to_char(NULL)) LOW_LCN_LTY_LOCATION_TYPE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADT_ADDRESS_TYPE,to_char(NULL)) LOW_LCN_ADT_ADDRESS_TYPE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_HOUSE_NO,to_char(NULL)) LOW_LCN_HOUSE_NO,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADDRESS_LINE_1,to_char(NULL)) LOW_LCN_ADDRESS_LINE_1,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ADDRESS_LINE_2,to_char(NULL)) LOW_LCN_ADDRESS_LINE_2,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CITY,to_char(NULL)) LOW_LCN_CITY,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_STC_STATE_CODE,to_char(NULL)) LOW_LCN_STC_STATE_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_ZIP_CODE,to_char(NULL)) LOW_LCN_ZIP_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_CNT_COUNTY_CODE,to_char(NULL)) LOW_LCN_CNT_COUNTY_CODE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LANDLORD,to_char(NULL)) LOW_LCN_LANDLORD,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_LANDLORD_PHONE,to_char(NULL)) LOW_LCN_LANDLORD_PHONE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',END_DATE,to_char(NULL)) LOW_END_DATE,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_SUB_LOCATION_GTA,to_char(NULL)) LOW_LCN_SUB_LOCATION_GTA,
    decode(LCN_ADT_ADDRESS_TYPE,'D',LCN_DIRECTION_GTA,to_char(NULL)) LOW_LCN_DIRECTION_GTA
    FROM LOCATIONS LOC
    WHERE (LCN_LTY_LOCATION_TYPE ='AS' OR LCN_ADT_ADDRESS_TYPE='D')
    AND LCN_CURRENT_ADDRESS_IND ='Y'
    thanks

Maybe you are looking for