How to get all GL accounts for each account in a given bank...
Hello Experts,
Is there a way to get all GL accounts for each account in a given house bank?
IN our company, there are 5 GL accounts for each bank so 1 GL for 1 account. they are for recon, payables,
receivables, etc. I checked table T012K but it only shows the main GL account. Hope you
can help me guys. Thank you and take care!
Try this.. it is based on company code
here it_cocodes is an internal table containing company codes
DATA: BEGIN OF it_glaccount OCCURS 0,
bukrs TYPE bukrs,
saknr TYPE saknr,
txt50 TYPE txt50_skat,
END OF it_glaccount.
DATA it_glaccount_wa LIKE it_glaccount.
LOOP AT it_cocodes INTO it_cocodes_wa WHERE ktopl <> ''.
SELECT bukrs saknr FROM skb1
INTO CORRESPONDING FIELDS OF it_glaccount_wa
WHERE bukrs = it_cocodes_wa-bukrs.
IF sy-subrc = 0.
SELECT SINGLE txt50 FROM skat INTO it_glaccount_wa-txt50
WHERE spras = 'E' AND ktopl = it_cocodes_wa-ktopl
AND saknr = it_glaccount_wa-saknr.
APPEND it_glaccount_wa TO it_glaccount.
CLEAR it_glaccount_wa-txt50.
ENDIF.
ENDSELECT.
loop at it_glaccount into it_glaccount_wa.
write:/....
endloop.
refresh...
clear...
endloop.
Similar Messages
-
If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
ThanksSorry you get only one notification sound for all email accounts. you can send a suggestion to apple here http://www.apple.com/feedback/
-
How to get top 10 records for each option in table prompt?
Hi,
I have created one report in which my requirement is to get top 10 highest salaries for each departments. I have created one table prompt which contains the names of all departments. On the salary column I have applied one filter i.e. TOP 10. Currently I am having 3 departments. I want to show the top 10 salaries for each department, but I am getting top 3 from first, 4 from second and 3 from third.They are calculating top 10 salaries based on all departments, not on individual department. How can I get top 10 salaries for each department?Hi,
Use TopN function in your column formula.
Ex: TOPN("Sales ,5 BY department)
Thanks,
Satya -
How to get the time interveral for each status of worklow (wating,Inprocess
Hi Friends,
I have requreiemnt to get the time interval for each status of workflow.
ex.
status
workflow id | startd date | enddate | waiting | Inprocessing|Error|......
1026 10.10.2008 25.10.2008 1hr 1hr 30 min 2 hr
Please do give me idea how to get the time stam of each status of workflow.
Thanks,
D.prabhuHi,
I think the following tables would be helpful to you:-
SWW_CONT Container Contents for Work Item Data Container
SWW_CONTOB "Container Cont. for Work Item Data Container (Only Objects)"
SWWLOGHIST History of a work item
SWWORGTASK Assignment of WIs to Org.Units and Tasks
SWWUSERWI Current Work Items Assigned to a User
SWWWIHEAD Header Table for all Work Item Types
Hope it Helps!
Regards,
Kanika -
How to get Privacy Policy value for each userprofile in sharepoint 2010?
In userprofile application, we have defined Privacy Policy of mobilephone feild as optional, so every user has option to choose visibility scope of this property to "Everyone/My Manager/my colegues/Only Me" .
Now I am trying to get mobilephone value and their selected visibility option for each user.
I am able to get mobilephone value but I could not get "what each user has chosen as their visibility scope"?Hi,
According to your post, my understanding is that you want to get Privacy Policy value for each userprofile in sharepoint 2010.
You need to use RunWithElevatedPrivileges method to impersonate user.
To get the get mobilephone policy, you can use user["CellPhone "].Privacy.
For more information, you can refer to:
c# - Getting property privacy with Sharepoint 2010
How to Programmatically Impersonate Users in SharePoint
Managing Sharepoint 2010 Profiles Programmatically
Thanks,
Linda Li
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Linda Li
TechNet Community Support -
How to get multiple output formats for each execution of the report?
Hi,
Is it possible to get multiple output formats for each execution of the report? If so can you provide some details?
ThanksIn Reports 6i, Reports Distribution was introduced. This allows you to run the report once and output to a number of destinations with a different format. It also allows you to distribute individual sections within a report to different destinations in different formats.
The Destinations for a Report to distribute to are defined either in a distribution file and passed on the command line or inside of the report definition.
To add a destination to the the report definition, bring up the property palette against the report object and then select the "Distribution" property under the "Report" node. This will bring up a dialog that allows you to create a distribution list. You can then test this list by selecting "file->distribute" from the menu.
To run a report that is to be distributed through rwrun60, you need to add "distribute=yes" to the command line. It will pick up the destinations from the report definition. If you add "destination=<filename>" then it will pick up the destinations from the specified "<filename>" and ignore the destinations in the report definition.
Note: if "distribute=yes" is specified on the command line then the destype/desname/desformat parameters will be used to format the report (ie: which printer/display to use during formatting for sizing objects) but will be ignored when the report is sent to the destinations. -
How to get all oneorder header_guids for a specific reference PRODUCT_ID?
Hi,
in servicerequest we add iobjects as reference objects.
The iobject represents the machine a customer has an issue with.
Within the iobject master we have a PRODUCT_ID. The product_ID represents the machine type.
So:
1 product_id could have 1:n iobjects (machines)
1 servicerequest has 1:1 iobject.
The requirement is to select all oneorder documents with a specific product_id within the assigned iobject.
I do not realy know which database tables i have to join?
Or is there already a function module in standard which can be used?
Thank you
Kind regards
ManfredHi,
OBJECT_ID can´t be the import parameter for IOBJECTs because it is from type CRMT_OBJECT_ID - which is the ID of transactions and not IOBJECTs.
I have played arround with this function module CRM_SERVICE_PORTAL_SEARCH but haven´t found an option to get all servicerequests (one order documents) for a specific reference object or a list of reference objects.
Are there other ideas how to use this or another function module for my requirement.
Thanks a lot.
Kind regards
Manfred -
How to get all authorization objects for a certain authorization profile
Hi ABAP experts,
I have the following problem: for a certain authorization profile of a role (created with transaction PFCG) I would like to get all contained authorization objects: e.g. for the contained object PLOG I would like to know/read all corresponding parameter values.
So:
- where are these values stored (dictionary table)?
- is there already a FM or a report to read all authoriation values for a certain authorization profile?
Thanks in advance.
Best regards,
OliverHi,
check the following it might useful for you:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
if helpful reward points are appreciated -
How to get all production orders for a workcenter
Hello ...
I have a requirement to create a report of all production orders for a given workcenter. The user enters the workcenter (CRHD-ARBPL), plant (CRHD-WERKS) and a date range, and wants to see a list of orders (AUFNR) that fall within that date range along with some other data from AFKO and AFPO.
I can't figure out a good, consistent way to get from workcenter to production orders.
Any ideas?
Thanks!
SharonHi there check this program for relation between SO PO and Production order
REPORT z_so_info.
TABLES: vbak, vbap, afko, afpo.
*Field catalog
TYPE-POOLS: slis.
DATA: lv_repid TYPE sy-repid VALUE sy-repid,
xfield TYPE slis_t_fieldcat_alv,
afield TYPE slis_fieldcat_alv.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) text-002.
SELECT-OPTIONS: so_so FOR vbak-vbeln OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
PARAMETERS:
p_kunnr LIKE vbak-kunnr, " sold-to
p_kunwe LIKE vbak-kunnr. " ship-to
SELECTION-SCREEN END OF BLOCK b2.
*Constants
CONSTANTS: c_zor TYPE vbak-auart VALUE 'ZOR',
c_we TYPE vbpa-parvw VALUE 'WE',
c_ag TYPE vbpa-parvw VALUE 'AG'.
* c_space TYPE space.
*Ranges
RANGES: ra_parvw FOR vbpa-parvw,
ra_kunnr FOR vbpa-kunnr.
*Tables
DATA: BEGIN OF gt_output OCCURS 0,
vbeln LIKE vbak-vbeln, " sales order number
posnr LIKE vbap-posnr, " SO item number
matnr LIKE vbap-matnr, " material number
sh LIKE vbpa-kunnr, " Ship-to
sp LIKE vbpa-kunnr, " Sold-to
lifnr LIKE ekko-lifnr, " Vendor
bstnk LIKE vbak-bstnk, " PO number
banfn LIKE vbep-banfn, " Purchase requi
po_st TYPE char30, " PO status text
pstyv TYPE vbap-pstyv, " Item catagory
aufnr LIKE afpo-aufnr, " Production Order
prd_stat TYPE string, " Prd order status
END OF gt_output.
DATA: wa_output LIKE gt_output.
FIELD-SYMBOLS: <fs_output> LIKE gt_output.
*Table for sales order and PO
TYPES : BEGIN OF gs_data,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
pstyv TYPE vbap-pstyv,
matnr TYPE vbap-matnr,
END OF gs_data.
DATA: gt_data TYPE STANDARD TABLE OF gs_data,
wa_data TYPE gs_data.
*Table for Production Orders
TYPES: BEGIN OF gs_prd,
aufnr TYPE afpo-aufnr,
posnr TYPE afpo-posnr,
kdauf TYPE afpo-kdauf,
kdpos TYPE afpo-kdpos,
wepos TYPE afpo-wepos, "Goods Receipt Indicator
elikz TYPE afpo-elikz, "Delivery Completed Indicator
objnr TYPE aufk-objnr, "Object number
* getri TYPE afko-getri, "Confirmed Order Finish Date
* gltri TYPE afko-gltri, "Actual finish date
END OF gs_prd.
DATA: gt_prd TYPE STANDARD TABLE OF gs_prd,
wa_prd TYPE gs_prd.
*Table for partner data
TYPES: BEGIN OF gs_partner,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
parvw TYPE vbpa-parvw,
kunnr TYPE vbpa-kunnr,
END OF gs_partner.
DATA: gt_partner TYPE STANDARD TABLE OF gs_partner,
wa_partner TYPE gs_partner.
TYPES: BEGIN OF gs_po,
ebeln TYPE ekkn-ebeln,
ebelp TYPE ekkn-ebelp,
vbeln TYPE ekkn-vbeln,
vbelp TYPE ekkn-vbelp,
END OF gs_po.
DATA: gt_po TYPE STANDARD TABLE OF gs_po,
wa_po TYPE gs_po.
TYPES: BEGIN OF gs_preq,
vbeln TYPE vbep-vbeln,
posnr TYPE vbep-posnr,
banfn TYPE vbep-banfn,
END OF gs_preq.
DATA: gt_preq TYPE STANDARD TABLE OF gs_preq,
wa_preq TYPE gs_preq.
TYPES: BEGIN OF gs_po_stat,
ebeln TYPE ekko-ebeln,
procstat TYPE ekko-procstat,
lifnr TYPE ekko-lifnr,
END OF gs_po_stat.
DATA: gt_po_stat TYPE STANDARD TABLE OF gs_po_stat,
wa_po_stat TYPE gs_po_stat.
*Field symbols
FIELD-SYMBOLS: <fs> TYPE tj02t-txt04,
<fs_temp> TYPE tj02t-txt04,
<fs_stat> TYPE char30.
START-OF-SELECTION.
PERFORM fr_build_range.
PERFORM fr_get_data.
PERFORM fr_build_fc.
PERFORM fr_output.
*& Form fr_get_data
* text
* --> p1 text
* <-- p2 text
FORM fr_get_data.
*Get SO
SELECT a~vbeln a~posnr a~pstyv a~matnr
FROM vbap AS a
JOIN vbak AS b
ON a~vbeln = b~vbeln
JOIN vbpa AS c
ON b~vbeln = c~vbeln
INTO TABLE gt_data
WHERE b~vbeln IN so_so
AND b~auart EQ c_zor "Only Sales Orders
AND c~kunnr IN ra_kunnr. "from selection screen
DELETE ADJACENT DUPLICATES FROM gt_data COMPARING vbeln posnr.
*get data of the production order
IF NOT gt_data[] IS INITIAL.
SELECT a~aufnr a~posnr a~kdauf a~kdpos a~wepos a~elikz
b~objnr
FROM afpo AS a
JOIN aufk AS b
ON a~aufnr = b~aufnr
INTO TABLE gt_prd
FOR ALL ENTRIES IN gt_data
WHERE a~kdauf EQ gt_data-vbeln
AND a~kdpos EQ gt_data-posnr.
ENDIF.
*Get partner data
IF NOT gt_data[] IS INITIAL.
SELECT vbeln posnr parvw kunnr
FROM vbpa
INTO TABLE gt_partner
FOR ALL ENTRIES IN gt_data
WHERE vbeln EQ gt_data-vbeln.
ENDIF.
*Get Purchase Order
IF NOT gt_data[] IS INITIAL.
SELECT ebeln ebelp vbeln vbelp
FROM ekkn
INTO TABLE gt_po
FOR ALL ENTRIES IN gt_data
WHERE vbeln EQ gt_data-vbeln
AND vbelp EQ gt_data-posnr.
SELECT vbeln posnr banfn
FROM vbep
INTO TABLE gt_preq
FOR ALL ENTRIES IN gt_data
WHERE vbeln EQ gt_data-vbeln
AND posnr EQ gt_data-posnr.
ENDIF.
IF NOT gt_po[] IS INITIAL.
SELECT a~ebeln a~procstat a~lifnr
FROM ekko AS a
JOIN ekpo AS b
ON a~ebeln = b~ebeln
INTO TABLE gt_po_stat
FOR ALL ENTRIES IN gt_po
WHERE b~ebeln EQ gt_po-ebeln
AND b~ebelp EQ gt_po-ebelp.
ENDIF.
*Move data to output table
LOOP AT gt_data INTO wa_data.
wa_output-vbeln = wa_data-vbeln.
wa_output-posnr = wa_data-posnr.
wa_output-pstyv = wa_data-pstyv.
wa_output-matnr = wa_data-matnr.
READ TABLE gt_po INTO wa_po WITH KEY vbeln = wa_data-vbeln
vbelp = wa_data-posnr.
IF sy-subrc EQ 0.
wa_output-bstnk = wa_po-ebeln.
READ TABLE gt_po_stat INTO wa_po_stat WITH KEY ebeln = wa_po-ebeln.
IF sy-subrc EQ 0.
wa_output-lifnr = wa_po_stat-lifnr.
CASE wa_po_stat-procstat.
WHEN '01'.
wa_output-po_st = 'Version in process'.
WHEN '02'.
wa_output-po_st = 'Active'.
WHEN '03'.
wa_output-po_st = 'In release'.
WHEN '04'.
wa_output-po_st = 'Partially released'.
WHEN '05'.
wa_output-po_st = 'Released Completely'.
WHEN '08'.
wa_output-po_st = 'Rejected'.
ENDCASE.
ENDIF. "inner read subrc
ENDIF. "outer read subrc
READ TABLE gt_preq INTO wa_preq WITH KEY vbeln = wa_data-vbeln
posnr = wa_data-posnr.
IF sy-subrc EQ 0.
wa_output-banfn = wa_preq-banfn.
ENDIF.
READ TABLE gt_prd INTO wa_prd WITH KEY kdauf = wa_data-vbeln
kdpos = wa_data-posnr.
IF sy-subrc EQ 0.
wa_output-aufnr = wa_prd-aufnr.
*get the purchase requisition for production order as well
SELECT SINGLE banfn
FROM ebkn
INTO wa_output-banfn
WHERE aufnr EQ wa_prd-aufnr.
*Get the status of the production order
PERFORM fr_get_prd_stat USING wa_prd-objnr
CHANGING wa_output-prd_stat.
ENDIF. " sy-subrc
READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
parvw = c_we.
IF sy-subrc EQ 0.
wa_output-sh = wa_partner-kunnr.
ENDIF.
READ TABLE gt_partner INTO wa_partner WITH KEY vbeln = wa_data-vbeln
parvw = c_ag.
IF sy-subrc EQ 0.
wa_output-sp = wa_partner-kunnr.
ENDIF.
APPEND wa_output TO gt_output.
CLEAR: wa_data, wa_prd,wa_partner,wa_output.
ENDLOOP.
ENDFORM. " fr_get_data
*& Form fr_build_range
* text
* --> p1 text
* <-- p2 text
FORM fr_build_range .
*Range for partner function
MOVE 'I' TO ra_parvw-sign.
MOVE 'EQ' TO ra_parvw-option.
MOVE 'SH' TO ra_parvw-low. " we
APPEND ra_parvw.
CLEAR ra_parvw.
MOVE 'I' TO ra_parvw-sign.
MOVE 'EQ' TO ra_parvw-option.
MOVE 'SP' TO ra_parvw-low. " ag
APPEND ra_parvw.
CLEAR ra_parvw.
*Range for ship-to and sold-to
MOVE 'I' TO ra_kunnr-sign.
MOVE 'EQ' TO ra_kunnr-option.
MOVE p_kunnr TO ra_kunnr-low.
APPEND ra_kunnr.
CLEAR ra_kunnr.
MOVE 'I' TO ra_kunnr-sign.
MOVE 'EQ' TO ra_kunnr-option.
MOVE p_kunwe TO ra_kunnr-low.
APPEND ra_kunnr.
CLEAR ra_kunnr.
ENDFORM. " fr_build_range
*& Form fr_build_fc
* text
* --> p1 text
* <-- p2 text
FORM fr_build_fc .
* sales order number
afield-fieldname = 'VBELN'.
afield-seltext_s = 'Sales #'.
afield-ref_tabname = 'VBAK'.
APPEND afield TO xfield. CLEAR afield.
* sales ITEM number
afield-fieldname = 'POSNR'.
afield-seltext_s = 'Item #'.
afield-ref_tabname = 'VBAP'.
APPEND afield TO xfield. CLEAR afield.
* Material Number
afield-fieldname = 'MATNR'.
afield-seltext_s = 'Material #'.
afield-ref_tabname = 'VBAP'.
afield-outputlen = 10.
APPEND afield TO xfield. CLEAR afield.
*Vendor Number
afield-fieldname = 'LIFNR'.
afield-seltext_s = 'Vendor Num.'.
afield-ref_tabname = 'EKKO'.
APPEND afield TO xfield. CLEAR afield.
* ship-to-party
afield-fieldname = 'SH'.
afield-seltext_s = 'Ship-to'.
afield-ref_tabname = 'VBPA'.
APPEND afield TO xfield. CLEAR afield.
* sold-to-party
afield-fieldname = 'SP'.
afield-seltext_s = 'Sold-to'.
afield-ref_tabname = 'VBPA'.
APPEND afield TO xfield. CLEAR afield.
*PO number
afield-fieldname = 'BSTNK'.
afield-seltext_s = 'PO NUM'.
afield-ref_tabname = 'EKKO'.
APPEND afield TO xfield. CLEAR afield.
*PO status
* afield-fieldname = 'PO_STAT'.
* afield-seltext_s = 'Step'.
* afield-ref_tabname = 'zbacklog_v2'.
* APPEND afield TO xfield. CLEAR afield.
*PO step status
afield-fieldname = 'PO_ST'.
afield-seltext_s = 'PO.Status'.
afield-ref_tabname = 'zbacklog_v2'.
APPEND afield TO xfield. CLEAR afield.
*Purchase requisition
afield-fieldname = 'BANFN'.
afield-seltext_s = 'Pur. Req.'.
afield-ref_tabname = 'VBEP'.
APPEND afield TO xfield. CLEAR afield.
*Item catagory
afield-fieldname = 'PSTYV'.
afield-seltext_s = 'Itm. Catg'.
afield-ref_tabname = 'VBAP'.
APPEND afield TO xfield. CLEAR afield.
*Prodcution Order number
afield-fieldname = 'AUFNR'.
afield-seltext_m = 'Prod.Order'.
afield-ref_tabname = 'AFKO'.
APPEND afield TO xfield. CLEAR afield.
*PRODCUTION status
afield-fieldname = 'PRD_STAT'.
afield-seltext_s = 'Prd. Step'.
afield-ref_tabname = 'zbacklog_v2'.
afield-outputlen = 20.
APPEND afield TO xfield. CLEAR afield.
*PRODUCTION step status
* afield-fieldname = 'PRD_ST'.
* afield-seltext_s = 'Prd. Status'.
* afield-ref_tabname = 'zbacklog_v2'.
* APPEND afield TO xfield. CLEAR afield.
ENDFORM. " fr_build_fc
*& Form fr_output
* text
* --> p1 text
* <-- p2 text
FORM fr_output .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_STRUCTURE_NAME =
* IS_LAYOUT =
it_fieldcat = xfield[]
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = gt_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " fr_output
*& Form fr_get_prd_stat
* text
* -->P_WA_PRD_OBJNR text
FORM fr_get_prd_stat USING p_objnr CHANGING p_prd_stat.
DATA: lt_status TYPE STANDARD TABLE OF jstat,
wa_status TYPE jstat,
lv_status TYPE tj02t-txt04,
lv_temp2 TYPE char5,
lv_buff TYPE string.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = p_objnr
only_active = 'X'
TABLES
status = lt_status
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
LOOP AT lt_status INTO wa_status.
IF wa_status-stat(1) EQ 'I'.
SELECT txt04 FROM tj02t
INTO lv_status
WHERE istat EQ wa_status-stat
AND spras EQ 'E'.
ENDSELECT.
lv_temp2 = lv_status.
CONCATENATE lv_temp2 p_prd_stat INTO p_prd_stat
SEPARATED BY ','.
ENDIF.
CLEAR: wa_status, lv_status, lv_temp2.
ENDLOOP.
lv_buff = p_prd_stat.
*Status of Production Order
IF lv_buff CS 'CRTD'.
p_prd_stat = 'Not Active'.
ENDIF.
IF lv_buff CS 'REL'.
IF lv_buff CS 'GMPS'.
p_prd_stat = 'Printed In Prod'.
ELSE.
p_prd_stat = 'Printed'.
ENDIF.
ENDIF.
IF lv_buff CS 'TECO'.
p_prd_stat = 'Technically Compt.'.
ENDIF.
ENDFORM. " fr_get_prd_stat -
How to get Sales rep information for each customer
Hi
For each record in ra_customers, I want to find associated Sales rep for each customer.
Can some one please tell me what table stores this information?
Thanks
AaliTry
SELECT rc.customer_name, rc.customer_number, jrs.NAME
FROM jtf_rs_salesreps jrs, ra_customers rc
WHERE rc.primary_salesrep_id = jrs.salesrep_idHope this helps,
Sandeep Gandhi -
How to get all minimum values for a table of unique records?
I need to get the list of minimum value records for a table which has the below structure and data
create table emp (name varchar2(50),org varchar2(50),desig varchar2(50),salary number(10),year number(10));
insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',3000,2005);
insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',4000,2007);
insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2007);
insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2008);
insert into emp (name,org,desig,salary,year) values ('emp1','org1','mgr',7000,2010);
commit;
SELECT e.name,e.org,e.desig,min(e.year) FROM emp e,(
SELECT e1.name,e1.org,e1.desig,e1.salary FROM emp e1
GROUP BY (e1.name,e1.org,e1.desig,e1.salary)
HAVING COUNT(*) >1) min_query
WHERE min_query.name = e.name AND min_query.org = e.org AND min_query.desig =e.desig
AND min_query.salary = e.salary
group by (e.name,e.org,e.desig);With the above query i can get the least value year where the emp has maximum salary. It will return only one record. But i want to all the records which are minimum compare to the max year value
Required output
emp1 org1 mgr 7000 2008
emp1 org1 mgr 7000 2007Please help me with this..Frank,
Can I write the query like this in case of duplicates?
Definitely there would have been a better way than the query I've written.
WITH got_analytics AS
SELECT name, org, desig, salary, year
, MAX (SALARY) OVER ( PARTITION BY NAME, ORG, DESIG) AS MAX_SALARY
, ROW_NUMBER () OVER ( PARTITION BY NAME, ORG, DESIG, SALARY
ORDER BY year DESC
) AS YEAR_NUM
FROM (SELECT 'emp1' AS NAME, 'org1' AS ORG, 'mgr' AS DESIG, 3000 AS SALARY, 2005 AS YEAR FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',4000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',4000,2008 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2008 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL)
SELECT name, org, desig, salary, year
FROM got_analytics
WHERE salary = max_salary
AND YEAR_NUM > 1
Result:
emp1 org1 mgr 7000 2010
emp1 org1 mgr 7000 2008
emp1 org1 mgr 7000 2007
emp1 org1 mgr 7000 2007
WITH got_analytics AS
SELECT name, org, desig, salary, year
, MAX (SALARY) OVER ( PARTITION BY NAME, ORG, DESIG) AS MAX_SALARY
, ROW_NUMBER () OVER ( PARTITION BY NAME, ORG, DESIG, SALARY
ORDER BY year DESC
) AS YEAR_NUM
, ROW_NUMBER () OVER ( PARTITION BY NAME, ORG, DESIG, SALARY, Year
ORDER BY YEAR DESC
) AS year_num2
FROM (SELECT 'emp1' AS NAME, 'org1' AS ORG, 'mgr' AS DESIG, 3000 AS SALARY, 2005 AS YEAR FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',4000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',4000,2008 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2007 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2008 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL UNION ALL
SELECT 'emp1','org1','mgr',7000,2010 FROM DUAL)
SELECT name, org, desig, salary, year
FROM got_analytics
WHERE salary = max_salary
AND YEAR_NUM > 1
AND YEAR_NUM2 < 2
Result:
emp1 org1 mgr 7000 2008
emp1 org1 mgr 7000 2007 -
How to get count of records for each type from internal table
Hi Guys,
I want to implement a logic to find out the count of records in a internal table.
Assume my internal table have one field having the entries as shown below.
Internal table Entries
10
10
10
11
11
12
12
12
12
13
14
14
15
15
15
15
15
16
16
17
18
19
20
20
20
....... etc....
I should get an output as below
10's - 3
11's -2 ,
12's - 4.... etc..
Could any one help me how to do this.
Thanx,
KumarREPORT zzz.
DATA: i(100),
t(100),
j TYPE n.
TYPES: BEGIN OF gt_int_type,
linex(100) TYPE c,
END OF gt_int_type.
DATA: gt_int TYPE STANDARD TABLE OF gt_int_type,
wa_int LIKE LINE OF gt_int.
START-OF-SELECTION.
wa_int-linex = '10'.
APPEND wa_int TO gt_int.
wa_int-linex = '10'.
APPEND wa_int TO gt_int.
wa_int-linex = '10'.
APPEND wa_int TO gt_int.
wa_int-linex = '11'.
APPEND wa_int TO gt_int.
wa_int-linex = '11'.
APPEND wa_int TO gt_int.
wa_int-linex = '12'.
APPEND wa_int TO gt_int.
wa_int-linex = '12'.
APPEND wa_int TO gt_int.
wa_int-linex = '12'.
APPEND wa_int TO gt_int.
wa_int-linex = '12'.
APPEND wa_int TO gt_int.
wa_int-linex = '13'.
APPEND wa_int TO gt_int.
wa_int-linex = '14'.
APPEND wa_int TO gt_int.
wa_int-linex = '14'.
APPEND wa_int TO gt_int.
wa_int-linex = '15'.
APPEND wa_int TO gt_int.
wa_int-linex = '15'.
APPEND wa_int TO gt_int.
wa_int-linex = '15'.
APPEND wa_int TO gt_int.
wa_int-linex = '15'.
APPEND wa_int TO gt_int.
wa_int-linex = '15'.
APPEND wa_int TO gt_int.
wa_int-linex = '16'.
APPEND wa_int TO gt_int.
wa_int-linex = '16'.
APPEND wa_int TO gt_int.
wa_int-linex = '17'.
APPEND wa_int TO gt_int.
wa_int-linex = '18'.
APPEND wa_int TO gt_int.
wa_int-linex = '19'.
APPEND wa_int TO gt_int.
wa_int-linex = '20'.
APPEND wa_int TO gt_int.
wa_int-linex = '20'.
APPEND wa_int TO gt_int.
wa_int-linex = '20'.
APPEND wa_int TO gt_int.
LOOP AT gt_int INTO wa_int.
WRITE:/ wa_int-linex.
ENDLOOP.
ULINE.
SKIP 3.
SORT gt_int BY linex.
READ TABLE gt_int INDEX 1 INTO i.
j = 0.
LOOP AT gt_int INTO wa_int.
IF wa_int-linex EQ i.
j = j + 1.
ELSE.
WRITE:/ i,'''s = ', j.
j = 1.
i = wa_int-linex.
ENDIF.
ENDLOOP.
WRITE:/ i,'''s = ', j.
consider clearing leading/trainling spaces... -
Enabling alternate account for specific accounts
Hi all,
Because of a project requirement we are to map two accounts (say A, B) with alternate accounts (say A1,A2,A3 with A and say B1,B2B3 with B). Currently alternate accounts are not used in production. In test environments we enabled alternate account at 'Installation Options' and 'Ledger for a unit' definition. Created alt accounts and mapped with accounts.
On the basis of account alt account combination tax applicable is calculated.
When we edit the journal in GL now, it gives error "The mapping between Account and AltAcct is invalid." for any journal line containig accounts other than A or B. Is therer any way by which we can avoid this error for journal lines containing accounts A or B. Or to validate the journal.
Otherwise if we have say 700 accounts in all in production, then creating alternate account for each account and mapping and analyzing the impact of the same gets beyond the scope of the project. Please help or suggest with any ideas.
Thanks in anticipation
Rohan
[email protected]Check below link. It may helpful to u
PIA: PeopleTools 8.5x Timeout Settings - Guidelines for Setting Timeout Values and Troubleshooting Timeout-Related Issues [ID 1470518.1] -
I have 3 iphones, an ipod touch and an Ipad on the same itunes account. should I have a different account for each device? If so how do I get all my purchases, like music on all the devices?
You can sync as many devices as you want to the same iTunes account, there is no limit. You can have the same content on each device or different content, the choice is yours. iTunes will keep everything straight, by device, including separate backups. I'd suggest giving each device a unique name, to make things easier.
-
My dad and I have shared an iTunes account for years and I just created a new apple id but I have no Idea how to get all those purchases to this new account. Help please?
The old Apple ID (presumably your dads) owns those songs and your new Apple ID does not. However, your dad can authorize your iD to use the songs by going to Store > Authorize This Computer from your iTunes menu and entering his Apple ID and password.
Maybe you are looking for
-
Assign a URL to an image in iWeb 2.0
I want to insert an image to my iWeb 2.0 page and apply "Shadow" and "Reflection" to the image, but do not want this image source from a local file. Instead, I want to assign it a URL to an external webservice. Using an HTML snippet will solve the pr
-
Dear Sir's I finished installation APEX on EX on Windows XP, but I could not login it gives Error on page "Application Express Administration Services" please any help regards
-
How can I remove hidden remnants of fonts?
When I pre-flight my book for print it gives me a report which lists a few fonts which is not seachable in the documents. I guess they are remnants from the original Word document. The remnants are from "Cambria", one case of cambria is even embedded
-
Combining PDF Forms with global elements
Hello all, I have a bit of a problem with combining .pdf forms into a package. I was hoping that I could convert word documents into .pdf format, then convert them into forms using global bindings for basic information in the forms such as customer n
-
SAP Portal Integration with InfoView
Hi Experts, I have successfully configured SAP Portal Integration with InfoView using the following steps provided by Ingo: - set the system that you want to be authenticated against as the DEFAULT system in the options of the SAP authentication. - g