Calling functions in External tables
I'm trying to create an External table and assigning a function return value to a column. But I'm getting error when trying to retrieve data from the table. Below are the scripts and error message. Can someone point me the correction.
create or replace
function v_sum ( v_num1 number, v_num2 number) return number as
v_res number;
begin
v_res := v_num1 + v_num2;
return v_res;
end;
create table tab_xyz
col1 varchar2(10),
col2 varchar2(10),
col3 number
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER DEFAULT DIRECTORY "MF_DIR" ACCESS PARAMETERS (
records delimited BY newline
load when (col1 != blanks)
badfile mf_dir:'xyz.csv.bad'
logfile mf_dir:'xzy.csv.log'
discardfile mf_dir:'xyz.csv.dsc'
fields terminated BY ',' optionally enclosed BY '"' MISSING FIELD VALUES ARE NULL
(col1,
col2,
col3 v_sum(3,4))
LOCATION ('xyz.csv' ))
REJECT LIMIT 100;
Error starting at line 4 in command:
select * from tab_xyz
Error report:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "identifier": expecting one of: "binary_double, binary_float, comma, char, date, defaultif, decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned, varrawc, varchar, varraw, varcharc, zoned"
KUP-01008: the bad identifier was: v_sum
KUP-01007: at line 9 column 11
29913. 00000 - "error in executing %s callout"
*Cause: The execution of the specified callout caused an error.
*Action: Examine the error messages take appropriate action.Thanks
fields terminated BY ',' optionally enclosed BY '"' MISSING FIELD VALUES ARE NULL
(col1,
col2,
col3 EXPRESSION "v_sum(3,4)")
LOCATION ('xyz.csv' ))
REJECT LIMIT 100;
KUP-01005: syntax error: found "identifier": expecting one of: "binary_double, binary_float, comma, char, date, defaultif, decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned, varrawc, varchar, varraw, varcharc, zoned"
KUP-01008: the bad identifier was: EXPRESSION
Similar Messages
-
UPPER function in external table definition ... ?
Greetings
Is there a way to specify a SQL function, like UPPER, in an external table column definition?
I know I can do it with SQL*Loader in the control file but I haven't found a way to do it in OWB?
I realize there are ways outside of the external table using a view, etc. but I'd like to reference the external table directly without having to create yet another object.
Thanks very much!!
-garyGreetings
Is there a way to specify a SQL function, like UPPER, in an external table column definition?
I know I can do it with SQL*Loader in the control file but I haven't found a way to do it in OWB?
I realize there are ways outside of the external table using a view, etc. but I'd like to reference the external table directly without having to create yet another object.
Thanks very much!!
-gary -
Call function in external .js from stage.onCompletion
I have my edge composition, and some functions in sim.js
within the stage.onCompletion event, I have:
$("<script type='text/javascript' src='sim.js'></script>").appendTo("#Stage");
how can I call functions, e.g. "testMe()" that are in sim.js from within the stage.onCompletion event?
$("testMe()"); was my first thought, but no. what am I missing?Lloydie maybe you can help me with this similar problem here (i think it is similar)
I am uncertain that i can use "transform" in edge, transform belongs to jquery.transform.js library. I am particulalry interested in animate({transform:.... to animate rotation and scales.
Can I call the transform.js into the stage like the way you called your custom .js?
Can we import additional libraries ? -
How to use lpad function in external table definition?
i need to modify one column of .csv file using lpad and want to insert it in external table.
lpad(AMT,3,'0')
Please send the codeHi,
Please read SQL and PL/SQL FAQ
Additionally when you put some code or output please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
The information you posted are quite poor. You don't expect to have an answer with such few details.
Anyway external table are read only.
Regards.
Al -
Calling functions and inserting tables based on values entered
Hello Everyone,
I am creating a function as below:
create or replace function func(flags in number,Ctry in varchar2) return number
is
maxv number;
flagv number;
begin
flagv:=1;
select max(num) into maxv from A;
if flags =1 then
insert into A(num,nam) values(maxv+1,Upper(Ctry));
else
flagv:=0;
end if;
return flagv;
end;
The function takes two parameters-The first one will be either 0 or 1.The second one will be name of a country.
If the first parameter is 1 then we would insert the country name passed, to the table name A.If its 0 then no insertion occurs and the function would return a value 0.
On compiling the function I get a success!.
When I do a
SQL>select distinct func(0,'UK') from B;
it works well and returns 0
However when I do
SQL>select distinct func(1,'UK') from B;
I expect an output of 1 & also expect UK to be inserted as anew row in the table A.However It throws an error saying "ORA-14551: cannot perform a DML operation inside a query .."
It is very important for me to use select to call the function, as my application would fire a select with that function and based on the value entered would insert or not insert at the back end.
Is there any way out to do this??
variable temps number
exec :number :=func(1,'UK');
does work but I cant use this in my application.
Hope you can help! Thanks!create or replace function func(flags in number,Ctry in varchar2) return number
is
PRAGMA AUTONOMOUS_TRANSACTION;
maxv number;
flagv number;
begin
flagv:=1;
select max(num) into maxv from A;
if flags =1 then
insert into A(num,nam) values(maxv+1,Upper(Ctry));
COMMIT;
else
flagv:=0;
end if;
return flagv;
end;
Is the above changes in BOLD enough or I need to do something else too in order to incorporate the autonomous transaction??
I am not too familiar with autonomous transaction.Could you please suggest the changes I need if any more required??
Thanks a ton for your suggestions!
Message was edited by:
user579245
Message was edited by:
user579245 -
CVI crashes when calling function from external DLL
I'm calling a CVI library from Test Stand 4.1. In that CVI library I load an external DLL (using LoadLibrary) and create a few function pointers (using GetProcAddress). The DLL loads successfully, and I get addresses for all of the imported functions.
However, when I one of the functions is called CVI crashes (Test Stand says it lost the ActiveX connection to CVI) when executing in an external CVI instance. If executed in the Test Stand process I get a system level exception.
If I step through the code in CVI, it hangs after trying to step into or over the call to the function pointer from the external DLL.
I am able to call the functions in a small test project I created in CVI, however when integrating it into an existing test library and calling it through Test Stand it fails.
Any ideas on how to go about debugging this issue?Have you tried calling into the dll that CVI calls directly from TestStand? I am curious to know if this also crashes.
I am also curious to know if there are any path references in the dll that is called by the CVI program. If so are they relative, or absolute paths?
I ask because one of the possibilities is that relative paths are being used to specify a path from the location of the code that is called, and they are not working because the current working directory is being specified by TestStand, and the paths are not relative to the working directory given by TestStand.
Jensen
National Instruments
Applications Engineer -
Error while importing external table
Hello,
I am getting the following error message when trying to import an external table:
SQL Exception
SQL Exception
Repository Error:SQL Exception..
Class Name: CacheMediator.
Method Name: getDDEntryFromDB.
Repository Error Message: ORA-22992: cannot use LOB locators selected from remote tables
I am using the "import..."- function of "external tables" in warehouse target module. The external table is working correctly when accessing it via sqlplus.
We are using owb version 10.2.0.1.
Any help would be appreciated.
Best regards
AlexanderMy friends, this a documented BUG into Metalink, but there is no solution.
I used a simple workaround:
1. I created the external table into the database;
2. I created the external table into the OWB repository;
3. I DIDN'T DEPLOY THE EXTERNAL TABLE TO THE DATABASE;
4. I used the external table into my mappings with no problems;
5. Finishing, I deployed my mappings to the database without any errors.
Hope to help!,
Gustavo. -
In fox , can I use call function which developed by ABAP?
I want to use the call function to read table in FOX.
thankshi
u can use functions, but not complex.
the syntax is as follows
CALL FUNCTION UPC_FUNCEXEC_SAVE
EXPORTING
I_NO_TRANSACTION_DATA = FLAG
tx
srin -
How to call a function with generic table parameter
Hi everybody
I need to call function module RSAR_ODS_API_GET (from BW). It recive an internal table with request ids and should return in E_T_DATA "unstructured" data from the psa and in E_T_RSFIELDTXT the description of the data structure, I guess
from sap help only thing I have reggarding how to use the function module is :
"You can call up the function module RSAR_ODS_API_GET with the list of request IDs given by the function module RSSM_API_REQUEST_GET. The function module RSAR_ODS_API_GET no longer recognizes InfoSources on the interface, rather it recognizes the request IDs instead. With the parameter I_T_SELECTIONS, you can restrict reading data records in the PSA table with reference to the fields of the transfer structure. In your program, the selections are filled and transferred to the parameter I_T_SELECTIONS.
The import parameter causes the function module to output the data records in the parameter E_T_DATA. Data output is unstructured, since the function module RSAR_ODS_API_GET works generically, and therefore does not recognize the specific structure of the PSA. You can find information on the field in the PSA table using the parameter E_T_RSFIELDTXT."
unfortunately I when running de report bellow, I get a dump which says:
Function parameter "E_DATA" is unknown
in the definition of the interface E_DATA has no type, which means it can recive any table type, right?
So I have two questions?
1) How to get the code working
2) How do I use the parameter E_T_RSFIELDTXT to parse the data returned in E_DATA
by debuging RSSM_API_REQUEST_GET for this code I found it try to put an internal table with the struct of the database table /BIC/B0000151000 in E_DATA
Thanks a lot for any help
rgds
my test report is:
REPORT ZTEST_PSA_API.
TABLES: /BIC/B0000151000 .
TYPE-POOLS: RSSM.
TYPES: BEGIN OF STC_REQ_LINE,
sign(1),
option(2),
low TYPE rsa_request,
high TYPE rsa_request,
END OF STC_REQ_LINE,
IT_REQUEST TYPE STC_REQ_LINE OCCURS 0.
DATA: lit_request TYPE RSSM_T_API_REQUEST_GET WITH HEADER LINE,
lc_system TYPE RSSM_T_API_LOGSYS,
lit_request1 TYPE IT_REQUEST WITH HEADER LINE.
DATA: lc_dtarget_name TYPE RSA_ODSNAME,
lit_meta_data TYPE RSARC_T_RSFIELDTXT.
DATA: lt_psa_data LIKE /BIC/B0000151000 OCCURS 0.
CALL FUNCTION 'RSSM_API_REQUEST_GET'
EXPORTING
I_SOURCE = '2LIS_13_VDITM'
I_TYP = 'D'
I_DATEFROM = '20060627'
IMPORTING
E_T_REQUEST = lit_request[]
E_T_LOGSYS = lc_system
EXCEPTIONS = 1.
READ TABLE lit_request.
lit_request1-sign = 'I'.
lit_request1-option = 'EQ'.
lit_request1-low = lit_request-request .
APPEND lit_request1 .
break-point .
CALL FUNCTION 'RSAR_ODS_API_GET'
EXPORTING
I_T_REQUEST = lit_request1[]
IMPORTING
E_ODSNAME = lc_dtarget_name
E_T_RSFIELDTXT = lit_meta_data
TABLES
E_DATA = lt_psa_data
EXCEPTIONS
NO_DATA_FOUND = 1
PARAMETER_FAILURE = 2
REQUEST_NOT_AVAILABLE = 3
NO_REQUEST_FOUND = 4
NO_FIELDS_TO_ODS = 5
NO_ODS_FOUND = 6
PACKAGE_LOCKED_BY_LOADING = 7 .Try to pass table parameter without "[]" :
CALL FUNCTION 'RSAR_ODS_API_GET'
EXPORTING
I_T_REQUEST = lit_request1
IMPORTING
E_ODSNAME = lc_dtarget_name
E_T_RSFIELDTXT = lit_meta_data
TABLES
E_DATA = lt_psa_data -
Third party system call function module/BAPI through RFC to update Z table
Dear Friends,
We have a third party system which directly inserts a Z table in SAP through its programming, which is an auditing issue.
We want the third party system should call function module/BAPI through RFC so that the Z table gets updated.
waiting for inputs..
Thanks,
Kumarif third party system is capable of making Remote Function call, then writing a Function module & making it remote enable is not difficult task in ABAP.
You may have to prepare specifications first to decide if third party system is going to Read, insert, update, delete records from Zee table. -
CALL function to extract data from a structure table
Hi Gurus,
Anyone knows how to write a call function to extract data from a structure table?
Your help is very much appreciated.
Thanks alot.Hi,
structure doesnot hold any data. instead of it you can check the stucture in which table it is used, find the table name,use select query to extract the data u needed.
you can use where used list option to find the structure in which table it is used.
regards
siva -
Displaying table using call function 'REUSE_ALV_GRID_DISPLAY'
I have created a table which has product code, product description, and product level. I am trying to display it using REUSE_ALV_GRID_DISPLAY. When I Check it, I get the following error message: "PVS2" is not an internal table - the "Occurs n" specification is missing.
Is it possible to copy PVS2 into another table, and then display that table using REUSE_ALV_GRID_DISPLAY?
I have patched together code from sdn, a client program, and my own code and I am starting to get confused. So, please help me.
Regards,
Al Lal
REPORT YABHINAV16.
* program to display products at chosen level *
Tables: T179, T179t.
types: begin of hierarchy,
prodh type t179-prodh,
vtext type t179t-vtext,
stufe type t179-stufe,
end of hierarchy.
types: begin of text,
prodh type t179t-prodh,
vtext type t179t-vtext,
end of text.
data: pvs type standard table of hierarchy initial size 0.
data: pvs2 type hierarchy.
data: it_text type standard table of text,
wa_text type text.
TYPE-POOLS:SLIS.
*For ALV
DATA: GT_FLD TYPE SLIS_T_FIELDCAT_ALV,
GT_EV TYPE SLIS_T_EVENT,
GT_HDR TYPE SLIS_T_LISTHEADER,
GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: WA_FLD TYPE SLIS_FIELDCAT_ALV,
WA_EV TYPE SLIS_ALV_EVENT,
WA_HDR TYPE SLIS_LISTHEADER,
WA_SORT TYPE SLIS_SORTINFO_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DEFINE FLD.
WA_FLD-FIELDNAME = &1.
WA_FLD-TABNAME = &2.
WA_FLD-OUTPUTLEN = &3.
WA_FLD-SELTEXT_L = &4.
WA_FLD-SELTEXT_M = &5.
WA_FLD-SELTEXT_S = &6.
WA_FLD-COL_POS = &7.
WA_FLD-FIX_COLUMN = &8.
WA_FLD-DO_SUM = &9.
APPEND WA_FLD TO GT_FLD.
CLEAR WA_FLD.
END-OF-DEFINITION.
CONSTANTS: C_TOP TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
C_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: MTRL LIKE SY-REPID,
TITLE LIKE SY-TITLE.
select-options level for t179-stufe no intervals.
start-of-selection.
Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
select prodh vtext from t179t into corresponding fields of table it_text for all entries in pvs where prodh = pvs-prodh.
end-of-selection.
sort pvs by prodh.
sort it_text by prodh.
loop at pvs into pvs2.
read table it_text into wa_text with key prodh = pvs2-prodh.
if sy-subrc eq 0.
pvs2-vtext = wa_text-vtext.
write: / pvs2-prodh, pvs2-vtext, pvs2-stufe.
endif.
* modify pvs2.
endloop.
perform BUILD_FIELDCAT.
perform GRID_DISPLAY.
form BUILD_FIELDCAT .
FLD 'PRODH' 'PVS2' '20' 'Product Hierarchy' ' ' ' ' '1' '' '' .
FLD 'VTEXT' 'PVS2' '40' 'Description ' ' ' ' ' '3' '' '' .
FLD 'STUFE' 'PVS2' '5' 'Level' ' ' ' ' '2' '' '' .
endform. " BUILD_FIELDCAT
form GRID_DISPLAY .
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = MTRL
I_CALLBACK_USER_COMMAND = 'C_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = C_TOP
I_STRUCTURE_NAME = 'PVS2'
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = GT_FLD
IT_SORT = GT_SORT
I_DEFAULT = 'X'
I_SAVE = 'U'
IT_EVENTS = GT_EV
TABLES
T_OUTTAB = PVS2[]
EXCEPTIONS
PROGRAM_ERROR = 1
others = 2.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " GRID_DISPLAYTYPE-POOLS : SLIS.
DATA : BEGIN OF WA_T001,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
ORT01 LIKE T001-ORT01,
END OF WA_T001,
IT_T001 LIKE TABLE OF WA_T001.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
DATA : V_NAME LIKE SY-REPID.
SELECT BUKRS BUTXT ORT01 FROM T001 INTO TABLE IT_T001 UP TO 15 ROWS. V_NAME = SY-REPID.
CALL FUCTION MODULE 'REUSE_ALV_FIELDCATLOG_MERGE. EXPORTING I_CALBACK_PROGRAM =
V_NAME I_INTERAL_TABNAME = 'WA_T001' I_INCLNAME = V_NAME CHANGING CT_FIELDCAT =
IT_FCAT.
CALL FUNCTION MODULE "REUSE_ALV_GRID_DISPLAY"
EXPORTING
I_CALLBACK_PROGRAM = V_NAME
IT_FCAT = IT_FCAT.
TABLES
T_OUTTAB = IT_T001
SY-REPID IS THE SYSTEM VARIABLE WHICH IS HAVING THE ABAP PROGRAM
OR CURRENT MAIN PROGRAM.
----- Sample Progam -
***INCLUDE YRVR058_DEST_WISE_SUMMARY_DF01 .
*& Form DISPLAY_DATA
text *-- Rajesh Vasudeva
--> p1 text
<-- p2 text
FORM DISPLAY_DATA .
IF ITAB[] IS NOT INITIAL.
PERFORM F_APPEND_BLOCK.
ELSE.
MESSAGE 'Data not found for the selection
criteria' TYPE 'S'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " display_data
*& Form f_append_block
text
--> p1 text
<-- p2 text
FORM F_APPEND_BLOCK .
DATA : L_WA_SORT TYPE SLIS_SORTINFO_ALV, "For
sort
L_WA_EVENTS TYPE SLIS_ALV_EVENT. "For
events
Event (Top of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
L_WA_EVENTS-FORM = C_TOPOFPAGE.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (Top of Page)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
L_WA_EVENTS-FORM = 'F_DISPLAY_HEADER_PARTA'(031).
"f_display_header_part
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Event (End of List)
CLEAR L_WA_EVENTS.
L_WA_EVENTS-NAME = SLIS_EV_END_OF_LIST.
L_WA_EVENTS-FORM = C_END_OF_LIST.
APPEND L_WA_EVENTS TO I_EVENTS_PART.
Set Layout Zebra
STRUCT_LAYOUT-ZEBRA = 'X'.
STRUCT_LAYOUT-NUMC_SUM = 'X'.
STRUCT_LAYOUT-TOTALS_TEXT = 'TOTAL:'(032).
set field catalog
PERFORM F_FIELD_CATALOG_PART.
ASSIGN ITAB[] TO <F_OUTTAB>.
V_PART = 'A'. "initiating list is A
PERFORM F_DISPLAY_BLOCK USING STRUCT_LAYOUT
I_FIELD_CAT_PART[]
C_TAB
I_EVENTS_PART[]
I_SORT_PART[].
ENDFORM. " f_append_block
*& Form f_field_catalog_part
text
--> p1 text
<-- p2 text
FORM F_FIELD_CATALOG_PART .
REFRESH I_FIELD_CAT_PART.
CLEAR I_FIELD_CAT_PART.
PERFORM F_CREATE_CATALOG USING :
*Month
C_TAB 'MONTH' 'MONTH' SPACE 'L' 7
I_FIELD_CAT_PART[],
*OBD
*C_TAB 'VBELN' 'Delivery' SPACE 'L' 12
I_FIELD_CAT_PART[],
*DATE
C_TAB 'WADAT_IST' 'Date' SPACE 'L' 10
I_FIELD_CAT_PART[],
*Destination
C_TAB 'CITY1' 'Destination' SPACE 'L' 25
I_FIELD_CAT_PART[],
*Qty By Road
C_TAB 'NTGEW_ROAD' 'Road Quantity' SPACE 'R' 16
I_FIELD_CAT_PART[],
*Rail Qty
C_TAB 'NTGEW_RAIL' 'Rail Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[],
*Total Qty C_TAB 'TOT' 'Total Quantity' SPACE 'R' 16 I_FIELD_CAT_PART[], *RR/Trk No.
C_TAB 'EXTI2' 'Truck/RR No.' SPACE 'L' 17 I_FIELD_CAT_PART[].
ENDFORM. " f_field_catalog_part
*& Form f_DISPLAY_block
text
-->P_STRUCT_LAYOUT text
-->P_I_FIELD_CAT_PART[] text
-->P_C_TAB text
-->P_I_EVENTS_PART[] text
-->P_I_SORT_PART[] text
FORM F_DISPLAY_BLOCK USING FP_LAYOUT TYPE
SLIS_LAYOUT_ALV
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV
VALUE(FP_TABNAME) TYPE
ANY
FP_I_EVENTS TYPE
SLIS_T_EVENT
FP_I_SORT TYPE
SLIS_T_SORTINFO_ALV.
DATA: V_REPID TYPE SYREPID,
"current Program id
C_SAVE TYPE CHAR1 VALUE 'A'.
"variant save
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = FP_LAYOUT
IT_FIELDCAT = FP_I_FCAT[]
IT_SORT = FP_I_SORT[]
I_SAVE = C_SAVE "variant
save
IT_EVENTS = FP_I_EVENTS[]
TABLES
T_OUTTAB = <F_OUTTAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_DISPLAY_block
*& Form f_create_catalog
text
-->P_C_TAB text
-->P_0085 text
-->P_0086 text
-->P_SPACE text
-->P_0088 text
-->P_5 text
-->P_I_FIELD_CAT_PART[] text
FORM F_CREATE_CATALOG USING FP_I_TABNAME TYPE
SLIS_TABNAME
FP_I_FIELDNAME TYPE SLIS_FIELDNAME
FP_I_SELTEXT TYPE
SCRTEXT_L
FP_I_DOSUM TYPE
CHAR1
FP_I_JUST TYPE C
FP_I_OUTPUTLEN TYPE
OUTPUTLEN
FP_I_FCAT TYPE
SLIS_T_FIELDCAT_ALV.
Record for field catalog
DATA: L_REC_FCAT TYPE SLIS_FIELDCAT_ALV.
L_REC_FCAT-TABNAME = FP_I_TABNAME.
L_REC_FCAT-FIELDNAME = FP_I_FIELDNAME.
L_REC_FCAT-SELTEXT_L = FP_I_SELTEXT.
L_REC_FCAT-DO_SUM = 'X'.
*l_rec_fcat-do_sum = ' '.
L_REC_FCAT-JUST = FP_I_JUST.
L_REC_FCAT-OUTPUTLEN = FP_I_OUTPUTLEN.
L_REC_FCAT-DECIMALS_OUT = '2'.
L_REC_FCAT-KEY = '1'.
APPEND L_REC_FCAT TO FP_I_FCAT.
ENDFORM. " f_create_catalog
Subroutines for Headings
*& Form f_display_header_partA
Display header for report for Part A
*& Form top_of_page
text
--> p1 text
<-- p2 text
FORM TOP_OF_PAGE .
SKIP 1.
WRITE:/25 ' Name of Company ',80 'RUN DATE' ,
SY-DATUM.
SKIP 1.
WRITE:/60 'RUN DATE' , SY-DATUM.
SKIP 1.
DATA: YR(4) TYPE N,
FIN_PRD(10) TYPE C.
IF S_DTABF-LOW+4(2) LT '04'.
YR = S_DTABF-LOW+0(4) - 1.
CONCATENATE YR '-' S_DTABF-LOW+2(2) INTO FIN_PRD.
ELSE.
YR = S_DTABF-LOW+0(4) + 1.
CONCATENATE S_DTABF-LOW0(4) '-' YR2(2) INTO
FIN_PRD.
ENDIF.
WRITE:/5 'DETAILS OF THE MONTH/DATE WISE DESPATCHES
MADE BY ROAD/RAIL DURING THE YEAR ' , FIN_PRD .
SKIP 1.
WRITE :/ 'SALES OFFICE : ' , P_SALES,' ' , RNAME.
SKIP 1.
ENDFORM. " DISPLAY_DATA
Award Points If Useful... -
To get import value of table spoolids in CALL function 'smartfomr' ?
I am calling smartform as like under:
DATA:l_doc_output_info TYPE ssfcrespd,
tab_otf_data TYPE ssfcrescl,
l_job_output_options TYPE ssfcresop.
CALL FUNCTION FNAME
IMPORTING
DOCUMENT_OUTPUT_INFO = l_doc_output_info
JOB_OUTPUT_INFO = tab_otf_data
JOB_OUTPUT_OPTIONS = l_job_output_options
exporting..
changing..
i am run the smartform than i get display than i print it form that smartform output but i am getting null value in : tab_otf_data-spoolids and tab_otf_data-otfdata,
So, how to get that table values?
if u know,
regards,
I am gettin null value inHi Scruz !
The parameter "GETOTF" of the structure CONTROL_PARAMETERS should be set.
Regards,
Vincent. -
Call function 'Download' using different internal tables
Hi everyone!
i declare 10 different internal tables, with the same structure but different data.
i need to create 10 different files (one from each internal table)
i dont want to call 10 times the function download.
is there someway to put a variable name(that refeer to my internal table)
something like this.
PERFORM Create_file USING mytable.
PERFORM Create_file USING mytable2.
PERFORM Create_file USING mytable3.
PERFORM Create_file USING etc....
FORM create_file USING table.
DATA: file(128),
zcancel(1).
archivo = 'c:\loans.dat'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = ' '
codepage = ' '
filemask_all = ' '
filemask_mask = ' '
filemask_text = ' '
filename = file
filetype = 'dat'
filetype_no_change = ' '
filetype_no_show = ' '
item = ' '
mode = ' '
wk1_n_format = ' '
wk1_n_size = ' '
wk1_t_format = ' '
wk1_t_size = ' '
IMPORTING
cancel = zcancel
TABLES
data_tab = <b>TABLE</b>
EXCEPTIONS
invalid_filesize = 01
invalid_table_width = 02
invalid_type = 03
no_batch = 04
unknown_error = 05.
ENDFORM.Hi,
Check this example..
It download t_mara1 & t_mara2..Modify the code according to your requirement..
DATA: t_mara1 LIKE mara OCCURS 0 WITH HEADER LINE.
DATA: t_mara2 LIKE mara OCCURS 0 WITH HEADER LINE.
DATA: v_filename LIKE rlgrap-filename.
DATA: v_char5(5).
FIELD-SYMBOLS: <fs> TYPE table.
DATA: v_variable(30).
DO 2 TIMES.
CLEAR: v_filename.
v_char5 = sy-index.
SHIFT v_char5 LEFT DELETING LEADING space.
CONDENSE v_char5.
CONCATENATE 'C:\TEST' v_char5 '.TXT' INTO v_filename.
CONCATENATE 'T_MARA' v_char5 '[]' INTO v_variable.
ASSIGN (v_variable) TO <fs>.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = v_filename
filetype = 'DAT'
TABLES
data_tab = <fs>
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
customer_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDDO.
Thanks,
Naren -
Hi All,
How to use the oracle in-built functions in the external table. I am trying to transform the value like CONTRACT_RATE TO_NUMBER(REPLACE(:CONTRACT_RATE,'%','')) which I use in SQL*Loader.
I am using 11g
Thanks in advance,
Jagadish Kumar A.MYou can use them when you're SELECTing from the external table.
So, simply define the columns in your external table as strings.
And then just:
select TO_NUMBER(REPLACE(CONTRACT_RATE,'%','')) CONTRACT_RATE
from your_external_table
Maybe you are looking for
-
Hi Guys, help me pls/ In my report i am having above 40 columns... when i placed the report in dashboard or when i viewing the report only 1 column is displaying..remaining all are null can any one help me
-
Problem in starting Application Server control
Hi, I have installed Oracle BI. But when Iam trying to configure the discoverer catalog, I could not able to connect to the Application server control. Please advice with which login credentails I need to login to the Application server control. Than
-
ORACLE 8 CRASH .....reason not known
I have Oracle 8.0.5 installed as a server which is used for a cleint-server application. Suddenlly the datafile which was of 3.5 GB was truncated to 150 MB. ALso now Oracle could not be started. AGve the following message ORA-01200: actual file size
-
Hi experts after an upgrade from SRM 3.0 to SRM 5.5 i have the following problem. The Users created after the upgrade don't appare in the Structure (ppoma). There are Position and Central Person, but the last level there isn't. I've implemented also
-
Q10 - Outlook contacts missing after software upgrade
Hi there, I have an executive at my company who upgraded to the Q10. It started to freeze when she went to her calendar. I rebooted the device, checked for software updates and upgraded using the latest available software release. After that upgra