How to dynamically create header record in a file
Hi All,
how can we create custom header in data file. i have interface that creates file dynamically and Generate Header is set to true. The file header contains the column names. i want to create different file header like FileName_noOfrows_currentDate .how can i do this
example... header_15_20121213
Thanks
Edited by: huny on Dec 19, 2012 4:53 AM
Hi
Please refer to this post :
How to Add Header and Footer in Flat file
You should find some advices and clues to create your custom header.
Similar Messages
-
Dynamically creating a Record Group based on Previously entered Record Grou
Forms [32 Bit] Version 10.1.2.3.0 (Production)
Hi,
I know how to dynamically create a record group based on a query and putting the code in When new form instance.
My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
For example
I have a record group with selects a Location,
when the user selects the Location from a list of values
the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
How can I populate the 2nd record group at run-time when I do not know what site the user will select?
If I simply populate in when new form instance as in location and just select everything, the list of values populates.
CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
I have put the code in the Location field in the when-list-changed trigger.
I am getting this error:
frm-41337: cannot populate the list from the record group
here is the code:
DECLARE
v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
v_recgrp RecordGroup; -- Record Group
v_status Number; -- Return Value of Populate_Group function.
c_where VARCHAR2(1000);
BEGIN
IF :location = '1' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
ELSIF :location = '2' THEN
c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
ELSIF :location = '3' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
ELSE
c_where := ' 1=1'; --EVERYTHING
END IF;
v_recsql := 'SELECT cost_centre, description FROM cost_centres where '||c_where;
-- Create the Record Group
v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
IF NOT ID_NULL(v_recgrp)
THEN -- No Error, record group has been successfully created.
-- Populate Record Group
v_status := POPULATE_GROUP('v_recgrp');
IF v_status = 0
THEN -- No Error. Record Group has been Populated.
POPULATE_LIST('block.CC', 'v_recgrp');
END IF; -- IF v_status = 0
-- Delete the Record Group as it is no longer needed.
DELETE_GROUP('v_recgrp');
END IF; -- IF NOT ID_NULL(v_recgrp)
END;thanks for your assistance.Hi,
Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
-Ammad -
How can i create Header and items in SMART FORM
Hi Experts,
How can i create Header and items in SMART FORM in the below driver program.
_Header fields_
SELECT BUKRS BUDAT GJAHR CPUDT USNAM BLART BELNR XBLNR BLDAT WAERS KURSF
FROM BKPF INTO CORRESPONDING FIELDS OF TABLE IT_HEAD WHERE BELNR IN S_BELNR AND BUDAT IN S_BUDAT AND GJAHR EQ S_GJAHR AND BUKRS EQ S_BUKRS AND CPUDT IN S_CPUDT AND USNAM IN S_USNAM.
Item firlds
SELECT BUZEI BSCHL SGTXT SHKZG KOSTL PRCTR WERKS WRBTR HKONT KUNNR ZFBDT FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_ITEM
FOR ALL ENTRIES IN IT_HEAD WHERE BELNR = IT_HEAD-BELNR AND GJAHR = IT_HEAD-GJAHR AND BUKRS = IT_HEAD-BUKRS.
LOOP AT IT_HEAD.
MOVE-CORRESPONDING IT_HEAD TO FINAL.
LOOP AT IT_ITEM
WHERE BELNR = IT_HEAD-BELNR.
MOVE-CORRESPONDING IT_ITEM TO FINAL.
ENDLOOP.
ENDLOOP.
Regards,
Sreedhar.for these internal tables you can pass some Identifier for both tables.
in header file : IT_HEAD
IDENT type char10,
BUKRS type BUKRS,
BUDAT type BUDAT, like
in header file :IT_ITEM
IDENT type char10,
BUZEI type BUZEI,
BSCHL type BSCHL, like in item data
you need to fille the IDENT value like
IT_HEAD:
10 -- DE01-- 10.20.2009
20 -- CH01-- 10.20.2009
IT_ITEM
10 -- 1234-- KSCHL value like all records
10 -- 2345-- KSCHL value like all records
10 -- 6783-- KSCHL value like all records
20 -- 3452-- 1KSCHL value like all records
20 -- 4532-- KSCHL value like all records
20 -- 4535-- KSCHL value like all records
in smartform you need to create 2 tables.
or create
LOOP with IT_HEAD
table with IT_HEAD
table with IT_ITEM
and put the condition for each table in DATA tab where condtion like IDENT = IT_HEAD-IDENT
in item table also INDENT = IT_ITEM-INDENT.. -
How to dynamically create a treeview in sharepoint using javascript or jquery
How to dynamically create a treeview in sharepoint using javascript that displays spsites ,spweb,splist
Hi,
In SharePoint 2010, we can customize web service and use Server Object Model to get all the SharePoint sites, webs and lists, then call the web service using jQuery and using the jQuery Treeview plugin to display the data.
The following articles for your reference:
Walkthrough: Creating a Custom ASP.NET Web Service
https://msdn.microsoft.com/en-us/library/office/ms464040%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
Using Jquery to call an ASMX service in sharepoint 2010
http://stackoverflow.com/questions/9035539/using-jquery-to-call-an-asmx-service-in-sharepoint-2010
jQuery-ui Treeview
https://plugins.jquery.com/btechcotree/
Best Regards,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Creating BOM using BDC :How to display no of records from flat file under
Hi,
How to display no of records from flat file under one (Alternative BOM) vertically.
When i execute, the records are replacing one by one.
Here my coding:
report ZBOM1
no standard page heading line-size 255.
*include bdcrecx1.
DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF BDCDATA.
data: ibdcdata type standard table of bdcdata WITH HEADER LINE.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = BDCDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(01)'
BDCDATA-IDNRK.
perform bdc_field using 'RC29P-MENGE(01)'
BDCDATA-MENGE.
perform bdc_field using 'RC29P-MEINS(01)'
BDCDATA-MEINS.
perform bdc_field using 'RC29P-POSTP(01)'
BDCDATA-POSTP.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
BDCDATA-POSNR. "'0010'.
perform bdc_field using 'RC29P-IDNRK'
BDCDATA-IDNRK. "'15'.
perform bdc_field using 'RC29P-MENGE'
BDCDATA-MENGE. "'1'.
perform bdc_field using 'RC29P-MEINS'
BDCDATA-MEINS. "'ml'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.
ENDFORM.Hi,
the BDCDATA structure must be fnam, fval,dynbegin,dynpro,program.
You have to declare like this and pass this in your CALL TRANSACTION statement.
Please give some other table name for BDCDATA you declared for and also for IBDCDATA. -
How set dynamically created query in GridControl?
How set dynamically created query in GridControl?
Thank youIf your dynamic query is based on an Entity object, then you can probably use RowSetInfo setQueryInfo method.
The argument to this method is a 'Query' object. There are three flavours provided in the oracle.dacf.dataset
package.
oracle.dacf.dataset.QueryViewInfo
defines an updateable SQL query based on a predefined BC4J View Object.
oracle.dacf.dataset.QueryStatementInfo
Creates a view object based on an arbitrary SQL statement.
oracle.dacf.dataset.QueryInfo
Creates a View Object from an Entity Object and additional SQL clauses. The View Object will have
that Entity Object as its sole Entity Object base.
If in your application you are able to specify the name of the entity, then you can use the QueryInfo method to define your
query. Please try the following.
SessionInfo si = ....
void runDynamicQuery()
RowSetInfo rsi = new RowSetInfo();
AttributeInfo ai = new AttibuteInfo(..);
ai.setName(..);
rsi..addChild(ai);
si.addChild( rsi)
rsi.setQueryInfo( new QueryInfo( ...../* include entity name */ .... ));
rsi.setName(....);
rsi.open(true);
grid.setDataItemName(...);
Hope this helps,
Sathish. -
How do I create a hyperlink to another file?
How can I create a hyperlink to another file on my Mac?
Do you really mean "Hyperlink" as in a web page link to your file?
Or do you want a Mac OS X Alias icon placed in a different folder or on your desktop to a file? Hold Command-Option keys while dragging the file to a new folder, will create an Alias.
Or perhaps a Unix Symbolic Link (similar to a Mac OS X Alias, only different). This is done from a Terminal session using "ln -s /path/to/your/file /path/to/folder/where/symlink/to/be/placed" -
How do i create "Save As" option to file menu in Numbers version 2.3 (554). I have done this previously but cant remember how its done. My OS is 10.9.3
You can follow the steps in this article on TUAW to change the five-key shortcut for Save As… to the old tthree-key shortcut.
-
How to create variable record length target file in SAP BODS
Hi All
I have a requirement to create target file which will have various record layout; meaning different record length (similar to cobol file format), but this is for the target. Please let me know what is the best practice and how to solution this requirment.
Thanks
AshHi Shiva,
Thanks for your feedback. My issue is that I have 10 different detail records (each record type is fixed length).
For each customer account, I have to write to file the header record, the detail records in the exact order, then continue with next account and so on and then write the trailer record. I have given sample layout below. Highlighted text is the record identifier in this exmaple while the underlineds are account numbers. Fields are fixed length right padded with space or 0.
220700000000SA00 Wednesday 2014-12-12 ASA00034 334 000 ---> (this is header)
220700000010SA10 AAb 00000+000000+ Akab xxxx bb 0000000000943 3433 --> (detail rec)
220700000010SA14 AAA 00034354 DDD 000000000+ --> (detail rec)
220700000010SA15 888e a88 00000000+ --> (detail rec)
. . . . . remaining detail records
220700000012SA10 AAb 00000+000000+ Akab xxxx bb 0000000000943 3433 --> (detail rec)
220700000012SA14 AAA 00034354 DDD 000000000+ --> (detail rec)
220700000012SA15 888e a88 00000000+ --> (detail rec)
. . . . . remaining detail records
220700000000SA99 Wednesday 2014-12-12 d334 000 --> (trailer is header) -
How to dynamically create a JSF dataTable from a String[][] array
Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable? -
How to dynamically create sqlldr control file using stored procedure
I am trying to dynamically create the control file (.ctl) and execute the same using a stored procedure.I would be passing the file name as a parameter to this procedure. How do I go about doing this?
The control file has the following structure. The file name (mktg) varies and is passed as an input to the stored procedure.
SPOOL mktg.ctl
LOAD DATA
INFILE 'mktg.csv'
INTO TABLE staging
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(COMPANY_NAME,
ADDRESS,
CITY,
STATE,
ZIP)
SPOOL OFF ;
sqlldr scott/tiger CONTROL= mktg.ctl LOG=mktg.log BAD=mktg.badWe are using oracle 9i rel 2.
I have not had much success with the creation of log and bad files using external tables when they are being used within a dynamic sql.
Plz check this:
Re: problems related to data loads from excel, CSV files into an oracle 9i db -
How can we create info record using IDOC INFREC?
Hi Friends,
Can we create info record using IDOC INFREC. If Yes. How?
Regards,
NarendraUsing IDOC INFREC & FM IDOC_INBOUND_SINGLE
-
How can i create a record with a qualified or a hierarchy look up field
if have the api to create a this record by one time or must to create lookup then create main record???
Hi,
The process is to first populate the values in the lookup(can be a part of main table or qualified table) and hierarchy tables. Once done, create the main table record and then fill the details in the qualified table for that particular main table record. Since the details of the qualified table are stored in the link established between main table record and qualified table record hence you cannot first create a qualified table record before creating main table record.
Also when you first create a main table record containing set of lookup & hierarchy fields then you wont find the values in the drop down since you have not filled the lookup tables, hence we always fill the lookup table data first.
Regards,
Jitesh Talreja -
In oracle forms how to restrict creating new record
I have a multi record block, I dont want to create new record. If I use the down key after the last record control is moving to next record. I dont want this to happen. I want to scroll between first and last record.
Can anyone tell me ?Look up the Forms Help for 'system.last_record'.
I'd code the KEY-DOWN trigger on the block as...
IF :System.Last_Record = 'TRUE' THEN
Bell;
Message('You are on the last row');
ELSE
down;
END IF;
This avoids any processing or validation work being done on leaving the current record or creating the new record. -
How to skip the header rows of the file using UTL_FILE?
Hi,
I created a procedure to read the file from shared location using UTl_FILE package. But, I stucked why because I don't know how to skip the header rows as those rows are headings for one of the report.Since, please help me.
Regards,
Vissu.....vissu wrote:
Hi,
I created a procedure to read the file from shared location using UTl_FILE package. But, I stucked why because I don't know how to skip the header rows as those rows are headings for one of the report.Since, please help me.
Regards,
Vissu.....UTL_FILE just reads data from the file. It has no concept of what could be a "header" or "body" or "records" or "footer" or any other data based concept. If you want to skip lines of a file, you will just need to read them using UTL_FILE and ignore them.
Maybe you are looking for
-
Getting the following error when creating a table in the webdynpro project
hello colleagues, I am able to navigate to a view from the initial view because in the second view I am having a table. It throws the following error while navigating 500 Internal Server Error The initial exception that caused the request to fail, wa
-
How does one mount , inspect , verify , and possibly repair a Time Capsule hard drive with Disk Utility ? My 500Gb 1st gen Time Capsule ( used wireless with Airport) has quit backing up new data . ( iMac Core2Duo, Snow Leopard) . TC says it need
-
Macbook Pro 2008 hangs when running video on nvidia 9400M
My MBP (2.4GHz unibody) freezes whenever I run youtube videos for a few minutes. Resetting the PRAM and SMC didn't solve the problem. It seems to happen more often when running on batteries rather than plugged in. This MBP model has two graphic cards
-
Why Does kernel_task use 80 % cpu?
Hi, Ive been having a problem with my 2ghz macbook running slowly. The first thing i did when i noticed the slowdown was to open Activity Monitor to find out what process was causing the slowdown. kernel_task was running at 84% of the cpu and had 54
-
Indexing on a Partitioned Table
Hi, Everybody, I have already an partitioned table which has 8 partitions. I have indexes also on this partitiioned table. I have created the partioned indexes. It is partitioned by range. I have now added 3 more partitions and inserted data into the