Use of LINE OF statement
Hi all,
what is the use of LINE OF statement?
DATA: itab_iv_item TYPE TABLE OF bapi_incinv_create_item,
itab_return TYPE TABLE OF bapiret2.
DATA: wa_iv_item LIKE LINE OF itab_iv_item,
wa_return LIKE LINE OF itab_return.
what these statements do
DATA: wa_iv_item LIKE LINE OF itab_iv_item,
wa_return LIKE LINE OF itab_return.
Thanks in advance
krupali.
Hi KR.,
1.
types: begin of st1,
<fields>
end of st1.
data: wa type st1.
Here we are declaring the wa by using the syntax TYPE. because here we know the structre.
2.
data: wa type vbak.
Here we are declaring the wa wrt Database Table so here we can use TYPE syntax again.
3.
data: begin of itab occurs 0,
<fields>
end of itab.
data: wa like line of itab.
Here we are declaring the wa wrt internal table which is having header line and body, so we can't use TYPE here, we must go for LIKE LINE OF syntax.
4.
data: itab like vbak occurs 0 with header line.
data: wa like line of itab
(or)
data: wa type vbak.
Hope it clear?
Thanks,
Naveen.I
Similar Messages
-
Using alias in where statement
simple sql:
SELECT EMPLOYEE_ID,
FIRST_NAME,
LAST_NAME,
EMAIL,
PHONE_NUMBER,
HIRE_DATE,
JOB_ID,
SALARY,
COMMISSION_PCT,
MANAGER_ID,
DEPARTMENT_ID
FROM EMPLOYEES
WHERE EMPLOYEE_ID > 1000;
is it somehow possible to use alias in where statement like
SELECT EMPLOYEE_ID "ID",
FIRST_NAME,
LAST_NAME,
EMAIL,
PHONE_NUMBER,
HIRE_DATE,
JOB_ID,
SALARY,
COMMISSION_PCT,
MANAGER_ID,
DEPARTMENT_ID
FROM EMPLOYEES
WHERE "ID" > 1000;Hi,
is it somehow possible to use alias in where statement likeWhy do you need it?
To answer your question "Not directly"
SQL> select empno eno, sal
2 from emp
3 where eno = 7900;
where eno = 7900
ERROR at line 3:
ORA-00904: "ENO": invalid identifierColumn Alias are names given to give meaningful names to columns or the arithmetic operations' column.
Twinkle -
What is the use of at new statement?
What is the use of at new statement?
Hi,
AT - itab
Syntax
LOOP AT itab result ...
[AT FIRST.
ENDAT.]
[AT NEW comp1.
ENDAT.
[AT NEW comp2.
ENDAT.
AT END OF comp2.
ENDAT.]
AT END OF comp1.
ENDAT.]
[AT LAST.
ENDAT.]
ENDLOOP.
Extras:
1. ... FIRST
2. ... |{END OF} compi
3. ... LAST
Effect
The statement block of a LOOP loop can contain control structures for control level processing. The respective control statement is AT. The statements AT and ENDAT define statement blocks that are executed at control breaks, that is, when the control structure is changed. The additions to the AT statements determine the control break at which their statement blocks are executed. Within these statement blocks, the statement SUM can be specified to add together the numeric components of a control level. For the output behavior result, the same applies as for LOOP AT.
The prerequisite for control level processing is that the internal table is sorted in exactly the same sequence as the component of its line type - that is, first in accordance with the first component, then in accordance with the second component, and so on. The line structure and the corresponding sorting sequence gives a group structure of the content of the internal table, whose levels can be evaluated using AT statements. The AT- ENDAT control structures must be aligned one after the other, in accordance with the group structure.
The statement blocks within the AT- ENDAT control structures are listed if an appropriate control break is made in the current table line. Statements in the LOOP- ENDLOOP control structure that are not executed within an AT- ENDAT control structure are executed in each pass of the loop.
In order that control level processing is carried out properly, the following rules must be observed:
After LOOP, a restricting condition cond can only be specified if this selects a consecutive line block of the internal table. Otherwise, the behavior of control level processing is undefined.
The internal table cannot be modified within the LOOP loop.
A work area wa specified in the LOOP statement after the addition INTO must be compatible with the line type of the table.
The content of a work area wa specified after the addition INTO in the LOOP statement must not be modified.
If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
The components of the current control key remain unchanged.
All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
All the other components to the right of the current control key are set to their initial value.
When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa.
Addition 1
... FIRST
Effect
The control level is defined by the first line of the internal table. The control break takes place when this line is read.
Note
In the group level AT FIRST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
Addition 2
... |{END OF} compi/>
Effect
: Control levels are defined by the beginning or end of a group of lines with the same content in the component compi (where i = 1, 2, and so on) and in the components to the left of compi. The control breaks take place when the content of the component compi or another component to the left of compi changes.
The compi components can be specified as described in Specification of Components, with the limitation that access to object attributes is not possible here.
Note
If the INTO or ASSIGNING additions are used in the LOOP statement, a field symbol can be entered after AT |{END OF} outside classes, to which the corresponding component of the work area wa or the field symbol <fs> is assigned. This form of dynamic component specification is obsolete and has been replaced by specification in the format (name).
Addition 3
... LAST
Effect
: The control level is defined by the last line of the internal table. The control break takes place when this line is read.
Note
In the group level AT LAST, the current group key contains no components and all character-type components of the work area wa are filled with "*" and all remaining components are set to their initial value.
Regards,
Prashant -
Can not use 'AT LINE-SELECTION' with SET PF-STATUS
Hi experts,
my code is like below:
PARAMATERS: .....
SET PF-STATUS 'st_nam'.
Perform Load_data . ' For list display
START-OF-SELECTION.
AT LINE-SELECTION.
Perform list_detail.
AT USER-COMMAND.
CALL SCREEN '1001'.
END-OF-SELECTION.
When I execute the report , the basic was displayed , but when then i double click on the list to call the next screen '1001'. It did not work , but if i omit the SET PF-STATUS m AT LINE-SELECTION worked week , so in this case what has happened i how can i solve this problem,
Thaks,
PS: Reward immediatelyHi,
Thank you very much for your helpful answers, I have copied the report downto my system and test it , When i used SET PF-STATUS , i can not use AT LINE-SELECTION to capture events ...May be we can not use these 2 statements in parallel,...:D
Thanks, -
How can I use an IF ELSE statement and the xdoxslt: get_variable together?
First of all, I'm a big fan of this forum and I just want to thank the community for helping make the BI Publisher world a better place.
I'm trying to populate a table with a years worth of data with the column=PRODUCT and row=month of DATE. Here's the catch, not all of the months will have data. So here's where my problem is, I'm not able to use an IF ELSE statement along with a XDOXSLT:GET_VARIABLE expression so that if there's no data for that month the default value will be 0.
Can someone help me find a solution to either one of the attempts below or a completely new method? Thanks!
BP4 = numeric month value using DATE (more code to pull only month from DATE not included here)
JAN1 = PRICE if data exists, else 0
1) I tried this and it didn't work:
<?if: xdoxslt:get_variable($_XDOCTX,'BP4'),01 then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
<?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
<?end if?>
2) I tried this and it didn't work:
<?xdoxslt:ifelse(xdoxslt:get_variable($_XDOCTX,'BP4')='01',xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE),xdoxslt:set_variable($_XDOCTX, 'JAN1',0))?>
<?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
<?end if?>
3) I tried this and it didn't work:
<?xdofx:if xdoxslt:get_variable($_XDOCTX,'BP4')='01' then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
<?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
<?end if?>
sample XML:
<ROW>
<Name>Craig Hernandez</NAME>
<DATE>2013-01-01T00:00:00.000+08:00</DATE>
<PRICE>31</PRICE>
<PRODUCT>BPD</PRODUCT>
</ROW>
-DrT
Edited by: 990965 on Feb 28, 2013 8:27 AMlet me clarify my logic, the template 1) searches for the relevant PRODUCT (in the case below, it searches for BPD which is the column in the table) 2) searches for the relevant month in DATE (which is the row in the table) 3) if data exists, get PRICE else default to 0
Variable definitions:
BP4 = numeric month value from DATE (more code to get this value not included here, but it works...)
JAN1 = set to PRICE if data exists for that month, else 0
the query is only pulling all of the existing data, so if there's no data for March then there wouldn't be a March entry in the xml. In the sample xml below, we only have data for the first two months (Jan, Feb) so that's the only data in the xml. I can't check if PRICE is null because the xml will not have any data for March.
I've read through other threads and it seems that BI Publisher can't use an IF THEN ELSE with the XDOXSLT:GET_VARIABLE. I sent the template and xml to you.
Sample XML:
<ROW>
<Name>Craig Hernandez</NAME>
<DATE>2013-01-01T00:00:00.000+08:00</DATE>
<PRICE>31</PRICE>
<PRODUCT>BPD</PRODUCT>
</ROW>
<ROW>
<Name>Craig Hernandez</NAME>
<DATE>2013-02-01T00:00:00.000+08:00</DATE>
<PRICE>30</PRICE>
<PRODUCT>BPD</PRODUCT>
</ROW>
Edited by: 990965 on Feb 28, 2013 8:30 AM -
How can I use more lines to show a field of a row in a report?
How can I use more lines to show a field of a row in a report? Table A have two columns: (c1 number(5),c2 varchar2(1000)).When I show the table on a report,the column c2 show itself in one row.So the width of html page is very wide.How can I split the field c2 to many lines?
Thanks for any help.I was wondering if an answer was found for this one.
I have the same problem using the default "Look 4" template for the region. I have found in the CSS file where it is defined and it specifies "nowrap" in the style, which is why the long value is not being split over multiple lines.
So, my question is, without modifying or creating templates, is there a way to override the "nowrap" attribute from within the item definition? e.g. in the Column Attributes.Column Formatting.CSS Style field. I had some success changing the display properties, such as background colour and font size but I can't seen to override the nowrap attribute! -
Hello,
I need your advise, please. My customer requires to print a specfic page from a pdf document they receive, using command line or 3rd party solution.
Anything you can advise, please? I have seen AcroRD32.exe options, but can only print the whole document.
Kind RegardsNot sure if there are any examples. The Acrobat SDK is a must, but it is best treated as documentation to study rather than examples to copy. The examples only illustrate a tiny fraction of the capabiliies.
(One other note: the solution must involve the client owning Acrobat; Acrobat is not for server use). -
I want to upgrade to CS6 Production Premium suite from CS5.5. Can I use CS6 upgrade made for CS5, or do I have to use upgrade that specifically states for CS5.5.
I am referring to the DVD installation Disks not Cloud. Disk last release, I believe in 2012.
Thank you.at the link i posted i see an upgrade for cs5 and cs5.5.
you can contact adobe support if you don't see that.
contact adobe support by clicking here and, when available, click 'still need help', https://helpx.adobe.com/contact.html -
Error while creating pool using command line
I am trying to create connection pool using command line as :
%JAVA_HOME%\bin\java weblogic.Admin -url %serUrl% -username %serUser% -password %serPwd% CREATE_POOL "XXXXXXXX" url=%DB2Url%,driver=com.ibm.db2.jcc.DB2Driver,testConnsOnReserve=true,testTableName=SYSTABLES,initialCapacity=2,maxCapacity=50,capacityIncrement=2,allowShrinking=true,props=user=%DB2Usr%;password=%DB2Pwd%
This was working fine in 8.1 ,but when i am using same in 9.2 it gives following error in console:
======================================================
<Feb 2, 2007 9:58:11 AM IST> <Error> <Deployer> <BEA-149265> <Failure occured in
the execution of deployment request with ID '1170390490712' for task 'weblogic.
deploy.configChangeTask.0'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:268)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
leListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(Depl
oymentCallbackFlow.java:360)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
river.java:26)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(Dep
loymentCallbackFlow.java:56)
Truncated. see log file for complete stacktrace
weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class:
com.ibm.db2.jcc.DB2Driver
at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:2
92)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.loadDriver(Connect
ionEnvFactory.java:77)
=====================================================
when i am again trying to start server , its unable to start.
Anybody have idea why this exception is coming.Hi ,
Please check the FSV (field status variant) for your company code in OBY6 .
then go to transaction code OB14 --> enter the FSV --> Check if field status group G006(Material account) is maintained there or not.
if not please maintain it.
Thanks & Regards
Anshu -
Error trying to use multiple lines from a PO in a Goods Receipt PO
I get the following error when I try to add 2 lines from a PO to a single Goods Receipt PO (code below):
-5002 One of the base documents has already been closed [PDN1.BaseEntry][line: 1]
I can create the Goods Receipt PO if I use 1 line or lines from multiple PO's???
SAPbobsCOM.Documents poReceipt2 = (SAPbobsCOM.Documents)_diApi.SboCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);
poReceipt2.CardCode = "ALL";
poReceipt2.DocDueDate = DateTime.Now;
poReceipt2.Lines.Quantity = 5;
poReceipt2.Lines.ItemCode = "HAMSHA";
poReceipt2.Lines.BaseEntry = 11;
poReceipt2.Lines.BaseLine = 0;
poReceipt2.Lines.BaseType = 22;
poReceipt2.Lines.Add();
poReceipt2.Lines.Quantity = 5;
poReceipt2.Lines.ItemCode = "LAMFIL";
poReceipt2.Lines.BaseEntry = 11;
poReceipt2.Lines.BaseLine = 1;
poReceipt2.Lines.BaseType = 22;
poReceipt2.Add();
Any help is appreciated!
Thanks,
DanielHi Louis, thanks for the post...
However the PO document that I am refercing definately has both lines open, if I use 1 of those lines it works fine, but the error occurs if I use 2 lines from the same PO. I am also definately using the docentry not the docnum for the GetByKey() method.
Can anyone run the same basic logic through the DI API? That is create a PO with 2 lines on it, then run the code as above to make a Goods Receipt PO and reference the 2 lines from the 1 PO document? (It works if I add multiple lines referncing lines from multiple PO docs??)
Thanks,
Dan
Message was edited by: Daniel Archer -
M or P master data table to be used in routine read statement
Hi
I update of a DSO i had a requirment for a routine to get the Attribute of a Infoobject.
So which master data table M or P table i need to use in my read statement and why
ThanksUse M table as it it the view on time dependent(P table) and time independent(Q table) tables.
M table is view on time dependent and time independent attributes, you can see characteristic values and all the attributes for the Characteristic.
The tables that go in the view are the Master Data Table and the Time-Dependent Master Data Table. If the characteristic only has time-dependent attributes, only the time-dependent master data table goes in. If the characteristic has only non-time-dependent attributes, only the master data table goes in. -
Hello All,
I am getting below error can you please help me
Error:-
The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.Perhaps this thread will help you out
http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Using procedure in SELECT statement
I have a select statement that currently uses 4 functions to receive necessary values. All the functions are recursive and returns values from the same row.
What I would like to do is replace these for function calls with 1 procedure. Does anybody know if it possible to use a procedure in this way inside a select statement?
If so, do you have the syntax for doing this?
E.g
SELECT
Mdbrd_Pkg.calculate_fixed_charge_fn(in_rc_id, ap.CONFIGSET_ID) AS FIXED_CHARGE,
Mdbrd_Pkg.calculate_charge_rate_fn(in_rc_id, ap.CONFIGSET_ID) AS CHARGE_RATE,
Mdbrd_Pkg.tax_liable_fn(in_rc_id, ap.CONFIGSET_ID) AS TAX_LIABLE,
Mdbrd_Pkg.charge_unit_fn( in_rc_id, ap.CONFIGSET_ID) AS CHARGEUNIT_ID
FROM .....This cannot be done. The part of the function used in the SELECT statement is the return value: procedures don't have return values (that's what makes tham procedures and not functions).
Obviously I don't know what your code does, but you should consider putting them into a single function that returns a TYPE with four attributes and then using the TABLE() function to cast them into something you could reference in the FROM clause of a correlated sub-query. Sounds a bit messy though.
Do these functions actually select data? Where does the recursion fit in?
Cheers, APC -
Using offset in join statement
hi,
i wanted to use offset in join statement. but it is giving error.
select a~kunnr
a~vkorg
from knvv as inner join zcust
on knvv-kunnr+5(5) = zcust-refid.hi neha,
try this code i tested it.
types: begin of ty_knvv,
INCLUDE type knvv,
kunid type i, " For u type is zcust-refid
end of ty_knvv.
data: it_knvv type STANDARD TABLE OF ty_knvv INITIAL SIZE 0,
wa_knvv type ty_knvv.
select *
from knvv
into table it_knvv.
loop at it_knvv into wa_knvv.
kunid = wa_knvv-kunnr+5(5).
wa_knvv-kunid = kunid.
MOdify it_knvv TRANSPORTING kunid.
read table zcust into wa_zcust with key resid = wa_knvv-kunid.
endloop. -
Hi,
In my program have written the code as
SORT gt_bsik BY lifnr belnr gjahr buzei.
DATA : gv_count TYPE i VALUE 0.
IF sy-subrc = 0.
LOOP AT gt_bsik.
AT NEW lifnr .
READ TABLE gt_lfb1 WITH KEY lifnr = gt_bsik-lifnr BINARY
SEARCH.
CLEAR lt_vendors.
lt_vendors-lifnr = gt_lfb1-lifnr.
ENDAT.
AT NEW belnr.
gv_new_invoice_ind = 'X'.
gt_bsik_copy-lifnr = gt_bsik-lifnr.
gt_bsik_copy-belnr = gt_bsik-belnr.
gt_bsik_copy-gjahr = gt_bsik-gjahr.
gt_bsik_copy-buzei = gt_bsik-buzei.
gv_count = gv_count + gt_bsik-buzei .
ENDAT.
the value of gt_bsik-buzei is coming as *** after passing tho AT NEW belnr stmt.Before that the value is correct only after passing tho it showing wrong value but the other fields are showing correct value .Whats the reason for this?HI,
Between AT NEW and endat statements you would have the field contents as **** after the field for which you have used in AT NEW statement. For example if you have used the 3rd field in AT NEW statement then between AT NEW and ENDAT statements you can access the first 3 fields contents only.If you want to access any field after 3rd field then you have to take a Back Up of those fields before you enter in to AT statement. In your case declare a WA_BSIK of type GT_BSIK.
Data : wa_bsik LIKE gt_bsik.
Before you enter in to AT NEW statement transfer contents of gt_bsik to wa_bsik.
WA_BSIK = GT_BSIK.
Between AT NEW and ENDAT use the field contents of wa_bsik and not gt_bsik.
AT NEW belnr.
gv_new_invoice_ind = 'X'.
wa_bsik_copy-lifnr = wa_bsik-lifnr.
wa_bsik_copy-belnr = wa_bsik-belnr.
wa_bsik_copy-gjahr = wa_bsik-gjahr.
wa_bsik_copy-buzei = wa_bsik-buzei.
gv_count = gv_count + wa_bsik-buzei .
ENDAT.
Maybe you are looking for
-
Can't connect to wireless network with Apple Computers (WRT54G)
Hi. I have had a password protected router (WRT54G) for over two years that any pc will connect to if I give them the password. However, my roommate has an apple laptop and he can't connect, no matter how many times we try. I just got an ipod touch
-
i need to convert this program so it sorts characters instead of numbers: public class SortDemo { public static void main(String[] args) { int[] arrayOfInts = { 32, 87, 3, 589, 12, 1076, 2000, 8, 622, 127 }; for (int i = arrayOfInts.length; --i >= 0;
-
PO Auto creation through Requisition Workflow
Hi, I am creating a Non-Catalog Request type of requistion in iProcurement. When I submit the requisition for approval and if the requisition is approved the PO is not getting created. Some of the metalink notes said a Contract PO needs to be created
-
Can I replace the G5 CP units in my pre intel power mac? I get the 3 flash light and am heating them with a hair dryer. It works but needs fixing and I can't afford a new mac
-
Disk wasn't ejected properly..Error
All of a sudden, when my late 2012 iMac wakes from sleep it wakes with a white screen and then takes about 4 seconds to get to the usual desktop screen where I enter my password.. When I log back in it says 'disk wasn't ejected properly' .. All I hav