HOW TO USE "WITH" STATEMENT IN MESSAGES
MESSAGE e001 WITH WERKS SY-REPID
TELL ME HOW TO USE "WITH" IN MESSAGES SEND SYANTAX AND EXAMPLE CODE
Messages e001(zz) with Var1 var2 var3.
For this statement to be valie, the variables var1 var2 var3 should be defined alrteady in the program.
and in se91, you should define a message class (Say ZZ ).
In that message class you can create a message with number (Say 001) with place holders (&).
001: & is a sampele message for & hgh & hjknkn
The & will get replaced by the variables var1 var2 var3 in the run time.
YOu can also create success messages if yo say:
Messages S001(zz) with Var1 var2 var3.
Information
Messages I001(zz) with Var1 var2 var3.
Warning:
Messages W001(zz) with Var1 var2 var3.
Abend:
Messages a001(zz) with Var1 var2 var3.
REFER sample programs : DEMO_MESSAGES
DEMO_MESSAGES_SIMPLE
Regards,
Ravi
Message was edited by:
Ravi Kanth Talagana
Similar Messages
-
How to use union statement with declare & set function?
Hi Experts,
i have small query about how to use union statement with declare & set function?
Example as below :
DECLARE @name AS date
Declare @name2 AS date
/* SELECT FROM [2013].[dbo].[OINV] T0 */
/* WHERE */
SET @name = /* T0.DocDate */ '[%1]'
SET @name2 = /* T0.DocDate */ '[%2]'
select '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2013.dbo.orct t1
inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2013.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]
Union
/* SELECT FROM [2014].[dbo].[OINV] T0 */
/* WHERE */
SET @name = /* T0.DocDate */ '[%1]'
SET @name2 = /* T0.DocDate */ '[%2]'
select '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2014.dbo.orct t1
inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2014.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between [%1] and [%2]You have to create stored procedure in SQL only .
Like u must have create for Crystal .
You can execute procedure in query manager but you have to enter parameter manually..
example
Exec @Test '20140101' '20140501'
Every time user has to enter it manually in yyyymmdd format in case of date parameters.
Example
Create Proc [@Test]
as begin
DECLARE @name AS date
Declare @name2 AS date
/* SELECT FROM [2013].[dbo].[OINV] T0 */
/* WHERE */
select '2013',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2013.dbo.orct t1
inner join 2013.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2013.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2013.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2013].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between @Name and @Name2
Union
/* SELECT FROM [2014].[dbo].[OINV] T0 */
/* WHERE */
select '2014',t5.U_salmannm,t1.CardName,t2.sumapplied as CollectionAmount,t2.DcntSum ,t3.DocTotal as InvoiceTotal,
datediff(dd,t3.DocDate,t1.Docdate) as Days
from 2014.dbo.orct t1
inner join 2014.dbo.RCT2 t2 on t1.DocNum = t2.DocNum
left join 2014.dbo.oinv t3 on
t3.docentry = t2.baseAbs
inner join 2014.dbo.ocrd t4 on t1.Cardcode = t4.CardCode
inner join [2014].[dbo].[@CQ_RTSM] t5 on t4.U_BeatCode = t5.U_RoutCode
where t2.DcntSum <> 0.000000 and t3.DocDate between
between @Name and @Name2
end -
How to use " PERFORM ", STATEMENT WITH OFFSET
hI,
How we use Perform statement with offset, like
Example: " PERFORM READ_SEGRELEASE USING INT_EDIDC+11."
My requirement is to use Perform with Automatic length declaration.
Automatic length declaration in PERFORM statement
Kindly Explain and Provide some Example programm written in this situation.
Thanks,
P.N.KumarHiere is an example of what you probably require:
DATA:
lv_offset TYPE syoffi,
lv_length TYPE flength,
lv_field TYPE string.
lv_field = 'This is my value: hello world'.
lv_length = 5.
lv_offset = 18.
PERFORM read_segrelease USING lv_field
lv_length
lv_offset.
*& Form READ_SEGRELEASE
* text
* -->P_LV_FIELD text
* -->P_LV_LENGTH text
* -->P_LV_OFFSET text
FORM read_segrelease USING p_lv_field TYPE string
p_lv_length TYPE flength
p_lv_offset TYPE syoffi.
DATA:
lv_result TYPE string.
lv_result = p_lv_field+p_lv_offset(p_lv_length).
WRITE: / lv_result.
ENDFORM. " READ_SEGRELEASE -
How to use perform statements in sap scripts
how to use perform statements in sap scripts . and pls send me one progam for this
thnaks
rajaHi Raja,
<b>PERFORM</b> key work is used to include subroutine in sapscript form...
But the processing is lttle bit different form the one we use in ABAP.
Here the paramters passed to form is stored in internal table of name-value table. there are two table one for inbound parameter and other for outbound parameters.
Check out the example below to see how this is used..
<b>Definition in the SAPscript form:</b>
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
<b>Coding of the calling ABAP program:</b>
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY PAGE.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY NEXTPAGE.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY BARCODE.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
ELSE.
OUT_PAR-VALUE = ||. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Hope this is clear to understand...
Enjoy SAP.
Pankaj Singh. -
hi everybody,
how to use collect statement to get the total amount paid to different vendor payments
data : begin of wa occurs 0,
bukrs type bsak-bukrs,
lifnr type bsak-lifnr,
land1 type lfa1-land1,
name1 like lfa1-name1,
dmbtr like bsak-dmbtr,
count type i value 0,
tot_vend type i,
vend type i.
data :end of wa.
data : itab like table of wa.
select distinct bukrs lifnr waers from bsak into
corresponding fields of wa
where bukrs in s_bukrs
and lifnr in s_lifnr
and bschl in s_bschl.
i want the total amount paid according to vendor i am using this way but i am not getting
loop at itab into wa.
wa-dmbtr = bsak-dmbtr.
collect wa-dmbtr into itab.
modify itab from wa transporting dmbtr.
i am unalbe to get it
can anybody help me regarding this if possible with example.
thanks in advance,
regards,
venu.Hi Venu,
types: BEGIN OF ty,
NAME(20),
SALES TYPE I,
END OF ty.
data : itab type standard table of ty,
itab1 type standard table of ty,
wa type ty,
wa1 type ty.
wa-NAME = 'Duck'. wa-SALES = 10.
append wa to itab.
wa-NAME = 'Tiger'. wa-SALES = 20.
append wa to itab.
wa-NAME = 'Duck'. wa-SALES = 30.
append wa to itab.
loop at itab into wa.
wa1 = wa.
collect wa1 into itab1.
endloop.
loop at itab1 into wa1.
write : / wa1-name , wa1-sales.
endloop.
COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
<b>If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.</b>
If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
In the program you mentioned yesterday,I am not able to get the logic since many lines are commented. -
Hi, I have a question on SMP3 and AppDevelopment (Agentry): how to use GCM (Google cloud Messaging) for Agentry Application for PUSH notification
Pratik,
Let me walk you through the flow with the assumption that the user is on an Android device and "connected" to the Agentry server.
An emergency workorder is created in SAP and assigned to the technician.
The SAP backend system will notify the Agentry server via an XML message that there is a workorder to send.
Agentry will get the details and if the user is connected attempt to send the workorder to the device via the Push mechanism
If the push fails to reach the Agentry client, the Agentry server will send a GCM message to the user
When the user returns to the Agentry client, the normal push processing / fetch will occur to receive the workorder from the server assuming the push retrys are in effect.
So, essentially you should not have to do anything to get the GCM to work as a secondary notification mechanism.
If you are looking to do something else with GCM that would be outside of Agentry.
--Bill -
How to use CASE statement in WDA
Hi All,
Can any one Please expain me ' How to use CASE statement in Web dynpro ABAP? '
Please give me an example also.
Thanks in Advance !Hi,
The usage of case statement in webdynpro is same as used in general ABAP.
Data: l_id type string.
l_id = wdevent->get_string( 'ID' ).
case l_id.
when 'BTN1'.
when 'BTN2'.
when 'OTHERS'.
endcase.
Regards,
Radhika. -
How to use collect statement for below
data : begin of itab,
n(3) type c,
n1 type n,
k(5) type c,
end of itab.
select n n1 from into itab table /zteest.
*internal table has
n n1 k
gar 100 uji
hae 90 iou
gar 90 uji
hae 87 iou
I want
gar 190
hae 177
How to use collect statement as n1 is n ..?
let me know..
Thankstry this..
DATA : BEGIN OF itab OCCURS 0,
n(3) TYPE c,
n1(3) TYPE p DECIMALS 2,
k(5) TYPE c,
END OF itab.
itab-n = 'gar'.
itab-n1 = 100.
itab-k = 'uji'.
COLLECT itab .CLEAR itab.
itab-n = 'hae'.
itab-n1 = 90.
itab-k = 'iou'.
COLLECT itab .CLEAR itab.
itab-n = 'gar'.
itab-n1 = 90.
itab-k = 'uji'.
COLLECT itab .CLEAR itab.
itab-n = 'hae'.
itab-n1 = 87.
itab-k = 'iou'.
COLLECT itab .CLEAR itab. -
How to use multiple statements inside the "THEN" block of CASE statement?
Below is the code:
SET @strTempString = case @strKeyMode
WHEN 'AUTO/CYCLE'
THEN @strRefID + '|' + @strRetID
WHEN 'CYCLE'
THEN @strRefID + '|' + @strRetID
WHEN 'COMMERCIAL'
THEN @strRefID + '|' + @strRetID
WHEN 'ISNAP'
THEN set @strFName = ltrim(rtrim((Left(dbo.CleanTheStringAdv(@strFName + ' ', 2) + ' ', 2))))
'' + @strRefID + '|' + @strLName + '|' + @strFName + '|' + @strZIPorPolType
WHEN 'ASNAP'
THEN @strRefID + '|' + @strRetID
WHEN 'MOAT'
THEN @strRefID + '|' + @strRetID
else '0'
end
The first 3 conditions are understandable. How to use multiple statements in 4th case?
Here I first want to set the value as:
set @strFName = ltrim(rtrim((Left(dbo.CleanTheStringAdv(@strFName + ' ', 2) + ' ', 2))))
and then return the string '' + @strRefID + '|' + @strLName + '|' + @strFName + '|' + @strZIPorPolType to @strTempString.
Please help me remove the syntax errors.
Thanks in advance.Try below SQL
DECLARE @strKeyMode varchar(20) = 'ISNAP'
DECLARE @SQL VARCHAR(MAX)
DECLARE @strRefID int=1
DECLARE @strRetID INT=2
--FIRST WAY
IF @strKeyMode ='AUTO/CYCLE'
SELECT CAST(@strRefID as varchar(10))
ELSE IF @strKeyMode ='CYCLE'
SELECT @sql = CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))
ELSE IF @strKeyMode='ISNAP'
SELECT @sql = CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))+'test'+'abc'
ELSE
SELECT @SQL='ABC'
print @sql
----SECOND WAY
SELECT @SQL = CASE @strKeyMode
WHEN 'AUTO/CYCLE' THEN CAST(@strRefID as varchar(10))
WHEN 'CYCLE' THEN CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))
WHEN 'ISNAP' THEN CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))+'test'+'abc'
ELSE 'No Record'
END
PRINT (@SQL)
--Prashanth -
HT3529 How can I get dictation for my iPad for use with email and messaging
How can I get dictation to use with messaging and email?
Apple's dictation requires Siri, which requires a 3rd or 4th generation iPad (or iPad Mini). See:
http://support.apple.com/kb/HT5457
Your post says you have a second generation iPad, so it will not have dictation.
There are third party apps available that might help you. -
How to use "OCI Statement Cache - OCIStmtPrepare2" with XA ? Tuxedo ?
Hi All
Is there is a way to use "OCI Statement Cache - OCIStmtPrepare2" with tuxedo and XA ?
We have found out that a lot of the "CPU time" is spent by OCIStmtPrepare. We have 8 frequent statements (with bind) that we would like to cache .
Based on the following ORACLE paper, our interpenetration is that it is not allowed to cache statements when using XA.
*"Oracle® Database Advanced Application Developer's Guide 11g Release 1 (11.1)" - "Developing Applications with Oracle XA"*
Highlights from the ORACLE paper.
"When used in an Oracle XA application, cursors are valid only for the duration of the transaction. Explicit cursors must be opened after the transaction begins, and closed before the commit or rollback."
"Ensure that the application resets the fetch state before ending a transaction. In general, use release_cursor=no. Use release_cursor=yes only when you are certain that a statement will execute only once."
Regards
TechSginconfirmed by ORACLE.
XA connections don't support OCIStmtPrepare2 (statement caching) -
How to use collect statement properly
In PBID table , i will get 4 rows for a material . I will get the corresponding values of bdzei from the same table . Now i will pass this bdzei into pbhi table. then i will get some 200 rows of data. I have to sum up the field plnmg , by grouping the laeda field of pbhi. In short, i need to know the sum of pbhi-plnmg for a particular pbhi-laeda . I know a way to do it. But i want to know how to use the COLLECT statement for this purpose. My output should contain oly 1 line for 1 material ..
PBID table
Matnr BDZEI
p4471 457
1002
2309
2493
PBHI table
BDZEI LAEDA PLNMG
1002 06.08.2004 0.000
1002 06.08.2004 83.000
457 07.08.2004 12.000
457 07.08.2004 24.000
Reqd O/p
MATNR LAEDA PLNMG
p4471 06.08.2004 83
p4471 07.08.2004 36
Hope u understood my situation .please help me out ...
Thanking you in advance ..
ShankarREPORT zppr_zpipr NO STANDARD PAGE HEADING LINE-SIZE 150 LINE-COUNT 63.
TABLES: pbid,
pbhi,
makt,
mseg,
mkpf.
DATA: BEGIN OF it_pbid OCCURS 0,
matnr LIKE pbid-matnr, " Material
status TYPE c LENGTH 4, " For distinguishing materials from pbid and pbim .. will contain space for PBID and 'PBIM' for PBIM
bdzei LIKE pbid-bdzei,
laeda LIKE pbhi-laeda,
end of it_pbid.
DATA: BEGIN OF it_pbim OCCURS 0,
matnr LIKE pbid-matnr, " Material
status TYPE c LENGTH 4, " For distinguishing materials from pbid and pbim .. will contain space for PBID and 'PBIM' for PBIM
bdzei LIKE pbim-bdzei,
laeda LIKE pbhi-laeda,
end of it_pbim.
DATA: BEGIN OF it_pbid_pbim OCCURS 0,
matnr LIKE pbid-matnr, " Material
laeda LIKE pbhi-laeda, " Reduction Date
dbmng LIKE pbhi-dbmng, " Planned quantity in the data base
plnmg LIKE pbhi-plnmg, " Planned quantity
status TYPE c LENGTH 4, " For distinguishing materials from pbid and pbim .. will contain space for PBID and 'PBIM' for PBIM
mblnr LIKE mseg-mblnr, " Material Doc Number
pbfnr LIKE pbid-pbdnr, " Plan Number
maktx LIKE makt-maktx, " Matl Desc
aenam LIKE pbhi-aenam, " User Changed
erfmg LIKE mseg-erfmg, " Qty Invoiced
budat LIKE mkpf-budat, " Invoice date
bdzei LIKE pbid-bdzei, " Independent requirements pointer
werks LIKE pbid-werks, " plant
pirrednqty TYPE i, " PIR Reduction Quantity = pbih-plnmg - pbih-dbmng
diff TYPE i, " Difference
slno TYPE i, " Sl No
END OF it_pbid_pbim.
DATA: BEGIN OF it_allrows OCCURS 0.
INCLUDE STRUCTURE it_pbid_pbim.
DATA: END OF it_allrows.
*DATA: BEGIN OF it_final OCCURS 0.
INCLUDE STRUCTURE it_pbid_pbim.
*DATA: END OF it_final.
DATA: BEGIN OF line,
matnr LIKE pbid-matnr, " Material
laeda LIKE pbhi-laeda, " Reduction Date
plnmg LIKE pbhi-plnmg, " Planned quantity
maktx LIKE makt-maktx, " Matl Desc
dbmng LIKE pbhi-dbmng, " Planned quantity in the data base
mblnr LIKE mseg-mblnr, " Material Doc Number
pbfnr LIKE pbid-pbdnr, " Plan Number
aenam LIKE pbhi-aenam, " User Changed
erfmg LIKE mseg-erfmg, " Qty Invoiced
budat LIKE mkpf-budat, " Invoice date
bdzei LIKE pbid-bdzei, " Independent requirements pointer
werks LIKE pbid-werks, " plant
pirrednqty TYPE i, " PIR Reduction Quantity = pbih-plnmg - pbih-dbmng
diff TYPE i, " Difference
slno TYPE i, " Sl No
status TYPE c LENGTH 4, " For distinguishing materials from pbid and pbim .. will contain space for PBID and 'PBIM' for PBIM
END OF line.
DATA Itfinal1 LIKE STANDARD TABLE
OF LINE
WITH DEFAULT KEY.
DATA ITfinal LIKE ITfinal1.
DATA: BEGIN OF it_dates OCCURS 0,
date TYPE sy-datum,
END OF it_dates.
DATA: l_slno TYPE i.
DATA: l_zebra TYPE c.
SELECT-OPTIONS:
s_werks FOR pbid-werks obligatory.
SELECT-OPTIONS:
s_matnr FOR pbid-matnr.
SELECT-OPTIONS:
s_pbdnr FOR pbid-pbdnr.
SELECT-OPTIONS:
s_laeda FOR pbhi-laeda obligatory.
parameter:
c_print type checkbox.
SELECT matnr bdzei FROM pbid INTO (it_pbid-matnr, it_pbid-bdzei) WHERE werks IN s_werks AND matnr IN s_matnr AND pbdnr IN s_pbdnr.
it_pbid-status = 'PBID'.
APPEND it_pbid.
move-corresponding it_pbid to it_pbid_pbim.
Append it_pbid_pbim.
ENDSELECT.
SELECT matnr bdzei FROM pbim INTO (it_pbim-matnr,it_pbim-bdzei) WHERE werks IN s_werks AND matnr IN s_matnr AND pbdnr IN s_pbdnr.
APPEND it_pbim.
Append it_pbid_pbim.
ENDSELECT.
*break-point.
START-OF-SELECTION.
LOOP AT s_laeda.
it_dates-date = s_laeda-low.
APPEND it_dates.
ENDLOOP.
DATA: l_startdate LIKE sy-datum.
IF s_laeda-high EQ space.
ELSE.
l_startdate = s_laeda-low + 1.
DO.
IF l_startdate <= s_laeda-high.
it_dates-date = l_startdate.
APPEND it_dates.
ELSE.
it_dates-date = sy-datum.
EXIT.
ENDIF.
l_startdate = l_startdate + 1.
ENDDO.
ENDIF.
*break-point.
LOOP AT it_pbim.
LOOP AT it_dates.
it_pbim-laeda = it_dates-date.
it_pbim-status = 'PBIM'.
MODIFY it_pbim TRANSPORTING laeda status.
MOVE-CORRESPONDING it_pbim TO it_pbid_pbim.
APPEND it_pbid_pbim.
ENDLOOP.
ENDLOOP.
break-point.
l_zebra = 'X'.
DATA: l_toterfmg LIKE mseg-erfmg.
DATA: l_erfmg LIKE mseg-erfmg.
data: l_totpir type i.
**************************************PBID*************************************
LOOP AT it_pbid.
move-corresponding it_pbid to it_pbid_pbim.
append it_pbid_pbim.
SELECT SINGLE maktx FROM makt INTO (it_pbid_pbim-maktx) WHERE matnr = it_pbid-matnr.
MODIFY table it_pbid_pbim TRANSPORTING maktx.
SELECT aenam laeda FROM pbhi INTO (it_pbid_pbim-aenam,it_pbid_pbim-laeda) WHERE bdzei = it_pbid-bdzei AND aenam = 'Abbau-'.
MODIFY TABLE it_pbid_pbim TRANSPORTING aenam laeda. " debug here
select single sum( dbmng ) sum( plnmg ) FROM pbhi INTO (it_pbid_pbim-dbmng,it_pbid_pbim-plnmg) WHERE bdzei = it_pbid-bdzei AND aenam = 'Abbau-' and laeda = it_pbid_pbim-laeda..
MODIFY TABLE it_pbid_pbim TRANSPORTING dbmng plnmg. " debug here
endselect.
it_pbid_pbim-pirrednqty = it_pbid_pbim-dbmng - it_pbid_pbim-plnmg.
MODIFY table it_pbid_pbim TRANSPORTING pirrednqty.
IF ( it_pbid_pbim-laeda IN s_laeda AND it_pbid_pbim-aenam EQ 'Abbau-' ).
MOVE-CORRESPONDING it_pbid_pbim TO it_allrows.
append it_allrows.
ELSEIF NOT it_pbid_pbim-laeda IN s_laeda.
delete it_pbid_pbim index sy-tabix. " debug here
ENDIF.
ENDSELECT.
ENDLOOP.
**************************************PBIM*************************************
LOOP AT it_pbim.
move-corresponding it_pbim to it_pbid_pbim.
append it_pbid_pbim.
SELECT SINGLE maktx FROM makt INTO (it_pbid_pbim-maktx) WHERE matnr = it_pbim-matnr.
MODIFY table it_pbid_pbim TRANSPORTING maktx.
SELECT aenam laeda FROM pbhi INTO (it_pbid_pbim-aenam,it_pbid_pbim-laeda) WHERE bdzei = it_pbim-bdzei AND aenam = 'Abbau-'.
MODIFY TABLE it_pbid_pbim TRANSPORTING aenam laeda. " debug here
select single sum( dbmng ) sum( plnmg ) FROM pbhi INTO (it_pbid_pbim-dbmng,it_pbid_pbim-plnmg) WHERE bdzei = it_pbim-bdzei AND aenam = 'Abbau-' and laeda = it_pbid_pbim-laeda..
MODIFY TABLE it_pbid_pbim TRANSPORTING dbmng plnmg. " debug here
it_pbid_pbim-pirrednqty = it_pbid_pbim-dbmng - it_pbid_pbim-plnmg.
MODIFY table it_pbid_pbim TRANSPORTING pirrednqty.
IF ( it_pbid_pbim-laeda IN s_laeda AND it_pbid_pbim-aenam EQ 'Abbau-' ).
MOVE-CORRESPONDING it_pbid_pbim TO it_allrows.
append it_allrows.
ELSEIF NOT it_pbid_pbim-laeda IN s_laeda.
delete it_pbid_pbim index sy-tabix. " debug here
ENDIF.
ENDSELECT.
ENDLOOP.
sort it_allrows by matnr laeda status.
**********************************ALL ROWS************************
loop at it_allrows.
line-matnr = it_allrows-matnr.
line-laeda = it_allrows-laeda.
line-plnmg = it_allrows-plnmg.
line-dbmng = it_allrows-dbmng.
line-mblnr = it_allrows-mblnr.
line-pbfnr = it_allrows-pbfnr.
line-maktx = it_allrows-maktx.
line-aenam = it_allrows-aenam.
line-erfmg = it_allrows-erfmg.
line-budat = it_allrows-budat.
line-bdzei = it_allrows-bdzei.
line-werks = it_allrows-werks.
line-pirrednqty = it_allrows-pirrednqty.
line-diff = it_allrows-diff.
line-slno = it_allrows-slno.
line-status = it_allrows-status.
collect line into itfinal1.
endloop.
loop at itfinal1 into line.
collect line into itfinal.
write: / line-matnr, line-plnmg, line-dbmng,line-laeda,line-status..
endloop.
skip 4.
loop at itfinal into line.
write: / line-matnr, line-plnmg, line-dbmng,line-laeda,line-status..
endloop.
break-point. -
HOW TO USE PERFORM STATEMENT IN SMARTFORMS
Hi,
Can anyone tell me how to use call subroutine in smartform?
Thanks & Regards,
Gauarv.Hi,
Hope this helps you..
You can use the PERFORM command to call an ABAP subroutine
(form) from
any program, subject to the normal ABAP runtime
authorization
checking. You can use such calls to subroutines for
carrying out
calculations, for obtaining data from the database that is
needed at
display or print time, for formatting data, and so on.
PERFORM commands, like all control commands, are executed
when a
document is formatted for display or printing.
Communication between a
subroutine that you call and the document is by way of
symbols whose
values are set in the subroutine.
The system does not execute the PERFORM command within
SAPscript
replace modules, such as TEXT_SYMBOL_REPLACE or
TEXT_INCLUDE_REPLACE.
The replace modules can only replace symbol values or
resolve include
texts, but not interpret SAPscript control commands.
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of
the four
SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must
therefore be
character strings.
The ABAP subroutine called via the command line stated
above must be
defined in the ABAP report prog as follows:
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The values of the SAPscript symbols passed with /: USING...
are now
stored in the internal table IN_TAB . Note that the system
passes the
values as character string to the subroutine, since the
field Feld
VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR
80). See the
example below on how to access the variables.
The internal table OUT_TAB contains names and values of the
CHANGING
parameters in the PERFORM statement. These parameters are
local text
symbols, that is, character fields. See the example below
on how to
return the variables within the subroutine.
From within a SAPscript form, a subroutine GET_BARCODE in
the ABAP
program QCJPERFO is called. Then the simple barcode
contained there
('First page', 'Next page', 'Last page') is printed as
local variable
symbol. -
hi experts,
I am working with interactive report using hide statement.for thr first time it is working properly but the next time it is not working properly.Hope some clear statement has to be given ..
Please give some simple progarm for interactiev report in list using hide statement.
regards,
maniHIDE dobj.
Effect
This statement stores the content of a variable dobj together with the current list line whose line number is contained in sy-linno in the hide area of the current list level. The data type of the variables dobj must be flat and no field symbols can be specified that point to rows of internal tables, and no class attributes can be specified. The stored values can be read as follows:
For each user action in a displayed screen list that leads to a list result, all the row values stored using HIDE - that is, the row on which the screen cursor is positioned at the time of the event - are assigned to the respective variables.
If a list row of an arbitrary list level is read or modified using the statements READ LINE or MODIFY LINE, all the values of this row stored using HIDE are assigned to the respective variables.
Notes
The HIDE statement works independently of whether the list cursor was set. In particular, variables for empty list rows can be stored - that is, rows in which the list cursor was positioned using statements like SKIP.
The HIDE statement should be executed immediately at the statement that has set the list cursor in the row.
Outside of classes, prior to release 7.0, for dobj constants and literals could still be specified. However, it was not possible to read them at list events and in the READ LINE statement.
Example
Storing square numbers and cubic numbers for a list of numbers. The example shows that arbitrary variables can be stored independently of row content. In the real situation, one would more likely store only the number and execute the calculation, when required, in the the event block for AT LINE-SELECTION.
REPORT ...
DATA: square TYPE i,
cube TYPE i.
START-OF-SELECTION.
FORMAT HOTSPOT.
DO 10 TIMES.
square = sy-index ** 2.
cube = sy-index ** 3.
WRITE / sy-index.
HIDE: square, cube.
ENDDO.
AT LINE-SELECTION.
WRITE: square, cube.
HIDE f.
The contents of f related to the current output line are stored. If this line is selected, f is filled automatically with the stored value.
The selection can be made using:
AT LINE-SELECTION
AT PFx
AT USER-COMMAND
READ LINE
You do not have to output the field with WRITE in order to be able to store its value.
The HIDE statement does not support structures that contain tables (deep structures).
System fields that are particularly useful in interactive reporting are listed in the system fields for lists documentation.
You cannot save lines or components of lines of an internal table that is addressed using a field symbol to the HIDE area. (Compare the ASSIGNING addition to the READ and LOOP statements). Assign the contents of the line or component to a global variable and save this instead.
You can only write variables to the HIDEarea.
In ABAP Objects, the following statements acause an error message:
CONSTANTS f.
HIDE: '...', f.
Correct syntax:
DATA: f1, f2.
HIDE: f1, f2.
Cause:
Interactive list events cause the fields hidden by the HIDE command to be overwritten with values in the HIDE area, which means that they must be changeable.n.
Reward points if useful. -
Please help how to use WITH query in UPDATE
Hi Experts,
Please help me.
Thanks.Not sure about your required output. But try using WITH clause query inside SET clause of UPDATE statement.
UPDATE SALES_REVENUE SR
SET
(SR.TODAY_REV,
SR.TODAY_MARGIN,
SR.TODAY_UNIT
) =
(WITH result_sum_temp
AS(
SELECT SALE_ID, IN_TEAM, 1 SALE_FLAG, loc, seg,
SUM(REV * rate) AS sum_rev,
SUM(MARGIN * rate) AS sum_mar,
SUM(UNIT) AS SUM_UNIT
FROM SALES
WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
AND SALE_SPOT = 7
AND SALE_ID = 375
AND SALE_MODEL = 'D'
AND IN_TEAM IS NOT NULL AND loc IS NOT NULL
GROUP BY SALE_ID, IN_TEAM, loc, seg
UNION ALL
SELECT SALE_ID, OUT_TEAM, 2 SALE_FLAG, loc, seg,
SUM(REV * rate) AS sum_rev,
SUM(MARGIN * rate) AS sum_mar,
SUM(UNIT) AS SUM_UNIT
FROM SALES
WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
AND SALE_SPOT = 2
AND SALE_ID = 375
AND SALE_MODEL = 'D'
AND OUT_TEAM IS NOT NULL AND loc IS NOT NULL
GROUP BY SALE_ID, OUT_TEAM, loc, seg)
(SELECT t.sum_rev, t.sum_mar, t.sum_unit
FROM result_sum_temp t
WHERE SR.SALE_ID = t.SALE_ID
AND SR.team_id = t.team_id
AND SR.SALE_FLAG = t.SALE_FLAG
AND SR.SEG = t.seg
AND SR.loc = t.loc
AND t.SALE_ID = 255)
WHERE SR.SALE_SPOT = 890
AND SR.SALE_ID = 255
AND (SR.SALE_ID, SR.team_id, SR.sale_flag, SR.SEGMENT, SR.LOB) IN
(SELECT SALE_ID,
team_id,
sale_flag,
seg,
loc
FROM result_sum_temp));
Maybe you are looking for
-
How to upload multiple files into a server location at a single time
Hi All, In my application i need to send multiple files from a particular page into the server location. In this page there will be an option to upload a file and after selecting the file , we will have an option asking if we were interested to send
-
I am a beginner at Final Cut Pro. Need help converting MPEG-2 to use.
I am a beginner at Final Cut Pro. I have mpeg-2 video footage that I am trying to import the footage into Final cut, but can't. I understand I need to convert the file format. I am unfamiliar with how to go about the converding file formats and the c
-
Where is the move tool on Ps Touch?
I made a selection and created a new layer and am trying to change the position of thay layer but I dont find the move tool. How can I move a new layer to a different position on the image?
-
Business Object - BDoc Supported Bo
Hello CRM Gurus, This question is related to BOL Object layer. When we create the Business Object of type BDoc Supported, 1.Why is the Write BDoc section of the Business Object becomes disabled with the BDoc name specified in the textbox? Thanks in A
-
HI frds, Please Update the List of Standard REports in HR Module. Like Head Count, Employee list with desigination Raghav