SSIS : How to create Column Header dynamically using expression in Flat File Source
Hi Team,
I need to keep configured Header Names for columns, Is there is any way to set each column name from expression? or is there is any other way?
Nope
But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
UNION ALL
SELECT Column1,Column2,Column3,1
FROM YourTable
ORDER BY Ord
then choose column headers in first row option
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Similar Messages
-
How to set column heading dynamically?
Hi:
How can I set a column heading dynamically -by PL/SQL code- ?
Regards,Hi,
Create a formula field, and return desired heading depending on your conditions, and use that field as the column header.
Regards,
Manu. -
How to create column header text while downloading file
How can we create column header text while downloading file using function GUI_DOWNLOAD(in SAP Release 4.6c) because there is no FIELDNAMES parameter in
4.6c version.Hii,
Check this sample code. I have called GUI_DOWNLOAD twice. Onetime to download header of table and next time data of table
REPORT z_file_download.
DATA: w_name(90) TYPE c.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
price LIKE sflight-price,
currency LIKE sflight-currency,
END OF fs_flight.
DATA:
BEGIN OF fs_head,
carrid(10) TYPE c,
connid(10) TYPE c,
fldate(10) TYPE c,
price(10) TYPE c,
curr(10) TYPE c,
END OF fs_head.
DATA:
t_head LIKE
TABLE OF
fs_head.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
fs_head-carrid = 'CARRID'.
fs_head-connid = 'CONNID'.
fs_head-fldate = 'FLDATE'.
fs_head-price = 'PRICE'.
fs_head-curr = 'CURRENCY'.
APPEND fs_head TO t_head.
SELECT-OPTIONS:
s_carrid FOR fs_flight-carrid.
START-OF-SELECTION.
SELECT carrid
connid
fldate
price
currency
FROM sflight
INTO TABLE t_flight
WHERE carrid IN s_carrid.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\flight.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_head
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\flight.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_flight
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
MESSAGE 'Download successful' TYPE 'I'.
ENDIF.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Abhijeet -
Create Column Heading and Mathematical Expressions?
Is their a way to create your own column heading to use later in a Smart Playlist? Also, can mathematical (+,-,*,/...) be used in it's creation?
I'm trying to create a column heading (variable) that would display (for each song) the ratio of Play Count / Skip Count. If that ratio is >1, then it's something I tend to listen more than skip. The reverse is true if it's <1. I can use this in a Smart Playlist to filter songs going to my iPod (by checking that playlist to be downloaded to my iPod) to those that I listen to most.
Any help would be appreciated.
Message was edited by: luke1012As I said earlier, you have to use double-quotes when you create object :
SQL> create table emp( "Name" varchar2(20),"Age" number(2));
Table created.
SQL> desc emp
Name Null? Type
Name VARCHAR2(20 CHAR)
Age NUMBER(2)Once more, why wanted such thing ?
See here below the inconvenient :
SQL> select name, age from emp;
select name, age from emp
ERROR at line 1:
ORA-00904: "AGE": invalid identifier
SQL> select "Name","Age" from emp;
no rows selectedBetter to avoid it.
Nicolas. -
How to create SOAP Header elements using SAAJ??
I am facing a problem when adding header elements under SOAP Header
using SAAJ(api).
I want to create a structure as following:
I get a empty SOAP header obejct by writing code--> SOAPHeader header
= envelope.getHeader();
But not able to add SOAP header elements as specified in example
below. I tried but its giving me error as
"HeaderElements must be namespace qualified"
CAN ANYBODY TELL ME THAT HOW TO ADD HEADER ELEMENTS USING SAAJ??
<SOAP:Header>
<AccountNumber>123</AccountNumber>
<AuthorisationCode>test111</AuthorisationCode>
<Source>abc</Source>
<Market>01</Market>
</SOAP:Header>I'm including this comment from some code I've just written after wrestling with this for hours (I've actually left it on another post as well). The upshot of it all is that you have to include a namespace URI when creating a header in SAAJ:
NOTE: SOAP 1.1 requires that all header entries be namespace-qualified to
namespace URI's. The SAAJ 1.2 implementation requires a Name object with
the namespace URI to make this happen even if the prefix used is already
visible by being declared higher in the document (e.g. in the Envelope).
However, the namespace URI is not present in the serialized header element
as long as it was declared higher in the document. In order to create a
header element without a prefix (to conform to a web service definition
that doesn't use a prefix in its headers, for example), leave the prefix
null in the addHeaderElement() method.
For example, with a SOAPHeader 'hdr':
//first create the name
Name name = env.createName("my-local-name", null, "my-URI");
//then create the header element
SOAPHeaderElement he = hdr.addHeaderElement(name);
This would result in an XML element that looked like this:
<my-local-name xmlns="my-URI"/>
This would allow SAAJ developers to create a header for a service that
only expected a local name in its header elements (as many do!). As long
as the service doesn't choke on the attribute (validation! evil!), this
should work.
Rob Kemmer
01/12/2005
-
How to create Schema Header and footer with Pipe delimiter file..?
Hi all,
I have issue with creating Schema Header and footer with body file ..The file format is Pipe delimiter.. The follwing file below like is...
Adapters:File Adapter(Read)-11g.
1|000|2025|SDFG|54787
1|2055|244|9566|000|000|044|2577|361147|45554|wweqw|52555|564|000|647|464
1|2027|344|4566|000|000|044|8577|361147|45554|wweqw|82555|564|000|647|844
1|2024|444|6566|000|000|044|9577|361147|45554|wweqw|12555|564|000|647|544
1|2023|544|8566|000|000|044|5577|361147|45554|wweqw|52555|564|000|647|442
1|2022|644|3566|000|000|044|7577|361147|45554|wweqw|02555|564|000|647|448
1|0000|546|25544|454
If you have sollution for this, please help me out..Thank you.You mean how many rows or columns..?
If coloumns means 5 and rows only one(1). -
How to create ADF selectManyChoice dynamically using arrayList?
Hi,
I am using JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. I want to dynamically create selectManyChoice through my backing using and populating the same using ArrayList. Can anyone provide me sample code for the same?
Thanks,
VikasDuplicate
-
How to create custom report plugin using child region report metadata
Hi,
I want to ask for help on how to create custom report plugin using child region report metadata. My idea is to create a child region, a classic report and set the condition to never.
Then i will query the child report metadata from apex view and use it to create a custom report like using jquery jq-grid. Any idea how i can create a process that will use the child report
metadata? I dont know how i can create a process just like how apex work, how apex render report, coz i want it to be control using the standard apex report attribute. This plugin will
render according to the child report attribute.
Is there anybody here had ever done this?Hi Nicolette,
Thanks for the reply. I know where to find the metadata, just asking for idea on how the rendering process will be.
Start from determining column heading, column order until finish rendering the report. The same way how apex
render the classic report.
Previously this imy my rendering process:
FUNCTION GETCOLUMN(P_REGION IN APEX_PLUGIN.T_REGION,
P_PLUGIN IN APEX_PLUGIN.T_PLUGIN,
P_VALUE IN VARCHAR2) RETURN SYS.DBMS_SQL.DESC_TAB2 IS
VSQLHANDLER APEX_PLUGIN_UTIL.T_SQL_HANDLER;
VCOLCOUNT NUMBER;
VCOLNAMES VARCHAR2(2000);
VAJAXIDENTIFIER VARCHAR2(100);
VPAGESIZE TYPEATTR := P_REGION.ATTRIBUTE_04;
VJSCODE VARCHAR2(32767);
BEGIN
VSQLHANDLER := APEX_PLUGIN_UTIL.GET_SQL_HANDLER(P_SQL_STATEMENT => 'select * from s_emp',
P_MIN_COLUMNS => 1,
P_MAX_COLUMNS => 999,
P_COMPONENT_NAME => P_REGION.ID);
VCOLCOUNT := VSQLHANDLER.COLUMN_LIST.COUNT();
FOR I IN 1 .. VCOLCOUNT LOOP
VCOLNAMES := VCOLNAMES || '{name: "' ||
UPPER(VSQLHANDLER.COLUMN_LIST(I).COL_NAME) || '",';
END LOOP;
APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
RETURN VSQLHANDLER.COLUMN_LIST;
EXCEPTION
WHEN OTHERS THEN
APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
RAISE;
END GETCOLUMN;
So this is how i get the header for my report plugin. The same method is use to get the value / data for each column. This process is work. So now
i want to extend my plugin so that i will use all attributes from the child report to render my plugin. So the column header, column order, all will depend
on the child report. And the column display condition is set, it will also check the condition before render the column. Sounds like i want to reinvent
the normal apex rendering process but this is what i want to achieve.
I need help to find the correct logic for my render process. Don't want too much for starting, just want to render the plugin correctly, same with child report,
same columns alias, column ordering and column conditional display.
Thanks,
akulala -
Change column header dynamically at report run time
how to use LOV In report column definition under column attributes for display..
If it suceeded will it dynamicaly change header name at time of running report
my requirement is actually to change column header dynamically at time of run report
is it possible with above mentioned way?
Apex 4.1, Oracle 11g, PL/SQL Gateway configuration
Please help me on this
ThanksHi,
by making use of specific report column templates and column template conditions you can change the headers dynamically.
See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ui_templt.htm#HTMDB25708 for more info.
regards,
Erik-jan -
Vc++ how to read column header of cursor
How to fetch the Column name or header of the stored procedure which is using a cursor as the output.
P_out out sys_refcursor
need to read the column name of this output.
I am using Vc++ code to reterive the data, in Vc++ how to read column header of cursorYou haven't provided much detail to go on. How are you reading data from the ref cursor? Do you already have a reader from it?
Maybe this helps.
Greg
create or replace procedure proc1 (v1 out sys_refcursor) as
begin
open v1 for select * from emp;
end;
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
public class RefCur
public static void Main()
using (OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
con.Open();
using (OracleCommand cmd = new OracleCommand("proc1", con))
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new OracleParameter("v1", OracleDbType.RefCursor, ParameterDirection.Output));
cmd.ExecuteNonQuery();
using (OracleDataReader reader = ((OracleRefCursor)cmd.Parameters[0].Value).GetDataReader())
for (int i=0;i<reader.FieldCount;i++)
Console.WriteLine(reader.GetName(i)); -
How to create the sales order using BAPI's ....?
Hi Guru's,
could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically i don't have basic knowledge on this....please provide required inputs ....:)
thanks in advance
Srinivas......Hi Guru's thanks for your inouts and your valuble time...
please find the program logic below...
*& Report ZAREPAS30
REPORT zarepas30.
DATA : gs_vbeln TYPE vbak-vbeln,
gs_order_header_in TYPE bapisdhd1,
gs_order_header_inx TYPE bapisdhd1x,
gt_order_items_in TYPE STANDARD TABLE OF bapisditm,
gwa_itab1 TYPE bapisditm,
gt_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
gwa_itab2 TYPE bapisditmx,
gt_order_partners TYPE STANDARD TABLE OF bapiparnr,
gwa_itab3 TYPE bapiparnr,
gt_return TYPE STANDARD TABLE OF bapiret2,
gwa_itab4 TYPE bapiret2.
Sales document type
PARAMETERS: p_auart TYPE auart OBLIGATORY.
Sales organization
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
Distribution channel
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
Division.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
Requested Delivery Date
PARAMETERS: p_edatu TYPE edatu OBLIGATORY.
Sold-to
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
Ship-to
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
Material
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
Quantity.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
Plant
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
gs_order_header_in-doc_type = p_auart.
gs_order_header_inx-doc_type = 'X'.
Sales organization
gs_order_header_in-sales_org = p_vkorg.
gs_order_header_inx-sales_org = 'X'.
Distribution channel
gs_order_header_in-distr_chan = p_vtweg.
gs_order_header_inx-distr_chan = 'X'.
Division
gs_order_header_in-division = p_spart.
gs_order_header_inx-division = 'X'.
Reguested Delivery Date
gs_order_header_in-req_date_h = p_edatu.
gs_order_header_inx-req_date_h = 'X'.
gs_order_header_inx-updateflag = 'I'.
Partner data
Sold to
gwa_itab3-partn_role = 'AG'.
gwa_itab3-partn_numb = p_sold.
APPEND gwa_itab3 TO gt_order_partners .
ship to
gwa_itab3-partn_role = 'WE'.
gwa_itab3-partn_numb = p_ship.
APPEND gwa_itab3 TO gt_order_partners .
ITEM DATA
gwa_itab2-updateflag = 'I'.
Line item number.
gwa_itab1-itm_number = '000010'.
gwa_itab2-itm_number = 'X'.
Material
gwa_itab1-material = p_matnr.
gwa_itab2-material = 'X'.
Plant
gwa_itab1-plant = p_plant.
gwa_itab2-plant = 'X'.
Quantity
gwa_itab1-target_qty = p_menge.
gwa_itab2-target_qty = 'X'.
APPEND gwa_itab1 TO gt_order_items_in.
APPEND gwa_itab2 TO gt_order_items_inx.
Line item number.
gwa_itab1-itm_number = '000020'.
gwa_itab2-itm_number = 'X'.
Material
gwa_itab1-material = p_matnr.
gwa_itab2-material = 'X'.
Plant
gwa_itab1-plant = p_plant.
gwa_itab2-plant = 'X'.
Quantity
gwa_itab1-target_qty = p_menge.
gwa_itab2-target_qty = 'X'.
APPEND gwa_itab1 TO gt_order_items_in.
APPEND gwa_itab2 TO gt_order_items_inx.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = gs_order_header_in
ORDER_HEADER_INX = gs_order_header_inx
IMPORTING
SALESDOCUMENT = gs_vbeln
tables
RETURN = gt_return
ORDER_ITEMS_IN = gt_order_items_in
ORDER_ITEMS_INX = gt_order_items_inx
order_partners = gt_order_partners.
Check the return table.
LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error occured while creating sales order '.
ELSE.
Commit the work.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'Document ', gs_vbeln, ' created'.
ENDIF. -
How to create a packet by using java?
Hi, i am currently working on a research and i have some problems here.
1) how to create a packet by using java programming ?
2) How can i set the packet's information (e.g: packet's length, size of its header, etc) by using java?
I am currently in a midst of this now and i hope that someone is willing to correspond to my questions and help me out of it.
Thank you!I wan to create a customize packet where the user can
define the header size, the packet's length etc. in
the program......Then you get to write it to the connection yourself. Look at the OutputStream classes to see how to write low level output to a connection. -
Want to send information in Header dynamically using HTTP adapter using post method
Hi ,
I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
I have followed below link to create UDF
http://scn.sap.com/thread/3241568
As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
Regards,Hi Abhay,
Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
You also need to test it successfully externally, capture the request and replicate it in XI.
Hope this helps,
Mark -
How to create a modeless dialog using commandlink
i want to create a modelessdialog using commandlink. and my code is
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<f:view>
<script language="Javascript1.2">
function modelesswin(){
window.showModelessDialog();
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h:form>
<h:commandLink onclick="javascript:modelesswin('popup.html', 300, 300)" value="click"></h:commandLink>
</h:form>
</body>
</f:view>
</html>
when i click the buttonlink the dialog box is not in a stable state that is its will appear and within a second it will disappear .. can any one of them can suggest me how to create a modeless dialoge using commandlink or by jsf option button
regards
subramanianIf I had to guess (and I do :), the onclick is firing, bring up the dialog, but the commandLink causes a form submit, so the page is submitted. There is no action on the commandLink, so it's navigating back to the same page, causing it to refresh and your dialog to disappear. It would appear to me that you need a h:outputLink or simply <a href="# onclick="..." /"></a>
-
How To avoid column heading for only total line in ALV list Display
Hi,
How To avoid column heading for only total line in ALV list Display.Hi,
to change colunm header field catlog is built
look at the example below
Changing column text headers
use this to change, hide, or alter the ALV columns
CLEAR: gt_fcat.
READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
*TEXT1 is your field name
ASSIGNING <gtfcat>.
IF sy-subrc = 0.
<gtfcat>-coltext = 'Date Type'.
<gtfcat>-no_out = ' '.
<gtfcat>-tooltip = 'Date Type Text from IT0019'.
<gtfcat>-seltext = 'IT0019'.
keep seltext to '' if u want to hide
ENDIF.
regards
austin
Maybe you are looking for
-
How to change the font color in a strict type def programatically
Could someone suggest a way to change the font color of a string indicator in a strict type def cluster programmatically? The cluster contains a label that is color-coded to match the function of the data channel represented by that cluster. The fun
-
Inline display of error message for a regular expression validation
Hi All, I am using ApexLib in my application. I am using regular expression validation for some of the items. Those validation will happen when the button is pressed and the message will be displayed as per the error. But, I want the errors to be dis
-
Print command from linux PC on to Windows Environment
Hi Experts, We have SAP on Windows and the network printer is also on Windows, the PC with Linux is integrated with network printer i.e when the print command from Linux is given the output is available from the printer (Windows). But when the print
-
My program hangs while i open a file.
Using multiple threads, would be able to resolve this.However, i don't know anything about it. Please provide me with resources in labview that will allow me to do this.
-
Display popup inside applyResult method of ovs?
Hi, I have implemented an object value selector for a field. Now what I want to do is to display a popup window when the user selects a row inside ovs popup (ie. inside the applyResult method). The popup window (with ok and cancel buttons) is being