Table Name in a form
Hi experts,
I'm new in SDK.
In a bubble event how can i now the table name associated to a form?...
Ex. Form "150" --> Table Name "OITM"
Form "133" --> Table Name "OINV"
Form "139" --> Table Name "ORDR"
Any help will be appreciated
Augusto Silva
Augusto,
Infelizmente não tens métodos que te permitam percorrer as colecções do B1. Se tivesses, podias facilmente identificar o que pretendes (ID de um determinado tipo de objecto, num formulário)...
Penso que a única alternativa é a que já te foi avançada.
Cumprimentos,
Vítor Vieira
In english:
Unfortunately, there are no specific methods to iterate B1 collections. If there were, you could easily know what you need (the ID of a specific type of object, in a form)...
A guess the only alternative is the one already pointed out.
Regards,
Vítor Vieira
Similar Messages
-
Reg Table name for Menu / Form Details
What is the Table name having the Menu name and Menu ID details for all modules?
Hi,
AFAIK this information is not stored in the database, appart from a fiew that are in the OADM table (PorName, RpdName, PdnName...). I think that this info is stored in a C++ library (don´t remember the name now).
Perhaps if you ask what the objetive is we could help you with a workaround.
Regards,
Ibai Peñ -
Can we find the table name from the form
note:without using the property palette
poelger is right, use GET_BLOCK_PROPERTY either with QUERY_DATA_SOURCE_NAME for the Query-table or with DML_DATA_TARGET_NAME for the DML-target
-
Source table name on ? ? level
hi
I would like to store in Java Variable source table name on <? ?> level.
<?
String table_name = Source_Table_Name;
?>
When I use:
<?
String p = "<%=odiRef.getSrcTablesList("", "[TABLE_NAME]", ", ", "")%>";
?>
then this code is translated to:
<?
String p = "<?=snpRef.getObjectShortName("L", "TABLE1", "SCHEMA1", "D")";
?>
where TABLE_NAME is already replaced to TABLE1. (the same happens when I use <%=odiRef.getFrom()%>
Thanks in advance
MarcinI had success using a regular expression to remove everything from the <?...?> expression before and after the table name.
Something like this might work.
<%
// Get the source table for this interface. A check will be added to verify that only one exists.
String srcTableCall = odiRef.getSrcTablesList(0, "", "[TABLE_NAME]", "", "");
// srcTableCall returns a string like <?=snpRef.getObjectShortName("L","<TableName>","<Physical Architecture>","D")?>. We have to use a pair
// of regular expressions to isolate the table name in a form that can be used to manipulate another string.
String srcTable = srcTableCall.replaceFirst ("^.*getObjectShortName.......", "").replaceFirst(".,.*$", "");
// The onClause is the mappings marked with UD1.
String onClause = odiRef.getColList("", "\tT.[COL_NAME] = [EXPRESSION]", "\n\tand\t", "", "UD1");
out.println ("onClause before substitution is " + onClause );
// Replace the source table in each EXPRESSION with S. This doesn't work like I think it should.
onClause = onClause.replace (srcTable, "S");
out.println ("onClause with substitution is " + onClause);
%> -
Hi, you all.
I'm making new security module for a system made in oracle forms, and when I tryied identify all tables used in one form I realized it will take me a lot of time, because there are more than 500 forms!
There is a way to find tables names in all *.fmb files at the same time and to show me if it is SELECT, INSERT, DELETE or UPDATE?
Thanks.not that i know of. you can use hibernate to generate tables from objects, but I don't know about swing.
geez, why would you want to? if that's all you want, better to write VB. personally, i don't think that tightly coupling UI and database elements that tightly is a very good idea. sounds brittle; no layering.
% -
How to find table name and field name in JSP FORM
Hi
In JSP form's like XML publisher responsibility>templet
In that form how can we see the system-last query . and how to see the table namehi yamini,
plz go to help->record history (for fining table name)
and
help->diagnostic->examine (for finding field name)& enter last_query
in JSP form also same above only i think.
or check in back end & apply who columns
Edited by: raghava bandi on Nov 7, 2008 2:05 AM -
Search table names in forms.fmb?
hello every one
i need to delete some tables from schema but i didn't know if this table used by some forms or not.
so i asked if there program can i give it the table name and the directory that contains forms.fmb
and this program return the forms that used the table.thanks
its worked now
Edited by: Mohamed Sife on 08/05/2009 10:29 م -
How to build Form or Report on different table name
Hi,
I want to know, is it possible to query data from a different tables with same structure.
For example:
I have tables tableA, tableB ....
What I want is to select table name from combo box and
after that to query data for the chosen table.
So is it possible anyway to build a form or report without knowing the table name during the design ?
ThanksHello Boris,
The way you can make this work is like this:
You need to create a view (say vw_2Tables)whose source is like
select "table_A" tableName, col1,col2,... from table_A
union
select "table_B" tableName, col1,col2,... from table_B
Then create the Report based on this view:
select tableName, col1, col2
from vw_2tables
where tableName = :P_tablename;
This will make the Portal create a bind parameter for you.
Create an LOV whose Select statement is
select "table_A" tableName from dual
union
select "table_B" tableName from dual
And add this LOV to the bind parameter source in Report
(in Customization Tab).
You need to run this Report in customize mode
(if your report name is say Rep_1
then this will be http://...../Rep_1.show_parm)
Hope this helps
Madhav -
Creating a form with variable table name(s)
Hi,
I am building a form that will allow user(s) switch to other user
(s) dynamically. I have been able able to do this by creating a
non-database table and use record group to read from the base
table of each user.(All the tables in question have the same
structure).
Record group is a read only, and I want to be able to do data
maninpulation with this form.
The questions are
(1) It possible to do data manipulation with record group and if
it is, how?
(2) Is it possible to build a form with a variable table name?
if possible, how?
Somebody pls help.
Thanks,
Olutunde.
nullOlutunde Babarinsa (guest) wrote:
: Hi,
: I am building a form that will allow user(s) switch to other
user
: (s) dynamically. I have been able able to do this by creating a
: non-database table and use record group to read from the base
: table of each user.(All the tables in question have the same
: structure).
: Record group is a read only, and I want to be able to do data
: maninpulation with this form.
: The questions are
: (1) It possible to do data manipulation with record group and
if
: it is, how?
: (2) Is it possible to build a form with a variable table name?
: if possible, how?
: Somebody pls help.
: Thanks,
: Olutunde.
Hi,
you can create and manipulate record groups at runtime(see Forms
Reference 'Create_Group' and 'Add_Group_Row') don't use
Create_Group_from_Query. For your purpose it's better to build a
cursor loop on your Query and add your datas after
manipulating with 'Add_Group_Row' to your Record Group.
It's possible to SET_BLOCK_PROPERTY(QUERY_DATA_SOURCE_NAME) but
it's not possible to change the item property 'Column Name'.
Therefor I would suggest to build a non database block and
populate these block by a programm unit, which works with a
pl/sql cursor loop and the 'create record' to populate these
block.
null -
Regarding finding the table name for a field in R12 forms
Hi all,
I need to know how to find the table name for a field in R12. I am working on extracting the employee information but i need to know how to get the table names for the fields.
Thank you,
rajPlease see these threads.
How to find table name in ebs
How to find table name in ebs
E-Business tables
E-Business tables
Thanks,
Hussein -
How to know primary key column name form a table name in sql query
Suppose I only know the table name. How to get its primary key column name from the table name?
ThanksViews don't have primary keys though their underlying tables might. You'd need to pick apart the view to determine where it's columns are coming from.
You can select the text of the view in question from user_views. -
Field and table names requested for BAPI_INCOMINGINVOICE_CREATE
Hi all,
The following data is being hardcoded in BAPI_INCOMINGINVOICE_CREATE functional module for testing the functioning of this bapi. Now kindly suggest me how to make this BAPI useful for all PO's. the following data is being passed into BAPI for generation of invoice. Kindly provide technical names along with table names for the following fields.
HEADERDATA
INVOICE_IND X
DOC_TYPE RE
DOC_DATE 24.07.2007
PSTNG_DATE 24.07.2007
REF_DOC_NO 5000000940
COMP_CODE ACW
CURRENCY INR
GROSS_AMOUNT 33,750.0000
CALC_TAX_IND X
BLINE_DATE 24.07.2007
iTEM DATA
INVOICE_DOC_ITEM 000001
PO_NUMBER 10070100
PO_ITEM 00001
TAX_CODE V0
ITEM_AMOUNT 33,750.0000
SHEET_NO 1000002022
ITEM_TEXT SDFDS
SHEET_ITEM 0000000001
Thanx in advance.
KrishnaHi I have taken particular PO and Executed the code. It is generating the Invoice Document No. Now it want to remove all the Hardcoding. Code i have used is as follows. How do i remove the hardcoding ?? send meif sample code is available???
Internal table declaration *
DATA: gt_headerdata TYPE STANDARD TABLE OF bapi_incinv_create_header
INITIAL SIZE 0,
gt_itemdata TYPE STANDARD TABLE OF bapi_incinv_create_item
INITIAL SIZE 0,
gt_accountingdata TYPE STANDARD TABLE OF bapi_incinv_create_account
INITIAL SIZE 0,
gt_return TYPE STANDARD TABLE OF bapiret2
INITIAL SIZE 0.
DATA: gs_headerdata LIKE bapi_incinv_create_header.
DATA: gs_itemdata LIKE bapi_incinv_create_item.
DATA: gs_accountingdata TYPE bapi_incinv_create_account.
DATA: gs_return TYPE bapiret2.
DATA: l_date TYPE sy-datum.
l_date = sy-datum - 15.
Error flag *
DATA: l_errflag(1) TYPE c.
Build Invoice header
Document Type (Invoice)
gs_headerdata-invoice_ind = 'X'.
gs_headerdata-doc_type = 51.
Document Date
gs_headerdata-doc_date = l_date.
Posting Date
gs_headerdata-pstng_date = l_date.
Reference Document No
gs_headerdata-ref_doc_no = 323348.
gs_headerdata-gross_amount = 31.
Currency
gs_headerdata-currency = 'USD'.
Company Code
gs_headerdata-comp_code = 'D3'.
Baseline Date
gs_headerdata-bline_date = l_date.
**Tax Indicator
*gs_headerdata-calc_tax_ind = 'X'.
Build order item(s) - Only 1 is used in this example
Document Item
gs_itemdata-invoice_doc_item = 000001.
Purchase Order Number
gs_itemdata-po_number = 3700000011.
Purchase Order Item
gs_itemdata-po_item = 00010.
Quantity
gs_itemdata-quantity = 31.
gs_itemdata-po_unit = 'Z00'.
Item Amount
gs_itemdata-item_amount = 31.
gs_itemdata-tax_code = 'O0'.
gs_itemdata-taxjurcode = '0100000000'.
APPEND gs_itemdata TO gt_itemdata.
Document Item
*gs_itemdata-invoice_doc_item = '00002'.
Purchase Order Number
*gs_itemdata-po_number = '4700000158'.
Purchase Order Item
*gs_itemdata-po_item ='00020' .
Quantity
*gs_itemdata-quantity = '5'.
*gs_itemdata-po_unit = 'Z00'.
Item Amount
*gs_itemdata-item_amount = '5'.
*gs_itemdata-tax_code = 'O0'.
*gs_itemdata-taxjurcode = '0100000000'.
*APPEND gs_itemdata TO gt_itemdata.
Accounting Data
***gs_accountingdata-costcenter = 'DUMMY CCTR'.
*gs_accountingdata-invoice_doc_item = '00001'.
*gs_accountingdata-xunpl = 'X'.
*gs_accountingdata-tax_code = 'O0'.
*gs_accountingdata-taxjurcode = '0100000000'.
*gs_accountingdata-ITEM_AMOUNT = 100.
*gs_accountingdata-gl_account = '0003805101'.
*APPEND gs_accountingdata TO gt_accountingdata.
*CLEAR :gs_accountingdata.
*Call the BAPI to Create the Return Order
data: gv_INVOICE type BAPI_INCINV_FLD-INV_DOC_NO,
gv_YEAR type BAPI_INCINV_FLD-FISC_YEAR.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
headerdata = gs_headerdata
IMPORTING
INVOICEDOCNUMBER = gv_INVOICE
FISCALYEAR = gv_YEAR
TABLES
return = gt_return
itemdata = gt_itemdata.
accountingdata = gt_accountingdata.
PERFORM error.
Check and write Return table
FORM error.
LEAVE TO LIST-PROCESSING.
CLEAR l_errflag.
LOOP AT gt_return INTO gs_return.
WRITE: / gs_return-type, gs_return-message(200).
IF gs_return-type = 'E'.
l_errflag = 'X'.
ENDIF.
ENDLOOP.
PERFORM commit.
ENDFORM. " ERROR INPUT
No errors - Commit
FORM commit.
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDFORM. " COMMIT INPUT
Thanks in advance
Krishnasri -
hi frds
Give me table name and field name of OPEN PO QUANTITY ..
thanks
Pari Vendhan.RSee the sample code for the open PO's based on Vendor
and do accordingly
*& Report ZMM_PO_REPORT
REPORT ZMM_PO_REPORT message-Id yb
NO STANDARD PAGE HEADING
LINE-COUNT 60(1)
LINE-SIZE 230.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master
t161, " PO Doc Types
t024, " Purchase Groups
ekko. " PO Header
T Y P E S D E C L A R A T I O N S
Purchase Orders Main Structure
TYPES: BEGIN OF s_po,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bukrs TYPE bukrs, " Company Code
bsart TYPE bbsrt, " PO Type
lifnr TYPE lifnr, " Vendor No
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
END OF s_po.
Purchase Orders History Structure
TYPES: BEGIN OF s_account,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
gjahr TYPE mjahr, " Fiscal Year
belnr TYPE mblnr, " PO Invoice No
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Local Currency
dmbtr TYPE dmbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
shkzg TYPE shkzg, " Dr/Cr Indicator
END OF s_account.
Purchase Orders History Structure(Item Sum)
TYPES: BEGIN OF s_inv_sum,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
END OF s_inv_sum.
Purchase Orders Main Structure
TYPES: BEGIN OF s_rep,
lifnr TYPE lifnr, " Vendor No
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bsart TYPE bbsrt, " PO Type
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
name1 TYPE name1, " Plant
orewr TYPE netpr, " To be Invoiced Price
curr TYPE waers, " Inv Doc Currency
END OF s_rep.
D A T A D E C L A R A T I O N S
DATA: gv_title1 TYPE sylisel, " Report title
gv_dial. " Color flag
C O N S T A N T S D E C L A R A T I O N S
CONSTANTS: c_x VALUE 'X', " Flag X
c_h VALUE 'H', " Debit
c_vgabe TYPE vgabe VALUE '2'. " Transaction Type
I N T E R N A L T A B L E S D E C L A R A T I O N S
DATA: i_po TYPE STANDARD TABLE OF s_po WITH HEADER LINE,
" Purchase Order
i_inv TYPE STANDARD TABLE OF s_inv_sum WITH HEADER LINE,
" PO Invoice Values
i_rep TYPE STANDARD TABLE OF s_rep WITH HEADER LINE,
" PO Invoice Values
i_ekbe TYPE STANDARD TABLE OF s_account WITH HEADER LINE.
" PO Invoice Values
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr MATCHCODE OBJECT kred,
s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
s_bsart FOR t161-bsart,
s_ekgrp FOR t024-ekgrp,
s_bedat FOR ekko-bedat.
SELECTION-SCREEN END OF BLOCK b1.
I N I T I A L I Z A T I O N *
INITIALIZATION.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_screen.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P - O F - P A G E *
TOP-OF-PAGE.
Header of the List
PERFORM header.
E N D - O F - P A G E *
Footer
END-OF-PAGE.
ULINE.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
Display the Report Output data
PERFORM display_data.
At Line-Selection
AT LINE-SELECTION.
When double clicked on EBELN display the details of Purchase Doc
PERFORM line_sel.
*& Form validate_screen
Validation of Selection Screen fields
FORM validate_screen .
Validation of Vendor Number
CLEAR lfa1-lifnr.
IF NOT s_lifnr[] IS INITIAL.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
ENDSELECT.
IF sy-subrc 0.
MESSAGE e000 WITH 'Invalid Vendor'(002).
ENDIF.
ENDIF.
Validation of PO Number
CLEAR ekko-ebeln.
IF NOT s_ebeln[] IS INITIAL.
SELECT ebeln UP TO 1 ROWS
INTO ekko-ebeln
FROM ekko
WHERE ebeln IN s_ebeln.
ENDSELECT.
IF sy-subrc 0.
MESSAGE e000 WITH 'Invalid Document Number'(003).
ENDIF.
ENDIF.
Validation of PO Document Type
CLEAR t161-bsart.
IF NOT s_bsart[] IS INITIAL.
SELECT bsart UP TO 1 ROWS
INTO t161-bsart
FROM t161
WHERE bsart IN s_bsart.
ENDSELECT.
IF sy-subrc 0.
MESSAGE e000 WITH 'Invalid Purchase Document Type'(004).
ENDIF.
ENDIF.
Validation of Purchasing Group
CLEAR t024-ekgrp.
IF NOT s_ekgrp[] IS INITIAL.
SELECT ekgrp UP TO 1 ROWS
INTO t024-ekgrp
FROM t024
WHERE ekgrp IN s_ekgrp.
ENDSELECT.
IF sy-subrc 0.
MESSAGE e000 WITH 'Invalid Purchasing Group'(005).
ENDIF.
ENDIF.
ENDFORM. " validate_screen
*& Form fetch_data
Fetching the PO related data from Database Tables
FORM fetch_data .
CLEAR i_po.
REFRESH i_po.
SELECT a~ebeln " PO No.
b~ebelp " PO Item
a~bstyp " PO Category
a~bukrs " Company Code
a~bsart " PO Type
a~lifnr " Vendor No
a~ekgrp " Purchase Group
a~waers " Currency
a~bedat " PO Date
b~txz01 " Material Text
b~werks " Plant
b~lgort " Storage Location
b~matkl " Material Group
b~menge " PR Quantity
b~meins " UOM
b~bprme " Price Unit
b~netpr " Net price
b~peinh " Price Unit UOM
b~pstyp " Item Category
b~knttp " Account Assignment Category
INTO TABLE i_po
FROM ekko AS a JOIN ekpo AS b
ON a~ebeln = b~ebeln
WHERE a~ebeln IN s_ebeln AND
a~lifnr IN s_lifnr AND
a~ekgrp IN s_ekgrp AND
a~bsart IN s_bsart AND
a~bedat IN s_bedat.
SORT i_po BY ebeln ebelp.
break-point.
IF NOT i_po[] IS INITIAL.
Fetch the PO History/Invoice Details from EKBE Table
CLEAR i_ekbe.
REFRESH i_ekbe.
SELECT ebeln " PO No.
ebelp " PO Item
gjahr " Fiscal Year
belnr " PO Invoice No
menge " PR Quantity
wrbtr " Price in Local Currency
dmbtr " Price in Foreign Currency
waers " Currency
shkzg " Dr/Cr Indicator
INTO TABLE i_ekbe
FROM ekbe
FOR ALL ENTRIES IN i_po
WHERE ebeln = i_po-ebeln AND
ebelp = i_po-ebelp AND
vgabe = c_vgabe.
IF sy-subrc = 0.
SORT i_ekbe BY ebeln ebelp.
LOOP AT i_ekbe.
IF i_ekbe-shkzg = c_h.
i_ekbe-wrbtr = i_ekbe-wrbtr * -1.
ENDIF.
MODIFY i_ekbe.
ENDLOOP.
break-point.
Sum up the Item wise Invoice totals
LOOP AT i_ekbe.
AT END OF ebelp.
READ TABLE i_ekbe INDEX sy-tabix.
SUM.
MOVE-CORRESPONDING i_ekbe TO i_inv.
APPEND i_inv.
ENDAT.
CLEAR i_inv.
ENDLOOP.
SORT i_inv BY ebeln ebelp.
break-point.
ENDIF.
ENDIF.
Move the Vendor Name and Invoice Values to I_rep Internal Table
LOOP AT i_po.
MOVE-CORRESPONDING i_po TO i_rep.
CLEAR i_inv.
READ TABLE i_inv WITH KEY ebeln = i_po-ebeln
ebelp = i_po-ebelp.
IF sy-subrc = 0.
i_rep-orewr = ( i_po-menge - i_inv-menge ) * i_po-netpr.
i_rep-curr = i_inv-waers.
ELSE.
i_rep-orewr = i_po-menge * i_po-netpr.
i_rep-curr = i_po-waers.
ENDIF.
break-point.
Get the Vendor Name
CLEAR lfa1-name1.
SELECT SINGLE name1 FROM lfa1 INTO lfa1-name1
WHERE lifnr = i_po-lifnr.
IF sy-subrc = 0.
i_rep-name1 = lfa1-name1.
ENDIF.
APPEND i_rep.
CLEAR i_rep.
break-point.
ENDLOOP.
SORT i_rep BY lifnr ebeln ebelp.
DELETE i_rep WHERE orewr LE 0.
break-point.
ENDFORM. " fetch_data
*& Form display_data
Display the Report Output data
FORM display_data .
DATA: lv_flag, " New Flag
lv_rec TYPE i. " No of Records
CLEAR lv_rec.
IF i_rep[] IS INITIAL.
MESSAGE e000 WITH 'No Data found'(022).
ELSE.
LOOP AT i_rep.
Toggle Color
PERFORM toggle_color.
IF lv_flag space.
NEW-LINE.
ENDIF.
At New Purchase Document
AT NEW ebeln.
WRITE:/1 sy-vline, 2(10) i_rep-ebeln INTENSIFIED OFF.
lv_flag = c_x.
lv_rec = lv_rec + 1.
ENDAT.
WRITE: 1 sy-vline,
12 sy-vline,13(4) i_rep-bsart,
17 sy-vline,18(10) i_rep-lifnr,
28 sy-vline,29(35) i_rep-name1,
64 sy-vline,65(4) i_rep-ekgrp,
69 sy-vline,70(10) i_rep-bedat,
80 sy-vline,81(5) i_rep-ebelp,
86 sy-vline,87(40) i_rep-txz01,
127 sy-vline,128(9) i_rep-matkl,
137 sy-vline,138(1) i_rep-pstyp,
139 sy-vline,140(1) i_rep-knttp,
141 sy-vline,142(4) i_rep-werks,
146 sy-vline,147(4) i_rep-lgort,
151 sy-vline,152(13) i_rep-menge UNIT i_rep-meins,
165 sy-vline,166(3) i_rep-meins,
169 sy-vline,170(15) i_rep-netpr CURRENCY i_rep-waers,
185 sy-vline,186(4) i_rep-waers,
190 sy-vline,191(5) i_rep-peinh,
196 sy-vline,197(4) i_rep-bprme,
201 sy-vline,202(15) i_rep-orewr CURRENCY i_rep-curr,
217 sy-vline,218(4) i_rep-curr,
222 sy-vline,223(7) i_rep-bstyp centered,
230 sy-vline.
NEW-LINE.
hide: i_rep-ebeln.
ENDLOOP.
ULINE.
FORMAT COLOR OFF.
WRITE : /2 'Total Number of Purchasing Documents:'(025) COLOR 3,
lv_rec COLOR 3.
ENDIF.
ENDFORM. " display_data
*& Form header
Write the Report Header
FORM header .
FORMAT RESET.
header
WRITE:/1(230) 'LIST OF PURCHASE DOCUMENTS PER VENDOR'(006) CENTERED.
SKIP.
FORMAT COLOR COL_HEADING.
ULINE.
WRITE:/1 sy-vline,2(10) 'Pur.Doc.No'(006) CENTERED,
12 sy-vline,13(4) 'Type'(007),
17 sy-vline,18(10) 'Vendor'(008) CENTERED,
28 sy-vline,29(35) 'Name'(009) CENTERED,
64 sy-vline,65(4) 'PGrp'(010) CENTERED,
69 sy-vline,70(10) 'Doc.Date'(012) CENTERED,
80 sy-vline,81(5) 'Item'(011),
86 sy-vline,87(40) 'Material Short Text'(024) CENTERED,
127 sy-vline,128(9) 'Mat.Group'(013),
137 sy-vline,138(1) 'I',
139 sy-vline,140(1) 'A',
141 sy-vline,142(4) 'Plnt'(014),
146 sy-vline,147(4) 'SLoc'(015),
151 sy-vline,152(13) 'Quantity'(016) CENTERED,
165 sy-vline,166(3) 'UoM'(017),
169 sy-vline,170(15) 'Net Value'(018) CENTERED,
185 sy-vline,186(4) 'Curr'(019),
190 sy-vline,191(5) 'Per'(020),
196 sy-vline,197(4) 'Unit'(021),
201 sy-vline,202(15) 'To be Invoiced'(023) CENTERED,
217 sy-vline,218(4) 'Curr'(019),
222 sy-vline,223(7) 'Doc.Cat'(026),
230 sy-vline.
ULINE.
ENDFORM. " header
*& Form toggle_color
This routine alters the color of the records in the list FORM toggle_color.
IF gv_dial = space.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
gv_dial = c_x.
ELSE.
FORMAT COLOR 1 INTENSIFIED OFF.
CLEAR gv_dial.
ENDIF.
ENDFORM. " toggle_color
*& Form LINE_SEL
*When double clicked on EBELN field display the details of Purchase Doc
FORM line_sel.
CASE sy-lsind.
WHEN '1'.
DATA: lv_field(20),
lv_value(10),
lv_bstyp like i_rep-bstyp.
clear: lv_bstyp,lv_value, lv_field.
GET CURSOR FIELD lv_field VALUE lv_value.
IF lv_field = 'I_REP-EBELN'.
IF NOT lv_value IS INITIAL.
READ LINE sy-index FIELD VALUE i_rep-bstyp
INTO lv_bstyp.
READ CURRENT LINE FIELD VALUE i_rep-bstyp INTO lv_bstyp.
if lv_bstyp = 'F'.
SET PARAMETER ID 'BES' FIELD lv_value.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
elseif ( lv_bstyp = 'K' or lv_bstyp = 'L' ).
SET PARAMETER ID 'VRT' FIELD lv_value.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
elseif lv_bstyp = 'A'.
SET PARAMETER ID 'ANF' FIELD lv_value.
CALL TRANSACTION 'ME43' AND SKIP FIRST SCREEN.
endif.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " line_sel{code]
<REMOVED BY MODERATOR>
kushagra
Edited by: Alvaro Tejada Galindo on Feb 18, 2008 2:03 PM -
Passing TABLE NAME as parameter is possible or not?
I want develop a small/simple report like this
TABLE NAME :
WHERE :
ORDER BY :
QUERY ROWS
In the above model i want to pass all the three (TABLE NAME,WHERE and ORDER BY) as a parameter.
My doubt, is that possible to pass TABLE NAME as a parameter? If so!
When i enter any TABLE NAME it has to fetch me out the records of that table (Based on WHERE condition and ORDER BY).
Is that possible to do?
Need some help!
Edited by: Muthukumar Seshadri on Aug 10, 2012 6:19 PMYes, it is possible with lexical parameters. Look in the help for examples:
SELECT Clause
SELECT &P_ENAME NAME, &P_EMPNO ENO, &P_JOB ROLE FROM EMP
P_ENAME, P_EMPNO, and P_JOB can be used to change the columns selected at runtime. For example, you could enter DEPTNO as the value for P_EMPNO on the Runtime Parameter Form.
Note that in this case, you should use aliases for your columns. Otherwise, if you change the columns selected at runtime, the column names in the SELECT list will not match the Report Builder columns and the report will not run.
FROM Clause
SELECT ORDID, TOTAL FROM &ATABLE
ATABLE can be used to change the table from which columns are selected at runtime. For example, you could enter ORD for ATABLE at runtime.
If you dynamically change the table name in this way, you may also want to use lexical references for the SELECT clause (look at the previous example) in case the column names differ between tables.
WHERE Clause
SELECT ORDID, TOTAL FROM ORD WHERE &CUST
ORDER BY Clause
SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL FROM ORD ORDER BY &SORT You have to be really careful with this approach. Dynamic SQL may cause serious performance problems.
Edited by: InoL on Aug 10, 2012 10:06 AM -
CAN I PASS A TABLE NAME AS A VARIABLE IN THE FROM CLAUSE?
For some reason, I am trying to use a variable name containing the actual table name in the from clause and it won't allow me. I keep getting the error saying I need to declare the variable I'm using eventhough I've used it in another statement that is not the FROM clause.
Example
SELECT count(col1), sum(col2)
FROM v_table_name;
v_table_name was declared as:
v_tablename VARCHAR2(20);
v_tablename := real_table_name;
Is it not allowed to use variables in the FROM clause or am I missing something here?You can use the Forms "From Clause Query" as the datasource for the data block. Then you can change the QUERY_DATA_SOURCE_NAME using set_block_property, so you can use any SQL statement you like. Of course you must name/alias the columns in a consistent manner so that the number of database items on the block matches those being queried.
Maybe you are looking for
-
1 Instance of iTunes - 2 External HDD's - One for music and One for Movies
Hello - How do I map 2 distinct HD's to my 1 instance of itunes. I want to have one with just music and one with just movies. Thanks!!
-
Need to add a new laptop running windows 8.1 to a shared network printer
Just got a new Dell laptop running windows 8.1 x64. My home wireless network has a shared HP Officejet 6000 E609a that is connected to a Dell Desktop running Window XP Pro. The laptop cannot connect with the printer. I think I need to download a Win
-
IOS4 reloads and repopulates all emails when entering Mail app
I'm having similar, but somewhat different issues with my email since updating to ios4 on my 3GS. I haven't been able to find others with the exact same problem, hence the new thread. Here is the issue: Since upgrading, every now and then randomly, w
-
Getting an error message when trying to download Adobe - HELP
Have tried uninstalling - but that does not work either. How can you help me? Caryn
-
Oracle XE Service has dissappeared...
Hi, I backed up Oracle XE, and after a reboot the Oracle XE service seems to have dissappeared. When I try and start the database I get a message saying that the service is invalid. When I check in Services the service is missing... I am running the