Like Purchase Analysis - Selection Criteria
Hi To All,
In
Administration -> Purchasing -A/P ->PurchasingReports ->PurcahseAnalysis
Same like that, i want to create Selection Criteria for my user screens.... Whether its possible...? If S, how can i do that..?
HI!
When i have created reports like this, I have used the following:
1. Created a button on the system form (Administration -> Purchasing -A/P ->PurchasingReports ->PurcahseAnalysis)
2. Saved the form as XML (form.GetAsXML() -> then save)
3. Opened in Screen Painter and modified as necessary -> minimum type and id
4. Now I had the form.
Regards,
J.
Ps: Even this solution is good, please hit points.
Similar Messages
-
Report for Sales and purchase tax (selection criteria-Tax code)
Hi
I have one query for sales tax details which gives me detail for all A/R invoices and taxes involved in it. But i want that while executing query system should ask tax code and gives detail of tax amount in front of item and invoice according to tax code selected.
The query is:
SELECT M.DocNum AS 'Inv.No ', M.DocDate as 'Date', M.CardName as 'Customer Name',L.Dscription,L.Quantity,L.Price, (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)', (SELECT Avg(TaxRate) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT ', (SELECT Avg(TaxRate) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as ' VAT% ', (SELECT Sum(TaxSum) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as 'VAT12.5 ', (SELECT Avg(TaxRate) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST 2% ', (SELECT Sum(TaxSum) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST @2 ', (SELECT Avg(TaxRate) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST ', (SELECT Avg(TaxRate) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED ', (SELECT Avg(TaxRate) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess% ', (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess ', (SELECT Avg(TaxRate) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' HCess % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' Hcess ', L.LineTotal as 'Row Total (Rs.)',M.DocTotal as 'Doc Total' FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND TargetType ! = 14 GROUP BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal ORDER BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal
I want 2 queries which asks tax code during selection criteria for both cases sales and purchase.Hi Malhotra,
Try this,
1st remove the FROM/TO Doc. Date where Condition in your Query report.
AND add the below where condition in your Query report.
WHERE statype = '[%0]'
OR
Try this Query Report.
SELECT
M.DocNum as 'A/R Invoice No.',
M.DocDate as 'Inv. Date',
M.CardCode as 'Customer Code',
M.CardName as 'Customer Name',
M.NumAtCard as 'Bill No. & Date',
ISNULL(L.ItemCode,'Service Item') as 'Item Code',
L.Dscription,
L.Quantity,
L.LineTotal,
L.TaxCode,
L.[VatSum],
M.WTSum AS 'TDS (Rs.)',
M.DocTotal as 'Total (Rs.)'
FROM OINV M
LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
WHERE
(M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
AND
L.TaxCode='[%2]'
GROUP BY
M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
ORDER BY
M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
Regards,
Madhan. -
Can we make the SELECTION CRITERIA BOX act as a Menu / Submenu system?
Dear All,
I have written several queries.
For user convenience, I wish to combine all related queries in a single Query and use the Selection Criteria box as a Menu System to select which Query script to run.
I can already do this by the use of variables.
But all variables are shown in the Selection Criteria Box, and users must fill in only the relevant boxes.
It's not a problem, but as the number of Queries grows, the Selection box becomes quite long and distracting.
I wonder if it is possible to create a sub-menu?
Example
Let's say: When you run the Query, it gives this Selection Box:
Query - Selection Criteria
Choose a Report [ ]
There are 2 choices:
(a) AP Aging by Document Date
(b) AP Aging by Posting Date
[OK] [Cancel]
When you choose AP Aging by Doc Date, this Selection Box should pop up:
Query - Selection Criteria
Document Date [ ]
[OK] [Cancel]
And when you choose AP Aging by Posting Date, this Selection Box should pop up:
Query - Selection Criteria
Posting Date [ ]
[OK] [Cancel]
Please let me know if this kind of menu / sub-menu system is possible using SQL only?
I tried (see code below), but all variables appear on the initial screen (not what I expect) - like this:
Query - Selection Criteria
Choose a Report [ ]
Document Date [ ]
Posting Date [ ]
[OK] [Cancel]
Thanks
Leon Lai
Here's a test code: (not exactly for the illustration above)
declare @apaging1 varchar(max)
set @apaging1 =
/*select T6.U_apaging1 from [dbo].[@APAGING] T6 where T6.U_apaging1*/ '[%0]'
/* @apaging1 : [0 = Summary] [Detailed] */
If @apaging1 = ' ' set @apaging1 = 'Sum'
If @apaging1 = 'Sum'
GOTO Screen1
If @apaging1 = 'Det'
GOTO Screen2
Screen1:
begin
declare @aptxn nvarchar (30)
set @aptxn =
/*select T9.U_aptxn from [dbo].[@APTRXNS] T9 where T9.U_aptxn*/ '[%9]'
/*@aptxn: [0 = PU] [PC] [Both]*/
If @aptxn = ' ' set @aptxn = 'PU'
end
Screen2:
begin
declare @taxdt1 date
set @taxdt1=
/*select T1.[TaxDate] from [dbo].[OPCH] T1 where T1.[TaxDate]*/ '[%5]'
endDear István Korös
Thanks a lot.
Sad
At least, your answer will save me a lot of time searching for the unattainable.
Best Regards
Leon Lai -
Hide Particular Item Group from Selection Criteria of Sales Analysis Report
Hello Experts,
Is this possible to Hide Particular Item Group from Selection Criteria of Sales Analysis Report?
I have one Item Group as 'Special Items'.
Now, when I open Item wise sales analysis report, I want to hide above mentioned group from selection criteria.
Thanks in advance.
Best Regards,
Pankit ShethHi,
1. Not possible to put validation for selection criteria windows.
2. In standard, I don't think it is possible to hide only one item group.
3. Alternatively don't give authorization to user for running sales reports. If still need create customized query and ask user run every month.
Thanks & Regards,
Nagarajan -
Purchase Requisition No data satisfying selection criteria
We have created a Maintenance Notification and converted it into Maintenance Order, after approval of maintenance Order it will generate a MM purchase requisition automatically.
But upon checking on Me53N or any other report for MM PR the PR does not exist. on Me53n it gives the error: No data satisfying selection criteria
but the PR exist on table EBAN.
thanks God blessIf you give proper inputs in ME5K or ME5A, you can get the PR list without any problem.
Also, while selecting PR in ME53N, have you given proper PR number directly or are you searching through some Search help option??
Please post your screen shots PM Order document flow, Operation tab, Components tab, ME53N search steps as well as MM PR reporting selection screen with that error message. -
PURCHASE REQ,No data satisfying selection criteria exists(error msg:MEQ009)
Hi,
I am unable to view My Purchase requisition history in ME51N
Error message "No data satisfying selection criteria exists" is displayed in the selecton variant
message number: MEQ009
pls. help me
RegardsThankyou verymuch
but my question is not that...
in ME51n > Document overview on> selection variant>My purchase requisitions> i fine the error displaying" NO DATA SATISFYING SELECTION CRITERIA EXISTS"
error msg number: MEQ-009
pls. help me with this...
Regards -
SNC- New field adding to the Purchase due list for selection criteria
Hi SNC Experts,
I have to Add new fields from the existing available fields from the configuration in the purchasing due list and for PO over view selection criteria. I want to know the configuration spot where should I go and look for thew list of exisitng fields which are not displayed for the selection criteria.HI Lata,
which version is the system running on? We have BSP UI in lower releases and WD UI in latest releases.
Best Regards,
Harsha Gatt -
Sales and Purchase Analysis reports by Item
The current functionality of these reports is more like an open items list rather than an analysis report.
If you Run a Purchase Analysis report by Item with a secondary selection of Supplier, and choose GRPO - the scenario is to find out how many of which products you have received in the date range from a specific supplier. This type on data is useful to use for negotiations on pricing etc.
Currently, the report will only display values for GRPO that have not been drawn to AP Invoice. This is supposedly system functionality, but, the report is called analysis, so should provide data for that purpose?Hi,
You may double click the column header to change the sort.
Thanks,
Gordon -
Cant see Purchase analysis report of standard SAP B1
Hi friends,
I am using SAP B1 2005 B , PL 36 facing Prob. that-
->though i make AP invoices , but cant able to see its report in Purchase analysis
, it does not show any data .just empty report comes without data.
But if i see Sales Sales Analysis report it shows perfect data in report.
pls. guide me.
regards,
maheshHi Mahesh
Sridharan is not entirely right, the purchase analysis will include all valid A/P Invoices, even if they are paid. The only ones excluded are canceled documents, and since an A/P Invoice cannot be canceled, it is not a problem. If it is credited by a credit note in full, then it will not be displayed as the nett effect is zero. The purchase analysis will look at A/P Invoice less A/P Credit Notes, or GRPO less Returns, depending on what you select.
My suggestion is that you check all the options like from date and to date are correctly specified. Make sure you don't have properties selected that are not in use, etc.
If you still can't get data, please give us the exact options you are selecting so we can test and help you resolve. We need to know if it is Annual/Quarterly/Monthly, AP Invoices/Purchase Order/GRPO, Individual/Group, Posting Date/Due Date/Document Date, etc.
Kind regards
Peter Juby -
Sale/Purchase Analysis Report
Hi All,
I want to create purchase analysis and sale analysis in crystal report.
Does anyone have a standard format for these? If yes, please help me out?Hi Sadhan,
wht kind of report u need ?
i have sme format regarding this :-
SELECT T0.[DocNum], T0.[DocDate], T0.NumAtCard As 'Bill No.', T0.[CardName], T1.[Dscription], T1.[Quantity], T1.Price As 'Rate', T1.[LineTotal] As 'Value', T0.[DocTotal] As 'Total Value', (ISNULL((SELECT SUM(T2.QUANTITY) FROM rpc1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetQTY, (ISNULL((SELECT SUM(T2.LineTotal) FROM RPC1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetValue, (isnull((SELECT SUM((case when upper(t4.STACode) like 'BED%' then T4.TaxSum else 0 end))
FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ExciseDuty,
(isnull((SELECT SUM((case when upper(t4.STACode) like 'eCess%' then T4.TaxSum else 0 end))
FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ECess,
(isnull((SELECT SUM((case when upper(t4.STACode) like 'hes%' then T4.TaxSum else 0 end))
FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) HEdCess, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'VAT12.5',
(isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT4, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT2, (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST2',
(isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST4', T2.TransCat As 'Form No.' FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PCH12 T2 ON T0.DocEntry = T2.DocEntry WHERE (T0.[DocDate]>='[%0]' and T0.[DocDate]<='[%1]')
may this help u if yes then send ur mail id i will send u sme more !!!!
Thanks,
JRAJPUT -
To create selection criteria for PO list
Dear MM Experts,
How we can get report on PO list on the basis of release strategy as selection criteria?
Path : IMG - MM - Purchasing - Reporting - Maintain purchase list - Selection parameters - Define selection parameters.
Please help me out.
Thanks & Regards,
Sandeep.Hi,
You can use ME2N -> Dynamic selections -> Purchasing Document Header -> here you will find fields like
1.Release group
2.Release Strategy
3.Release indicator
4.Release status
Here input your required selection data and Save as variant for later use
Same dynamic selection also available in report *ME80FN , ME2C etc -
RFIDITSR00:Selection criteria for MM invoices in IDITSR_SELECT_V
Dear Gurus,
Could you kindly share with us how you were able to manage the customising settings in IDITSR_SELECT_V for S03CCR report.
The customising setting we made are: included Purchases account 6XXXXXXX in IDITSR_SELECT_V for reporting category S03CCR and while executing the report:excluded BE ,entered keydate,selected vendors(GL and customer not selected)
The customising was working fine when we raise an FI invoice and included the Purchases account 6XXXXXX in our customising(IDITSR_SELECT_V) and selected vendors on the selection screen while executing the report.
However, this selection criteria is not working for MM invoices.
For ex:We included the Purchases account 6XXXXXXX in out customising and while executing the report we selected All vendors and "did not select GL accounts" and the output doesnt show this good receipt.
I can understand the logic as while Goods receipt the entry is
Debit Purchases A/c
Credit GR/IR A/c
and as in our selection while executing the report we selected only vendors this entry is not been shown in the report.
and while Invoice receipt the entry is
Debit GR/IR A/c
Creidt Vendor A/C
Though we have vendor line here we do not have the Purchases a/c (6XXXXXXX)as counterpart debit and the invoice doesnt get included in the report.
I tried adding the GR/IR account 4XXXXXXXXX in the customising of IDITSR_SELECT_V but that didnt help either and while executing the report selected GL accounts instead of vendors,in this case the transaction is included in the report but the country ISO code is always coming as BE.
Could you kindly advice how you were able to generate the report to include the open items from MM in the S03CCR reporting category.
Many thanks in advance.
PrasadHi Vee,
The provided code did help and I have the following code now which works fine.
$('input[name=f01]').change( function() {
if ($(this).is(':checked')) {
index_of_this = $('[name=f01]').index(this);
for (i=0;i<index_of_this;i++) {
if (!$('[name=f01]:eq('+i+')').attr('checked')) {
$(this).attr('checked',false);
alert('Check the sequence of invoices to be paid. Invoices should be one after another and you can not pay one Invoice before paying the one that is preceded');
return false;
else
$('[name=f01]').checked = true
alert('Check the sequence of invoices to be paid. Invoices should be one after another and you can not pay one Invoice before paying the one that is preceded');
return false;
setSelectedInvoiceValues ()
setSelectedInvoiceValues ()Additionally I would like to add
Assume that checkbox 1,2,3,4,5 is checked, then what happens when 3 is unchecked ? User should not be allowed to uncheck 3 unless 4 and 5 are unchecked.I have tried to handle this part in the else { } but it is not totally correct.
I am not able to un-check the last checked which should be allowed.
Also the following does not work in Mozilla Firefox but does in Internet Explorer.
$('[name=f01]').checked = true
Please help
Thanks & Regards
Arif Khadas
Edited by: Arif Khadas on May 23, 2011 12:05 PM -
Selection Criteria for Quick View
Hello all,
does anybody have an idea how to add an additional filed to selection in Quick View?
I need to add Purchasing group. Thanks for any ideas.
Regards,
IgorThanks Juraj,
I forgot to say we are on SCMSNC 7.01 and we have Purch Org available in our system. It was a custom development in 5.1, now SAP has added it as default to PO worklist/Duelist, and some other screens as extended selection criteria.
We would like to have it on QuickView selection and it looks like that it has to be custom development anyway. We had some discussion w/SAP, they might add this to future releases.
Igor -
Creating new selection criteria when searching for PR
Hi,
Need help. i want to add selection criteria when searching for a Purchase Requisition (PR).
Currently, when u go to ME52N/ME53N, and you click on 'Other Purchase Request' then you click on F4 the following option are only available when searching for some criteria of PR.
Purchase Requisition per Asset
Purchase Requisition per Requirement Tracking Number
Purchase Requisition per Services
Purchase Requisition per Purchasing Group
Purchase Requisition per Order
Purchase Requisition per Cost Center
Purchase Requisition per Material
Purchase Requisition per Network
Purchase Requisition per Project
Purchase Requisition per Sales Document
my intention to add option perhaps like :
Purchase Requisition per Requestor (the one who created the PR)
Purchase Requition per Short Text
How can i achieve this? Thanks in advance.
SheHi ,
Goto OS52. Press F4.
Enter thedevelopment class as ME.
Select MBAN, then Enter .
Click on Included Search Helps.
You need add your search.
Explain your requirement to ABAP team . They will help u in updating the search help.
Regards
Ramesh Ch -
Selection Criteria addition-Not working
Hi!
I have this report wherein I need to add two fields VBAP-Kunnr and knvv-konda in the selection screen so that I can do my drill down or search criteria based upon these two selections also apart from the existing ones, but unfortunately I am unable to get throiugh this and somehow putting this two selections in the selection criteria its not taking any effect or its just actinga dummy selection and I am unale to drill down my report based upon those. Can anyone have a look and let me know what could be the problem please. Help would be highly appreciated.
Thanks
*& Include ZSD_PFGENERATETOP Report ZSD_PFGENERATE
REPORT zsd_pfgenerate LINE-SIZE 170 LINE-COUNT 65.
TABLES: lips, likp, vbap, vbak, vbrp, vbpa, vbrk.
CONSTANTS: cns_vgtyp TYPE vbrp-vgtyp VALUE 'J',
cns_intyp TYPE vbrk-vbtyp VALUE 'M',
cns_vkorg TYPE vbak-vkorg VALUE 'CA01',
cns_vkorg_US type vbak-vkorg value 'US01', "DEVK903521
cns_parsh TYPE vbpa-parvw VALUE 'WE',
cns_parsp TYPE vbpa-parvw VALUE 'AG',
cns_parre type vbpa-parvw value 'RE', "bill-to
cns_auzwp TYPE vbak-auart VALUE 'ZWP',
cns_auzct TYPE vbak-auart VALUE 'ZCT',
cns_auzif TYPE vbak-auart VALUE 'ZIF',
cns_auztm TYPE vbak-auart VALUE 'ZTM',
cns_fkff TYPE vbrk-fkart VALUE 'ZFF5',
cns_fkos TYPE vbrk-fkart VALUE 'ZOF5',
cns_upd(1) TYPE c VALUE 'S',
cns_mode(1) TYPE c VALUE 'N'.
Internal Tables and Work Areas
DATA: BEGIN OF it_vbpos OCCURS 0,
werks TYPE vbap-werks,
audat TYPE vbak-audat,
auart TYPE vbak-auart,
kunag TYPE vbak-kunnr,
name1_ag TYPE kna1-name1,
kunsh TYPE likp-kunnr,
name1_sh TYPE kna1-name1,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
vbdel TYPE likp-vbeln,
psdel TYPE lips-posnr,
kunre type kunre, "Bill-to Party
name1_re type kna1-name1, "Bill-to Party Name
END OF it_vbpos,
BEGIN OF it_vbpos_temp OCCURS 0,
vgbel TYPE lips-vgbel,
vgpos TYPE lips-vgpos,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
END OF it_vbpos_temp,
BEGIN OF it_report OCCURS 0,
werks TYPE vbap-werks,
vbeln TYPE vbak-vbeln,
vbdel TYPE likp-vbeln,
audat TYPE vbak-audat,
auart TYPE vbak-auart,
name1_ag TYPE kna1-name1,
name1_sh TYPE kna1-name1,
name1_re type kna1-name1, "Bill-to Party Name
mark(1) TYPE c,
END OF it_report,
BEGIN OF it_vbeln OCCURS 0,
vbeln TYPE vbak-vbeln,
END OF it_vbeln,
wa_vbeln LIKE LINE OF it_vbeln,
wa_vbpos LIKE LINE OF it_vbpos,
wa_report LIKE LINE OF it_report,
wa_sel LIKE LINE OF it_report.
DATA: it_vbrp type table of vbrp,
it_vbrk type table of vbrk.
BDC Variables
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
DATA: wa_bdc LIKE LINE OF bdc_tab,
it_bdcmess TYPE TABLE OF bdcmsgcoll.
*& Selection-Screen definition
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-002.
PARAMETERS: p_rdff TYPE c RADIOBUTTON GROUP rad1 DEFAULT 'X',
p_rdos TYPE c RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_werks FOR vbap-werks OBLIGATORY NO INTERVALS,
s_auart FOR vbak-auart,
s_kunag FOR vbak-kunnr, "Sold-to Party
s_kunnr FOR likp-kunnr, "Ship-to Party
s_kunre for vbak-kunnr, "Bill to Party
s_vdatu FOR vbak-vdatu OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block0.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_vgbel TYPE vbak-vgbel.
SELECTION-SCREEN END OF BLOCK block1.
selection-screen begin of block block3 with frame title text-003.
parameters: p_billed RADIOBUTTON GROUP r1,
p_delvd RADIOBUTTON GROUP r1 default 'X',
p_all RADIOBUTTON GROUP r1.
selection-screen end of block block3.
*& Include ZSD_PFGENERATEE01
START-OF-SELECTION.
PERFORM read_report.
END-OF-SELECTION.
SET PF-STATUS 'STAT1000'.
IF it_vbpos[] IS INITIAL.
MESSAGE s999(z001) WITH 'No Data Selected for this criteria'.
ELSE.
PERFORM show_report.
ENDIF.
*& List Events
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
LOOP AT it_report INTO wa_report.
wa_report-mark = 'X'.
MODIFY it_report FROM wa_report.
ENDLOOP.
PERFORM show_report.
WHEN 'DSEL'.
LOOP AT it_report INTO wa_report.
wa_report-mark = ''.
MODIFY it_report FROM wa_report.
ENDLOOP.
PERFORM show_report.
ENDCASE.
AT LINE-SELECTION.
DO.
READ LINE sy-index FIELD VALUE wa_report-mark wa_report-vbeln
wa_report-vbdel.
IF sy-subrc NE 0.
EXIT.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_report-vbeln
IMPORTING
output = wa_report-vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_report-vbdel
IMPORTING
output = wa_report-vbdel.
READ TABLE it_report INTO wa_sel
WITH KEY vbeln = wa_report-vbeln.
IF sy-subrc EQ 0.
wa_sel-mark = wa_report-mark.
MODIFY it_report FROM wa_sel INDEX sy-tabix.
ENDIF.
ENDIF.
ENDDO.
REFRESH: it_vbeln.
LOOP AT it_report INTO wa_report WHERE mark EQ 'X'.
CASE 'X'.
WHEN p_rdff.
wa_vbeln = wa_report-vbdel.
WHEN p_rdos.
wa_vbeln = wa_report-vbeln.
ENDCASE.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
SORT it_vbeln BY vbeln.
DELETE ADJACENT DUPLICATES FROM it_vbeln.
IF NOT it_vbeln[] IS INITIAL.
PERFORM process_vf01.
ENDIF.
*& Include ZSD_PFGENERATEF01
*& Form read_report
Routine to read applicable orders from database
FORM read_report.
DATA: lwa_lips TYPE lips,
lc_vbeln TYPE vbrk-vbeln.
Retrieve sales orders based on selection criteria where billing doc has not been
created for the delivery yet
REFRESH: it_vbeln, it_vbpos, it_report.
Select into table based on Onsite/Fixed Facility
CASE 'X'.
WHEN p_rdff.
changed for performance reasons (i.e. time-out)
k~vgbel is not in it_vbpos but was in select statment ?
SELECT vbap~werks vbak~audat vbak~auart vbak~kunnr AS kunag
vbak~vbeln vbap~posnr
INTO CORRESPONDING FIELDS OF TABLE it_vbpos
FROM vbak INNER JOIN vbap
ON vbak~mandt = vbap~mandt
AND vbak~vbeln = vbap~vbeln
WHERE vbap~werks IN s_werks
AND vbak~vdatu IN s_vdatu
AND vbak~vkorg in (cns_vkorg,cns_vkorg_US)
AND vbap~oid_ship IN s_kunnr
AND vbak~kunnr IN s_kunag
AND vbak~auart IN s_auart
AND ( vbak~auart = 'ZWP' or vbak~auart = 'ZIF' or
vbak~auart = 'ZCT' or vbak~auart = 'ZTM' or
vbak~auart = 'ZOIL' ).
IF SY-SUBRC = 0.
SELECT vgbel vgpos vbeln posnr FROM lips
INTO CORRESPONDING FIELDS OF TABLE it_vbpos_temp
FOR ALL ENTRIES IN it_vbpos
WHERE vgbel = it_vbpos-vbeln
AND vgpos = it_vbpos-posnr
%_hints oracle 'index ("LIPS" "LIPS~Z01")'.
SORT it_vbpos_temp by vgbel vgpos.
LOOP AT it_vbpos.
READ TABLE it_vbpos_temp
WITH KEY vgbel = it_vbpos-vbeln vgpos = it_vbpos-posnr
BINARY SEARCH.
IF SY-SUBRC = 0.
it_vbpos-vbdel = it_vbpos_temp-vbeln.
it_vbpos-psdel = it_vbpos_temp-posnr.
modify it_vbpos.
ENDIF.
ENDLOOP.
ENDIF.
WHEN p_rdos.
SELECT k~vbeln p~posnr k~kunnr AS kunag k~audat k~auart p~werks k~vgbel
INTO CORRESPONDING FIELDS OF TABLE it_vbpos
FROM vbak AS k INNER JOIN vbap AS p ON k~vbeln = p~vbeln
WHERE p~werks IN s_werks AND k~vdatu IN s_vdatu AND
k~vkorg in (cns_vkorg,cns_vkorg_US) AND "DEVK903521
k~vgbel EQ p_vgbel AND
k~kunnr IN s_kunag AND k~auart IN s_auart AND
p~oid_ship IN s_kunnr.
ENDCASE.
Determine if delivery has been billed out, if not can create PF Invoice - CHANGED
LOOP AT it_vbpos INTO wa_vbpos.
Check Ship-to in
SELECT SINGLE kunnr INTO wa_vbpos-kunsh FROM vbpa
WHERE parvw EQ cns_parsh AND vbeln EQ wa_vbpos-vbeln.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
Check for Bill-to
select single kunnr into wa_vbpos-kunre from vbpa
where parvw eq cns_parre and vbeln eq wa_vbpos-vbeln
and kunnr in s_kunre.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
Get Partner Texts
SELECT SINGLE name1 INTO wa_vbpos-name1_ag FROM kna1
WHERE kunnr EQ wa_vbpos-kunag.
SELECT SINGLE name1 INTO wa_vbpos-name1_sh FROM kna1
WHERE kunnr EQ wa_vbpos-kunsh.
SELECT SINGLE name1 INTO wa_vbpos-name1_re FROM kna1
WHERE kunnr EQ wa_vbpos-kunre.
CASE 'X'.
WHEN p_rdff.
IF p_delvd = 'X'.
optimized for performance reasons i.e. time-out
Check if delivery has been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc EQ 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ELSEIF p_billed = 'X'.
Check if delivery hasn't been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ENDIF.
WHEN p_rdos.
IF p_delvd = 'X'.
Check if order has been billed out
SELECT SINGLE * FROM vbrp
WHERE vbeln EQ wa_vbpos-vbeln AND
vgpos EQ wa_vbpos-posnr.
IF sy-subrc EQ 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
ELSEIF p_billed = 'X'.
Check if delivery hasn't been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON pvbeln = kvbeln
WHERE pvgtyp EQ cns_vgtyp AND pvgbel EQ wa_vbpos-vbdel AND
pvgpos EQ wa_vbpos-psdel AND kvbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ENDIF.
ENDCASE.
MOVE-CORRESPONDING wa_vbpos TO wa_report.
APPEND wa_report TO it_report.
MODIFY it_vbpos FROM wa_vbpos.
ENDLOOP.
if 'onsite field summary', then process by release sales orders
IF p_rdos = 'X'.
sort it_report by vbeln.
delete adjacent duplicates from it_report comparing vbeln.
else.
SORT it_report BY werks name1_ag name1_sh vbeln.
DELETE ADJACENT DUPLICATES FROM it_report.
endif.
SORT it_report BY name1_sh werks name1_ag vbeln.
ENDFORM. " read_report
*& Form process_vf01
Call transaction VF01 and fill screen table with order values
FORM process_vf01.
DATA: ln_index(2) TYPE n,
lc_field(20) TYPE c,
lc_fkart TYPE vbrk-fkart,
li_lines TYPE i,
lc_msgtxt(99) TYPE c,
lwa_bdcoptions TYPE ctu_params,
lwa_mess LIKE LINE OF it_bdcmess.
REFRESH: it_bdcmess.
lwa_bdcoptions-dismode = cns_mode.
lwa_bdcoptions-updmode = cns_upd.
CASE 'X'.
WHEN p_rdff.
lc_fkart = cns_fkff.
WHEN p_rdos.
lc_fkart = cns_fkos.
ENDCASE.
REFRESH: bdc_tab.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
' ' 'BDC_CURSOR' 'RV60A-FKART',
' ' 'RV60A-FKART' lc_fkart,
' ' 'BDC_OKCODE' '/00'.
LOOP AT it_vbeln INTO wa_vbeln.
ln_index = sy-tabix.
Up to the second delivery of the BDC add the Delivery to the screen, after that click the More Documents for every entry. logic changed for DEVK902353
CASE ln_index.
WHEN 1.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
WHEN 2 OR 3.
IF p_rdos 'X'.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' 'FKAN'..
ELSE.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
ENDIF.
WHEN OTHERS.
If p_rdos 'X'.
CONCATENATE 'KOMFK-VBELN' '(2)' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' 'FKAN'.
endif.
ENDCASE.
ENDLOOP.
VF01 will go to a different screen if only one line selected
DESCRIBE TABLE it_vbeln LINES li_lines.
IF li_lines EQ 1.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0104',
' ' 'BDC_OKCODE' '=SICH'.
ELSE.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' '=SICH'.
ENDIF.
CALL TRANSACTION 'VF01' USING bdc_tab OPTIONS FROM lwa_bdcoptions
MESSAGES INTO it_bdcmess.
WRITE: / 'BDC Messages:'.
SKIP.
LOOP AT it_bdcmess INTO lwa_mess.
CALL FUNCTION 'RH_MESSAGE_GET'
EXPORTING
arbgb = 'VF'
msgnr = lwa_mess-msgnr
msgv1 = lwa_mess-msgv1
msgv2 = lwa_mess-msgv2
msgv3 = lwa_mess-msgv3
msgv4 = lwa_mess-msgv4
IMPORTING
msgtext = lc_msgtxt
EXCEPTIONS
message_not_found = 1
OTHERS = 2.
WRITE: /5 lc_msgtxt.
ENDLOOP.
ENDFORM. " process_vf01
form update_bdc *
subroutine to add the data to the bdc table for trans. vf01 *
FORM update_bdc USING dynpro field content.
CLEAR bdc_tab.
IF dynpro EQ 'X'.
bdc_tab-program = field.
bdc_tab-dynpro = content.
bdc_tab-dynbegin = 'X'.
ELSE.
bdc_tab-fnam = field.
bdc_tab-fval = content.
ENDIF.
APPEND bdc_tab.
ENDFORM. "UPDATE_BDC
*& Form show_report
Report to Display Available Orders on Screen
FORM show_report .
DATA: l_idx TYPE i.
WRITE: / 'Available Orders/Deliveries for Plant:'.
LOOP AT s_werks.
WRITE: s_werks-low.
ENDLOOP.
SKIP.
FORMAT INTENSIFIED ON COLOR COL_HEADING.
WRITE: /5 text-h01, text-h02.
CASE 'X'.
WHEN p_rdff.
WRITE: text-h06.
ENDCASE.
WRITE: text-h03, text-h04, text-h05, text-h07,
/ sy-uline.
FORMAT INTENSIFIED OFF COLOR OFF.
l_idx = 0.
LOOP AT it_report INTO wa_report.
IF l_idx EQ 0.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
l_idx = 1.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
l_idx = 0.
ENDIF.
WRITE: / wa_report-mark AS CHECKBOX,
wa_report-auart UNDER text-h01,
wa_report-vbeln UNDER text-h02.
CASE 'X'.
WHEN p_rdff.
WRITE: wa_report-vbdel UNDER text-h06.
ENDCASE.
WRITE: wa_report-audat UNDER text-h03,
wa_report-name1_ag UNDER text-h04,
wa_report-name1_sh UNDER text-h05,
wa_report-name1_re under text-h07.
HIDE: wa_report-mark, wa_report-vbeln, wa_report-vbdel.
ENDLOOP.
ENDFORM. " show_report
Thanks for your kind help.
Aarav.Hi, Anne-Marie;
You may be running into a common issue that is docuemented here:
[SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333833393335%7D.do]
Regards,
Jonathan
Edited by: Jonathan Parminter on Mar 16, 2009 8:03 AM
Maybe you are looking for
-
IPod is not recognized by Windows Vista - possible solution
During the past couple of weeks that I faced this problem I found out that a lot of people had the same question as I did. Here is a possible solution. I have HP Pavilion laptop with Windows Vista. After I connected my new iPod – it didn't show up in
-
SA520 NAT/PAT not working with NAT address
The SA520 I have is configured on one public IP address and an exchange server is behind it. THe exchange server is configured with an internal address and the SA520 is performing NAT translation to a unique public address for the email server itsel
-
Image on pc not rendering fast
i have created and posted a starter site on my own domain. when i view on a mac the images render real quick. on a pc the images with drop shadows take up to 10 seconds. i have tried it on many different pc's with the same results. question is: is th
-
Hi All, Is there a document viewer out of the box control available in oracle JDeveloper. The purpose of the document viewer control is for users to view pdf file content on the webpage. This help users to see the document and fill in some document p
-
How add title to checkbox when select multiselect in htmlb table
I am doing htmlb using Java and can't seem to be able to add a title to the checkbox on my table. I see how to get the columns in java by using the following code TableColumn columnA = model.getColumnAt(2); But I can't seem to access the column that