TVARV Table Variable Update
Hi All,
We have a requirement to add a new variable to the TVARV Table
I am able to do it thru SM30.
This variable is used in a variant in a program that runs periodically.
the new variant shd be similar to 1001_CURR_MONTH_START_DATE
now the month and the year shd change based on the fiscal period we are in.
The option I have found is to write a program to update the TVARV table and run this program before running the actual FI program.
But there are other variables that seem to be getting updated and I did not find any programs updating them,
So is there some other way that I can update the date in the variable other than the program approach
Appreciate your help.
Thank you
Lalitha
Best option is through program update , but one thing you need to do is change the TVARV table technical settings. you need to switch off the buffer i.e. select buffering not allowed. Then write a FM or program to update the entry.
Ex:
update tvarv
set low = value " your value
where name = name " your variable name
and type = 'P' " or 'S'
and numb = 0.
I am using the same solution ..
Regards,
Sunil
Similar Messages
-
Defining Selection variables for program variant, TVARV table Help - urgent
Hi All,
Can anyone tell me, what is the transaction to create new variables in table TVARV to use them in my variant for fiscal year and WIP period fields in selection screen of SAPKKA07 program.I used STVARV and it creates variables in table TVARVC table not in TVARV table and moreover in creating a variant the selection variables are defaulted as variables from TVARVC table as input help but not the variables in TVARV table however I see and understand different from SAP Help. The following is the link
http://help.sap.com/saphelp_47x200/helpdata/en/25/c966398ae5c13ae10000000a114084/frameset.htm
for selection variable creation.
Can anyone help me on this this is very urgent. Your help is highly appreciated
Thanks in advance
KumarThanks Appana,
I know we can create the variable that way but, that is something hardway to do it. I want to go about it from transaction not meaning to update the table directly and moreover if I update the TVARV table directly as u said I still dont see the variable I created in the list I get on input help for selection variables while creating a program variant.
I hope u can suggest me better now.
Thanks
Kumar -
Update TVARV table entries using a Function Module or Program
Hi Gurus,
My requirement is that I have a entry in TVARV table which has a 'low'. We would like to change this value whenever we desire. We are unable to do it via sm30 and se16 as table maintenance access is not permitted in Production environment.
Can you please provide any Function module or program code to do it?
Requirement - User can enter a value into TVARV table by executing a function module or program
Thank you all, will award points,
PriyanshHi Priyansh,
Please refer to SAP Help for more information on variant maintenance and more specifically variable values in variants. You can use t/code STVARV for maintaining the variant variables in table TVARVC (Client-Specific Variant Variables).
Note: I suggest to use the TVARVC table instead of TVARV.
If you are looking for Function Modules in the area of Variant Maintenance, then please have a look at Function Group SVAR (t/code SE80).
If you are looking for Function Modules in the area of User Variables in Variants, then please have a look at Function Group SVUV (t/code SE80).
Furthermore, if you are looking for a program to update table TVARVC, please have a look at ABAP: Dynamic Variant Processing with STVARV.
Best eregards,
Sander -
Is there any STD prog which update Table TVARV-Table of VAR in SEL Cre
Hi ,
Can any one tell me which STD program will be used to update the Table TVARV (Table of Variable in selection cretria ). Or this table should be updated manually ? .Please kindly let me know .
Thanks & Regards,
VeeraHi Veera,
TVARV table has allowed maintanace status and Maintanace view is available for the same.
So go to transaction SM30 and maintance the Table as you required.
Thanks
Nimesh S. Patel -
Creating Variable in TVARV table via SM30
Hi Gurus,
I need to create a variable in TVARV to hold the last EXecution TIME and DATe of my program.
I did it earlier in Development , now when i have to create it again in Quality for testing, its not geetting displayed via se11.
date time
I created the variable form SM30 -- Maintain-- 'ZZZ' --- 20081202_112309
Now when i goto se11 and check for contents its displaying my variable.
Can anyone suggest where am i going wrong , or perhaps wats the best practise to create a VArable in TVARV Table.
Your suggestions are Deeply Valuable to me..
Thanking you,
ZIaHi Zia,
Please use transaction code STVARV to maintain TVARV variables.
Regards,
Rahul -
Hi,
I've a report where there is the field Year.
If I save a variant the next year system will propose 2011 when that variant will be manually selected.
I would like the system will update automatically the value of the year.
I don't know how to do that by TVARV table
Best regardsUsing TVARV (TVARVC)
First create a periodic (daily) job (or ask basis to) that executes standard report RVSETDAT, this report will update some values in TVARV (and TVARVC on more recent versions) (*)
Then in your variant use variable RV_ACTUAL_YEAR (Read [Using Variables for Date Calculations|http://help.sap.com/saphelp_nw04s/helpdata/en/c0/98039be58611d194cc00a0c94260a5/frameset.htm] in [Variable Values in Variants|http://help.sap.com/saphelp_nw04s/helpdata/en/c0/980398e58611d194cc00a0c94260a5/frameset.htm])
Other solution
Fill the field with SY-DATUM(4) in INITIALIZATION block, and in the variant definition, check the box "Save field without values" (Read [Variant Attributes|http://help.sap.com/saphelp_nw04s/helpdata/en/c0/98038ce58611d194cc00a0c94260a5/frameset.htm] in [Variable Values in Variants|http://help.sap.com/saphelp_nw04s/helpdata/en/c0/980398e58611d194cc00a0c94260a5/frameset.htm])
Regards,
Raymond
(*) You could also create a copy of the program in your namespace (Zxxx, Yxxx, etc.) and maintain your own variable -
hi all,
Could you please advise me how to update this table? And what's the fuhi,
TVARV is used to store the variants.So
Best option is through program update , but one thing you need to do is change the TVARV table technical settings. you need to switch off the buffer i.e. select buffering not allowed. Then write a FM or program to update the entry.
Ex:
update tvarv
set low = value " your value
where name = name " your variable name
and type = 'P' " or 'S'
and numb = 0. -
Module pool - table control - update ztable
hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
pd: sorry for my bad english
this is my code:
TOP:
PROGRAM z_pp_lote_etiquetas MESSAGE-ID zz.
TABLES:zc2p_lote_etique,
zc2p_lider_modul.
DATA: ok_code LIKE sy-ucomm.
DATA save_ok LIKE sy-ucomm.
* internal table
DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
**************Workarea
DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
DATA: sel.
DATA: MARK.
DATA: init.
DATA: col TYPE scxtab_column.
DATA: lines TYPE i.
* Variable Declaration
DATA : flg, "Flag to set the change mode
ln TYPE i. "No. of records
* Table Control Declartion.
CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
**PROCESS BEFORE OUTPUT INCLUDE **
*& Include Z_PP_LOTE_ETIQUETAS_O01
*& Module set_status OUTPUT
* Setting the GUI status
MODULE status_0100 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
ENDMODULE. " set_status OUTPUT screen 100
* MODULE status_0101 OUTPUT
* Setting the GUI status
MODULE status_0101 OUTPUT.
SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
SET TITLEBAR 'Z_PP_LOT_ETIQ'.
* Data retreving
if init is INITIAL.
select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
zc2p_lider_crtl-lines = ln + 10.
init = 'X'.
endif.
ENDMODULE. "status_0101 OUTPUT
module change_sdyn_conn output.
* you can change the content of current table control line via
* sdyn_conn
READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
endmodule. " FILL_TABLE_CONTROL OUTPUT
MODULE set_screen_fields OUTPUT.
LOOP AT SCREEN.
IF flg IS INITIAL.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
*ENDIF.
* Modifying the screen after making changes
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " set_screen_fields OUTPUT
PROCESS AFTER INPUT INCLUDE.
* MODULE USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'LIDM'.
CALL SCREEN 101.
WHEN 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
* MODULE USER_COMMAND_0101 INPUT
MODULE user_command_0101 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SORT'.
DATA: fldname(100),help(100).
READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
SPLIT col-screen-name AT '-' INTO help fldname.
SORT it_zc2p_lider_modul BY (fldname).
WHEN 'CHANGE'.
* Setting the flag to make the table control in editable mode[excluding
* primary key].
flg = 'Y'.
WHEN 'BACK'.
CALL SCREEN 100.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
MODIFY zc2p_lider_modul FROM it_zc2p_lider_modul.
COMMIT WORK.
ENDCASE.
ENDMODULE. "USER_COMMAND_0101 INPUT
* MODULE read_table_control INPUT
MODULE read_table_control INPUT.
* Check input values
IF mark = 'X' AND save_ok = 'DELETE'.
DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
ENDIF.
ENDMODULE. " READ_TABLE_CONTROL INPUT
Screen Flow Logic 100
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
Screen Flow Logic 101.
PROCESS BEFORE OUTPUT.
MODULE status_0101.
LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
zc2p_lider_crtl.
* Dynamic screen modifications
MODULE set_screen_fields.
MODULE change_sdyn_conn.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_0101.
LOOP AT it_zc2p_lider_modul.
MODULE read_table_control.
ENDLOOP.
i hope somebody can help for what i missing here thanks>
Sanjeev Kumar wrote:
> Hello Edgar,
>
> Problem seems to be there in the flow logic of 101
>
>
> PROCESS BEFORE OUTPUT.
> MODULE status_0101.
> LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
> zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
> * Dynamic screen modifications
> MODULE set_screen_fields.
> MODULE change_sdyn_conn.
> ENDLOOP.
> *
> PROCESS AFTER INPUT.
> MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.
>
> LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
> MODULE read_table_control.
> ENDLOOP.
>
>
>
> With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
>
> Try these changes and I hope it will work.
>
> Thanks
> Sanjeev
i do the firts advice but the second one i get syntax error :
my code :
PROCESS AFTER INPUT.
LOOP at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0101.
error :
In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP
AT". -
Sort the Data Selection in TVARV Table
hello...i wanted to run a SAP Standard Program and it is have a variant selection for me to select the variable from TVARV table. When this program run, I would like to have a selection of choosing the latest date to run the program based on the variant I save. I created a variables in the TVARV table but I cannot see any selection which can sort the selection based on the latest date. I can only choose to be EQ and etc. Is there any selection that I can make so that the program always choose to be run based on the latest date? thanksss alot!!!
Look at table VARID.
Rob -
Hello Experts,
Can You help me; I get the follwing error in my query
Msg 1087, Level 15, State 2, Line 31
Must declare the table variable "@ASE_SUBART_GROEP".
the @ASE_SUBART_GROEP is a self-defined table in this SQL environment.
Maybe you know the error or the missing part
Thanks in advance, Jos DielemansI'm not familiar with SAP Business One unfortunately, so can only be of limited help here. But I'm going to guess that @ASE_SUBART_GROEP is a table variable passed to a stored procedure and is defined and passed down by the application, so you won't
be able to copy-paste this code directly into management studio and get it to work.
You could remove the join to return *all* records. Although the dataset might be very big
SELECT T0.CardCode AS 'Klantnr'
,T0.CardName AS 'Klantnaam'
,T4.GroupName AS 'Klantgroep'
,T9.Descr AS 'Merknaam'
,T5.SlpName AS 'Verkoper'
,T3.MailCity AS 'Leverplaats'
,T7.NAME AS 'Leverland'
,T3.City AS 'Factuurplaats'
,T7.NAME AS 'Factuurland'
,T0.DocNum AS 'Documentnr'
,T0.DocDate AS 'Datum'
,Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) AS 'Jaar'
,RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2) AS 'Maand'
,(Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) + '-' + RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2)) AS 'Periode'
,T1.ItemCode AS 'Artikelnr'
,T2.ItemName AS 'Artikelnaam'
,T1.Quantity AS 'Aantal VEH'
,T2.SVolume AS 'Aantal EH per VEH'
,(T1.Quantity * T2.SVolume) AS 'Aantal EH'
,T8.UnitName AS 'EH-Naam'
,T6.ItmsGrpNam AS 'Artikelgroep'
,T2.U_ItemGrp AS 'Hoofdgroep'
,T10.NAME AS 'Subgroep'
,T1.CogsAcct AS 'Kostpr.rek.'
,T1.AcctCode AS 'Opbrengstrek.'
,T1.LineTotal AS 'BrutoOmzet'
,T0.DiscPrcnt AS 'Korting'
,(+ T1.LineTotal * (100 - T0.DiscPrcnt) / 100) AS 'NettoOmzet'
FROM dbo.OINV T0
INNER JOIN dbo.INV1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode
INNER JOIN OCRG T4 ON T3.GroupCode = T4.Groupcode
INNER JOIN OSLP T5 ON T3.SlpCode = T5.SlpCode
INNER JOIN OITB T6 ON T2.ItmsGrpCod = T6.ItmsGrpCod
INNER JOIN OCRY T7 ON T3.Country = T7.Code
LEFT OUTER JOIN OLGT T8 ON T2.SVolUnit = T8.UnitCode
LEFT OUTER JOIN UFD1 T9 ON T3.U_ZPgroep = T9.FldValue
AND TableID = 'OCRD'
AND FieldID = 2
--LEFT OUTER JOIN @ASE_SUBART_GROEP T10 ON T2.U_ASE_SUB_ARTGROEP = T10.Code
WHERE T0.DocDate >= '20120101'
AND T0.Canceled = 'N'
UNION ALL
SELECT T0.CardCode AS 'Klantnr'
,T0.CardName AS 'Klantnaam'
,T4.GroupName AS 'Klantgroep'
,T9.Descr AS 'Merknaam'
,T5.SlpName AS 'Verkoper'
,T3.MailCity AS 'Leverplaats'
,T7.NAME AS 'Leverland'
,T3.City AS 'Factuurplaats'
,T7.NAME AS 'Factuurland'
,T0.DocNum AS 'Documentnr'
,T0.DocDate AS 'Datum'
,Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) AS 'Jaar'
,RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2) AS 'Maand'
,(Cast((Datepart(Year, T0.DocDate)) AS VARCHAR) + '-' + RIGHT('00' + CAST(DATEPART(MONTH, T0.DocDate) AS VARCHAR(2)), 2)) AS 'Periode'
,T1.ItemCode AS 'Artikelnr'
,T2.ItemName AS 'Artikelnaam'
,- T1.Quantity AS 'Aantal VEH'
,T2.SVolume AS 'Aantal EH per VEH'
,(- T1.Quantity * T2.SVolume) AS 'aantal EH'
,T8.UnitName AS 'EH-Naam'
,T6.ItmsGrpNam AS 'Artikelgroep'
,T2.U_ItemGrp AS 'Hoofdgroep'
,T10.NAME AS 'Subgroep'
,T1.CogsAcct AS 'Kostpr.rek.'
,T1.AcctCode AS 'Opbrengstrek.'
,- T1.LineTotal AS 'BrutoOmzet'
,T0.DiscPrcnt AS 'Korting'
,(+ T1.LineTotal * (100 - T0.DiscPrcnt) / 100) AS 'NettoOmzet'
FROM dbo.ORIN T0
INNER JOIN dbo.RIN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode
INNER JOIN OCRG T4 ON T3.GroupCode = T4.Groupcode
INNER JOIN OSLP T5 ON T3.SlpCode = T5.SlpCode
INNER JOIN OITB T6 ON T2.ItmsGrpCod = T6.ItmsGrpCod
INNER JOIN OCRY T7 ON T3.Country = T7.Code
LEFT OUTER JOIN OLGT T8 ON T2.SVolUnit = T8.UnitCode
LEFT OUTER JOIN UFD1 T9 ON T3.U_ZPgroep = T9.FldValue
AND TableID = 'OCRD'
AND FieldID = 2
--LEFT OUTER JOIN @ASE_SUBART_GROEP T10 ON T2.U_ASE_SUB_ARTGROEP = T10.Code
WHERE T0.DocDate >= '20120101'
AND T0.Canceled = 'N'
ORDER BY T0.CardCode
The join to the table variable has been commented out above, so the code should run. After that you might want to update the WHERE clause to include only particular sub-groups -
Oracle equivalent to SQL Server Table Variables ?
Does Oracle have anything equivalent to SQL Server table variables, that can be used in the JOIN clause of a select statement ?
What I want to do is execute a query to retrieve a two-column result, into some form of temporary storage (a collection ?), and then re-use that common data in many other queries inside a PL/SQL block. I could use temporary tables, but I'd like to avoid having to create new tables in the database, if possible. If I was doing this in SQL Server, I could use a table variable to do this, but is there anything similar in Oracle ? SQL Server example:
use Northwind
DECLARE @myVar TABLE(CustomerID nchar(5), CompanyName nvarchar(40))
INSERT INTO @myVar(CustomerID, CompanyName)
select CustomerID, CompanyName
from Customers
--Join the variable onto a table in the database
SELECT *
FROM @myVar mv join Customers
on mv.CompanyName = Customers.CompanyName
The closest I've found in Oracle is to use CREATE TYPE to create new types in the database, and use TABLE and CAST to convert the collection to a table, as shown below. I can't see anyway without creating new types in the database.
CREATE TYPE IDMap_obj AS Object(OldID number(15), NewID number(15));
CREATE TYPE IDMap_TAB IS TABLE OF IDMap_obj;
DECLARE
v_Count Number(10) := 0;
--Initialize empty collection
SourceIDMap IDMap_TAB := IDMap_TAB();
BEGIN
--Populate our SourceIDMap variable (dummy select statement for now).
FOR cur_row IN (select ID As OldID, ID + 10000000 As NewID From SomeTable) LOOP
SourceIDMap.extend;
SourceIDMap(SourceIDMap.Last) := IDMap_obj(cur_row.OldId, cur_row.NewId);
END LOOP;
--Print out contents of collection
FOR cur_row IN 1 .. SourceIDMap.Count LOOP
DBMS_OUTPUT.put_line(SourceIDMap(cur_row).OldId || ' ' || SourceIDMap(cur_row).NewId);
END LOOP;
--OK, can we now use our collection in a JOIN statement ?
SELECT COUNT(SM.NewID)
INTO v_Count
FROM SomeTable ST JOIN
TABLE(CAST(SourceIDMap As IDMap_TAB)) SM
ON ST.ID = SM.OldID;
DBMS_OUTPUT.put_line(' ' );
DBMS_OUTPUT.put_line('v_Count is ' || v_Count);
END;Hi, got this from our plsql guys:
The term "table function" is a bit confusing here. In Oracle-speak, it means a function that can be used in the from list of a select statement thus:
select * from Table(My_Table_Function()),..
where...
The function's return type must be a collection that SQL understands. So for the interesting case -- mimicking a function with more than one column -- this would be a nested table of ADTs where both the ADT and the nested table are defined at schema level. PL/SQL -- by virtue of some clever footwork -- allows you to declare the type as a nested table of records where both these types are declared in a package spec. This alternative is generally preferred, especially because the nested table can be of Some_Table%rowtype (or Some_Cursor%rowtype if you prefer).
As I understand it from our man on the ANSI committee, our use terminology follows the standard.
The construct below seems to be a bit different (though there are similarities) because it appears from your code sample that it's usable only within procedural code. And the object from which you select is a variable rather than a function.
So, after that preamble... the answer would be:
No, we don't have any constructs to let you "declare" something that looks like a regular schema-level table as a PL/SQL variable -- and then use (static) SQL on it just as if it were a schema-level table.
But yes, you can use PL/SQL's pipelined table function to achieve much of the same effect.
Look at the attached Table_Function.sql.
It shows that you can populate a collection of records using ordinary PL/SQL code. You can't use SQL for insert, update, or delete on such a collection. I see that SQL Server lets you do
insert into Program_Variable_Table select... from Schema_Level_Table
The PL/SQL equivalent would be
select...
bulk collect into Program_Variable_Collection
from Schema_Level_Table
The attached shows that once you have populated your collection, then you can then query it with regular SQL -- both from inside PL/SQL code and from naked SQL.
and the code is here
CONNECT System/p
-- Drop and re-create "ordinary" user Usr
EXECUTE d.u
CONNECT Usr/p
create table Schema_Things(ID number, Description Varchar2(80))
create package Pkg is
subtype Thing_t is Schema_Things%rowtype;
type Things_t is table of Thing_t; -- index by pls_integer
Things Things_t;
-- PLS-00630: pipelined functions must have
-- a supported collection return type
-- for "type Things_t is table of Thing_t index by pls_integer".
function Computed_Things return Things_t pipelined;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer);
end Pkg;
create package body Pkg is
function Computed_Things return Things_t pipelined is
Idx pls_integer;
Thing Thing_t;
begin
Idx := Things.First();
while Idx is not null loop
pipe row (Things(Idx));
Idx := Things.Next(Idx);
end loop;
end Computed_Things;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer) is
begin
Things := Things_t();
Things.Extend(No_Of_Rows);
for j in 1..No_Of_Rows loop
Things(j).ID := j;
Things(j).Description := To_Char(j, '00009');
end loop;
insert into Schema_Things
select * from Table(Pkg.Computed_Things());
end Insert_Schema_Things;
end Pkg;
-- Test 1.
begin Pkg.Insert_Schema_Things(100); end;
select * from Schema_Things
-- Test 2.
begin
Pkg.Things := Pkg.Things_t();
Pkg.Things.Extend(20);
for j in 1..20 loop
Pkg.Things(j).ID := j;
Pkg.Things(j).Description := To_Char(j, '00009');
end loop;
for j in 1..5 loop
Pkg.Things.Delete(5 +2*j);
end loop;
end;
select * from Table(Pkg.Computed_Things())
/ -
Add entries to database tables using update function module
Hi All,
I have a small requirement, in which I need to update Z-tables usimg update function module in update task. In the calling program, I have gathered the data in a field symbol value of type any. I need to pass the same to that function module to update the data which is in the field symbol.
Please guide me how to achieve this technically.
Thanks in advance,
Pradipta .Hi,
I believe you already have evrything with you.....Start Coding the same and come back with any Coding issue.
I believe you will not be able to pass the Field Symbol in FM Interface.....You need to pass the Variable which Field Symbol is referring.... -
Hello folks,
I am just wondering how to code a select statement on a tvarv table with ranges.
To be clear, I had created a variable with name ZTEST and then I clicked on the YELLOW arrow on the right and entered 10 numbers from 1 to 10.
Now I have a report with a selection screen field 'p_num' and in that report I am coding the SELECT statement on tvarv in the following way.
select single *
from tvarv
into ls_tvarv
where name eq 'ZTEST'
and low eq p_num.
Is this correct. p_num can have values anywhere between 1 and 10.
Will the above code work if p_num is 1 or 2 or 3 up to 10??
Please let me know.
Thanks,Hi
Your record in TVAR it should be:
TVAR-NAME = 'ZTEST'.
TVAR-TYPE =
TVAR-NUMB =
TVAR-SIGN =
TVAR-OPTI =
TVAR-LOW = 1
TVAR-HIGH = 10.
In your code:
DATA: MIN TYPE I, MAX TYPE I.
SELECT * FROM TVARV WHERE NAME = 'ZTEST'.
MOVE: TVARV-LOW TO MIN,
TVARV-HIGH TI MAX.
EXIT.
ENDSELECT.
IF P_NUM < MIN OR P_NUM > MAX.
ERROR.
ENDIF.
Max -
How to find out list of variants in TVARV table
hi!
can anybody can guide me on the following issues? plz
How to list all variants in TVARV table?
How to find out any Z* programs that writes to TVARV table, using the variant name?
How to find out the programs which are reads the TVARV data into a program variant?
Thanks & Regards,
vijayOr some help might be useful:
http://help.sap.com/saphelp_47x200/helpdata/en/c0/98037ae58611d194cc00a0c94260a5/frameset.htm
Regards,
Subramanian V. -
What are the tables will update while loading Master data ?
Hello Experts,
What are the tables will update while loading Master data ? And requesting you to provide more information about Master data loading and its related settings in the beginning of creation infoobjects.It depends upon the type of Master data u r loading....
In all the master data loadings, for every new value of master data an SID will be created in the SID table /BI*/S<INFOOBJECT NAME> irrespective of the type of master data.
But the exceptional tables that get updated depending on the type of master data are.....
If it is a time Independent master data then the /BI*/P<INFOOBJECT NAME> table gets updated with the loaded data.
If it is a time dependent master data then the /BI*/Q<INFOOBJECT NAME> table gets updated with the loaded data.
If the master data is of time Independent Navigational attributes then for every data load the SID table will get updated first and then the /BI*/X<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
If the master data is of time dependent navigational attributes then for every data load the SID table will get updated first and then the /BI*/Y<INFOOBJECT NAME> table gets updated with the SID's created in the SID table (NOT WITH THE MASTER DATA).
NOTE: As said above, For all the data in P, Q, T, X, Y tables the SID's will be created in the S table /BI*/S<INFOOBJECT NAME>
NOTE: Irrespective of the time dependency or Independency the VIEW /BI*/M<INFOOBJECT NAME> defined on the top of /BI*/P<INFOOBJECT NAME> & /BI*/Q<INFOOBJECT NAME> tables gives the view of entire master data.
NOTE: it is just a View and it is not a Table. So it will not have any physical storage of data.
All the above tables are for ATTRIBUTES
But when it comes to TEXTS, irrespective of the Time dependency or Independency, the /BI*/T<INFOOBJECT NAME> table gets updated (and of course the S table also).
Naming Convention: /BIC/*<InfoObject Name> or /BI0/*<InfoObject Name>
C = Customer Defined Characteristic
0 = Standard or SAP defined Characteristic
* = P, Q, T, X,Y, S (depending on the above said conditions)
Thanks & regards
Sasidhar
Maybe you are looking for
-
Help with Re-Linking Navigation Buttons
I have Adobe Flash CS3 Pro. I have a navigation header flash file that came with my website template and I am having difficulty making sense of the actionscript. It has a logo section with effects, 5 main nav buttons that move, and two extra link but
-
Add Profit center to cost collector
Hello SAP Guru Is it possible to add a profit center to a cost collector which is already is in use.If yes then how ? Thanks in advance.
-
EventListeners, bindingUtils, garbageCollection and you...
Hey everyone, I hope somewhere can help me with this, because I have been running in circles on this. I am developing on a fairly large application and have recently noticed that instances of my class that have event listeners of data binding tied to
-
Word 2011 - Tables Layout button disappeared!
Hi. Normally when I click on the "Tables" a button in the Ribbon it extends horizontally and allows a new " Tables Layout" button to its right side. This is now not appearing at all. I am highlighting a Word Table nothing nada. Just that up/down "to
-
Toggle Full Screen with lingo?
Hi there, I have just got a Mac mini 10.6.2 and I'm testing exporting mac projectors from Dir11.5 on XP. What I'd like to achieve is to swap between two states whilst playing the projector. State 1: Small draggable Windowed state with title bar and M