Interface pgm doubt
Hi,
I have a requirement to enhance orders05 with two zfields.I want to generate an outbound IDOC..Pls let me know how to fill this zfields.Automatically the value will be populated or need to find an exit .If so pls suggest exit name.This two fields has been already extended in EKKO Table.
Regrds
Arun.P
Hi
You are have added fields to EKKO.That means you are send PO idoc.
For PO process code is ME10 and function module assinged to this is IDOC_OUTPUT_ORDERS. This function module is used to fill that data to IDOC.
Now goto SE37 and provide this function module name & click on display.
In this function module at last you have PERFORM fuellen_idoc_inttab.Double click on this and in this search fot PERFORM customer_function. In this perform you will have the exit CALL CUSTOMER-FUNCTION '002'. In this exit you need to populate the data into Z-fields.
Regards,
Raghu.
Similar Messages
-
Receiving Open Interface related doubt
Hi All,
We are currently on Oracle Release 12.0.4 and need some help/information regards Receiving Open Interface tables : rcv_headers_interface & rcv_transactions_interface tables.
We import the ASN which is being sent across from the Supplier via EDI directly into the Receiving Open Interface tables and then RTP program ( Receiving Transaction Processor ) program processes these into the base tables
to complete the receipt process..
Now for some reason or the other lets say because of EDI data issues or some other system issue with the RTP program , the Interface records end up in error status & the users have to manually complete the Receipt in Oracle Forms directly..
Now this Interface data over a period in time keeps accumulating while the corresponding PO Document would already have been Received manually in Oracle.
Because of this errored interface records the Interface tables keep growing in size in terms of data volume..
Now is there a way script or a program which validates these interface records and purges these automatically based on some validations on its own..
For Example : for a po if the records are stuck in the interface table but the po shipment has already been received in manually and in Closed Status, then it would automatically purge these records from interface tables.
Could someone please help us with this as soon as possible with any suggestions or workarounds..
ThanksCurrently there is no purge program available to purge the records in RTI. Further the oracle support wont be able to provide a delete script to delete the records in RTI (The reason being, the records are populated by the customer and customers are the best persons to validate the records and delete them on their own).
However, for ASN's
You may write a query based on the RTI.po_distribution_id and then check, whether the corresponding po shipment\distribution is already received \ closed for receiving and then you may delete. -
Payables Open Interface Pgm fails without any error(Very urgent)
All,
I'm into an integration project where in I'm pushing Invoice doc from a third party appln to Oracle apps (11.5.10.2) thru payables open interface. The integration is smooth till today. We pushed a record today, but the concurrent neither picks up the data but failed with 'completed error' status. When I delete the same record from the interface, the concurrent runs fine. So we are sure there is some issue with the data in my record. Since concurrent is failed without any reason, from where I can get the log to know what is the actual problem with that record? Pls help me with your inputs.
Thanks,
SenSen,
To enable trace, please refer to this document (skip the part about generating TKPROF, just check the concurrent request output file if more details about the error are logged after enabling trace and setting the profile option).
Note: 453527.1 - How To Trace a Concurrent Request And Generate TKPROF File
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=453527.1
The database log file can be usually found under $ORACLE_HOME/admin/<SID>_<hostname>/bdump directory (or from SQL*Plus, issue "show parameter background_dump_dest").
Regards,
Hussein -
Hi guys,
I have a file with the following example source:
80
80
56
25
32
80
56
The target is an R/3 and the interface is IDoc. All lines with value 80 should map to RPLMAS02 and the others values to ARTMAS 05. So, is two different mappings based on content field for the same target service R/3.
I already have two different mappings for each IDoc type, and Im using the function createIf to exclude the lines that I dont want to add in each IDoc. But, I cant do it using XPath conditions in the Interface Determination, because both mappings are always performed
Which is the best way to achieve this issue?
Thanks in advance,
Ricardo.Hi folks,
Thanks a lot for your prompt answers.
Aamir: Take my source code as an example, I have several lines with different key field values. Based on these key field values I want to route both contents to different mappings. The lines with 80 value to RPLMAS mapping and the rest (different from 80) to ARTMAS mapping. But, from my understanding, at Interface Determination level, one message is considered and the XPath conditions only checks where 80 value exists or not. As I've a message with both values 80 and !=80), both mappings are performed and the last one is generated empty with error.
Saravana: I didn't understood where this "workaround" solve my issue above?
Resuming: I want to route lines for two different mappings and not an entire message. I mean, I want to put lines 80 in one mapping and the rest in another every thing at the same execution time.
Thanks in advance,
Ricardo. -
Reuse alv hierseq list display pgm doubt
can anyone tell me s my coding s write or not becos in the report output i cannot view the line item details but it s gettign populated in the itab
REPORT ZTEST_1.
TABLES: KNB1,BSID.
TYPE-POOLS: SLIS.
*TYPES:BEGIN OF TYP_OUTPUT.
INCLUDE STRUCTURE ZRFPOSXEXT.
*TYPES:END OF TYP_OUTPUT.
TYPES:BEGIN OF TYP_BSEG,
bukrs like bsid-bukrs,
kunnr like bsid-kunnr,
zuonr like bsid-zuonr,
belnr like bsid-belnr,
bldat like bsid-bldat,
xblnr like bsid-xblnr,
blart like bsid-blart,
dmbtr like bsid-dmbtr,
aufnr like bsid-aufnr,
vbel2 like bsid-vbel2,
posn2 like bsid-posn2,
END OF TYP_BSEG.
TYPES:BEGIN OF TYP_VBRP,
VBELN LIKE VBRP-VBELN,
AUBEL LIKE VBRP-AUBEL,
AUPOS LIKE VBRP-AUPOS,
VKGRP LIKE VBRP-VKGRP,
TDNAME LIKE STXH-TDNAME,
TDLINE LIKE TLINE-TDLINE,
END OF TYP_VBRP.
data: wa_vbrp type typ_vbrp.
DATA:
*GT_HEADER_TABLE TYPE TYP_OUTPUT OCCURS 0 WITH HEADER LINE,
GT_ITEM_TABLE TYPE TYP_VBRP OCCURS 0 WITH HEADER LINE.
DATA: IT_BSEG TYPE TYP_BSEG OCCURS 0 WITH HEADER LINE.
Define fieldcatalog
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
Callback program
DATA: G_REPID LIKE SY-REPID.
List layout description
DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
Group order criterium
DATA: GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
Layout *
Definition for field choice screen **
GS_LAYOUT-HEADER_TEXT = 'HEADER'.
GS_LAYOUT-ITEM_TEXT = 'ITEM'.
GS_LAYOUT-DEFAULT_ITEM = 'X'.
Initialization fieldcatalog ***
G_REPID = SY-REPID.
PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
Data selection ***
PERFORM SELECT_DATA.
Define keyinfo as sort group definition ***
CLEAR GS_KEYINFO.
GS_KEYINFO-HEADER01 = 'BELNR'. "idenify header and item
GS_KEYINFO-ITEM01 = 'VBELN'.
Call function to list display (hier-seq) ***
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
I_TABNAME_HEADER = 'GT_HEADER_TABLE'
I_TABNAME_HEADER = 'IT_BSEG'
I_TABNAME_ITEM = 'GT_ITEM_TABLE'
I_STRUCTURE_NAME_HEADER = <STRUCTURE_NAME_HEADER>
I_STRUCTURE_NAME_ITEM = <STRUCTURE_NAME_ITEM>
IS_KEYINFO = GS_KEYINFO
TABLES
T_OUTTAB_HEADER = GT_HEADER_TABLE
T_OUTTAB_HEADER = IT_BSEG
T_OUTTAB_ITEM = GT_ITEM_TABLE
EXCEPTIONS
PROGRAM_ERROR = 1.
FORMS ***
FORM FIELDCAT_INIT USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Deviations of group fields to be merged *
Initialize group field(s) of header table **
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 1.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'BLART'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'DOC TYPE'.
LS_FIELDCAT-OUTPUTLEN = 2.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 2.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'BLDAT'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'DOC DATE'.
LS_FIELDCAT-OUTPUTLEN = 8.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 3.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'BELNR'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'ACC DOC NO'.
LS_FIELDCAT-OUTPUTLEN = 10.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 4.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'XBLNR'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'REFERENCE'.
LS_FIELDCAT-OUTPUTLEN = 16.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 5.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'ZUONR'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'ASSGNMENT NO'.
LS_FIELDCAT-OUTPUTLEN = 19.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 6.
LS_FIELDCAT-TABNAME = 'IT_BSEG'.
LS_FIELDCAT-FIELDNAME = 'DMBTR'.
LS_FIELDCAT-KEY = 'X'. " sets key field
LS_FIELDCAT-SELTEXT_M = 'AMT N LOC CURR'.
LS_FIELDCAT-OUTPUTLEN = 13.
APPEND LS_FIELDCAT TO gt_fieldcat.
Initialize keyfield(s) of item table **
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 7.
LS_FIELDCAT-TABNAME = 'GT_ITEM_TABLE'.
LS_FIELDCAT-FIELDNAME = 'AUPOS'.
LS_FIELDCAT-TECH = 'X'. " sets technical field
LS_FIELDCAT-SELTEXT_M = 'LINE ITEM'.
LS_FIELDCAT-OUTPUTLEN = 6.
APPEND LS_FIELDCAT TO gt_fieldcat.
CLEAR LS_FIELDCAT.
ls_fieldcat-col_pos = 8.
LS_FIELDCAT-TABNAME = 'GT_ITEM_TABLE'.
LS_FIELDCAT-FIELDNAME = 'TDLINE'.
LS_FIELDCAT-TECH = 'X'. " sets technical field
LS_FIELDCAT-SELTEXT_M = 'OI NOTES'.
LS_FIELDCAT-OUTPUTLEN = 132.
APPEND LS_FIELDCAT TO gt_fieldcat.
Hidden field(s) of tables (header and/or item) **
CLEAR LS_FIELDCAT.
ls_fieldcat-tabname = '<header/item_table_name>'.
LS_FIELDCAT-FIELDNAME = '<GROUP_FIELD_NAME>'.
LS_FIELDCAT-NO_OUT = 'X'. "sets hidden field
APPEND LS_FIELDCAT TO RT_FIELDCAT.
ENDFORM. "fieldcat_init
FORM SELECT_DATA.
data: begin of wa_olino,
tdname like stxh-tdname,
tdline like tline-tdline,
end of wa_olino.
data: it_olino like wa_olino occurs 0 with header line.
data: begin of wa_stxh,
tdname like stxh-tdname,
end of wa_stxh.
data: it_stxh like wa_stxh occurs 0 with header line.
data: begin of wa_lines.
include structure ztline.
data: end of wa_lines.
data: IT_LINES LIKE wa_lines OCCURS 0 WITH HEADER LINE.
select bukrs kunnr zuonr belnr bldat xblnr blart dmbtr aufnr vbel2
posn2
from bsid
into table it_bseg
where kunnr in so_wlkun
and bukrs in so_wlbuk.
select vbeln aubel aupos vkgrp
from vbrp
into table gt_item_table
for all entries in it_bseg
where vbeln = it_bseg-belnr.
sort gt_item_table by aubel aupos.
loop at gt_item_table into wa_vbrp.
concatenate wa_vbrp-aubel wa_vbrp-aupos into wa_olino-tdname.
wa_vbrp-tdname = wa_olino-tdname.
modify gt_item_table from wa_vbrp.
append wa_olino to it_olino.
endloop.
select tdname from stxh into corresponding fields of table it_stxh
for all entries in it_olino
where tdobject = 'VBBP'
and tdname = it_olino-tdname
and tdid = '0002'
and tdspras = 'EN'.
data: j type i,k_lines type i..
sort it_stxh by tdname.
*sort it_output by tdname.
describe table GT_ITEM_TABLE lines k_lines.
*loop at it_output into wa_output. "where blart = '1Z'.
loop at gt_item_table into wa_vbrp.
loop at it_stxh where tdname = wa_vbrp-tdname.
read table it_stxh.
CALL FUNCTION 'ZREAD_TEXT_1'
EXPORTING
CLIENT = SY-MANDT
ID = '0002'
LANGUAGE = SY-LANGU
NAME = IT_STXH-tdname
OBJECT = 'VBBP'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = IT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
*data: I type i.
if sy-subrc = 0.
loop at it_lines.
it_lines-tdname = wa_vbrp-tdname.
modify it_lines. "from wa_lines.
endloop.
loop at it_lines.
*i = sy-tfill.
wa_vbrp-tdline = it_lines.
if sy-tabix = 1.
modify gt_item_table from wa_vbrp.
else.
append wa_vbrp to gt_item_table.
endif.
clear it_lines-tdline.
endloop.
endif.
endloop.
if sy-tabix = k_lines.
exit.
endif.
endloop.
sort it_olino by tdname.
ENDFORM. " select_dataHi,
Go thru the following Example program. It can solve ur problem..
*& Report : ZASSG_ALV_JAYARAM3
*& Title : Hierarchical sequential ALV report
*& Author :
*& Created on : *& Request :
*& Desription : Generates a Hierarchial sequental ALV report to list
out Billing details.
*& Modification Log
*& Mod # Author Date Requested by
*& Reason for Change
*& 00 #
REPORT ZASSG_ALV_JAYARAM3 NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 64
MESSAGE-ID Z00.
*..Type Definitions for ALV Report
TYPE-POOLS SLIS.
Table/Structure declarations. *
TABLES : VBRK, " Billing: Header Data
VBRP, " Billing: Item Data
T001, " Comapny Codes
TVKOT, " Sales Organizations: Texts
MAKT. " Material Descriiptions
*.. Internal Tables declaration *
*----- Internal table to store billing docs which are not cancelled
DATA : BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN, " Billing document
WAERK LIKE VBRK-WAERK, " SD document currency
VKORG LIKE VBRK-VKORG, " Sales organization
VTEXT LIKE TVKOT-VTEXT, " Sales organization text
FKDAT LIKE VBRK-FKDAT, " Billing date
BUKRS LIKE VBRK-BUKRS, " Company Code
BUTXT LIKE T001-BUTXT, " Company Code text
NETWR LIKE VBRK-NETWR, " Net value in document currency
END OF IT_VBRK.
*-----Internal table to stroe ITEM DETAILS
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN2 LIKE VBRP-VBELN, " Billing document
POSNR LIKE VBRP-POSNR, " Billing item
FKIMG LIKE VBRP-FKIMG, " Actual billed quantity
VRKME LIKE VBRP-VRKME, " Sales unit
NETWR LIKE VBRP-NETWR, " Net value of the billing item
MATNR LIKE VBRP-MATNR, " Material number
ARKTX LIKE VBRP-ARKTX, " Short text for sales order item
END OF IT_VBRP.
Variable / Flag Declerations *
DATA : FG_COLOR VALUE ' ', " FLAG TO CHANGE THE COLOR OF THE RECORD
FG_NO_DATA VALUE ' '. " FLAG TO CHECK THE DATA
DATA : V_REPID TYPE SYREPID.
ALV Type declaration *
DATA : IT_FIELDCAT TYPE STANDARD TABLE OF
SLIS_FIELDCAT_ALV WITH HEADER LINE.
DATA : IT_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV.
DATA : IT_EVENT TYPE SLIS_T_EVENT,
WA_EVENT LIKE LINE OF IT_EVENT.
DATA : IT_HEADINGS TYPE STANDARD TABLE OF
SLIS_LISTHEADER WITH HEADER LINE.
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
Selection Screen. *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN, " Billing doc no
S_FKDAT FOR VBRK-FKDAT OBLIGATORY, " Billing date
S_MATNR FOR VBRP-MATNR. " Material no
SELECTION-SCREEN END OF BLOCK B1.
Event:Initialization *
INITIALIZATION.
V_REPID = SY-REPID.
S_FKDAT-LOW = SY-DATUM - 200.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
AT Selection Screen. *
AT SELECTION-SCREEN.
PERFORM VALIDATE_VBELN.
PERFORM VALIDATE_MATNR.
Event: Start-of-Selection *
START-OF-SELECTION.
PERFORM GET_VBRK_DATA.
PERFORM GET_VBRP_DATA.
Event: End-of-Selection *
END-OF-SELECTION.
PERFORM GET_EVENTS.
PERFORM FIELDCATALOG.
PERFORM LIST_DISPLAY.
FORM DEFINITIONS *
*& Form list_display
text
--> p1 text
<-- p2 text
FORM LIST_DISPLAY.
WA_LAYOUT-INFO_FIELDNAME = 'COLOR'.
WA_LAYOUT-TOTALS_TEXT = 'GRAND TOTAL'.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-KEY_HOTSPOT = 'X'.
WA_KEYINFO-HEADER01 = 'VBELN'.
WA_KEYINFO-ITEM01 = 'VBELN2'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'IT_VBRK'
I_TABNAME_ITEM = 'IT_VBRP'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
IS_KEYINFO = WA_KEYINFO
IS_PRINT =
IS_REPREP_ID =
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = IT_VBRK
T_OUTTAB_ITEM = IT_VBRP
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. " list_display
*& Form fieldcatalog
text
--> p1 text
<-- p2 text
FORM FIELDCATALOG.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*..Changing the fieldcatlog as required
LOOP AT IT_FIELDCAT.
CASE IT_FIELDCAT-FIELDNAME.
WHEN 'VBELN'.
IT_FIELDCAT-SELTEXT_L = 'Billing doc no'.
IT_FIELDCAT-SELTEXT_M = 'Bill No'.
IT_FIELDCAT-SELTEXT_S = 'Bill'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
OUTPUTLEN
WHERE FIELDNAME = 'VBELN'.
WHEN 'WAERK'.
IT_FIELDCAT-SELTEXT_L = 'SD document Currency'.
IT_FIELDCAT-SELTEXT_M = 'Document Currency'.
IT_FIELDCAT-SELTEXT_S = 'Currency'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'WAERK'.
WHEN 'VKORG'.
IT_FIELDCAT-SELTEXT_L = 'Sales Organisation'.
IT_FIELDCAT-SELTEXT_M = 'Sales Org'.
IT_FIELDCAT-SELTEXT_S = 'S,Org'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VKORG'.
WHEN 'VTEXT'.
IT_FIELDCAT-SELTEXT_L = 'Sales Organisation Name'.
IT_FIELDCAT-SELTEXT_M = 'Sales Org Text'.
IT_FIELDCAT-SELTEXT_S = 'S,Org'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VTEXT'.
WHEN 'FKDAT'.
IT_FIELDCAT-SELTEXT_L = 'Billing Date'.
IT_FIELDCAT-SELTEXT_M = 'Bill.Date'.
IT_FIELDCAT-SELTEXT_S = 'BDate'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'FKDAT'.
WHEN 'BUKRS'.
IT_FIELDCAT-SELTEXT_L = 'Company Code'.
IT_FIELDCAT-SELTEXT_M = 'Company'.
IT_FIELDCAT-SELTEXT_S = 'Comp'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'BUKRS'.
WHEN 'BUTXT'.
IT_FIELDCAT-SELTEXT_L = 'Company Name'.
IT_FIELDCAT-SELTEXT_M = 'Comp Text'.
IT_FIELDCAT-SELTEXT_S = 'Comp'.
IT_FIELDCAT-OUTPUTLEN = '25'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'BUTXT'.
WHEN 'NETWR'.
IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
IT_FIELDCAT-SELTEXT_S = 'Net Value'.
IT_FIELDCAT-OUTPUTLEN = '20'.
IT_FIELDCAT-DO_SUM = 'X'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
DO_SUM
WHERE FIELDNAME = 'NETWR'.
ENDCASE.
ENDLOOP.
PERFORM FIELDCAT_SECLIST.
ENDFORM. " fieldcatalog
*& Form sort_tab
text
--> p1 text
<-- p2 text
FORM SORT_TAB.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'VBELN'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
ENDFORM. " sort_tab
*& Form get_events
text
--> p1 text
<-- p2 text
FORM GET_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = IT_EVENT
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IT_EVENT INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
WA_EVENT-FORM = 'DISPLAY_HEADER'.
MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX.
ENDFORM. " get_events
*& Form DISPLAY_HEADER
text
--> p1 text
<-- p2 text
FORM DISPLAY_HEADER.
WRITE : /3 'Date : ',
10 SY-DATUM USING EDIT MASK '__/__/____',
35 'Intelligroup Asia Pvt. Ltd',
80 'Time : ',
90 SY-UZEIT,
/3 'User : ',
10 SY-UNAME,
30 SY-TITLE,
80 'Page : ',
90 SY-PAGNO.
ENDFORM. " DISPLAY_HEADER
*& Form VALIDATE_VBELN
text
--> p1 text
<-- p2 text
FORM VALIDATE_VBELN.
Validating Billing doc no
SELECT VBELN
INTO VBRK-VBELN
UP TO 1 ROWS
FROM VBRK
WHERE VBELN IN S_VBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE E010. " Invalid billing doc no
ENDIF.
ENDFORM. " VALIDATE_VBELN
*& Form VALIDATE_MATNR
text
--> p1 text
<-- p2 text
FORM VALIDATE_MATNR.
Validating material no
SELECT MATNR
INTO VBRP-MATNR
UP TO 1 ROWS
FROM VBRP
WHERE MATNR IN S_MATNR.
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE E018. " Invalid material number
ENDIF.
ENDFORM. " VALIDATE_MATNR
*& Form GET_VBRK_DATA
text
--> p1 text
<-- p2 text
FORM GET_VBRK_DATA.
To get Billing doc detials based on selections
SELECT V~VBELN
V~WAERK
V~VKORG
V~FKDAT
V~BUKRS
V~NETWR
T~VTEXT
C~BUTXT
INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
FROM VBRK AS V
INNER JOIN VBRP AS P
ON VVBELN = PVBELN
INNER JOIN TVKOT AS T
ON VVKORG = TVKORG
INNER JOIN T001 AS C
ON VBUKRS = CBUKRS
WHERE V~VBELN IN S_VBELN
AND V~FKDAT IN S_FKDAT
AND P~MATNR IN S_MATNR.
SORT IT_VBRK.
DELETE ADJACENT DUPLICATES FROM IT_VBRK COMPARING VBELN.
IF SY-SUBRC NE 0.
FG_NO_DATA = 'X'.
ENDIF.
ENDFORM. " GET_VBRK_DATA
*& Form GENERATE_SECLIST
text
--> p1 text
<-- p2 text
FORM GENERATE_SECLIST USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'. "DOUBLE CLICK
READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
ENDCASE.
ENDFORM. " GENERATE_SECLIST
*& Form FIELDCAT_SECLIST
text
--> p1 text
<-- p2 text
FORM FIELDCAT_SECLIST.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*..Changing the fieldcatlog as required
LOOP AT IT_FIELDCAT.
CASE IT_FIELDCAT-FIELDNAME.
WHEN 'VBELN2'.
IT_FIELDCAT-NO_OUT = 'X'.
IT_FIELDCAT-KEY = SPACE.
MODIFY IT_FIELDCAT TRANSPORTING NO_OUT
KEY
WHERE FIELDNAME = 'VBELN2'.
WHEN 'POSNR'.
IT_FIELDCAT-SELTEXT_L = 'Billing Iem no'.
IT_FIELDCAT-SELTEXT_M = 'Bill Item No'.
IT_FIELDCAT-SELTEXT_S = 'Item No'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
OUTPUTLEN
WHERE FIELDNAME = 'POSNR'.
WHEN 'FKIMG'.
IT_FIELDCAT-SELTEXT_L = 'Actual billed quantity'.
IT_FIELDCAT-SELTEXT_M = 'Billed Quantity'.
IT_FIELDCAT-SELTEXT_S = 'Bill.Qty'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'FKIMG'.
WHEN 'VRKME'.
IT_FIELDCAT-SELTEXT_L = 'Sales Unit'.
IT_FIELDCAT-SELTEXT_M = 'Sale unit'.
IT_FIELDCAT-SELTEXT_S = 'S.Unit'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VRKME'.
WHEN 'NETWR'.
IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
IT_FIELDCAT-SELTEXT_S = 'Net Value'.
IT_FIELDCAT-OUTPUTLEN = '20'.
IT_FIELDCAT-DO_SUM = 'X'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
DO_SUM
WHERE FIELDNAME = 'NETWR'.
WHEN 'MATNR'.
IT_FIELDCAT-SELTEXT_L = 'Material Number'.
IT_FIELDCAT-SELTEXT_M = 'Mat. Number'.
IT_FIELDCAT-SELTEXT_S = 'Mat. No'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'MATNR'.
WHEN 'ARKTX'.
IT_FIELDCAT-SELTEXT_L = 'Text for sales order item'.
IT_FIELDCAT-SELTEXT_M = 'Sale Order Text'.
IT_FIELDCAT-SELTEXT_S = 'SO Item text'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'ARKTX'.
ENDCASE.
ENDLOOP.
ENDFORM. " FIELDCAT_SECLIST
*& Form GET_VBRP_DATA
text
--> p1 text
<-- p2 text
FORM GET_VBRP_DATA.
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
INTO TABLE IT_VBRP
FROM VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN EQ IT_VBRK-VBELN.
ENDFORM. " GET_VBRP_DATA -
Interface for credit card settlement between Bank, Company n Employee
Hi Experts,
I am facing a situation, where in we need to develop a new interface for credit card settlement. The scenario is as follows. The company gives a corporate credit card to the employee who has gone on travel. The employee makes some official and a few personal expenses on that card. The bank processes the payments and sends the bill to the company for payment. The company pays the bill and then gets into recovery from the employee for the personla expenses that he has incurred.
Now we need to automate this with SAP travle management and would appreciate if you could help me out.
Do we have a standard interface for the same?
Regards
KabbyThis is a common process in Travel mgmt.
1. The Bank provides the Card transaction file daily and it will be placed in the application server, from where the daily file interface pgm uploads the transations in employees buffer.
2. employee uses the buffer transactions while creating expense report and using itemize button he will mention the personal expenses made using company credit card
3. while posting, appropriate entries are made i.e, Expense accounts are credited, credit card clearing account is debited, and personal expenses as well are debited.
Please mention the card company and the file format in which they provide the file.if it is Amex format files or CCD format files, we can use the standard interfaces available, otherwise you need to go for new interface development -
How to pass a structure in PL/SQL external proc.
This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Everything is working fine, except When there is a structure in OUT parameter.
My database version.
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - ProductionI have set up the listner.ora and tnsnames.ora and written a package called dbms_kernel32sb.
There are 9 program units.
1. CreateFile -- working fine
2. CloseFile -- working fine
3. GetSize -- working fine
4. FindFirstFile -- NOT working, because one OUT parameter has the structure type WIN32_FIND_DATA.
5. GetFileTime -- NOT working, because one OUT parameter has the structure type FILETIME
6. GetDiskFreeSpace -- working fine
7. GetDriveType -- working fine.
8. GetLastError -- working fine
9. ExecuteCommand -- working fine.
Here is the package specification:
CREATE OR REPLACE PACKAGE dbms_kernel32sb AS
Name: dbms_kernel32sb.pks
Author: Saubhik Banerjee
Date: 24th Jan 2011
Version: 1.0
Comment: This package is to implement some functionality from kernel32.dll.
Usng extproc
OPEN_EXISTING_FILE CONSTANT PLS_INTEGER :=3;
FILE_ATTRIBUTE_NORMAL CONSTANT PLS_INTEGER :=128;
DISABLE_FILE_SHARE_MODE CONSTANT PLS_INTEGER :=0;
NO_FILE_SECURITY_ATTRIBUTE CONSTANT PLS_INTEGER :=0;
NO_TEMPLATE_FILE CONSTANT PLS_INTEGER :=0;
GENERIC_FILE_ACCESS CONSTANT PLS_INTEGER :=0;
FILE_SIZE_HIGH CONSTANT PLS_INTEGER :=400000000;
EXECUTE_FILE CONSTANT VARCHAR2(4):='open';
PRINT_FILE CONSTANT VARCHAR2(5):='print';
NO_PARAMATER CONSTANT VARCHAR2(2):=' ';
FUNCTION CreateFile(pi_FileName VARCHAR2 --1, File name
,pi_DesiredAccess BINARY_INTEGER --2, Type of access required (read/write ect)
,pi_ShareMode BINARY_INTEGER --3, share mode
,pi_SecurityAttributes BINARY_INTEGER --4, securoty attribute
,pi_CreationDisposition BINARY_INTEGER --5, open existing, create new etc
,pi_FlagsAndAttributes BINARY_INTEGER --6, File attribute- normal
,pi_TemplateFile BINARY_INTEGER) --Not required.
Return BINARY_INTEGER;
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
Return BINARY_INTEGER;
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
pio_FileSizeHigh IN OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
,pio_Win32_Find_data OUT
WIN32_FIND_DATA
RETURN BINARY_INTEGER;
FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
,pio_FileCreationTime IN OUT FILETIME
,pio_LastAccessTime IN OUT FILETIME
,pio_LastWriteTime IN OUT FILETIME
RETURN BINARY_INTEGER;
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
,pio_SectorsPerCluster OUT BINARY_INTEGER
,pio_BytesPerSector OUT BINARY_INTEGER
,pio_NumberOfFreeClusters OUT BINARY_INTEGER
,pio_TotalNumberOfClusters OUT BINARY_INTEGER
RETURN BINARY_INTEGER;
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2;
FUNCTION GetLastError RETURN BINARY_INTEGER;
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2;
END dbms_kernel32sb;
Here is the package body:
CREATE OR REPLACE PACKAGE BODY dbms_kernel32sb AS
/* Name: dbms_kernel32sb.pkb
Author: Saubhik Banerjee
Date: 24th Jan 2011
Version: 1.0
Comment: This package is to implement some functionality from kernel32.dll.
Usng extproc
FUNCTION
CreateFile( pi_FileName VARCHAR2 --1
, pi_DesiredAccess BINARY_INTEGER --2
, pi_ShareMode BINARY_INTEGER --3
, pi_SecurityAttributes BINARY_INTEGER --4
, pi_CreationDisposition BINARY_INTEGER --5
, pi_FlagsAndAttributes BINARY_INTEGER --6
, pi_TemplateFile BINARY_INTEGER) --7
Return BINARY_INTEGER IS EXTERNAL LIBRARY kernel32 Name "CreateFileA"
PARAMETERS( pi_FileName STRING
, pi_DesiredAccess long
, pi_ShareMode long
, pi_SecurityAttributes long
, pi_CreationDisposition long
, pi_FlagsAndAttributes long
, pi_TemplateFile long
, return long);
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
Return BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 Name "CloseHandle"
PARAMETERS (pi_FileHandle long, return long);
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
pio_FileSizeHigh IN OUT BINARY_INTEGER)
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetFileSize"
PARAMETERS (pi_FileHandle long, pio_FileSizeHigh long, return long );
FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
,pio_FileCreationTime IN OUT FILETIME
,pio_LastAccessTime IN OUT FILETIME
,pio_LastWriteTime IN OUT FILETIME
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetFileTime"
WITH CONTEXT
PARAMETERS ( CONTEXT,
pi_FileHandle long
, pio_FileCreationTime OCIColl
, pio_FileCreationTime INDICATOR SHORT
, pio_LastAccessTime OCIColl
, pio_LastAccessTime INDICATOR SHORT
, pio_LastWriteTime OCIColl
, pio_LastWriteTime INDICATOR SHORT
, return long );
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
,pio_Win32_Find_data OUT
WIN32_FIND_DATA
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "FindFirstFileA"
--WITH CONTEXT
PARAMETERS
( --CONTEXT,
pi_FileName STRING--, pi_FileName INDICATOR SHORT
, pio_Win32_Find_data BY REFERENCE OCIColl--,pio_Win32_Find_data INDICATOR long
, return long );
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
,pio_SectorsPerCluster OUT BINARY_INTEGER
,pio_BytesPerSector OUT BINARY_INTEGER
,pio_NumberOfFreeClusters OUT BINARY_INTEGER
,pio_TotalNumberOfClusters OUT BINARY_INTEGER
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetDiskFreeSpaceA"
PARAMETERS ( pi_RootPathName STRING
, pio_SectorsPerCluster BY REFERENCE long
, pio_BytesPerSector BY REFERENCE long
, pio_NumberOfFreeClusters BY REFERENCE long
, pio_TotalNumberOfClusters BY REFERENCE long
, return long );
FUNCTION GetDriveTypeA( pi_driveLetter VARCHAR2) RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetDriveTypeA"
PARAMETERS (pi_driveLetter STRING, RETURN long);
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2 IS
BEGIN
CASE GetDriveTypeA(pi_driveLetter)
WHEN 2 THEN RETURN 'Removable';
WHEN 3 THEN RETURN 'Drive Fixed';
WHEN 4 THEN RETURN 'Remote';
WHEN 5 THEN RETURN 'Cd-Rom';
WHEN 6 THEN RETURN 'Ram disk';
ELSE RETURN 'Unrecognized';
END CASE;
END;
FUNCTION GetLastError RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetLastError"
PARAMETERS (return long);
FUNCTION ShellExecute( pi_Hwnd BINARY_INTEGER
,pi_Operation VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
,pi_ShowCmd BINARY_INTEGER
) RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY SHELL32 NAME "ShellExecuteA"
PARAMETERS (pi_Hwnd long,pi_Operation STRING,pi_FileName STRING
,pi_Parameters STRING,pi_DefaultDirectory STRING
,pi_ShowCmd long, return long
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
,pi_FileName VARCHAR2
,pi_Parameters VARCHAR2
,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2 IS
v_return_val BINARY_INTEGER;
BEGIN
v_return_val:= ShellExecute(0,pi_OperationType
,pi_FileName,pi_Parameters
,pi_DefaultDirectory,0
IF v_return_val <=32 THEN
RETURN 'Error!';
ELSE RETURN 'Success!';
END IF;
END;
END dbms_kernel32sb;
Now the working demos:
SQL> SET SERVEROUT ON
SQL> /* Demo I:- How to obtain file size */
SQL> DECLARE
2 v_FileSize BINARY_INTEGER;
3 v_FileSizeHigh PLS_INTEGER;
4 v_FileHandle BINARY_INTEGER;
5 v_filename VARCHAR2(500) :='C:\test2.csv';
6 v_dummy BINARY_INTEGER;
7 BEGIN
8 v_FileSizeHigh := DBMS_KERNEL32SB.FILE_SIZE_HIGH;
9 v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
10 ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
11 ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
12 ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUT
13 ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
14 ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
15 ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
16 v_FileSize := DBMS_KERNEL32SB.Getsize(v_FileHandle, v_FileSizeHigh)
17 DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_FileSize);
18 v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
19 END;
20 /
File Size in Bytes: 61
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo II:- How to find free disk space */
SQL> DECLARE
2 v_rootpath VARCHAR2(500) :='C:\';
3 v_dummy BINARY_INTEGER;
4 v_sectorspercluster BINARY_INTEGER;
5 v_bytespersector BINARY_INTEGER;
6 v_numberoffreeclusters BINARY_INTEGER;
7 v_totalnumberofclusters BINARY_INTEGER;
8 v_freespace NUMBER;
9 v_totalspace NUMBER;
10 BEGIN
11 v_dummy:=DBMS_KERNEL32SB.GetDiskFreeSpace(v_rootpath
12 ,v_sectorspercluster
13 ,v_bytespersector
14 ,v_numberoffreeclusters
15 ,v_totalnumberofclusters
16 );
17
18 DBMS_OUTPUT.put_line('Sector pre Cluster: ' ||v_sectorspercluster);
19 DBMS_OUTPUT.put_line('Bytes per sector: ' ||v_bytespersector);
20 DBMS_OUTPUT.put_line('Number Of Free Clusters: ' ||v_numberoffreeclusters);
21 DBMS_OUTPUT.put_line('Total Number Of Clusters: ' ||v_totalnumberofclusters);
22 v_freespace:=v_numberoffreeclusters/1024/1024/1024;
23 v_freespace:=ROUND(v_freespace*v_sectorspercluster*v_bytespersector,3);
24 v_totalspace:=v_totalnumberofclusters/1024/1024/1024;
25 v_totalspace:=ROUND(v_totalspace*v_sectorspercluster*v_bytespersector,3);
26 DBMS_OUTPUT.put_line('Total Space (GB):' ||v_totalspace);
27 DBMS_OUTPUT.put_line('Total number of Free space (GB): '||v_freespace );
28 END;
29 /
Sector pre Cluster: 8
Bytes per sector: 512
Number Of Free Clusters: 739477
Total Number Of Clusters: 9765622
Total Space (GB):37.253
Total number of Free space (GB): 2.821
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo IV:- How to get drive type*/
SQL> SELECT dbms_kernel32sb.GetDriveType('C:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('C:\')
Drive Fixed
SQL> SELECT dbms_kernel32sb.GetDriveType('D:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('D:\')
Cd-Rom
SQL> SELECT dbms_kernel32sb.GetDriveType('E:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('E:\')
Unrecognized
SQL>
SQL> /* Demo V:- How to execute an Operating System Command*/
SQL> DECLARE
2 v_FileToExecute VARCHAR2(20):='test.bat';
3 v_Parameter VARCHAR2(20):='test1.csv';--dbms_kernel32sb.NO_PARAMATER
4 v_DefaultDirectory VARCHAR2(20):='C:\';
5 v_ReturnValue VARCHAR2(20);
6 BEGIN
7 v_ReturnValue:=dbms_kernel32sb.ExecuteCommand(dbms_kernel32sb.EXECUTE_FILE
8 ,v_FileToExecute
9 ,v_Parameter
10 ,v_DefaultDirectory
11 );
12 DBMS_OUTPUT.put_line('Status: '||v_ReturnValue);
13 END;
14 /
Status: Success!
PL/SQL procedure successfully completed.
SQL> Now the sub programs with structures are NOT getting called successfully.
SQL> /* Demo III:- How to obtain file time */
SQL> DECLARE
2 v_FileHandle BINARY_INTEGER;
3 v_filename VARCHAR2(500) :='C:\test2.csv';
4 v_dummy BINARY_INTEGER;
5 v_filecreationtime FILETIME;
6 v_lastaccesstime FILETIME;
7 v_lastwritetime FILETIME;
8 v_err BINARY_INTEGER;
9 BEGIN
10 v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
11 ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
12 ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
13 ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUTE
14 ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
15 ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
16 ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
17 v_dummy := DBMS_KERNEL32SB.GetFileTime( v_FileHandle
18 ,v_filecreationtime
19 ,v_lastaccesstime
20 ,v_lastwritetime
21 );
22 v_err:=DBMS_KERNEL32SB.GetLastError;
23 DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_dummy);
24 DBMS_OUTPUT.put_line('Error:'||v_err);
25 v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
26 END;
27 /
File Size in Bytes: 0
Error:203
PL/SQL procedure successfully completed.
SQL> So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.
CREATE OR REPLACE TYPE FILETIME_rec IS OBJECT
( LowDateTime NUMBER
,HighDateTime NUMBER
CREATE OR REPLACE TYPE FILETIME IS TABLE OF FILETIME_rec;Edited by: Saubhik on Feb 1, 2011 4:15 PMSaubhik wrote:
This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Interesting. Familiar with the Wn32 API, but do not run Oracle on Windows and never looked at this aspect of integration.
So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.The problem is that this passes the parameter by reference and not value. In a vanilla C/C++/Delphi program, you will create a variable of that struct and then pass a long pointer to that variable when making the API call. That pointer will be dereferenced and the memory it points to, populated. This is not a problem as the underlying DLL you call that does this, uses your process's data segment.
Extproc is different. In order to protect the integrity of the database server process, an external call is done by a "proxy" process. It acts as the interface between your PL/SQL code and the actual external call.
In this case, this "proxy" process will be doing the implicit LoadLibrary() call to load kernel32.dll interface - and the DLL will expect to dereference and access this process's memory struct to populate it. This "proxy" process in turn needs to know that despite it calling the interface by reference, it needs to return that parameter to PL/SQL by value - as your PL/SQL code cannot dereference a pointer passed back by that "proxy" process and access its memory to gain access to that struct.
In basic terms - that argument is a 32 bit number containing a pointer. That is what the "proxy" process needs to pass to the interface call. Your code is passing a struct and not a pointer, right?
And that is the basic problem I believe. How to address this.. not sure. You can have your own DLL as interface that does not use pointers but expect arguments to be passed by value. But this will suck as you then need to include a custom DLL to deploy and have PL/SQL call that, instead of simply accessing and calling the native kernel interface.
Doubt that many Win32 programmers with OCI (Oracle Call Interface) frequents this forum. So perhaps this is not the best place to ask. I would be hitting Metalink (support.oracle.com) search function in your sho3s though as there should be support notes dealing with this subject matter. -
Problem in Manager.createPlayer()
hi to all,i have some problem in javax.media.Player interface.
javax.swing.JFileChooser jfc=new javax.swing.JFileChooser();
int res=jfc.showOpenDialog(null);
if(res==javax.swing.JFileChooser.APPROVE_OPTION){
URL mediaURL = null;
try
// get the file as URL
mediaURL = new URL("file",null,jfc.getSelectedFile().getAbsolutePath());
} // end try
catch ( MalformedURLException malformedURLException )
System.err.println( "Could not create URL for the file" );
javax.media.MediaLocator ml=new javax.media.MediaLocator(mediaURL);
try {
player = Manager.createRealizedPlayer(ml);
} catch (NoPlayerException noplayer) {
System.out.println("No player "+noplayer);
// TODO: handle exception
}catch(CannotRealizeException cant){
System.out.println("Cannot "+cant);
catch(java.io.IOException ioe){
System.out.println("Error "+ioe);
In above code,
player=Manager.createPlayer(ml);
is not working , it shows exception : NoPlayer exception is raised.
What can i do for run the video file. Any one give me good suggestion for me..
Reply as soon as possible,
Thanking you,
Azharudeen Ahmed M.Sc
[email protected]>
how to use all the formats in JMF....>Ahhh.. (sighs) the 'learning curve of media'.
The answer is both simple (to say) and complex (to program).
To play 'all formats' simply write a decoder for any format that JMF does not support 'out of the box', as well as any formats to be released.
I think the reason people are fooled into thinking it is 'easy' to play all formats is that the Win. media player has a very clever mechanism to pretend that it can. If the Win. media player encounters a format it does not understand, it opens a connection back to microsoft, and tells MS what the file reports as its format, in the hope that the MS website can provide the decoders 'on the fly'.
That is one way to provide support for (previously unknown) formats.
Java (or rather, the JMF) uses a different mechanism to add new formats, the Service Provider Interface - I doubt it would be compatible with active downloading of the new decoders, as the Services for JMF need to be registered at application start-up.
The FMJ (note the reversal of letters) is a project aimed at providing the 'extra' encoding support for more formats, but even it does not cover 'every format'.
To be blunt, I would not use JMF for a 'general player' like you seem to want. JMF is good for dealing with media over which you have total control, and can thereby encode the media in whatever format that is compatible with JMF, best suits your application.
As far as a general player of 'anything the user might throw into it', JMF fails badly. :-( -
Driver for NATO custom storage device
Hello,
We need a POC to discuss development of a driver for download of imagery data from aircraft Removable Memory Module (RMM) to NATO ground stations using Sun/ Solaris workstations. A new NATO STANAG (standard) is being developed which defines the interface. It includes electrical and command protocol (SCSI III over FC PLDA) and a unique file system. Initial tests revealed that SUN OS was not able to download data from the RMM unless the a label was placed in the RMM directory but writing to the RMM is not allowed by the STANAG so a custom driver is needed.
Thank you,
Tom Canniere
SAIC PM for NATO Advanced Data Storage Interface Pgm.Did you ever get a reply to this?
-
Content Type Column Names with same display Name ???
Hi everyone,
I have a SharePoint Sitecollection where are Site Column Display Names are the same (see Image)
If I view the URL links, the internal names are different, that's ok.
But how is this possible ? You can't rename the columns with existing names ?
Thanks
StephanLike Enrique I would say these werent created via the interface. Doubt a migration would have done anything only Lookups seem to be duplicating. Could these be used in a form of some kind?
If this is helpful please mark it so. Also if this solved your problem mark as answer. -
Hi,
just received my new iPod shuffle Second Generation. Everything’s great, but when I plug it into my Xbox 360, it isn’t showing up! Nano and Shuffle First Generation works! Please help me.
Thanks a lot.
iPod shuffle (Second Generation) Windows XPFlash drives work, nanos work, video iPods work, other old dock-connector ipods work, 1st gen shuffles work, but I don't believe the 2nd gen shuffle will work. As I recall, the 2nd gen shuffle cannot be used, like the 1st gen, as an external data flash drive in addition to its iPod music functions. And that's all the 360 does is see any iPod as an external USB storage device, with a tiny bit of extra effort to resolve the filing hierarchy on the iPod. The 2nd shuffle connects via a proprietary USB2 interface; I doubt the 360 sees it as a USB device.
But yes you do need the the free iPod update from the Xbox Live Marketplace to play unprotected AAC files on an iPod. It's free, takes about a minute to download, and then it just works.
But for hard-drive based iPod owners, I wouldn't use them with my 360. I was leery of using it because there was no clean way to unmount the iPod once you've plugged it in -- you have to switch the 360 off to get the iPod out of connected mode -- so I connected my 3rd gen iPod instead of my iPod video. The 360 keeps the iPod hard drive spun up all the time. Obviously, this will zip through the battery in no time, if you have a 3rd gen iPod that will sync over USB2 but not charge; and iPods weren't really meant to work this way. They're meant to spin up the drive, copy music to an onboard RAM cache, then spin down the drive and play out of the cache -- not spin the drive at full speed all the time. My iPod got blazingly hot connected to my 360, so I never did it again. I either stream music off my Mac to the 360 -- or when an online game is so network traffic intensive, like Gears of War, that that won't work and the stream stops, I bought for $28 a Lexar 512MB Jump Drive, and I just rotate songs out on that. Works great, holds around a 100 songs, selects as Portable Device under the music source, and doesn't suffer from network traffic issues. -
Iphone with Bluetooth Keyboards
I have an Stowaway Ultra-Slim Bluetooth Keyboard that worked very well with my Treo 680. Now, I replaced the Treo (regretfully I sold it) for the Iphone, and I cannot make it work with the portable keyboard. I guess it is related with the lack of drivers for Iphone. Does somebody knows another portable keyboard that works with Iphone ? Thank you.
At the moment, no Bluetooth device aside from a headset will work with an iPhone.
Given Apple's stance on revolutionary technologies and natural interfaces, I doubt that's likely to change. -
INTERFACE DETERMINATION AND RECEIVER DETERMINATION DOUBTS???
Hi Team
I am having doubts regarding the Interafce Determination and the receiver determination. In pur landscape in our objects, some times i am seeing a Condition is being defined in the Interafce Determination and sometimes am seeing a Condition is being defined in the receiver determination . could you please let me know the differences between the above two.
thanx in advance.Hi Nabhinav,
Condtions in receiver determination - These conditions are evaluated and executed to determine the receivers for this incoming message.
Condtions in Interface determination - These conditions are evaluated and ececuted to determine the Interface mapping to be called in order to map the source message to the target message.
Please take a loot at these links for more details:
http://help.sap.com/saphelp_srm50/helpdata/en/26/5ccd3bb4560f01e10000000a11402f/content.htm
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce2a8e3a8e5430e10000000a42189b/content.htm
Also, search the SDN before posting you query.
Regards, Gaurav. -
hi all,
i have 2 doubts in interfaces in OO ABAP
1. do all the methods in interface are by default abstract
2. do all the methods have to be compulsorily implemented
Regards,
N ManjrekarHi,
No all methods in interface are not default abstract.
i think all the methods of interfaces have to be implemented in the class.oterwise u will get error implementation missing for method.
Regards,
Sruthi -
Hi,
When a class implement an interface,the method of the class should thorugh the same exception or any of its subclass exception or any different exception,as that of the exception declared on the abstarct method of the interface.
Please any one solve my doubt as early as possible.
Thanks
VishHi,
When a class implement an interface,the method of
the class should thorugh the same exception or any of
its subclass exception or any different exception,as
that of the exception declared on the abstarct method
of the interface.
Is this supposed to be multiple choice?
The easiest way for you to answer this question is to try it out yourself in code.
Maybe you are looking for
-
I have a season pass to Dr Who and all 30+ other shows purchased on iTunes work great. Last night's episode (Hide) has a hissing sound so loud it drowns out all the audio in the show when i try to watch it on my Apple TV. I then downloaded the episo
-
Hi All, At the time of installing Desktop ADI I encountered with follwing error. An Unexpected Error Has Occurred in ADI: Routine: MAINGLDI: DoSignOn Source: oraGLDI32 Message: Object variable or With block variable not set Error Number: 91 It is rec
-
Retriving com class error in add-on client machine
Dear all, i got error com class error when i start the add-on. The add-on working good all systems except two client system. Thanks & Regards B.Lakshmi narayanan
-
Image resizes when imported or placed into InDesign
I'm having a problem with placing images into Indesign. The problem is random but sometimes when I place an image or drag it from my library into indesign the scale changes. It should place at 100% both horizontally and vertically but not always. whe
-
Hello, This is not a wild cry of anger about Location services such as iCloud, I think that they are brilliant, and that is exactly my point. At the moment I am unable, however hard I try, to find my Mac Book Pro on iCloud when I am at home, presumab