MB5B G/L ACCOUNT AS SELECTION CRITERIA
Hi experts
I have to modify mb5b tranx prg . presently we are using date as selection criteria..but now onwards user wants G/L account along with date as selection criteria. I created one selec-option for field HKONT type hkont-bseg. Now in select queries i need ur help ..Kindly tell me where i need to use this field in my select queries to fetch RELEVANT data.
Regards
Anu
Go thru this code. hope it will help you.
reward if help.
REPORT zfi_gl_fss0
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_gl OCCURS 0,
saknr(010), " GL Account
bukrs(004), " Company Code
waers(005), " Currency
xsalh(001), " BAl Local Curr Ind
mwskz(002), " Tax Category
xopvw(001), " Open Item Ind
xkres(001), " Line Item Ind
zuawa(003), " Sort Key
fstag(004), " Field Category
END OF i_gl.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X', " Flag
c_tax VALUE '0'. " Tax Category
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_gl
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Upload the Data from Internal Table
LOOP AT i_gl.
Initial Screen
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'
'2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ACC_CRE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
i_gl-saknr.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
i_gl-bukrs.
perform bdc_dynpro using
'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB02'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
i_gl-WAERS.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XSALH'
i_gl-XSALH.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
i_gl-MWSKZ.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
i_gl-XOPVW.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'
c_x."i_gl-XKRES.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
i_gl-ZUAWA.
perform bdc_dynpro using
'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
i_gl-FSTAG.
Call The Transaction
PERFORM bdc_transaction USING 'FSS0'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
Similar Messages
-
DRQ: Isolate the Daily, Monthly and Yearly CheckBoxes in Selection Criteria
Module: Financials => Financial Reports => Accounting => General Ledger
Request to Isolate the Daily, Monthly and Yearly Check Boxes in the General Ledger - Selection Criteria screen, instead of an option in the report window.
Problem: If there is BP/General Ledger having long transaction list, then once user un-check any of the check boxes system takes long time to remove/hide those rows which contains Totals. Which is effecting the performance of the report also. Also those checkboxes appeared with check marked by default.
If user has an option in the selection criteria screen, then they can choose which Total they want before previewing the report and mark accordingly.
Thanks & Regards
Anjan BhowmickBeing reached to 10 open question, I am forced to close this thread
-
How to transfer Customers to APO based on selection criteria of Division
Hello,
We have to transfer Customer Master specific to one business unit to APO and we don't want to transnfer the Customers of another business units. The differentiation of customers is done at a Distribution Channel & Division level. But we don't have Dist Channel & Division as a Selection criteria in Integration Model(CFM1).
The other option od Sales Org. Account Grp are common to other Business units too.
Please provide your suggestions how we can do this.
Thanks,
AshishAshish
You can manipulate the CFM1 o/p list using the BadI CIF_INT_MODEL. So you actually select all customers in the integration model and add custom logic in this badI implementation to delete the customers that you dont want to transfer . The updated CFM1 output list will then contain the customers that you want .
Actually we used this BadI for manipulating the PIR's and BOM IM's and it is working without issues
Thanks
Aparna -
Selection Criteria for Delta loads triggered using MDM_CLNT_EXTR
Hi ,
Currently we are required to load data only from two specific account groups . Therefore in the selection criteria in mdm_clnt_extr we maintian these two account groups and extract data.
However, when setting up the delta load there does not to be an option to restrcit the delta to a specify an criteria. Therefore, in our case several records from account groups which are not required are passed on to the MDM system.
Is there a way to address this requirement ?
1. There is an option to run the initial load variants at regular intervals, the problem with this is that in our case we have several variant creates as the R/3 system does not allows extraction on more that 999 records at a time. Therefore at point of time to capture the delta records , if we run all these jobs our network gets choked.
2. Run delta job, but without selection criteria it pulls out records which we don't require
Any suggestions on how this problem can be addressed are welcome ,
Thanks in advance,
Anita GeorgeThanks Michael !
Well, regarding hte ALE settings, we did take a look in bd64 the filters are based on objects which one of these is relevant for customer account groups ? Probably in the future we would require all data, and then is it enogh to remove the filter ?
Can a filter be maintained at the XI level , this would be good as only the required account groups are passed on to MDM . Is there any documentation on available on this ?
Regarding the Import Manager, will have to check this functionality, as it is now no matter how many times we update the map/rename /load/unload it automated imports keep failing.
Our R/3 system seems to have problem extracting more than 999 records, as we tried with different number of records and all those extraction jobs got cancelled. So, currently we are running multiple jobs for the initial load and even this is very time consuming.
Thanks & Regards,
Anita George -
SQ01 query on LDB BRF with selection criteria on BSEG
Dear all,
we built an inofset on LDB BRF (BKPF - BSEG) and a query with selection criteria based on both BKPF and BSEG tables.
My proble : when the query select a posting fullfilling header data selection criteria but not line item criteria, it still displayed the header data in the layout.
We set up a filter on the account to hide results where account is blank but we loss the filter exporting the result on access. So if anyome has a better idea, we'll be very thankfull.
Br,Hi Rick,
What Edan proposed will work as logical AND (both filters on dates will be checked simultaneously).
Here is a solution.
Youll have a user entry variable on 0CALDAY.
- Create a new variable on 0CALDAY, customer exit, mandatory, not ready for input. This variable should return the date entered in user entry variable.
- Create a structure in columns.
- New selection (lets name it chg). Put there your KF and your Change date char. Restrict it by the user entry var. Hide it.
- New selection (lets name it crt). Put there your KF and your Created on date char. Restrict it by the customer exit var. Hide it.
New formula (lets name it FilteredAmount):
( 'chg' <> 0 ) * 'chg' + ( 'crt' <> 0 ) * 'crt'
Create a condition:
FilteredAmount <> 0.
Best regards,
Eugene -
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 -
BGP selection criteria in a VXR-G2 running SB code
Hi,
In brief, I have a VRF configured on a PE router which is a 7200-G2 router running 12.2(31)SB18, I import two route targets, one of them belongs to another VRF.
Now, when I receive two default routes from both VRFs, and my question is, why did the PE router preferred the default route from 192.168.253.252:20500:0.0.0.0/0 although it's the newer one as presented below (I have removed the RT and then added it again, so that the route becomes the more recent)
Any ideas?
pe1#sh ip bg vpnv4 vrf network 0.0.0.0/0
BGP routing table entry for 192.168.253.210:10:0.0.0.0/0, version 43143585
Paths: (1 available, best #1, table network)
Flag: 0x420
Advertised to update-groups:
3
Local, imported path from 192.168.253.252:10:0.0.0.0/0
192.168.253.251 (metric 2010) from 192.168.253.110 (192.168.253.110)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:20500:10
Originator: 192.168.253.252, Cluster list: 192.168.253.110
mpls labels in/out nolabel/719
pe1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
pe1(config)#ip vrf network
pe1(config-vrf)# route-target import 20500:20500
pe1(config-vrf)#^Z
pe1#sh ip bg vpnv4 vrf network 0.0.0.0/0
BGP routing table entry for 192.168.253.210:10:0.0.0.0/0, version 43146664
Paths: (2 available, best #1, table network)
Flag: 0x420
Advertised to update-groups:
3
Local, imported path from 192.168.253.252:20500:0.0.0.0/0
192.168.253.251 (metric 2010) from 192.168.253.110 (192.168.253.110)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:20500:20500
Originator: 192.168.253.252, Cluster list: 192.168.253.110
mpls labels in/out nolabel/825
Local, imported path from 192.168.253.252:10:0.0.0.0/0
192.168.253.251 (metric 2010) from 192.168.253.110 (192.168.253.110)
Origin incomplete, metric 0, localpref 100, valid, internal
Extended Community: RT:20500:10
Originator: 192.168.253.252, Cluster list: 192.168.253.110
mpls labels in/out nolabel/719Hello Sreenivas,
Thanks but I already know that.
When I click on fullscreen selection criteria (mountain icon) I only see user fields I added in the config when I'm connected with a user account that never accessed IMA11.
Is there a way to allow people who already accessed IMA11 to see new user fields configured in CUSTSEL_IM_FA_IA?
Thanks,
François -
Changing Selection Criteria in Current DataSources
I am pulling in financial information from BSEG into BW. BSEG is a massive table with a lot more information than I care to pull in for my purposes. I would like to be able to select a range of GL Accounts to pull in, but I cannot find a way to make certain fields available as selection criteria. When I go into "Change DataSource", I can unselect fields, and even select certain fields, but the option for most is grayed out.
How can I make other fields available as selection criteria?
Thanks for the help.
SeanHi Sean,
this is pure brutal code....
SELECT SINGLE * FROM ROOSFIELD
WHERE OLTPSOURCE = ZBW_BSEG AND
OBJVERS = 'A' AND
FIELD = GREYFIELD.
IF SY-SUBRC = 0.
ROOSFIELD-SELECTION = 'X'.
MODIFY ROOSFIELD.
ENDIF.
Sean, test this solution to verify if the selection you done works effectivly...
Hope this helps.
Bye,
Roberto
(remember to click on the star as way to thank !!!) -
2 selection Criteria on Profit & Loss Report (Project & Dimension)
Good day Experts,
Is it possible for Profit & Loss Report to have 2 Selection Criteria? our client wants to have Profit & Loss Report per Product (Project) & Branch (Dimension).
We tried to create an A/R & A/P Transactions with Project & Dimension defined for each line item, when we viewed the P&L Report, and select Project only as the Selection Criteria the P&L is correct, but when we included the Dimension on the Selection Criteria it only shows the Income / Turn-over Account Value & not viewing the COS / COGS Account Value.
Hope to hear from you soon. =)First you should check in JE where project and profit center updated or not .because if account type is not Expenditure then cost center nerver effect JE entries .
And Project updated have not any issue but in Cost center it should be Expenditure Account in Chart of Account.
Thanks
Manvendra Singh Niranjan -
Where is define Templates in Profit Center Report - Selection Criteria
Hello Experts,
where is define Templates in Profit Center Report - Selection Criteria Window ?
Dixit PatelDefine Templates in
Financials ->Cost Accounting -> Cost Centre Hierarchy -
Selection Criteria - Customer Clearing
Dear Gurus,
I have used the selection criteria ZUONR (Allocation) for clearing customers automatically.
But strangely it does not work even if the allocation field is the same in both the Debits & Credits.
In OB74 the rules have been defined as below for customers:
D.....600000..........700000.........ZUONR
Let me know if there is anything else i am missing in the customization.
Thanks.
regards,
RajHi Sue,
I checked up the Allocation Field (ZUONR) is identical and the amounts total to zero. The customer account also falls in the range specified.
Very strangely it works for some customers and does not for others.
Allocation... Doc No... DT... Doc date.... PK.... Cur... Amount... Text
RIVERS.....................DZ...04/11/2007..15......USD....1000-.....CP PP 30032078
RIVERS.....................RV...04/20/2007..01......USD....1000.............................
This is an example where it does not work... been racking my head to find an solution.
Thanks.
regards,
Raj -
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 -
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. -
PS report: multible selection for report selection criteria
Is there a possibility to define multible selections in the report selection variables of a PS hierarchy report?
I tried to define them via
CJE6 -> EDIT -> General data selction
and entered valiables in the FROM column and the TO column. But when I execute the report it will not show multible selction, but only single selection. Also, I did not find a SAP standard report which has multible selection in the report selection criteria screen.
I found the multible selections only in the DB profile selection screen and the dynamic selection, but that is not the solution I am searching for.
Can anybody kindly help me with this?E.g. S_ALR_87013532
here you can see multible selection in the DB profile selection group, but not in the report selection group. I would like to use multible selection in the report selection group, as mentioned above.
I am aware of the possibility of creating a new DB profile, but this is only my option B. -
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
Maybe you are looking for
-
F110 - clear debits in one vendor with credits in another vendor
Hi Experts We have a scenario where there are two vendor accounts created in SAP for two different business processes done with same vendor. For example - Vendor A created in SAP for all finished goods purchases from XYZ ltd Vendor B created in SAP
-
Have you all had the firmware update but not the OS update. I'm still on 7.10.7740.16 OS version? Is there any way to force this update?
-
How to create new users inside of a zone...?
So I've set up my first zone, got it up and running and logged into the console as root. It responds to remote connect protocols (ssh, telnet, etc) however since logging in as root is generally frowned upon I was going to create myself as a standard
-
Hi, I can see a menu item called export within the tool. But, where is import? BTW, I also noted the export doesn't seem to work like you expect it to. If you select tables and packages only packages will export. If you export table, it only exports
-
i've encounter popup illegal operation in plugin(shockwave flash) so i try get help from firefox guy.there already try their best to help but the problem still exist.when i browsing web that require flash it'll popup and after 2 3 time click ok on po