Help needed in report programming
Hi All
I am processing some data on first screen of a report transaction and an output is displayed on second screen. My requirement is that when I press back, I have to come to SAP initial screen.
I have tried all options with 'LEAVE'. Problem is that control doesnt come even once in report, it goes into some standard code so I am unable to make changes..
Kindly help.
Thanks
Dinesh
<LOCKED BY MODERATOR - USE APPROPRIATE TITLES>
<LOCKED BY MODERATOR - URGENT, PLEASE HELP OR SIMILAR ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Aug 18, 2008 5:17 PM
Hi,
Since it is a report program. U have to set PF status in ur output page (either ALV or any other output format).
In GUI status, triger the function code for BACK.
Then, inside the event AT USER-COMMAND, code LEAVE PROGRAM for the BACK function.
If it is an ALV output, the PF-status and User-command event should be called in the ALV function module.
Regards,
Prem
Similar Messages
-
Need example report program using PNPCE LDB in SAP HR
Need example report program using PNPCE LDB in SAP HR.
and how to create a report category in sap hr for using it as cutomised selection screen.Hi,
Go through the following links, i hope it will help you.....
/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
A sample prog with LDB PNP
*& Report ZH_REPT_PAYMENT *
report zh_rept_payment line-size 80 no standard page
heading.
tables: pernr, " Standard Selections for HR Master Data Reporting
pcl1, " HR Cluster 1
pcl2, " HR Cluster 2
pa0009,
PA9001,
PA9006,
pa0002,
pc260 , " Cluster Directory for Payroll Results
bnka .
Infotypes
infotypes: 0001. " Organizational Assignment
Declaration of Internal Tables
data : bnka1 like bnka occurs 0 with header line .
data: begin of t_int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
end of t_int_rep.
data: begin of int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
begda like pa0009-begda, "Begin date
end of int_rep.
Declaration of Data Variables
data: ws_betrg like pc209-betrg, " BT Amount
w_val like spell occurs 0 with header line,
int_rep1(6), " TYPE I, " Employee Number
cnt type i value 0, " Counter
calcmolga like t500l-molga value '40', " Country Grouping
v_id(15),
calc_currency like t001-waers value 'INR'. " Currency
data : ctr type i,
dt_merge like pa0009-begda.
data: ws_totemp(6) type c,
ws_totamt(20) type c,
r_mth(9) type c,
ws_fpbeg(6) type c,
ws_fpend(6) type c,
ws_mthyr(6) type c,
ws_mthyr_r(14) type c,
r_mth_t(3) type c,
ws_amt(8) type c,
ws_bankl(14) type c,
ws_date(6) type c,
amount_word(500),
total_page type i,
pages type i,
remain type i.
data begin of i_spell.
include structure spell .
data end of i_spell .
data : c_molga type t500l-molga value '40',
c_banks type bnka-banks value 'IN'.
Standard Includes
include rpc2cd09. "Cluster CD data definition
include pc2rxin0.
include rpc2rx09.
include rpppxd00. " Data Definition buffer PCL1/PCL2
include rpppxd10. " Common Part buffer PCL1/PCL2
include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
pa_year(4) type c default sy-datum(4) obligatory,
p_bankl like pc209-bankl, " Bank Number
p_zlsch like pc209-zlsch. " Payment method
selection-screen end of block b1.
save_calc_currency = calc_currency.
count_top = 0.
get_pernr_flag = 0.
Top-Of-Page
top-of-page.
perform convert_month using pa_mth(2) r_mth.
ws_mthyr_r = r_mth.
concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
SKIP 5.
skip 1.
skip 4.
if int_rep-bankl eq ' '.
if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
int_rep-zlsch eq ' '.
write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
elseif int_rep-zlsch eq 'L'.
write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
endif.
else.
write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
endif.
skip.
write: /34 ws_mthyr_r,
62 'Page :'(008),69(2) sy-pagno intensified off,
' Of ',78(2) pages intensified off.
clear pages.
read table bnka1 with key bankl = int_rep-bankl .
if sy-subrc = 0.
if int_rep-zlsch eq 'T'.
write:/03(10) 'Bank Name : ', bnka1-banka.
write:/03(10) 'Branch : ', bnka1-brnch.
write:/03(10) 'Address : ', bnka1-stras.
endif.
endif.
skip.
write:/1(80) sy-uline.
write: /1 sy-vline, 2(5) 'Sl.No'(002),
7 sy-vline, 8(8) 'Emp.No.'(003),
16 sy-vline,17(35) 'Employee Name'(004).
*--added for Demand Draft
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline, 48(15) 'Payable at'(005).
else.
write : 47 sy-vline,48(15) 'Account No.'(005).
endif.
write: 63 sy-vline,64(16) 'Amount'(006),
80 sy-vline.
write:/1(80) sy-uline.
end-of-page.
write:/1(80) sy-uline.
write:/2 'Printed on ', sy-datum.
Start-of-selection.
start-of-selection.
*perform h_headr.
ctr = 0.
set margin 5.
call function 'RP_GET_CURRENCY'
exporting
molga = calcmolga
importing
waers = calc_currency
exceptions
others.
if sy-subrc ne 0.
calc_currency = 'DEM'.
calc_currency = save_calc_currency.
endif.
get pernr.
cd-key-pernr = pernr-pernr.
perform import_cluster.
get_pernr_flag = 1.
check : ocd-version-molga eq calcmolga.
The table 'tabpernr' is filled with the personnel numbers
and is used after selection is finished.
move-corresponding pernr to tabpernr.
append tabpernr.
The table 'tab_rgdir' is filled
loop at rgdir.
rx-key-pernr = pernr-pernr.
unpack rgdir-seqnr to rx-key-seqno.
perform int_tab. "fill tab_rgdir
perform import_bt.
perform validate.
endloop.
End of Selection
end-of-selection.
*perform h_headr.
perform convert_date_a using pa_mth r_mth_t.
sort int_rep by bankl zlsch pernr betrg descending.
delete adjacent duplicates from int_rep
comparing bankl zlsch pernr .
sort int_rep by bankl zlsch bankn . "PERNR.
loop at int_rep.
at new bankl.
select single * into bnka1 from bnka
where banks = c_banks and
bankl = int_rep-bankl .
append bnka1.
clear bnka1.
endat.
endloop.
for Demand Draft - purpose added
loop at int_rep.
concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
select single * "zweck into int_rep-zweck
from pa0009 where
pernr = int_rep-pernr and
bankl = int_rep-bankl and
zlsch = int_rep-zlsch
and begda <= dt_merge and
endda >= dt_merge .
if sy-subrc = 0.
int_rep-zweck = pa0009-zweck.
modify int_rep.
endif.
endloop.
*-for DD and Chq sorted by PAyable at and EMPNO wise
if p_zlsch = 'T' .
sort int_rep by bankl zlsch bankn . "PERNR.
else. "added for "payable at" for DD/Chq
else.
sort int_rep by zweck pernr . "PERNR.
endif.
*delete adjacent duplicates from int_rep.
t_int_rep] = int_rep[.
loop at int_rep.
*-for page of page no.
total_page = 0.
loop at t_int_rep where bankl = int_rep-bankl
and zlsch = int_rep-zlsch.
total_page = total_page + 1.
endloop.
pages = total_page div 25.
remain = total_page mod 25.
comment bcoz its adding one extra page no.
done as on 29/11/2004
if remain > 0.
pages = pages + 1.
endif.
**-end
at new bankl.
ctr = 0 .
new-page.
endat.
at new zlsch.
ctr = 0 .
new-page.
endat.
clear v_id.
select single natio
into pa0002-natio
from pa0002
where pernr eq int_rep-pernr.
*-testing......for soma
if ctr > 24.
ctr = 0 .
write:/1(80) sy-uline.
new-page .
endif.
ctr = ctr + 1 .
cnt = cnt + 1.
pack int_rep-pernr to int_rep1.
write:/1 sy-vline, 2(3) cnt intensified off,
7 sy-vline, 9(6) int_rep1 intensified off,
16 sy-vline,17(35) int_rep-ename intensified off .
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline,48(15) int_rep-zweck intensified off.
else.
write:
47 sy-vline,48(15) int_rep-bankn intensified off .
endif.
write: 63 sy-vline,64(16) int_rep-betrg
intensified off currency 'INR',
80 sy-vline.
ws_betrg = ws_betrg + int_rep-betrg.
*-testing......for soma
skip.
write :
/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
sy-vline .
*-end testing......for soma
at end of zlsch.
if int_rep-bankl = ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed On ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
endif.
endat.
at end of bankl.
if int_rep-bankl ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed on ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
NEW-PAGE.
endif.
endat.
endloop.
End of Page
end-of-page.
write: /2 'Prepared by :'(010), '_______________',
45 'Checked by :'(011),'_______________'.
*& Form IMPORT_CLUSTER
Importing Data from Cluster *
form import_cluster.
sy-subrc = 0.
rp-imp-c2-cd.
if sy-subrc eq 0.
if cd-version-number ne ocd-version-number.
endif.
endif. " SY-SUBRC EQ 0
endform. " IMPORT_CLUSTER
*& Form INT_TAB
Filling internal table tab_rgdir form int_tab.
*Fill internal table tab_rgdir.
move-corresponding rgdir to tab_rgdir.
tab_rgdir-pernr = pernr-pernr.
append tab_rgdir.
endform. " INT_TAB
*& Form IMPORT_bt
Import Values from Bank Transactions Table (BT) form import_bt.
rp-init-buffer.
RP-IMP-C2-RX.
rp-imp-c2-in.
if rp-imp-in-subrc eq 0.
if in-version-number ne oin-version-number.
write: / 'Schlüssel des Clusters RX:'(015),
rx-key-pernr, rx-key-seqno.
write: / 'The imported version of the cluster'(016), 'RX',
'is not current'(017).
write: / 'Imported version :'(018),
oin-version-number.
write: / 'Current version of cluster :'(019),
in-version-number.
stop.
else.
sy-subrc = 0.
endif.
else.
sy-subrc = 8.
write: /
'Inconsistencies between cluster directory and directory for'(020).
write: /
'No payroll results found for data in cluster directory'(021).
write : /
'Please contact hotline to solve the current problem'(022).
endif.
ws_fpbeg(2) = versc-fpbeg+4(2).
ws_fpbeg+2(4) = versc-fpbeg(4).
ws_fpend(2) = versc-fpend+4(2).
ws_fpend+2(4) = versc-fpend(4).
ws_mthyr(2) = pa_mth.
ws_mthyr+2(4) = pa_year.
check ws_mthyr = ws_fpbeg.
check ws_mthyr = ws_fpend.
loop at bt. "from pc209
int_rep-pernr = pernr-pernr.
int_rep-ename = pernr-ename.
int_rep-bankl = bt-bankl.
int_rep-bankn = bt-bankn.
int_rep-betrg = bt-betrg.
int_rep-zlsch = bt-zlsch.
append int_rep.
endloop.
IF P_BANKL ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE ZLSCH P_ZLSCH.
ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ENDIF.
endform. " IMPORT_BT
*& Form CONVERT_MONTH
Fetching Month Text form convert_month using mth t_mth.
case mth.
when '01'.
t_mth = 'January'(023).
when '02'.
t_mth = 'February'(024).
when '03'.
t_mth = 'March'(025).
when '04'.
t_mth = 'April'(026).
when '05'.
t_mth = 'May'(027).
when '06'.
t_mth = 'June'(028).
when '07'.
t_mth = 'July'(029).
when '08'.
t_mth = 'August'(030).
when '09'.
t_mth = 'September'(031).
when '10'.
t_mth = 'October'(032).
when '11'.
t_mth = 'November'(033).
when '12'.
t_mth = 'December'(034).
endcase.
endform. " CONVERT_MONTH
*& Form CONVERT_DATE_A
Fetching Month Text * form convert_date_a using mth_t t_mth_t.
case mth_t.
when '01'.
t_mth_t = 'Jan.'(035).
when '02'.
t_mth_t = 'Feb.'(036).
when '03'.
t_mth_t = 'Mar.'(037).
when '04'.
t_mth_t = 'Apr.'(038).
when '05'.
t_mth_t = 'May.'(039).
when '06'.
t_mth_t = 'Jun.'(040).
when '07'.
t_mth_t = 'Jul.'(041).
when '08'.
t_mth_t = 'Aug.'(042).
when '09'.
t_mth_t = 'Sep.'(043).
when '10'.
t_mth_t = 'Oct.'(044).
when '11'.
t_mth_t = 'Nov.'(045).
when '12'.
t_mth_t = 'Dec.'(046).
endcase.
endform. " CONVERT_DATE_A
*& Form VALIDATE
text
--> p1 text
<-- p2 text form validate .
if p_bankl <> ' ' and p_zlsch ' '.
delete int_rep where bankl p_bankl.
elseif p_bankl = ' ' and p_zlsch ' '.
delete int_rep where zlsch p_zlsch.
elseif p_bankl ' ' and p_zlsch = ' '.
delete int_rep where bankl p_bankl.
endif.
endform. " VALIDATE
check this weblog.....
/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
Also , check the following link too.
http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
Regards,
Harish -
Need help in the Report Program!!!
Hi,
This is SAI KUMAR.
<b>Selection Screen</b>
Sales Org: <b>VKORG</b>
Distribution Channel: <b>VTWEG</b>
Division: <b>SPART</b>
Billing Type: <b>FKART</b>
Plant: <b>WERKS</b>
Payment Terms: <b>ZTERM</b>
Sold-to Party: <b>KUNAG</b>
Billing Date: <b>FKDAT</b>
Now Using the above Selection screen inputs, I want to generate the following fields in the output.
<b>Output Screen</b>
Invoice No: <b>VBELN</b>
Invoice Date: <b>FKDAT</b>
Customer Number: <b>KUNNR</b>
Customer Name: <b>NAME1</b>
Material Description: <b>MAKTX</b>
Payment Terms: <b>ZTERM</b>
Net Value: <b>NETWR</b>
Ship-to City: <b>ORT01</b>
Sold-to party: <b>KUNAG</b>
Ship-to party: <b>KUNNR</b>
<u><b>Tables Used: </b></u>
Delivery: <b>LIKP, LIPS</b>
Invoice:<b>VBRK, VBRP</b>
Customer: <b>KNA1</b>
Material: <b>MARA</b>
Material Description: <b>MAKT</b>
<b>
Now the Problem what I got is....How to link between these tables...ie., what common fields can be used between these tables so that I can use FOR ALL ENTRIES and retrieve the above output fields.</b>
Can anyone please help me out in giving a REPORT program or a pseudo code for the above data.
Thanks & Regards,
SAI KUMAR
<b>ID: [email protected]</b>See the below code :
REPORT zjpvrom323 NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 35
MESSAGE-ID zjpv001 .
*& Development ID: OM_DD_323_LJP *
*& Report : ZJPVROM323 *
*& This application is used to Develop a new billing document that *
*& fulfills the NPKK Requirement That does not exist in JSP *
*& functionality.according to the delivery date it displays Monthly *
sales notes report *
*& Change Log: *
*& Init. Who Date Text *
*& MALIKDH1 Seshu Reddy 2003/07/20 Initial Development *
Constants
CONSTANTS :c_vkorg(4) VALUE 'JP20', " Sale Organization
c_vtweg(2) VALUE 'TR', " Distribution Channel
c_rfbsk VALUE 'C', " Status for transfer to accounting
c_spart(2) VALUE '01', " Division
c_kvgr2(3) VALUE 'Z51', " Customer Group 2
c_fkart(4) TYPE c VALUE 'ZJPW', " Billing Type
c_waerk(5) TYPE c VALUE 'JPY', " SD document currency
c_kschl(4) TYPE c VALUE 'ZJPC', " Condition type
c_no_of_lines TYPE i VALUE '35',
C_CONS_5(1) TYPE C VALUE '5',
C_CONS_8(1) TYPE C VALUE '8',
C_CONS_10(2) TYPE C VALUE '10',
c_konwa(5) TYPE c VALUE 'JPY'. " Rate unit (currency or
" percentage)
DB-Tables *
*TABLES : vbrk, " Billing : Header Data
vbrp, " Billing : Item Data
kna1, " Customer master : General data
knvv, " Customer master : sales data
likp, " Delivery : Header data
konv, " Condition : Transaction data
konp, " Condition : items
zjpv_torihiki, " Add on table:Business transaction category
zjpv_rebate. " Add on table : rebate table
Variables/Internal table *
DATA :g_date(2) TYPE n, " Date
g_month(2) TYPE n, " Month
g_year(4) TYPE n , " Year
g_bill_low(10) TYPE n, " From date
g_bill_high(10) TYPE n, " To date
g_month1(2) TYPE n, " Month
g_year1(4) TYPE n, " Year
g_date1(2) TYPE n, " Date
g_year2(4) TYPE n, " Year
g_datum LIKE sy-datum, " System date
g_skip(4) TYPE c , " Line break
g_ctax(8) TYPE c, " Consumption tax
g_ctax1(10) TYPE c, " Consumption tax
g_ctax2(16) TYPE c, " Consumption tax
g_vol(6) TYPE c, " Volume
g_vol1(6) TYPE c, " Volume
g_vol2(7) TYPE c, " Volume
g_tamt(10) TYPE c, " Total amount
g_tamt1(13) TYPE c, " Total amount
g_tamt2(16) TYPE c, " Total amount
g_gtotal(10) TYPE c, " Net total
g_gtotal1(13) TYPE c, " Net total
g_gtotal2(16) TYPE c, " Net total
g_uprice(8) TYPE c, " Unit Price
g_uprice1(10) TYPE c, " Unit Price
g_uprice2(11) TYPE c, " Unit Price
g_amount(10) TYPE c, " Amount
g_amount1(13) TYPE c, " Amount
g_amount2(14) TYPE c, " Amount
g_fctax(16) TYPE c, " Consumption Tax (Total)
g_ftamnt(16) TYPE c, " Total amount (Total)
g_ftotal(16) TYPE c, " net total (Total)
g_fctax1(8) TYPE c, " Totals with Comma (Consumption tax)
g_fctax2(10) TYPE c, " Totals with Comma (Consumption tax)
g_fctax3(11) TYPE c, " Totals with Comma (Consumption tax)
g_ftamt1(10) TYPE c, " Totals with comma (Total amount)
g_grand_total(16),
g_grand_total1(14),
g_net_total(16),
g_net_total1(14),
g_middle_val(16),
g_middle_val1(11),
g_ftamt2(13) TYPE c, " Totals with Comma(Total amount)
g_ftamt3(14) TYPE c, " Totals with comma(Total amount)
g_ftotal1(10) TYPE c, " Totals with comma(Net total)
g_ftotal2(13) TYPE c, " Totals with comma(Net total)
g_ftotal3(14) TYPE c. " Totals with comma(Net total)
*Internal table for billing document header
DATA : BEGIN OF t_vbrk OCCURS 0,
vbeln LIKE vbrk-vbeln, " Billing Doc number
vbtyp LIKE vbrk-vbtyp, " Document Category
kunag LIKE vbrk-kunag, " sold-to-party
vkorg LIKE vbrk-vkorg, " sales organization
vtweg LIKE vbrk-vtweg, " Distribution Channel
kunrg LIKE vbrk-kunrg, " Payer
fkart_rl LIKE vbrk-fkart_rl," Billing Type
fkdat LIKE vbrk-fkdat, " Billing date
mwsbk LIKE vbrk-mwsbk, " Tax amount in document currency
netwr LIKE vbrk-netwr, " Net value in document currency
waerk LIKE vbrk-waerk, " SD document currency
knumv LIKE vbrk-knumv, " Number of the document condition
END OF t_vbrk.
internal table for Output formatting
DATA : BEGIN OF t_oput OCCURS 0,
rbcode(4) TYPE c, " Regulating Branch Code
tpcode(10) TYPE c, " trading partner code
bdgrp(3) TYPE c, " Billing Document Group
zjd_torihikikubn(3) TYPE c, " business transaction
"category
tpname1(35) TYPE c, " trading partner name 1
tpname2(35) TYPE c, " trading partner name 2
bdgnm(10) TYPE c, " Billing Doc Group Name
dcode(10) TYPE c, " destination code
dname(35), " destination name
fkdat(10) TYPE c, " Date of Issue
vbeln(10) TYPE c, " Billing Doc No
zzjp_remarks(30) TYPE c, " Remarks
ctax(16) TYPE c, " Consumption Tax
tamnt(16) TYPE c, " Total Amount
gtotal(16) TYPE c, " Grand total,
pcode(9) TYPE n, " Product Code
pname(40) TYPE c, " Product name
volume(16) TYPE p decimals 3, " volume
volume1 type i,
volume2(16) type c,
uprice(13) TYPE c, " Unit Price
amount(16) TYPE c, " Amount
posnr(6) TYPE n, " Billing Item
END OF t_oput.
*Internal table for Customer Master Sales Data
DATA : BEGIN OF t_knvv OCCURS 0,
kunnr LIKE knvv-kunnr, " Customer Number
vkorg LIKE knvv-vkorg, " Sales Organization
vtweg LIKE knvv-vtweg, " Distribution Channel
spart LIKE knvv-spart, " Division
kvgr2 LIKE knvv-kvgr2, " Customer Group 2
vkbur LIKE knvv-vkbur, " sales office
END OF t_knvv.
*Internal table for Customer Master Data
DATA : BEGIN OF t_kna1 OCCURS 0,
kunnr LIKE kna1-kunnr, " Customer number
name1 LIKE kna1-name1, " Customer Name 1
name2 LIKE kna1-name2, " Customer Name 2
END OF t_kna1.
Internal table used for billing document items
DATA : BEGIN OF t_vbrp OCCURS 0,
vbeln LIKE vbrp-vbeln, " Billing Document
posnr LIKE vbrp-posnr, " Billing item
zjd_torihikikubn LIKE vbrp-zjd_torihikikubn, " Business
" Transaction Category
vgbel LIKE vbrp-vgbel, " Document number of the
" reference document
vgtyp LIKE vbrp-vgtyp, " Document category of
" preceding SD document
zzjp_remarks LIKE vbrp-zzjp_remarks, " Remarks
zjd_kanamei LIKE vbrp-zjd_kanamei,
fkimg LIKE vbrp-fkimg, " Actual billed quantity
netwr LIKE vbrp-netwr, " Net value of the
" billing item in document currency
zjd_touitsumatnr LIKE vbrp-zjd_touitsumatnr,
END OF t_vbrp.
Internal table used for Rebate Table
DATA : BEGIN OF t_zjpv_rebate OCCURS 0,
fkart LIKE zjpv_rebate-fkart, " Billing type
rebate_code LIKE zjpv_rebate-rebate_code, " Rebate Code
rebate_name LIKE zjpv_rebate-rebate_name, " Rebate Name
END OF t_zjpv_rebate.
*Internal table used for Delivery Header
DATA : BEGIN OF t_likp OCCURS 0,
vbeln LIKE likp-vbeln, " Delivery No
kunnr LIKE likp-kunnr, " Ship-to party
END OF t_likp.
*Internal table for conditions (Transaction Data)
DATA : BEGIN OF t_konv OCCURS 0,
knumv LIKE konv-knumv, " Number of the document condition
kposn LIKE konv-kposn, " Condition item number
kschl LIKE konv-kschl, " Condition type
knumh LIKE konv-knumh, " Condition type
END OF t_konv.
Internal table for conditions (Item)
DATA : BEGIN OF t_konp OCCURS 0,
knumh LIKE konp-knumh, " Number of the document condition
kbetr LIKE konp-kbetr, " Rate (condition amount or
" percentage) where no scale exists
konwa LIKE konp-konwa, " Rate unit (currency or percentage)
END OF t_konp.
Internal table for table Torihiki Kubun
DATA : BEGIN OF t_zjpv_torihiki OCCURS 0,
kubun LIKE zjpv_torihiki-kubun, " Condition type
rep_grp LIKE zjpv_torihiki-rep_grp, " Shikiri Report Group
rep_grp_name LIKE zjpv_torihiki-rep_grp_name, " Shikiri Report
" Group NAME
END OF t_zjpv_torihiki.
DATA: l_tpname1(35) TYPE c, " trading partner name 1
l_tpname2(35) TYPE c, " trading partner name 2
l_bdgnm(10) TYPE c, " Billing Doc Group Name
G_FLG(1) type c,
G_FLG1(1) type c.
Selection screen *
SELECTION-SCREEN : BEGIN OF BLOCK zjpv WITH FRAME TITLE text-001.
PARAMETER : p_date LIKE sy-datum OBLIGATORY. " Delivery date
SELECTION-SCREEN : END OF BLOCK zjpv.
RANGES : r_bdate FOR vbrk-fkdat. " Billing date
Initialization *
INITIALIZATION.
p_date = sy-datum.
MAIN PROCESSING *
START-OF-SELECTION.
This Perform is used for getting Billing date According to Delivery
Date(Output date)
PERFORM f_bill_date_move.
Selecting the data from tables VBRK,VBRP,KNVV,KNA1,KONV,KONP,LIKP,
ZJPV_TORIHIKI and ZJPV_REBATE
PERFORM f_get_data.
Passing the data from the internal tables (T_VBRK,T_VBRP,T_KNVV,
T_KNA1,T_KONV,T_KONP,T_LIKP, T_ZJPV_TORIHIKI and T_ZJPV_REBATE)
to out put Internal table(T_OPUT)
PERFORM f_process_data.
END OF SELECTION *
END-OF-SELECTION.
Out put formatting
PERFORM f_output_data.
*& Form F_Bill_DATE_MOVE
This Perform is used for getting Billing date According to Delivery *
Date(Output date) *
FORM f_bill_date_move.
g_datum = p_date + 10.
g_month = g_datum+4(2).
g_year = g_datum+0(4).
IF g_month = 1.
g_year = g_year - 1.
g_month = 12.
g_date = 1.
ELSE.
g_month = g_month - 1.
g_date = 1.
ENDIF.
Passing the date to billing date-low
CONCATENATE g_year g_month g_date INTO g_bill_low.
r_bdate-low = g_bill_low.
r_bdate-sign = 'I'.
r_bdate-option = 'BT'.
g_month1 = g_datum+4(2).
g_year1 = g_datum+0(4).
IF g_month1 = 1.
g_year1 = g_year1 - 1.
g_month1 = 12.
ELSE.
g_month1 = g_month1 - 1.
ENDIF.
CASE g_month1.
WHEN 1.g_date1 = '31'.
WHEN 3.g_date1 = '31'.
WHEN 4.g_date1 = '30'.
WHEN 5.g_date1 = '31'.
WHEN 6.g_date1 = '30'.
WHEN 7.g_date1 = '31'.
WHEN 8.g_date1 = '31'.
WHEN 9.g_date1 = '30'.
WHEN 10.g_date1 = '31'.
WHEN 11.g_date1 = '30'.
WHEN 12.g_date1 = '31'.
ENDCASE.
g_year2 = g_year1.
IF g_month1 = 2.
g_year2 = g_year2 MOD 4 .
IF g_year2 = 0.
g_date1 = 29.
ELSE.
g_date1 = 28.
ENDIF.
ENDIF.
Passing the date to billing date-high
CONCATENATE g_year1 g_month1 g_date1 INTO g_bill_high.
r_bdate-high = g_bill_high.
APPEND r_bdate.
ENDFORM. " F_Bill_DATE_MOVE
*& Form f_get_data
Selecting the data from tables VBRK,VBRP,KNVV,KNA1,KONV,KONP,LIKP, *
ZJPV_TORIHIKI and ZJPV_REBATE *
FORM f_get_data.
Selecting the data from VBRK into internal table T_VBRK.
SELECT vbeln
vbtyp
kunag
vkorg
vtweg
kunrg
fkart_rl
fkdat
mwsbk
netwr
waerk
knumv
FROM vbrk
INTO TABLE t_vbrk
WHERE fkdat BETWEEN r_bdate-low and r_bdate-high
and RFBSK = C_RFBSK
AND vbtyp IN ('N' , 'S' , 'M' , 'O' , 'P')
AND vkorg = c_vkorg
AND vtweg = c_vtweg
AND netwr <> 0.
IF sy-subrc Eq 0.
sort t_vbrk.
ENDIF.
Selecting the data from KNVV into internal table T_KNVV.
SELECT kunnr
vkorg
vtweg
spart
kvgr2
vkbur
FROM knvv
INTO TABLE t_knvv
FOR ALL ENTRIES IN t_vbrk WHERE ( kunnr = t_vbrk-kunag
OR kunnr = t_vbrk-kunrg )
AND vkorg = t_vbrk-vkorg
AND vtweg = t_vbrk-vtweg
AND spart = c_spart
AND kvgr2 = c_kvgr2.
Selecting the data from VBRP into internal table T_VBRP.
SELECT vbeln
posnr
zjd_torihikikubn
vgbel
vgtyp
zzjp_remarks
zjd_kanamei
fkimg
netwr
zjd_touitsumatnr
FROM vbrp
INTO TABLE t_vbrp
FOR ALL ENTRIES IN t_vbrk
WHERE vbeln = t_vbrk-vbeln.
Selecting the data from ZJPV_REBATE into internal table T_ZJPV_REBATE.
SELECT fkart
rebate_code
rebate_name
FROM zjpv_rebate
INTO TABLE t_zjpv_rebate
FOR ALL ENTRIES IN t_vbrk
WHERE fkart = t_vbrk-fkart_rl.
Selecting the data from KNA1 into internal table T_KNA1.
SELECT kunnr
name1
name2
FROM kna1
INTO TABLE t_kna1
FOR ALL ENTRIES IN t_knvv
WHERE kunnr = t_knvv-kunnr.
IF NOT t_vbrp[] IS INITIAL.
Selecting the data from LIKP into internal table T_LIKP.
SELECT vbeln
kunnr
FROM likp
INTO TABLE t_likp
FOR ALL ENTRIES IN t_vbrp
WHERE vbeln = t_vbrp-vgbel.
ENDIF.
Selecting the data from KONV into internal table T_KONV.
SELECT knumv
kposn
kschl
knumh
FROM konv
INTO TABLE t_konv
FOR ALL ENTRIES IN t_vbrk
WHERE knumv = t_vbrk-knumv
AND kschl = c_kschl.
Selecting the data from KONP into internal table T_KONP.
SELECT knumh
kbetr
konwa
FROM konp
INTO TABLE t_konp
FOR ALL ENTRIES IN t_konv
WHERE knumh = t_konv-knumh.
Selecting the data from ZJPV_TORIHIKI into internal table
T_ZJPV_TORIHIKI.
SELECT kubun
rep_grp
rep_grp_name
FROM zjpv_torihiki
INTO TABLE t_zjpv_torihiki
FOR ALL ENTRIES IN t_vbrp
WHERE kubun = t_vbrp-zjd_torihikikubn.
ENDFORM. " f_get_data
*& Form f_process_data
Reading The Data from Internal tables (T_VBRK,T_VBRP,T_KNVV,T_KNA1, *
T_LIKP,T_KONV,T_KONP,T_ZJPV_REBATE and T_ZJP_TORIHIKI) *
FORM f_process_data.
Sorting the internal table t_kna1, t_vbrk, t_vbrp ,t_knvv,t_kna1,
t_likp and t_zjpv_rebate
SORT: t_kna1 BY kunnr,
t_vbrk BY vbeln,
t_vbrp BY vbeln,
t_knvv BY kunnr,
t_zjpv_rebate BY fkart,
t_knvv BY kunnr vkorg vtweg spart,
t_likp BY vbeln.
LOOP AT t_vbrk.
Reading the data from internal table t_knvv
READ TABLE t_knvv WITH KEY kunnr = t_vbrk-kunag
vkorg = t_vbrk-vkorg
vtweg = t_vbrk-vtweg
spart = c_spart
kvgr2 = c_kvgr2.
IF sy-subrc NE 0.
g_flg = 'X'.
ENDIF.
Reading the data from internal table t_knvv
READ TABLE t_knvv WITH KEY kunnr = t_vbrk-kunrg
vkorg = t_vbrk-vkorg
vtweg = t_vbrk-vtweg
spart = c_spart
kvgr2 = c_kvgr2.
IF sy-subrc NE 0.
G_FLG1 = 'X'.
ENDIF.
IF G_FLG = 'X' AND G_FLG1 = 'X'.
DELETE T_VBRK.
CLEAR: G_FLG, G_FLG1.
CONTINUE.
ENDIF.
ENDLOOP.
DATA : l_sign(1) TYPE c VALUE '-',
l_ctax(15) TYPE n ,
l_tamnt(15) TYPE n ,
l_volume(16) TYPE c,
l_gtotal(15) TYPE n,
l_amnt(15) TYPE n.
SORT t_konv BY knumv kposn kschl.
SORT t_konp BY knumh.
LOOP AT t_vbrp.
READ TABLE t_vbrk WITH KEY vbeln = t_vbrp-vbeln.
IF sy-subrc <> 0.
DELETE t_vbrp.
CONTINUE.
ENDIF.
Reading the data from Internal table T_zjpv_rebate(Rebate table)
READ TABLE t_zjpv_rebate WITH KEY
fkart = t_vbrk-fkart_rl
BINARY SEARCH.
IF sy-subrc NE 0 OR t_vbrk-fkart_rl EQ c_fkart.
MOVE t_vbrk-kunag TO t_oput-tpcode.
ELSE .
IF t_vbrk-fkart_rl NE c_fkart.
MOVE t_vbrk-kunrg TO t_oput-tpcode.
ENDIF.
ENDIF.
READ TABLE t_zjpv_rebate WITH KEY
fkart = t_vbrk-fkart_rl
BINARY SEARCH.
IF sy-subrc NE 0.
Passing the last 6 values of ZJD_TOUITSUMANTR into product code.
MOVE t_vbrp-zjd_touitsumatnr+3(6) TO t_oput-pcode.
MOVE t_vbrp-zjd_kanamei TO t_oput-pname.
ELSE.
MOVE t_zjpv_rebate-rebate_code+3(6) TO t_oput-pcode.
MOVE t_zjpv_rebate-rebate_name TO t_oput-pname.
ENDIF.
Reading the data from Internal table T_KNA1(Customer Master)
READ TABLE t_kna1 WITH KEY
kunnr = t_oput-tpcode BINARY SEARCH.
IF sy-subrc = 0.
MOVE t_kna1-name1 TO t_oput-tpname1.
MOVE t_kna1-name2 TO t_oput-tpname2.
ENDIF.
Reading the data from Internal table T_vbrp(Billing Documnet: Item)
MOVE t_vbrp-zjd_torihikikubn TO t_oput-zjd_torihikikubn.
Reading the data from Internal table T_KNVV
READ TABLE t_knvv WITH KEY kunnr = t_vbrk-kunrg
vkorg = c_vkorg
vtweg = c_vtweg
spart = c_spart
BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE t_knvv-vkbur TO t_oput-rbcode.
ENDIF.
Reading the data from Internal table T_LIKP (Delivery : Header)
IF t_vbrp-vgtyp = 'J' OR t_vbrp-vgtyp = 'T'.
READ TABLE t_likp WITH KEY
vbeln = t_vbrp-vgbel
BINARY SEARCH.
IF sy-subrc = 0.
MOVE t_likp-kunnr TO t_oput-dcode.
ENDIF.
ENDIF.
Reading the data from Internal table T_KNA1.
READ TABLE t_kna1 WITH KEY kunnr = t_likp-kunnr BINARY SEARCH.
IF sy-subrc = 0 AND NOT t_oput-dcode IS INITIAL.
MOVE t_kna1-name2 TO t_oput-dname.
ENDIF.
*Passing the values from internal table t_vbrk and t_vbrp to
*out put internal table.
MOVE t_vbrk-fkdat TO t_oput-fkdat.
CONCATENATE t_oput-fkdat0(4) '.' t_oput-fkdat4(2) '.'
t_oput-fkdat+6(2) INTO t_oput-fkdat.
MOVE t_vbrk-vbeln TO t_oput-vbeln.
MOVE t_vbrp-posnr TO t_oput-posnr.
MOVE t_vbrp-zzjp_remarks TO t_oput-zzjp_remarks.
*Checking for billing document category.
IF t_vbrk-vbtyp = 'M' OR t_vbrk-vbtyp = 'P' OR t_vbrk-vbtyp = 'S'.
IF t_vbrk-waerk = c_waerk.
t_oput-ctax = t_vbrk-mwsbk * 100.
t_oput-tamnt = t_vbrk-netwr * 100.
t_oput-gtotal = t_oput-ctax + t_oput-tamnt.
ELSE.
t_oput-ctax = t_vbrk-mwsbk .
t_oput-tamnt = t_vbrk-netwr.
t_oput-gtotal = t_oput-ctax + t_oput-tamnt.
ENDIF.
ENDIF.
IF t_vbrk-vbtyp = 'O' OR t_vbrk-vbtyp = 'N' .
IF t_vbrk-waerk = c_waerk.
l_ctax = ( t_vbrk-mwsbk * 100 ) .
*The contents of the consumption tax are converted to display format.
PERFORM F_ALPHA_CONV USING L_CTAX.
CONCATENATE l_sign l_ctax INTO t_oput-ctax.
CONDENSE t_oput-ctax.
l_tamnt = ( t_vbrk-netwr * 100 ).
*The contents of the total amount are converted to display format.
PERFORM F_ALPHA_CONV USING L_TAMNT.
CONCATENATE l_sign l_tamnt INTO t_oput-tamnt.
CONDENSE t_oput-tamnt.
l_gtotal = t_oput-ctax + t_oput-tamnt.
*The contents of the grand total are converted to display format.
PERFORM F_ALPHA_CONV USING L_GTOTAL.
CONCATENATE l_sign l_gtotal INTO t_oput-gtotal.
ELSE.
l_ctax = t_vbrk-mwsbk.
*The contents of the consumption tax are converted to display format.
PERFORM F_ALPHA_CONV USING L_CTAX.
CONCATENATE l_sign l_ctax INTO t_oput-ctax.
l_tamnt = ( t_vbrk-netwr ).
*The contents of the total amount are converted to display format.
PERFORM F_ALPHA_CONV USING L_TAMNT.
CONCATENATE l_sign l_tamnt INTO t_oput-tamnt.
l_gtotal = ( t_oput-ctax + t_oput-tamnt ).
*The contents of the grand total are converted to display format.
PERFORM F_ALPHA_CONV USING L_GTOTAL.
CONCATENATE l_sign l_gtotal INTO t_oput-gtotal.
ENDIF.
ENDIF.
Comparing the volume with given conditions.
IF t_vbrp-fkimg EQ 0.
t_oput-volume = space.
ELSEIF t_vbrp-fkimg NE 0.
IF t_vbrk-vbtyp = 'M' OR t_vbrk-vbtyp = 'P' OR t_vbrk-vbtyp = 'S'.
t_oput-volume = t_vbrp-fkimg.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 3
input = t_oput-volume
SIGN = ' '
IMPORTING
OUTPUT = t_oput-volume1
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
move t_oput-volume1 to t_oput-volume2.
condense t_oput-volume2 no-gaps.
ELSEIF t_vbrk-vbtyp = 'O' OR t_vbrk-vbtyp = 'N'.
t_oput-volume = t_vbrp-fkimg.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 3
input = t_oput-volume
SIGN = ' '
IMPORTING
OUTPUT = t_oput-volume1
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
l_volume = t_oput-volume1.
*The contents of the volume are converted to display format.
PERFORM F_ALPHA_CONV USING L_VOLUME.
CONCATENATE l_sign l_volume INTO t_oput-volume2.
condense t_oput-volume2 no-gaps.
ENDIF.
ENDIF.
*Unit price
IF t_vbrp-fkimg EQ 0.
t_oput-uprice = space.
ELSE.
Reading The data from Internal Table T_KONV(Condition :Transactional)
READ TABLE t_konv WITH KEY knumv = t_vbrk-knumv
kposn = t_vbrp-posnr
kschl = c_kschl
BINARY SEARCH.
IF sy-subrc = 0.
Reading The data from Internal Table T_KONP(Condition : Items)
READ TABLE t_konp WITH KEY
knumh = t_konv-knumh
BINARY SEARCH.
IF sy-subrc = 0.
IF t_konp-konwa = c_konwa.
t_oput-uprice = 100 * t_konp-kbetr.
ELSE.
t_oput-uprice = t_konp-kbetr.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
Caluculating the amount with given conditions
IF t_zjpv_rebate-fkart = t_vbrk-fkart_rl.
t_oput-amount = t_vbrk-netwr.
ELSE.
t_oput-amount = t_vbrp-netwr.
ENDIF.
IF t_vbrk-waerk EQ c_waerk.
t_oput-amount = 100 * t_oput-amount.
ENDIF.
IF t_vbrk-vbtyp ='M' OR t_vbrk-vbtyp = 'P' OR
t_vbrk-vbtyp = 'S'.
ELSE.
IF t_vbrk-vbtyp = 'O' OR t_vbrk-vbtyp = 'N'.
IF t_oput-amount+15(1) = l_sign.
l_amnt = t_oput-amount+0(15).
PERFORM F_ALPHA_CONV USING L_AMNT.
CONCATENATE l_sign l_amnt INTO t_oput-amount.
ELSE.
l_amnt = t_oput-amount.
PERFORM F_ALPHA_CONV USING L_AMNT.
CONCATENATE l_sign l_amnt INTO t_oput-amount.
ENDIF.
ENDIF.
ENDIF.
Reading the data from Internal Table T_ZPV_TORIHIKI
READ TABLE t_zjpv_torihiki WITH KEY
kubun = t_vbrp-zjd_torihikikubn
BINARY SEARCH.
IF sy-subrc = 0.
t_oput-bdgrp = t_zjpv_torihiki-rep_grp.
t_oput-bdgnm = t_zjpv_torihiki-rep_grp_name.
ENDIF.
APPEND t_oput.
Clearing the memory of the internal tables.
CLEAR: t_oput,
t_vbrp,
t_vbrk,
t_kna1,
t_knvv,
t_zjpv_rebate,
t_zjpv_torihiki,
t_likp,
t_konv,
t_konp.
ENDLOOP.
ENDFORM. " f_process_data
*& Form f_output_data
Output formatting
FORM f_output_data.
SORT t_oput BY rbcode
tpcode
bdgrp
fkdat
zjd_torihikikubn
vbeln
posnr.
DATA : l_volume(5) TYPE c,
l_ctax(8) TYPE c.
MOVE t_oput-volume TO l_volume.
MOVE t_oput-ctax TO l_ctax.
DATA : l_ctax1(16) ,
l_ctax2(16),
l_vol1(14) ,
l_vol3(8),
l_vol2(14),
l_tamt1(16),
l_tamt2(16),
l_gtotal1(16),
l_gtotal2(16),
l_uprice1(16),
l_uprice2(16),
l_amount1(16) TYPE c,
l_amount2(16) TYPE c,
l_fctax1(16) TYPE c,
l_fctax2(16) TYPE c,
l_ftamt1(16) TYPE c,
l_ftamt2(16) TYPE c,
l_ftotal1(16) TYPE c,
l_ftotal2(16) TYPE c,
l_sign(1) TYPE c VALUE '-'.
CONSTANTS c_minus VALUE '-'.
SORT t_konv BY knumv kposn kschl.
SORT t_oput BY zjd_torihikikubn vbeln posnr.
Printing Final Values.
LOOP AT t_oput.
Perform F_FORMAT_SUBTOTAL is used to align the value with the commas
for display purpose.
L_CTAX2 = T_OPUT-CTAX.
G_CTAX2 = T_OPUT-CTAX.
PERFORM F_FORMAT_SUBTOTAL USING G_CTAX2
C_CONS_8.
CONDENSE T_OPUT-CTAX.
Perform F_FORMAT_SUBTOTAL is used to align the value with the commas
for display purpose.
L_TAMT2 = T_OPUT-TAMNT.
G_TAMT2 = T_OPUT-TAMNT.
PERFORM F_FORMAT_SUBTOTAL USING G_TAMT2
C_CONS_10.
CONDENSE T_OPUT-TAMNT.
Perform F_FORMAT_SUBTOTAL is used to align the value with the commas
for display purpose.
L_GTOTAL2 = T_OPUT-GTOTAL.
G_GTOTAL2 = T_OPUT-GTOTAL.
PERFORM F_FORMAT_SUBTOTAL USING G_GTOTAL2
C_CONS_10.
CONDENSE T_OPUT-GTOTAL.
Perform F_FORMAT_SUBTOTAL is used to align the value with the commas
for display purpose.
*Volume
IF t_oput-volume >= 99999 OR t_oput-volume <= -99999.
t_oput-volume = space.
ELSE.
l_vol1 = t_oput-volume.
l_vol2 = t_oput-volume.
CONDENSE l_vol1.
CONDENSE l_vol2.
IF l_vol1+0(1) EQ '-'.
REPLACE '-' WITH space INTO l_vol1.
ENDIF.
CONDENSE l_vol1.
WRITE l_vol1 TO g_vol RIGHT-JUSTIFIED.
REPLACE '.' WITH ',' INTO l_vol1.
write :85 l_vol1.
IF NOT g_vol+0(2) IS INITIAL.
g_vol10(2) = g_vol0(2).
g_vol1+2(1) = ','.
ENDIF.
IF NOT g_vol+2(3) IS INITIAL.
g_vol13(3) = g_vol2(3).
ENDIF.
replace '.' with ',' into t_oput-volume.
l_vol2 = t_oput-volume.
IF l_vol2+0(1) EQ '-'.
g_vol2 = g_vol1 .
CONDENSE g_vol2.
CONCATENATE c_minus g_vol2 INTO g_vol2.
ELSE.
g_vol2 = g_vol1 .
CONDENSE g_vol2.
ENDIF.
ENDIF.
L_VOL1 = T_OPUT-VOLUME.
PERFORM F_FORMAT_SUBTOTAL USING L_VOL1
C_CONS_5.
CONDENSE L_VOL1.
Unit Price
IF t_oput-uprice >= 99999999 OR t_oput-uprice <= -99999999.
t_oput-uprice = space.
ELSE.
l_uprice1 = t_oput-uprice .
l_uprice2 = t_oput-uprice.
CONDENSE l_uprice1.
CONDENSE l_uprice2.
IF l_uprice1+0(1) EQ '-'.
REPLACE '-' WITH space INTO l_uprice1.
ENDIF.
CONDENSE l_uprice1.
WRITE l_uprice1 TO g_uprice RIGHT-JUSTIFIED.
IF NOT g_uprice+0(2) IS INITIAL.
g_uprice10(2) = g_uprice0(2).
g_uprice1+2(1) = ','.
ENDIF.
IF NOT g_uprice+2(3) IS INITIAL.
g_uprice13(3) = g_uprice2(3).
g_uprice1+6(1) = ','.
ENDIF.
IF NOT g_uprice+5(3) IS INITIAL.
g_uprice17(3) = g_uprice5(3).
ENDIF.
IF l_uprice2+0(1) EQ '-'.
g_uprice2 = g_uprice1 .
CONDENSE g_uprice2.
CONCATENATE c_minus g_uprice2 INTO g_uprice2.
ELSE.
g_uprice2 = g_uprice1 .
CONDENSE g_uprice2.
ENDIF.
ENDIF.
Amount
IF t_oput-amount >= 99999999 OR t_oput-amount <= -99999999 .
t_oput-amount = space.
ELSE.
l_amount1 = t_oput-amount.
l_amount2 = t_oput-amount.
CONDENSE l_amount1.
CONDENSE l_amount2.
IF l_amount1+0(1) EQ '-'.
REPLACE '-' WITH space INTO l_amount1.
ENDIF.
CONDENSE l_amount1.
WRITE l_amount1 TO g_amount RIGHT-JUSTIFIED.
IF NOT g_amount+0(1) IS INITIAL.
g_amount0(1) = g_amount0(1).
g_amount1+1(1) = ','.
ENDIF.
IF NOT g_amount+1(3) IS INITIAL.
g_amount12(3) = g_amount1(3).
g_amount1+5(1) = ','.
ENDIF.
IF NOT g_amount+4(3) IS INITIAL.
g_amount16(3) = g_amount4(3).
g_amount1+9(1) = ','.
ENDIF.
IF NOT g_amount+7(3) IS INITIAL.
g_amount110(3) = g_amount7(3).
ENDIF.
IF l_amount2+0(1) EQ '-'.
g_amount2 = g_amount1 .
CONDENSE g_amount2.
CONCATENATE c_minus g_amount2 INTO g_amount2.
ELSE.
g_amount2 = g_amount1 .
CONDENSE g_amount2.
ENDIF.
ENDIF.
NEW-PAGE.
MOVE t_oput-tpname1 TO l_tpname1.
MOVE t_oput-tpname2 TO l_tpname2.
MOVE t_oput-bdgnm TO l_bdgnm.
AT NEW bdgrp.
IF t_oput-rbcode CO '*'.
t_oput-rbcode = space.
ENDIF.
IF t_oput-tpcode CO '*'.
t_oput-tpcode = space.
ENDIF.
IF t_oput-tpname1 CO '*'.
t_oput-tpname1 = space.
ENDIF.
IF t_oput-tpname2 CO '*'.
t_oput-tpname2 = space.
ENDIF.
IF t_oput-bdgnm CO '*'.
t_oput-bdgnm = space.
ENDIF.
PERFORM f_write_heading.
ENDAT.
AT NEW vbeln.
IF sy-linno = 35 OR sy-linno = 1.
NEW-PAGE.
PERFORM f_write_heading.
WRITE:/6 t_oput-fkdat , 18 t_oput-dcode+3(7) ,
28 t_oput-vbeln+2(8) ,
37 t_oput-dname+0(20) .
ELSE.
WRITE:/6 t_oput-fkdat , 18 t_oput-dcode+3(7) ,
28 t_oput-vbeln+2(8) ,
37 t_oput-dname+0(20) .
ENDIF.
ENDAT.
WRITE:/6 t_oput-fkdat, 18 t_oput-dcode+3(7),
28 t_oput-vbeln+2(8),
37 t_oput-dname+0(20).
IF sy-linno = 35 OR sy-linno = 1.
NEW-PAGE.
PERFORM f_write_heading.
CONDENSE L_VOL1 NO-GAPS.
MOVE l_vol1 TO l_vol3.
WRITE:/6 t_oput-fkdat , 18 t_oput-dcode+3(7) ,
28 t_oput-vbeln+2(8) ,
37 t_oput-dname+0(20) .
WRITE:/39 t_oput-pcode+3(6) ,
50 t_oput-pname+0(25) ,
79 t_oput-zjd_torihikikubn ,
85 t_oput-volu -
Help Needed in Reports (Breaks, totals)
Hi All,
I am a fairly new user in Apex and would appreciate any help. I have a requirement to generate a report as follows:
In below reports 1001,1002 are projects and i need to obtain project totals (e.g. 500,300,150,50) displayed conditionally. At first i had to display only projects and i could do it using 1 column report break.
But how can i include the totals in the report breaks. And its more than 3 columns that i would need in breaks.
Any suggestions? I dont think i can use breaks for this as APEX does not support more than 3 columns.
Name task budget Expense commitments balance end_Date
1001 500 300 150 50 15-01-2008
1001-1-aa 1 200 100 50 50 15-01-2008
1001-2-ab 2 300 200 100 0 15-01-2008
1002 500 300 150 50 15-01-2008
1002-1-aa 1 200 100 50 50 01-01-2008
1002-2-ab 2 300 200 100 0 01-01-2008
Thanks
SumanaHi All,
Thanks Arie, your suggestion helped me to move in the right direction.
I could display the project totals as needed without using breaks, but using a combination of query and report template change. The above examples given helped to certain extent.
Now I have a requirement which is an extention to the above problem. I dont know if I must start a new thread for this.
I need the report totals to be displayed conditionally. This condition has 3 cases, out of which I am able to achecive two.
For the 3rd I would really appreciate any help/suggestions. I tried changing query/template. But it dint help.
Here is the prob:
Col1 Col2 Col3
Project_name sum(amt) sum(amt)
task1 amt amt
task2 amt amt
In above, the sum(amt) must be displayed when project_owner is person logged in.
Col1 Col2 Col3
Project_name
task1 amt amt
task2 amt amt
In above, when task owner is person logged in then I must not display the sum(amt).
I am successful in acheving both of the above, when all tasks owner is person logged in and when project owner is person logged in.
But when I have project owner = person logged in and task1 owner = person logged in and task2 owner != person logged in my display comes out as shown below.
Col1 Col2 Col3
Project_name sum(amt) sum(amt)
Project_name
task1 amt amt
*task2 amt amt
The actual display for third case must be:
Col1 Col2 Col3
Project_name sum(amt) sum(amt)
task1 amt amt
*task2 amt amt
Thanks
Sumana -
Help needed to report open orders from R/3 SD!
Hello all,
I need to report net open order value from SAP R/3 SD to BW. I'm using cube 0SD_C05 to report inquiry vs. quotation vs. orders. Is there any standard ods object in business content which can be used to report open orders? If not, will it be a good idea to create a ODS object and use it directly for reporting open orders? This BW installation is for a small IT company and we don't generate a lot of quotations or orders on a daily basis. Please guide.
Thanks and Regards,
Sumithi Sumit,
check if you can use 0SD_O01 - order item data
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/2b4f815f153014e10000000a114e5d/content.htm
other business content ods objects are 0sd_o02-05.
http://help.sap.com/saphelp_nw2004s/helpdata/en/0b/f5cc3c7dea9006e10000000a114084/frameset.htm
(expand left side 'ods')
hope this helps. -
Help needed with Report Design
Hi All,
Here is the requirement.
Period Type(holds 2 values) : Payment and Vested.
we have field 'Total Days' which is calculated based on "User Selected" Period Type.
For example, When Period Type is Payment,
If start date is less than or equal to grant date and end date is less than or equal to vest date, then calculation is (End Date - Grant Date)+1
If start date is greater than grant date and end date is less than or equal to vest date, then calculation is (End Date - Mobility Start Date)+1 (similarly 2 more if conditions) ...we have similar calculation for Period Type - 'Vested'.
This Period Type is a multiselect Prompt. How can this be achievable.
Any thoughts will be greatly appreciated.
Thanks.I simply did as i got a tip on FB to do
quote from adobe themselves on facebook "Adobe Illustrator You might also want to try asking on our forums as there are many people that can help there as well! http://forums.adobe.com/community/illustrator/illustrator_general"
sry if it was wrong of me, simply thought there might be someone nice out there to give a helping hand
Date: Tue, 5 Jun 2012 13:41:48 -0600
From: [email protected]
To: [email protected]
Subject: Help needed with a design!
Re: Help needed with a design!
created by in Illustrator - View the full discussion
This really isn't the place to ask for free services.
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4467790#4467790
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4467790#4467790. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Illustrator by email or at Adobe Forums
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
Help needed for report on tables vbak and vbap
Hello,
I needed help in one of my work issues, this is my first project and Iam still learning. kindly help.
I was asked to take erdat,vbeln,posnr from selection screen and compare it with the data already in tables vbap,vbak. If the data
already exists and exception needs to be raised saying that the 'data exists',but if the data is not present in the tables the
tables have to be updated. This has to be done using function module only.
Then I have to write a REPORT calling the above function module and finally displaying the number of records updated and the
list of them.
I have started writing a function module:
FUNCTION z_tableupdate.
""Local Interface:
*" IMPORTING
*" VALUE(DATE) LIKE VBAK-ERDAT DEFAULT SY-DATUM
*" VALUE(SALESORDERNO) LIKE VBAK-VBELN
*" VALUE(ITEMNO) LIKE VBAP-POSNR
*" EXPORTING
*" VALUE(EX_VBAP) LIKE VBAP STRUCTURE VBAP
*" VALUE(SYS) LIKE SY-SYSID
*" VALUE(EX_VBAK) LIKE VBAK STRUCTURE VBAK
*" EXCEPTIONS
*" DATA_UPDATED
*" DATA_EXISTS
SELECT * FROM vbak INTO vbak_wa WHERE erdat = date
AND vbeln = salesorderno.
ENDSELECT.
SELECT * FROM vbap INTO vbap_wa WHERE posnr = itemno.
ENDSELECT.
IF sy-subrc EQ 0.
ex_vbap = vbap_wa.
ex_vbak = vbak_wa.
ELSE.
RAISE data_exists.
ENDIF.
sys = sy-sysid.
ENDFUNCTION.
How is the above code for function module, will this work??
Now can I write a report to call the above function module and update the record?? if so, how to update ??? please help...Lots of thanks in advance.Hi
Welcome to SDN forum
Whay can't you write a simple report in SE38.
why you are using Fun module
Nothing wrong in it.
But first become perfetc in reports in SE38 and then do using the fun modules
write a simple select statement like
SELECT AVBELN AERDAT BPOSNR BMATNR
INTO TABLE ITAB
FROM VBAK AS A JOIN VBAP ON
AVBELN = BVBELN
WHERE A~VBELN IN S_VBELN AND
A~ERDAT IN S_ERDAT AND
B~POSNR IN S_POSNR.
IF SY-SUBRC <> O.
WRITE: / 'No data found'.
ENDIF.
First write this in SE38 by defining a proper selection screen and internal tables
then do as fun module
see the doc for fun module
Function Modules;
Check this matter.
Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
You can create them from TCode SE37.
Go through the following doc:
Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
Function Module Interfaces
The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
Syntax
... [IMPORTING parameters]
[EXPORTING parameters]
[CHANGING parameters]
[TABLES table_parameters]
[{RAISING|EXCEPTIONS} exc1 exc2 ...]
The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
Interface parameters
The interface parameters are defined on the relevant tab pages in the Function Builder.
IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
Exceptions
The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
Note
For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
RFC is a technology which is used to access a functions (Modules) from
the remote systems.
If a function module is set as remote enabled which can be access from
the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
But Normal function modules can not accessd from the remote system.
Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
CALLING A FUNCTION MODULE:
1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
--> Write the Corresponding FM name --> Hit Enter
2)The appropriate import ,export Parameters will be displayed in ur editor
3)Pass the Values Here.
Also check these links.
http://www.geocities.com/victorav15/sapr3/abapfun.html
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
See the following links:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
Regards
Anji -
Hi Experts
my requirement is to combine the standard selection screens of T-CODE IW39 & IW59 as a one selection screen.
i tried a lot but i'm unable to do it.
in these selection screens some blocks are called by dynamically through ldb. if i copied standard prog of T-CODE IW39 as zprogram it dispalying the whole selection screen but at that time i'm unable to merge IW59 selection screen code with this caode.
can any help me urgent .plzhi
chk this out
SELECTION-SCREEN: Special Variant for Logical Databases
You may only use these variants in the INCLUDE program DBldbSEL of logical database ldb.
Variants:
1.SELECTION-SCREEN BEGIN OF VERSION vers TEXT-xxx.
2. SELECTION-SCREEN END OF VERSION vers.
3. SELECTION-SCREEN EXCLUDE ... .
4.SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
5.SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab.
6.SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE node.
7.SELECTION-SCREEN FIELD SELECTION FOR NODE node.
Variant 1
SELECTION-SCREEN BEGIN OF VERSION vers TEXT-xxx.
Variant 2
SELECTION-SCREEN END OF VERSION vers.
Variant 3
SELECTION-SCREEN EXCLUDE ... .
Effect
Defines a selection screen version (three character name vers). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects from version vers using SELECTION-SCREEN EXCLUDE. This allows you to reduce the database-specific part of the standard selection screen to those objects relevant to the report in question without having to sacrifice important selection criteria in other reports.
You activate a selection screen version for a report by entering it in the report attributes. If the database access program SAPDBldb itself has a selection screen version in its attributes, this applies to all reports that use the logical database and for which you have not declared a particular selection screen variant.
The function of the text symbol TEXT-xxx is to enable users to choose a selection screen variant using F4 help on the program attributes screen.
Extras:
(for SELECTION-SCREEN EXCLUDE) 1. ... PARAMETERS par 2. ... SELECT-OPTIONS sel
3. ... RADIOBUTTON GROUPS radi
4. ... BLOCKS block
5. ... IDS id
Effect
Excludes selection screen objects between SELECTION-SCREEN BEGIN and END OF VERSION. You can also exclude individual parameters, select-options, and radiobutton groups, within SELECTION-SCREEN BEGIN/END OF BLOCK blocks, and other SELECTION-SCREEN objects such as comments and underlines using the ID id addition.
Notes
You can only exclude objects of the DS:ABEN.SELECTION_SCREEN>standard selection screen 1000, not any that belong to a screen defined using SELECTION-SCREEN BEGIN OF SCREEN ... AS SUBSCREEN. If the standard selection screen includes objects from other screens ( SELECTION-SCREEN INCLUDE ... ID ...), you can use SELECTOIN-SCREEN EXCLUDE IDS ... to exclude them from the screen.
The database program SAPDBldb can use the function module RS_SELSCREEN_VERSION to use the active version of the selection screen for the current report.
Example
TABLES SPFLI.
NODES CHARLY. " with structure SFLIGHT
PARAMETERS PAR_1 LIKE SPFLI-CARRID FOR TABLE SPFLI.
SELECT-OPTIONS SEL_1 FOR SPFLI-CONNID.
SELECT-OPTIONS SEL_2 FOR CHARLY-FLDATE.
SELECT-OPTIONS SEL_3 FOR SPFLI-CITYFROM.
SELECTION-SCREEN COMMENT /10(20) TEXT-100 FOR TABLE SFLIGHT ID 001.
SELECTION-SCREEN COMMENT /8(30) TEXT-200 FOR NODE CHARLY ID 002.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK B100 WITH FRAME TITLE TEXT_001.
PARAMETERS P100_1 TYPE SFLIGHT-SEATSMAX FOR NODE CHARLY.
SELECTION-SCREEN END OF BLOCK B100.
SELECTION-SCREEN END OF SCREEN 100.
PARAMETERS PAR_2 LIKE SY-SUBRC FOR TABLE SFLIGHT.
PARAMETERS PAR_3 LIKE CHARLY-PLANETYPE FOR NODE CHARLY.
SELECTION-SCREEN BEGIN OF VERSION ABC TEXT-008.
SELECTION-SCREEN EXCLUDE PARAMETERS: PAR_1, PAR_3.
SELECTION-SCREEN EXCLUDE SELECT-OPTIONS SEL_2.
SELECTION-SCREEN EXCLUDE IDS 001.
SELECTION-SCREEN END OF VERSION ABC.
SELECTION-SCREEN BEGIN OF VERSION XYZ TEXT-XYZ.
SELECTION-SCREEN EXCLUDE IDS 100.
SELECTION-SCREEN END OF VERSION XYZ.
If the report attributes (or the attributes of database program SAPDBldb) contain the selection screen version ABC, the parameters PAR_1 and PAR_3, the select-option SEL_2 and the comment with text number 100 (ID 001) do not appear on the selection screen. Text symbol 008 of SAPDBldb is displayed if you choose F4 help for the 'Selection screen version' field.
If the program attributes (or the attributes of the database program SAPDBldb) contain the selection screen version XYZ, the block B100 containing the parameter P100_1 does not appear on the standard selection screen 1000, but it does appear on the subscreen 100..
Variant 4
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
Variant 6
SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE
node.
Extras:
... ID id
Effect
This statement returns the tables or nodes of the logical database for which additional selections are supported. If one of these tables or nodes is active in the report (declared using TABLES or NODES, or in the path from the database hierarchy root to a table declared using TABLES or NODES), the 'Free selections' pushbutton appears on the selection screen. If the user chooses this function, the system branches to a dialog in which the user can enter selections for the relevant fields of the appropriate tables. There are two ways to set the fields for which users can make free selections:
Using a selection view created for that purpose:
You maintain selection views within logical database maintenance. They consist of a set of fields from tables in the logical database that are divided into groups. You can also preselect fields here. Customers may overlay the selection view (that is, the system searches first for a customer-specific selection view. Only if one does not exist will the system display the SAP selection view).
If you have already made a preselection in the selection view, the user sees the selection screen for the preselected fields on which to enter his or her selections. If no fields have been preselected, the user must first select some.
Using all fields of all tables
In this case, the user must choose the table and then the fields for which he or she wants to define additional selections. Having selected these, he or she then passes to the selection screen for entering the free selections.
The database access program SAPDBldb takes on the form of a complex data object DYN_SEL consisting of WHERE clauses generated by the user input for dynamic database access.
Note
You cannot use free selections for nodes with type C (complex data objects).
Note
The precise definition of the object DYN_SEL is stored in TYPE-POOL RSDS and reads:
TYPES: BEGIN OF RSDS_WHERE,
TABLENAME LIKE RSDSTABS-PRIM_TAB,
WHERE_TAB LIKE RSDSWHERE OCCURS 5,
END OF RSDS_WHERE.
TYPES: BEGIN OF RSDS_TYPE,
CLAUSES TYPE RSDS_WHERE OCCURS 5,
TEXPR TYPE RSDS_TEXPR,
TRANGE TYPE RSDS_TRANGE,
END OF RSDS_TYPE.
DATA DYN_SEL TYPE RSDS_TYPE.
The object DYN_SEL contains (amongst other elements) a component (CLAUSES), which is an internal table. Each line in the internal table contains a table name (TABLENAME) and a further internal table (WHERE_TAB), that contains the WHERE clauses for table (TABLENAME).
The structure of the two other components is contained in type pool RSDS.
TEXPR contains the selections in a storeable format that you can use for the 'freely callable' function modules used to enter free selections ( FREE_SELECTIONS_INIT, FREE_SELECTIONS_DIALOG). TRANGE contains the selections in the form of RANGES tables , that you can use with the IN operator in the SELECT, CHECK and IF statements.
Note
Neither the TYPE-POOL RSDS nor the declaration of DYN_SEL need to be written into the database program: both are automatically included by the system.
In the database program SAPDBldb, an access to a table XXXX might look like this:
FORM PUT_XXXX.
DATA L_DS_CLAUSES TYPE RSDS_WHERE.
MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
INTO L_DS_CLAUSES.
SELECT * FROM XXXX
WHERE field1 IN ...
AND field2 ....
AND (L_DS_CLAUSES-WHERE_TAB).
PUT XXXX.
ENDSELECT.
ENDFORM.
Note
If the table L_DS_CLAUSES-WHERE_TAB is empty (in other words, there are no free selections for table XXXX), the system ignores the addition ... AND (L_DS_CLAUSES-WHERE_TAB) in the SELECT statement.
Variant 5
SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab.
Variant 7
SELECTION-SCREEN FIELD SELECTION FOR NODE node.
Extras:
... ID id
Effect
This statement returns the tables and nodes of the logical database for which field selections are supported.
If required by the report, not all fields of these tables and nodes are filled from the database, but only those that the report needs. You declare these fields in the report using GET dbtab FIELDS f1 ... fn or GET dbtab LATE FIELDS f1 ... fn (the field list is then completed by the system, using the key fields of table dbtab).
You can improve performance considerably by restricting the fields used to those that are really necessary.
The database access program SAPDBldb receives the fields for the dynamic field selection in the form of an internal table SELECT_FIELDS.
Note
You cannot use this addition for nodes with type C (complex data objects).
Note
The exact definition of the object SELECT_FIELDS is stored in TYPE-POOL RSFS and reads:
TYPES: BEGIN OF RSFS_TAB_FIELDS,
TABLENAME LIKE RSDSTABS-PRIM_TAB,
FIELDS LIKE RSFS_STRUC OCCURS 10,
END OF RSFS_TAB_FIELDS.
TYPES: RSFS_FIELDS TYPE RSFS_TAB_FIELDS OCCURS 10.
DATA SELECT_FIELDS TYPE RSFS_FIELDS.
SELECT_FIELDS is an internal table. Each line of the internal table contains a table name (TABLENAME) and a further internal table (FIELDS) containing the fields of table (TABLENAME).
Note
You do not need to declare the TYPE-POOL RSFS or SELECT_FIELDS in the database program, since both are included automatically by the system. Unlike the objects linked using the DYNAMIC SELECTIONS addition, SELECT_FIELDS is also available in the report.
In the database program SAPDBldb, an access to table XXXX might look like this:
FORM PUT_XXXX.
DATA L_TAB_FIELDS TYPE RSFS_TAB_FIELDS.
MOVE 'XXXX' TO L_TAB_FIELDS-TABLENAME.
READ TABLE SELECT_FIELDS WITH KEY L_TAB_FIELDS-TABLENAME
INTO L_TAB_FIELDS.
SELECT (L_TAB_FIELDS-FIELDS)
INTO CORRESPONDING FIELDS OF XXXX
FROM XXXX
WHERE field1 IN ...
AND field2 ....
PUT XXXX.
ENDSELECT.
ENDFORM.
Notes
If table L_TAB_FIELDS is empty (in other words, the report for table XXXX does not require any field selection), SELECT (L_TAB_FIELDS) ... behaves like SELECT * ..., that is, all fields of table XXXX are filled.
The internal table SELECT_FIELDS is filled when the INIT routine runs in the database program or when the INITIALIZATION runs in the report. The program can access it if the logical database requires extra fields. -
2 Layout's for 2 screens different F4 Help needed for same program
Hi Friends,
I have 2 layouts in the selection screen the first layout is for screen 1 and the second layout is for screen 2.
I save the layouts when I run the report.
Now when I do F4 Help for the first layout it shows me all the layouts available for the program and the same thing
for Second layout too.
Is there a way for the first layout I need to get only the layouts for the first screen when I hit the F4 button
and for the second layout I need to get only the layouts for the second screen when I hit the F4 button. in order to choose
I am using REUSE_ALV_VARIANT_F4 and passing report name to is_variant and i_save = 'X'.
Thanks,
chaithanya.I think this is not possible.
Variant names get stored on Report Name as key.
a® -
Help needed in Dialog programming
Hi,
I am in a module pool program. This contains a subscreen which has a tablecontrol. Based on one of the entry in the table control. I need to stop the user to change the value.
So I have coded like the below.
If i_tc-value = 0.
v_scrno = sy-dynnr.
leave to screen v_scrno.
endif.
But the above code gives an ABEND error with message
<b>SET SCREEN not allowed in subscreen (screen: <Program name> <Screen nbr>)</b>
Please help to solve the above issue. User must make the entry in the table control. How to stop the user for changing the entry?Hi Murphy,
I don't know on wot entry you want to stop the user to changes , i hope for stoping your user you may have some condiation once that condation pass make use screen properties to make that field into display mode such that the user again not able to edit.
Thanks,
saleem. -
Hi friends,
I needs some information on Report Painter.
I already searched in help.sap.com.
but i cannot get these below information.
Please help me out. it is very urgent for me.
1.what are the general Tcodes used in this ?
2.when and where should we use report painter concept over standard reporting ?
3. Is report painter exclusively used for any specific module like Project systems, FI/CO. or it can be used across all the SAP Functional Modules?
4. I tried to create Report using Report painter Tcode CJE4
then i got some basic doubts as below?
a) what is difference between Project report and Summarization reports for project in report painter?
b)Is it mandatory to create Form then attaching this Form to Report?
c)what is difference in Two Axes, One axis with key figure,
One axis without key figure structure ?
d) what is meant by Key figure and Characteristics in this ?
Thanks in advance.
Regards,
SateeshReport painter
the below Pdf should help you
http://www.virtuosollc.com/PDF/Get_Reporter.pdf
Reward points.. -
Help needed with reporting API
Hi Guys,
ok i have tried many things but i just cant seem to get to grips with the "apireport.pl" tool provided to produce reports.
I have downloaded a fresh copy from ironport, only changed the Hostnames and primary_config files as needed, but no matter what i do i get the following error when i run the tool.
"Argument "--" isn't numeric in addition (+) at C:\Ironport reporting\apireport-1-0\apireport.pl line 264, <CSVFILE> line 2".
The othert thing is that the reports are produced but when you look at it the pie chart it just displays as a single state of all inbound mail being clean.
Any help or example scripts / config would be appreciated.
ThanksI can now see that the report being produced IS only displaying the data for clean mail, hence the pie chart showing all mail clean, it just isnt displaying any other data but i dont know how to resolve this. When i look at the reports chart there is no data in the fields for anything other than clean mail so im presuming the process isnt either pulling in the data or processing it into the report
Any help would be appreciated thanks -
Hi All,
I have a requirement where i have to copy standard cost center report S_ALR_87013611 and change the G/L account to Alternative account and text.
how do i copy this report painter report and modify the G/L account as required.
i haven't worked on report painter .
Points guaranteed !!!!
Thanks & Regards,
RaghavendraHi,
The Transaction code to create creating report writer it is GR31 and report painter is GRR1 and for .
Reaport Painter allows you to create reports using data from SAP application components, which you can adapt to meet your individual requirements.
Many of your reporting requirements can already be met by using the standard reports provided by various SAP application components. If these SAP standard reports do not meet your reporting needs, Report Painter enables you to define your specific reports quickly and easily.
Report Painter fulfills a function similar to Report Writer, but is easier to use. Most of the functions found in Report Writer have been built into Report Painter; however, you do not need to be familiar with all Report Writer concepts (such as Sets) in order to use Report Painter.
When executing a Report Painter report, it is displayed by the system in Report Writer format. You thus have access to the same functions as for Report Writer reports defined in the same way, and can combine Report Painter and Report Writer reports together in a report group.
Report Painter uses a graphical report structure, which forms the basis for your report definition and displays the rows and columns as they appear in the final report output.
To facilitate report definition, you can use many of the standard reporting objects provided by SAP (such as libraries, row/column models, and standard layouts) in your own specific reports. When you define a Report Painter report you can use groups (sets). You can also enter characteristic values directly.
Advantages of Report Painter include:
Flexible and simple report definition
Report definition without using sets
Direct layout control: The rows and columns are displayed in the report definition as they appear in the final report output, making test runs unnecessary.
Hope this helps u.
Regards,
Seema. -
Help needed with report grouping
Post Author: David Waugh
CA Forum: General
I have a summary report that has three groupings - The groupings areas follow:
Partner Group (Group1)Client Group (Group2)Actual Client (Group3)
For instance, there are 9 Partners, and each Client Group can/could have numerous Actual Clients.
The Details section is supressed. There are two parameter fields (Start Date and End Date). The summary is initally displayed at the Actual Client Group (Group 3) footer. Then there is a summary total on the Client Group (Group2) level, for all of those clients that are within that same Client Group.
I am able to sort all of the data at the Client Group (Group2) level either ascending or descending. In the Actual Client Group footer there is a Running Total for the Invoices billed during the period provided via the two parameter fields. Then there is an Invoice total for all of the clients that are within that same Client Group level (Group2).
I need to setup another parameter that will sort via Client Group displaying the top 25 Client Groups per Partner. Is this done via a Group Selection Formula?
Any help is appreciated.
Thank you,DavidPost Author: Jagan
CA Forum: General
Have a read in the help about TopN and about the group sort expert.
Is there a reason you're using running totals rather than plain old summaries? -
Code help in writing report Program
Hello experts
I have to write a selection screen program based on the following requirements (only for sales Org:5090, plant:9000, Outbound delivery type= "LF")
Selection parameters:
Material (lips-matnr)
Sold to party(likp-kunag): can hardcode it to 5090
Sales Org(likp-vkorg)
Plant(lips-werks) : hard code it to plant:9000
Sales order(likp-vbeln)
Actual goods movement dates(likp-wadat_ist)
Invoice number
Sales order
Output
material numberlips~matnr ( should Display only S* materials and material type FERT)
Serial number of the device shipped (objk-sernr)
Delivery number (lips~vbeln)
Invoice number (vbrp-vbeln)
Invoice price=Vbrp-vbeln/quantity (invoice price)
Notification number (Viqmel-QMNUm)
KBB Repair Level(VIQMEL-QMTXT from QMCOD )
KBC Repair level(VIQMMA-MNCOD from KBC-SM07 code group(VIQMMA-MNGRP))
code help is higly appreciated,
Thanks
SpHi anurag,
Code is going like this, i could able to display it but when i run it ABAP Dump is coming.
what could be the reason?
Tahnks
SP
*& Report ZSDR_PRICING_KSE_RPT *
REPORT ZSDR_PRICING_KSE_RPT .
TABLES: likp, lips, vbfa, vbak.
TYPE-POOLS: slis.
*/ Selection and Input Parameters
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003.
SELECT-OPTIONS: s_matnr FOR lips-matnr,
s_kunag FOR likp-kunag.
SELECT-OPTIONS: s_vkorg FOR likp-vkorg NO INTERVALS,
s_werks FOR lips-werks.
SELECT-OPTIONS: s_vbeln FOR likp-vbeln,
s_waist FOR likp-wadat_ist.
SELECT-OPTIONS: s_vgbel FOR lips-vgbel.
SELECTION-SCREEN END OF BLOCK block2.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
TYPES: BEGIN OF ty_data,
matnr TYPE lips-matnr,
sernr TYPE equi-sernr,
vbeln TYPE lips-vbeln,
invno TYPE vbfa-vbeln,
qmnum TYPE vbak-qmnum,
netwr type vbrp-netwr,
END OF ty_data.
DATA: gt_data TYPE TABLE OF ty_data WITH HEADER LINE.
TYPES: BEGIN OF ty_lips,
vbeln TYPE likp-vbeln,
matnr TYPE lips-matnr,
wersk TYPE lips-werks,
vgbel TYPE lips-vgbel,
END OF ty_lips.
DATA: gt_lips TYPE TABLE OF ty_lips WITH HEADER LINE.
DATA: gt_vbfa TYPE TABLE OF vbfa WITH HEADER LINE.
DATA: gt_vbrp TYPE TABLE OF vbrp WITH HEADER LINE.
TYPES: BEGIN OF ty_ser01,
lief_nr TYPE ser01-lief_nr,
obknr TYPE ser01-obknr,
sernr TYPE objk-obknr,
END OF ty_ser01.
DATA: gt_ser01 TYPE TABLE OF ty_ser01 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM get_data.
PERFORM display_data.
*& Form get_data
FORM get_data.
SELECT likpvbeln lipsmatnr lipswerks lipsvgbel
INTO CORRESPONDING FIELDS OF TABLE gt_lips
FROM likp INNER JOIN lips ON lipsvbeln = likpvbeln
WHERE lips~matnr IN s_matnr
AND lips~werks IN s_werks
AND likp~kunag IN s_kunag
AND likp~wadat_ist IN s_waist
AND lips~vgbel IN s_vgbel
AND likp~vkorg IN s_vkorg.
IF NOT gt_lips[] IS INITIAL.
SELECT vbeln vbelv INTO CORRESPONDING FIELDS OF TABLE gt_vbfa
FROM vbfa
FOR ALL ENTRIES IN gt_lips
WHERE vbelv = gt_lips-vgbel
AND vbtyp_n = 'M'.
IF NOT gt_vbfa[] IS INITIAL.
SELECT vbeln matnr netwr
INTO CORRESPONDING FIELDS OF TABLE gt_vbrp
FROM vbrp FOR ALL ENTRIES IN gt_vbfa
WHERE vbeln = gt_vbfa-vbeln.
SELECT ser01lief_nr ser01obknr objk~sernr
INTO CORRESPONDING FIELDS OF TABLE gt_ser01
FROM ser01 INNER JOIN objk ON objkobknr = ser01obknr
FOR ALL entries IN gt_vbfa
WHERE ser01~lief_nr = gt_vbfa-vbeln
AND taser EQ 'SER01'.
ENDIF.
ENDIF.
clear: gt_data[].
LOOP AT gt_lips.
LOOP AT gt_vbfa WHERE vbelv = gt_lips-vgbel.
READ TABLE gt_vbrp WITH KEY vbeln = gt_vbfa-vbeln
matnr = gt_lips-matnr.
LOOP AT gt_ser01 WHERE lief_nr = gt_vbfa-vbeln.
gt_data-matnr = gt_lips-matnr.
gt_data-sernr = gt_ser01-sernr.
gt_data-vbeln = gt_lips-vbeln.
gt_data-invno = gt_vbfa-vbeln.
gt_data-netwr = gt_vbrp-netwr.
APPEND gt_data.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDFORM. " get_data
*& Form display_data
FORM display_data.
DATA: lv_repid TYPE sy-repid.
lv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = lv_repid
I_INTERNAL_TABNAME =
i_structure_name = gt_data
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = lv_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
it_fieldcat = gt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_data
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Maybe you are looking for
-
Transaction brackets of the workflow has been damaged
Hi, I am integrating workflow with the HR Processes and Forms using HCM. The process is new hiring and in configuration I have given the workflow name which is copy of the standard workflow(WS18900008). The event used is draft_created. When I execute
-
How read/write matlab style WAV sound file?
The supplied LabVIEW WAV read/write VIs require fixed sampling rates (like 8000, 11025, 22050, 44100), and use integer data (so the waveforms take on large +/- integer values). I need to read/write WAV files that are like those used in Matlab with it
-
N82, Unable to install, Not Enough memory error, p...
Like installing some selected applications like Skyfire, Coreplayer, Palringo, but it just did that one time I needed to install the applications, when I bought it new it was fine.
-
can we apply conditions,xception,etc.. on ods while doing reporting.
-
Modified Stored Procedure Doesn't Refresh In Report
Hello -- I modified a stored procedure to add a new table and field. The new field doesn't show up in the field explorer after selecting "Verify Database". If I create a new report with the stored procedure, the new field appears as expected. Any ide