Need to delete flag "quantity incomplete" for table COSP (periodic repost)
Hello.
Step 1. I writed-off fuel to Internal order(unit of measure Liter ) ,
Step 2 Posted SKF,
Step 3 Execute Actual periodic reposting.
The issue is that receivers Internal orders has "empty" field quantity, it is because in table COSP field MUVO (quantity incomplete)= 'X'.
So I want to make it(MUVO) empty to see quantity in Receiver orders . How can I do this (BADI, user-exit), and what is the problem that I can face after that?
By the way, I'm not going to post fuel in Milliliters.
Hi,
For primary cost elements, the system keeps a control record in Table COKA for each object, cost element, fiscal year, and origin, which defines for all postings in a fiscal year whether and in which unit of measure quantities are transferred to the totals record. Basically, the posted quantity (COEP-MBGBTR) is updated in the posted unit of measure (COEP-MEINB) in the line item. Whether the quantity is transferred to the totals record depends on the control record valid for the object. If the quantity is transferred to the totals record, the total quantity field (COEP-MEGBTR) is also filled in the line item.
The control (COKA) record is created with the first posting in the fiscal year an cannot be changed during the year. In the cost element master record, you can store a default value for the unit of measure and set the "Manage quantity" indicator. If the indicator is set, the system sends a warning, if an actual posting is made without an entry for the unit of measure. If the unit of measure is changed subsequently in the cost element master, this does not affect quantity update, if there had already been postings in the fiscal year concerned.
If another posting is made to the same cost element at a later time, the system checks whether the posted quantity can be converted to the unit defined in the COKA record. If this is the case, the quantity is converted accordingly (e.g. kg to t) and transferred to the totals record. Otherwise, it is not transferred. To indicate that there had been such a posting (which is not contained in the total quantity) in period xxx, the "Quantity incomplete" indicator (COSP-MUVxxx) is set in the totals record.
Hope this information is helpful for you.
regards
Waman
Similar Messages
-
Need Customizing request instead of Workbench for Table Mainetnance
Hello All,
I created a ztable with Table Maintenance.
Whenever I am creating entries using SM30 it is asking workbench request instead of customizing request.
I need customizing request to be created for table entries.
Can anybody help me in this regard.Hi Eric,
Thanks a lot!.
The problem is solved....
Thank you very much for your help.
Regards,
Sunil -
Threshold quantity calculation for one previous periods
Hi,
There is a requirement to calculate the Threshold quantity if we give calender month(april 2007) it has to pick the back 12 months shipped quantity (month wise)
starts from march 2007 to feb 2006. and finds the active months(shipped quantity for that month shoulbe > 0) then it calculates the threshold quantity as
for eg.,
jan feb mar apr may jun jul aug sep oct nov dec total
100 200 100 100 50 100 200 50 100 60 200 100 1360
threshod qty : (1360/12)*8 = 907
here 8 is threshold factor
jan feb mar apr may jun jul aug sep oct nov dec total
100 200 0 100 50 100 200 0 100 60 200 100 1210
threshod qty : (1210/10)*8 = 968
the selection screen input is calendar month eg., 04/2007 (april/2007)
Please give the logic for calculating the above with steps
please specify any FM for these.
Thanks in advanceHi Viswa,
Thank you for your prompt reply. I tried with your answer, when I ran AFAB with posting period 1, I am getting below error.
"You want to carry out a repeat depreciation posting run in period 001. However, the last posting run was for period 006.
Start the repeat run again using period 006".
Kind Regards
Shanid -
Need help with date range searches for Table Sources in SES
Hi all,
I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
I am using SES 10.1.8.3 on Windows 32.
My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
TRACKNUM Varchar2
TITLE Varchar2
SUMMARY CLOB
SYMBOLCODE Varchar2
Timestamp Date
OBSDATE Date
GEOM SDO_GEOMETRY
I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
Schedule crawls and indexes entire REPORTS table.
In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 10-MAR-07, 22-SEP-07, 02-FEB-08, etc.)
And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
Thanks very much, in advance….raford,
Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
thanks very much! -
Need to delete / clear PO value for a deleted shopping cart item.
Hi friends
Please help me on below mentioned issue.
I have a shopping cart with one deleted item, That deleted item shows a PO number under table BP_PDBEI field BE_OBJECT_ID in production server.
User want that PO number to be delete or clear from that shopping cart deleted item.
We are not authorize to delete or clear a entry from the SAP standard table itself.
Is there any function module, I can use directly in production server which can delete / clear this PO number from table BP_PDBEI field BE_OBJECT_ID from shopping cart deleted item
Please help urgently.
Thanks a lot in advance.Hi
check this FM
ISM_PORDER_DELETE
ISM_PORDERNEW_DELETE
ISM_PORDERRET_DELETE
Regards,
Viquar Iqbal -
Need to delete Table Contents for the list of tables in the internal table.
Hi All,
I have req where in I have the list of table in an internal table and delete the contents of the tables which are in the internal table.
I need to delete the contents of the table using Native SQL statements. Else I can use function modules to delte the contents of table.
Thanks in advance. Appriciable if you can revert as soon as possible at all.
Thanks and Regards,
Raj.
Edited by: Thomas Zloch on Mar 11, 2010 1:56 PMHi,
You can try using truncate statement in native sql.
EXEC SQL.
TRUNCATE TABLE ABC.
ENDEXEC. -
Batch Management Quantity - Deletion flag
All,
1. When performing a GR for a Purchase Order, we manually create a dummy batch for the material via BAPI_BATCH CREATE
2.Due to our business requirements, we set the deletion flag for this batch during creation.
But when I am doing this, the system is also flagging the MARD-LVORM, i.e the deletion flag is being set at the material/plant/sloc level for the quantity being updated via the GR.
Hence, from here on, at later stages, any new real batches that I create for this material and try to update stock for these new batches, the deletion flag is set for these new batch.
The batch master itself does not have a deletion flag set i.e, the MCHA and MCH1, do not have a deletion flag (LVORM) set.
It seems to be that only the stock is being set to delete. Anything you all can think of?
Thanks>
Venky wrote:
> All,
>
> 1. When performing a GR for a Purchase Order, we manually create a dummy batch for the material via BAPI_BATCH CREATE
> 2.Due to our business requirements, we set the deletion flag for this batch during creation.
>
> But when I am doing this, the system is also flagging the MARD-LVORM, i.e the deletion flag is being set at the material/plant/sloc level for the quantity being updated via the GR.
>
> Hence, from here on, at later stages, any new real batches that I create for this material and try to update stock for these new batches, the deletion flag is set for these new batch.
>
> The batch master itself does not have a deletion flag set i.e, the MCHA and MCH1, do not have a deletion flag (LVORM) set.
>
> It seems to be that only the stock is being set to delete. Anything you all can think of?
>
> Thanks
unbelivable.
why should BAPI_BATCH CREATE update MARD, this does not make any sense to me.
I can imagine that the MARD segment might be created in background too if it does not yet exist. But then it is either flagged for deletion because you did not initialize the field in your program, or you hit a real SAP bug which should be reported to SAP via OSS. -
Need to delete data from main table and all child tables ...
hi all,
i need to delete rows pertaining to perticular table and all the child
tables basing on certain code.i need to write a procedure to which i will
pass the table name and code..
like del_info(tab_name,code)
example:
suppose if i call as del_info(clients,760)
the procedure should delete all info reg. code 760
and the table clients and also all the child records of this table
perting to code 760.
simply .. i need to delete from the table passed and also
all the child tables down the heirarchy regarding certain code ...
help ???
Ravi Kumar MHi,
Depends how you defined referential integrity.
You can use ON DELETE CASCADE, please read the next doc http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/clauses3a.htm#1002692
Hope this help you,
Nicolas. -
Problem :ALV:Deletion Flags not showing in output
hi all !
I have a alv program which displays customer data.there are three deletion flags columns in the output.
First deletion flag will be: KNA1-LOEVM
Second deletion flag will be: KNB1-LOEVM
Third deletion flag will be: KNVV-LOEVM
earlier all three were showing.but now no one is showing.i'm pasting my code here if any expert can have a look and find out the BUG.
CODE STARTS----
report zqsdcap_cust.
INCLUDE DECLARATIONS
include:
ziabapcapph_macros. "Holcim Useful Macros
TABLE DECLARATIONS
tables:
tvko, "Org. Unit: Sales Organizations
t001, "Company codes
kna1, "Customer Master
knvv, "Customer master sales
knvi, "Customer tax classificat'n
knb1, "Customer master company code
<<CR003-DEVK949538 start ins
adr6. "SMTP numbers
<<CR003-DEVK949538 end ins
TYPE DECLARATIONS
type-pools:
slis.
STRUCTURE DECLARATIONS
Define structure for keep data in ALV list
data: begin of gs_output_list,
vkorg like knvv-vkorg, "Sales organization
ktokd like kna1-ktokd, "Customer A/C grp
kunnr like kna1-kunnr, "Customer number
vtweg like knvv-vtweg, "Distribution channel
name1 like kna1-name1, "Name1
name3 like kna1-name3, "Name3
name4 like kna1-name4, "Name4
stras like kna1-stras, "Street
cityc like kna1-cityc, "City
bezei1 like t005h-bezei, "Sales office
land1 like kna1-land1, "Country
regio like kna1-regio, "Region
bezei2 like t005u-bezei, "Region decription
kdgrp like knvv-kdgrp, "Customer group
ktext like t151t-ktext, "Cust grp name
bzirk like knvv-bzirk, "Sales district
bztxt like t171t-bztxt, "Description
zterm like knvv-zterm, "Payment term
lzone like kna1-lzone, "Transport zone
vtext like tzont-vtext, "Description
erdat like kna1-erdat, "Creation date
end of gs_output_list.
Internal table for customer tax data
data: begin of gs_output_tax,
vkorg like knvv-vkorg, "Sales organization
kunnr like kna1-kunnr, "Customer number
vtweg like knvv-vtweg, "Distribution channel
name1 like kna1-name1, "Name1
name3 like kna1-name3, "Name3
name4 like kna1-name4, "Name4
ort01 like kna1-ort01, "City
stcd1 like kna1-stcd1, "STD code
spart like knvv-spart, "Division
taxkd like knvi-taxkd, "Tax classific'n
tatyp like knvi-tatyp, "Tax category
vtext like tskdt-vtext, "Tax description
end of gs_output_tax.
Internal table for HVL customer master
data: begin of gs_output_hvl,
kunnr like kna1-kunnr, "Customer number
stceg like kna1-stceg, "VAT registration no
telfx like kna1-telfx, "Fax number
telf1 like kna1-telf1, "First telephone number
stras like kna1-stras, "House number and stret
ort02 like kna1-ort02, "District
cityc like kna1-cityc, "City code
bezei like t005h-bezei, "City description
regio like kna1-regio, "Region
ort01 like kna1-ort01, "City
name2 like kna1-name2, "Name2
name1 like kna1-name1, "Name1
bzirk like knvv-bzirk, "Sales district
spart like knvv-spart, "Division
vtweg like knvv-vtweg, "Distribution channel
vkorg like knvv-vkorg, "Sales organization
end of gs_output_hvl.
Internal table for customer database CRM
data: begin of gs_output_crm,
vkorg like knvv-vkorg, "Sales organization
vtweg like knvv-vtweg, "Distribution channel
bzirk like knvv-bzirk, "Sales district
kunnr like kna1-kunnr, "Customer number
name1 like kna1-name1, "Name1
name2 like kna1-name2, "Name2
stras like kna1-stras, "House number street
ort01 like kna1-ort01, "City
ort02 like kna1-ort02, "District
pstlz like kna1-pstlz, "Postal code
cityc like kna1-cityc, "City code
telf1 like kna1-telf1, "First telephone number
telfx like kna1-telfx, "Fax number
vkbur like knvv-vkbur, "Sales office
regio like kna1-regio, "Region
vkgrp like knvv-vkgrp, "Sales group
kdgrp like knvv-kdgrp, "Customer group
kvgr3 like knvv-kvgr3, "Customer group 3
altkn like knb1-altkn, "Previous record number
erdat like knvv-erdat, "Creation date
found_dat like zcrm_bp_ext-found_dat, "Found date
<<CR000-DEVK943142 start del
versg like knvv-versg, "Customer statistic grp
bukrs like knb1-bukrs, "Company code
<<CR000-DEVK943142 end del
end of gs_output_crm.
Internal table for customer information
data: begin of gs_output_info,
kunnr like kna1-kunnr, "Customer number
vkorg like knvv-vkorg, "Sales organization
vtweg like knvv-vtweg, "Distribution channel
stcd2 like kna1-stcd2, "Tax code
name1 like kna1-name1, "Name1
name2 like kna1-name2, "Name2
<<CR002-DEVK944835 start ins
name3 like kna1-name3, "Name3
<<CR002-DEVK944835 end ins
stras like kna1-stras, "House number street
ort01 like kna1-ort01, "City
ort02 like kna1-ort02, "District
pstlz like kna1-pstlz, "Postal code
regio like kna1-regio, "Region
land1 like kna1-land1, "Country code
cityc like kna1-cityc, "City code
telf1 like kna1-telf1, "First telephone number
telfx like kna1-telfx, "Fax number
<<CR001-DEVK944239 start ins
bzirk like knvv-bzirk, "Sales District
vkbur like knvv-vkbur, "Sales Office
kdgrp like knvv-kdgrp, "Customer group
<<CR001-DEVK944239 end ins
vkgrp like knvv-vkgrp, "Sales group
kvgr3 like knvv-kvgr3, "Customer group 3
versg like knvv-versg, "Customer stat grp
kdkg2 like kna1-kdkg2, "Customer condition gp2
kdkg1 like kna1-kdkg1, "Customer condition gp1
<<CR001-DEVK944239 start del
kdgrp like knvv-kdgrp, "Customer group
<<CR001-DEVK944239 end del
altkn like knb1-altkn, "Previous record#
erdat like knvv-erdat, "Creation date
note_text(200) type c, "<<CR003-DEVK949538 ins
smtp_addr like adr6-smtp_addr, "<<CR003-DEVK949538 ins
loevm1 like kna1-loevm, "Deletion flag all
loevm2 like knb1-loevm, "Deletion flag Cd
loevm3 like knvv-loevm, "Deletion flag sal
end of gs_output_info.
ALV Grid Declaration
data:
gs_fieldcat type slis_fieldcat_alv,
gs_layout type slis_layout_alv,
gs_event type slis_t_event,
gs_variant like disvariant,
gs_sort_info type slis_sortinfo_alv,
gs_exit_caused_by_user type slis_exit_by_user,
gs_tabname type slis_tabname,
gs_header type slis_entry.
INTERNAL TABLE DECLARATIONS
Define internal table for keep data in ALV list
data:
gt_output_list like table of gs_output_list,
gt_output_tax like table of gs_output_tax,
gt_output_hvl like table of gs_output_hvl,
gt_output_crm like table of gs_output_crm,
gt_output_info like table of gs_output_info,
<<CR003-DEVK949538 start ins
gv_text like tline occurs 0 with header line,
<<CR003-DEVK949538 start ins
ALV Grid Declaration
gt_fieldcat type slis_t_fieldcat_alv,
gt_list_top_of_page type slis_t_listheader,
gt_list_top_of_page2 type slis_t_listheader,
gt_sort_info type slis_t_sortinfo_alv.
VARIABLE DECLARATIONS
data:
ALV Grid Declaration
gv_save,
gv_exit_caused_by_caller,
gv_repid type sy-repid,
gv_user_command type slis_formname value 'USER_COMMAND',
gv_top_of_page type slis_formname value 'TOP_OF_PAGE',
gv_top_of_list type slis_formname value 'TOP_OF_LIST',
gv_end_of_list type slis_formname value 'END_OF_LIST',
lv_store like thead-tdname, "<<CR003-DEVK949538 ins
lv_id like thead-tdid, "<<CR003-DEVK949538 ins
lv_lines type i. "<<CR003-DEVK949538 ins
SELECTION SCREEN DECLARATIONS
Define selection-screen of query
selection-screen: begin of block blk with frame title text-001.
select-options: s_vkorg for knvv-vkorg "Sales org
obligatory
memory id vko,
s_bzirk for knvv-bzirk, "Sales district
s_vtweg for knvv-vtweg, "Dist channel
s_spart for knvv-spart "Division
default 'CM',
s_taxkd for knvi-taxkd, "Tax classific'n
s_kunnr for kna1-kunnr, "Customer number
s_regio for kna1-regio, "Region
s_kdgrp for knvv-kdgrp, "Customer group
s_vkgrp for knvv-vkgrp, "Sales group
s_vkbur for knvv-vkbur, "Sales office
s_lzone for kna1-lzone, "Zone
s_erdat for kna1-erdat, "Creation date
s_zuawa for knb1-zuawa, "Key for sorting
s_ktokd for kna1-ktokd, "Customer A/C grp
s_altkn for knb1-altkn, "Previous rec no
s_bukrs for knb1-bukrs "Company code
obligatory
memory id buk,
s_loevm1 for kna1-loevm, "Deletion flag all
s_loevm2 for knb1-loevm, "Deletion flag Cd
s_loevm3 for knvv-loevm. "Deletion flag sal
selection-screen: end of block blk.
selection-screen: begin of block b2 with frame title text-002.
parameters: pr_cust1 radiobutton group a1
default 'X'
user-command bkg,
pr_cust2 radiobutton group a1,
pr_cust3 radiobutton group a1,
pr_cust4 radiobutton group a1,
pr_cust5 radiobutton group a1.
selection-screen: end of block b2.
AT SELECTION-SCREEN ON S_VKORG
at selection-screen on s_vkorg.
select vkorg
into tvko-vkorg
from tvko
where vkorg in s_vkorg.
authorization check for sales org.
authority-check object 'V_VBRK_VKO'
id 'VKORG' field tvko-vkorg
id 'ACTVT' field '03'.
check sy-subrc ne 0.
message e002(zgen) with 'No authorization for sales org.'
tvko-vkorg.
endselect.
AT SELECTION-SCREEN ON S_BUKRS
at selection-screen on s_bukrs.
if pr_cust4 eq 'X' or
pr_cust5 eq 'X'.
select bukrs
into t001-bukrs
from t001
where bukrs in s_bukrs.
authorization check for plant and company code
authority-check object 'A_S_WERK'
id 'BUKRS' field t001-bukrs
id 'WERKS' dummy.
check sy-subrc ne 0.
message e002(zgen) with 'No authorization for this company code.'
t001-bukrs.
endselect.
endif.
AT SELECTION-SCREEN OUTPUT
at selection-screen output.
loop at screen .
if pr_cust1 eq 'X'.
if screen-name = 'S_VTWEG-LOW' or
screen-name = 'S_VTWEG-HIGH' or
screen-name = 'S_SPART-LOW' or
screen-name = 'S_SPART-HIGH' or
screen-name = 'S_TAXKD-LOW' or
screen-name = 'S_TAXKD-HIGH' or
screen-name = 'S_BUKRS-LOW' or
screen-name = 'S_BUKRS-HIGH' or
screen-name = 'S_ERDAT-LOW' or
screen-name = 'S_ERDAT-HIGH' or
screen-name = 'S_ALTKN-LOW' or
screen-name = 'S_ALTKN-HIGH' or
screen-name = 'S_VKBUR-LOW' or
screen-name = 'S_VKBUR-HIGH' or
screen-name = 'S_LOEVM1-LOW' or
screen-name = 'S_LOEVM1-HIGH' or
screen-name = 'S_LOEVM2-LOW' or
screen-name = 'S_LOEVM2-HIGH' or
screen-name = 'S_LOEVM3-LOW' or
screen-name = 'S_LOEVM3-HIGH'.
screen-input = 0.
endif.
elseif pr_cust2 eq 'X'.
if screen-name = 'S_BZIRK-LOW' or
screen-name = 'S_BZIRK-HIGH' or
screen-name = 'S_KDGRP-LOW' or
screen-name = 'S_KDGRP-HIGH' or
screen-name = 'S_LZONE-LOW' or
screen-name = 'S_LZONE-HIGH' or
screen-name = 'S_KTOKD-LOW' or
screen-name = 'S_KTOKD-HIGH' or
screen-name = 'S_ERDAT-LOW' or
screen-name = 'S_ERDAT-HIGH' or
screen-name = 'S_KTOKD-LOW' or
screen-name = 'S_KTOKD-HIGH' or
screen-name = 'S_ALTKN-LOW' or
screen-name = 'S_ALTKN-HIGH' or
screen-name = 'S_VKBUR-LOW' or
screen-name = 'S_VKBUR-HIGH' or
screen-name = 'S_LOEVM1-LOW' or
screen-name = 'S_LOEVM1-HIGH' or
screen-name = 'S_LOEVM2-LOW' or
screen-name = 'S_LOEVM2-HIGH' or
screen-name = 'S_LOEVM3-LOW' or
screen-name = 'S_LOEVM3-HIGH' or
screen-name = 'S_BUKRS-LOW' or
screen-name = 'S_BUKRS-HIGH' or
screen-name = 'S_VKGRP-LOW' or
screen-name = 'S_VKGRP-HIGH'.
screen-input = 0.
endif.
elseif pr_cust3 eq 'X'.
if screen-name = 'S_BZIRK-LOW' or
screen-name = 'S_BZIRK-HIGH' or
screen-name = 'S_KDGRP-LOW' or
screen-name = 'S_KDGRP-HIGH' or
screen-name = 'S_LZONE-LOW' or
screen-name = 'S_LZONE-HIGH' or
screen-name = 'S_ERDAT-LOW' or
screen-name = 'S_ERDAT-HIGH' or
screen-name = 'S_KTOKD-LOW' or
screen-name = 'S_KTOKD-HIGH' or
screen-name = 'S_SPART-LOW' or
screen-name = 'S_SPART-HIGH' or
screen-name = 'S_TAXKD-LOW' or
screen-name = 'S_TAXKD-HIGH' or
screen-name = 'S_REGIO-LOW' or
screen-name = 'S_REGIO-HIGH' or
screen-name = 'S_ALTKN-LOW' or
screen-name = 'S_ALTKN-HIGH' or
screen-name = 'S_VKBUR-LOW' or
screen-name = 'S_VKBUR-HIGH' or
screen-name = 'S_LOEVM1-LOW' or
screen-name = 'S_LOEVM1-HIGH' or
screen-name = 'S_LOEVM2-LOW' or
screen-name = 'S_LOEVM2-HIGH' or
screen-name = 'S_LOEVM3-LOW' or
screen-name = 'S_LOEVM3-HIGH' or
screen-name = 'S_BUKRS-LOW' or
screen-name = 'S_BUKRS-HIGH' or
screen-name = 'S_VKGRP-LOW' or
screen-name = 'S_VKGRP-HIGH' or
screen-name = 'S_VTWEG-LOW' or
screen-name = 'S_VTWEG-HIGH'.
screen-input = 0.
endif.
elseif pr_cust4 eq 'X'.
if screen-name = 'S_LZONE-LOW' or
screen-name = 'S_LZONE-HIGH' or
screen-name = 'S_TAXKD-LOW' or
screen-name = 'S_TAXKD-HIGH' or
screen-name = 'S_REGIO-LOW' or
screen-name = 'S_REGIO-HIGH' or
screen-name = 'S_ZUAWA-LOW' or
screen-name = 'S_ZUAWA-HIGH'.
screen-input = 0.
endif.
else.
if screen-name = 'S_LZONE-LOW' or
screen-name = 'S_LZONE-HIGH' or
screen-name = 'S_TAXKD-LOW' or
screen-name = 'S_TAXKD-HIGH'.
screen-input = 0.
endif.
endif.
modify screen.
endloop.
INITIALIZATION
initialization.
perform deactivate_program using sy-cprog.
START OF SELECTION
start-of-selection.
Customized function to get data from database table
perform get_data.
<<CR003-DEVK949538 start ins
perform get_internal_note_text tables gt_output_info.
<<CR003-DEVK949538 end ins
Create sort of ALV list
perform build_sort.
Send data to ALV list to display
if pr_cust1 eq 'X'.
gs_tabname = text-003.
gs_header = text-004.
perform write_alv_report tables gt_output_list
gt_sort_info.
elseif pr_cust2 eq 'X'.
gs_tabname = text-005.
gs_header = text-006.
perform write_alv_report tables gt_output_tax
gt_sort_info.
elseif pr_cust3 eq 'X'.
gs_tabname = text-007.
gs_header = text-008.
perform write_alv_report tables gt_output_hvl
gt_sort_info.
elseif pr_cust4 eq 'X'.
gs_tabname = text-009.
gs_header = text-010.
perform write_alv_report tables gt_output_crm
gt_sort_info.
else.
gs_tabname = text-011.
gs_header = text-012.
perform write_alv_report tables gt_output_info
gt_sort_info .
endif.
FORM EVENTTAB_FIELD
Fill Event tab, for ALV Grid Display
form eventtab_field using gs_events type slis_t_event.
data:
ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gs_events.
read table gs_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move gv_top_of_page to ls_event-form.
append ls_event to gs_events.
endif.
endform. " eventtab_field
FORM TOP_OF_PAGE
Write at Top of Page of ALV grid
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
endform. "top_of_page
FORM COMMENT_BUILD
Write header of ALV grid
form comment_build using lt_top_of_page type slis_t_listheader
gs_header.
data:
lv_tdate(10),
lv_fdate(10),
ls_line type slis_listheader.
clear: ls_line.
ls_line-typ = 'H'.
ls_line-info = gs_header.
append ls_line to lt_top_of_page.
endform. "comment_build
FORM INIT_FIELDCAT
Fill Field Catalog for ALV Grid
form init_fieldcat using gs_tabname.
refresh: gt_fieldcat.
use this function to get the all fields in the structure.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = gv_repid
i_internal_tabname = gs_tabname
i_inclname = gv_repid
changing
ct_fieldcat = gt_fieldcat.
if sy-subrc eq 0.
clear mark for key field to set color of key column
gs_fieldcat-key = ''.
modify gt_fieldcat from gs_fieldcat transporting key
where fieldname ne space.
read table gt_fieldcat with key fieldname = 'FOUND_DAT'
into gs_fieldcat.
gs_fieldcat-seltext_l = text-013.
modify gt_fieldcat from gs_fieldcat
transporting seltext_l
where fieldname = 'FOUND_DAT'.
<<CR003-DEVK949538 start ins
read table gt_fieldcat with key fieldname = 'NOTE_TEXT'
into gs_fieldcat.
gs_fieldcat-seltext_l = text-014.
modify gt_fieldcat from gs_fieldcat
transporting seltext_l
where fieldname = 'NOTE_TEXT'.
<<CR003-DEVK949538 start ins
endif.
endform. "init_fieldcat
FORM INIT_LAYOUT
Layout initial
form init_layout using gs_layout type slis_layout_alv.
gs_layout-info_fieldname = 'LINECOLOR'.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
endform. " init_layout
FORM WRITE_ALV_REPORT
form write_alv_report tables gt_output
gt_sort_info.
ALV Grid display
clear: gv_repid,
gv_save.
gv_repid = sy-repid.
gs_variant-report = gv_repid.
gv_save = 'A'.
Build fieldcatalog
perform init_fieldcat using gs_tabname.
Build list events
perform eventtab_field using gs_event.
Show in ALV Grid form
perform init_layout using gs_layout.
Build comments
perform comment_build using gt_list_top_of_page[]
gs_header.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = ' '
i_callback_program = gv_repid
is_layout = gs_layout
i_save = gv_save
is_variant = gs_variant
it_events = gs_event[]
it_sort = gt_sort_info[]
it_fieldcat = gt_fieldcat[]
importing
e_exit_caused_by_caller = gv_exit_caused_by_caller
es_exit_caused_by_user = gs_exit_caused_by_user
tables
t_outtab = gt_output
exceptions
program_error = 1
others = 2.
endform. "write_alv_report
FORM GET_DATA
form get_data.
Get customer list
if pr_cust1 eq 'X'.
select knvv~vkorg
kna1~ktokd
kna1~kunnr
knvv~vtweg
kna1~name1
kna1~name3
kna1~name4
kna1~stras
kna1~cityc
kna1~regio
kna1~land1
knvv~kdgrp
knvv~bzirk
knvv~zterm
kna1~lzone
kna1~erdat
from kna1 join knvv
on kna1kunnr = knvvkunnr
into corresponding fields of table gt_output_list
where kna1~kunnr in s_kunnr
and knvv~vkorg in s_vkorg
and knvv~bzirk in s_bzirk
and kna1~regio in s_regio
and knvv~kdgrp in s_kdgrp
and kna1~lzone in s_lzone
and kna1~erdat in s_erdat
and kna1~ktokd in s_ktokd.
loop at gt_output_list into gs_output_list.
Get City decsription
perform get_city_description using gs_output_list-cityc
changing gs_output_list-bezei1.
Get Region description
select single bezei
from t005u
into gs_output_list-bezei2
where bland = gs_output_list-regio
and land1 = gs_output_list-land1"<<CR000-DEVK942345 ins
and spras = sy-langu.
Get customer group description
select single ktext
from t151t
into gs_output_list-ktext
where kdgrp = gs_output_list-kdgrp
and spras = sy-langu.
Get sales district description
select single bztxt
from t171t
into gs_output_list-bztxt
where bzirk = gs_output_list-bzirk
and spras = sy-langu.
Get zone decription
select single vtext
from tzont
into gs_output_list-vtext
where zone1 = gs_output_list-lzone
and spras = sy-langu.
modify gt_output_list from gs_output_list index sy-tabix
transporting bezei1
bezei2
ktext
bztxt
vtext.
clear gs_output_list.
endloop.
Get customer tax data
elseif pr_cust2 eq 'X'.
select kna1~kunnr
kna1~name1
kna1~name3
kna1~name4
kna1~ort01
kna1~stcd1
knvv~vkorg
knvv~spart
knvv~vtweg
knvi~taxkd
knvi~tatyp
from kna1 join knvv
on kna1kunnr = knvvkunnr
join knvi
on kna1kunnr = knvikunnr
into corresponding fields of table gt_output_tax
where kna1~kunnr in s_kunnr
and knvv~vkorg in s_vkorg
and knvv~vtweg in s_vtweg
and knvv~spart in s_spart
and kna1~regio in s_regio
and knvi~taxkd in s_taxkd.
Get customer tax description
loop at gt_output_tax into gs_output_tax.
select single vtext
from tskdt
into gs_output_tax-vtext
where tatyp = gs_output_tax-tatyp
and taxkd = gs_output_tax-taxkd
and spras = sy-langu.
if sy-subrc eq 0.
modify gt_output_tax from gs_output_tax index sy-tabix
transporting vtext.
clear gs_output_tax.
endif.
endloop.
Get customer HVL data
elseif pr_cust3 eq 'X'.
select kna1~kunnr
kna1~stceg
kna1~telfx
kna1~telf1
kna1~stras
kna1~ort02
kna1~cityc
kna1~regio
kna1~ort01
kna1~name2
kna1~name1
knvv~bzirk
knvv~spart
knvv~vtweg
knvv~vkorg
from kna1 join knvv
on kna1kunnr = knvvkunnr
into corresponding fields of table gt_output_hvl
where kna1~kunnr in s_kunnr
and knvv~vkorg in s_vkorg.
loop at gt_output_hvl into gs_output_hvl.
Get city description.
perform get_city_description using gs_output_hvl-cityc
changing gs_output_hvl-bezei.
if sy-subrc eq 0.
modify gt_output_hvl from gs_output_hvl index sy-tabix
transporting bezei.
clear gs_output_hvl.
endif.
endloop.
Get cust CRM data
elseif pr_cust4 eq 'X'.
select kna1~kunnr
knvv~versg "<<CR000-DEVK943142 del
knvv~vkorg
knvv~vtweg
knvv~bzirk
knvv~vkgrp
knvv~kdgrp
knvv~vkbur
kna1~name1
kna1~name2
kna1~ort01
kna1~pstlz
kna1~regio
kna1~stras
kna1~telf1
kna1~telfx
kna1~ort02
kna1~cityc
knvv~kvgr3
knb1~altkn
knb1~bukrs "<<CR000-DEVK943142 del
knvv~erdat
zcrm_bp_ext~found_dat
from kna1 join knvv
on kna1kunnr = knvvkunnr
join knb1
on knvvkunnr = knb1kunnr
join zcrm_bp_ext
on knb1kunnr = zcrm_bp_extkunnr
into corresponding fields of table gt_output_crm
where kna1~kunnr in s_kunnr
and knvv~vkorg in s_vkorg
and knvv~vtweg in s_vtweg
and knvv~spart in s_spart
and knvv~bzirk in s_bzirk
and knvv~kdgrp in s_kdgrp
and knvv~vkgrp in s_vkgrp
and knvv~vkbur in s_vkbur
and knvv~erdat in s_erdat
and kna1~ktokd in s_ktokd
and kna1~loevm in s_loevm1
and knb1~loevm in s_loevm2
and knvv~loevm in s_loevm3
and knb1~bukrs in s_bukrs
and knb1~altkn in s_altkn.
else.
Get customer information
<<CR001-DEVK944342 start del
select kna1~kunnr
knvv~vkorg
knvv~vtweg
kna1~stcd2
kna1~name1
kna1~name2
kna1~ort01
kna1~land1
kna1~pstlz
kna1~regio
kna1~stras
kna1~telf1
kna1~telfx
knvv~bzirk "<<CR001-DEVK944239 ins
knvv~vkbur "<<CR001-DEVK944239 ins
kna1~ort02
kna1~cityc
knvv~vkgrp
knvv~kvgr3
knvv~versg
kna1~kdkg2
kna1~kdkg1
knvv~kdgrp
knb1~altkn
knvv~erdat
kna1~loevm
knb1~loevm
knvv~loevm
<<CR001-DEVK944342 end del
<<CR001-DEVK944342 start ins
select kna1~kunnr
knvv~vkorg
knvv~vtweg
kna1~stcd2
kna1~name1
kna1~name2
kna1~name3 "<<CR002-DEVK944835 ins
kna1~stras
kna1~ort01
kna1~ort02
kna1~pstlz
kna1~regio
kna1~land1
kna1~cityc
kna1~telf1
kna1~telfx
knvv~bzirk
knvv~vkbur
knvv~kdgrp
knvv~vkgrp
knvv~kvgr3
knvv~versg
kna1~kdkg2
kna1~kdkg1
knb1~altkn
knvv~erdat
kna1~loevm
knb1~loevm
knvv~loevm
<<CR001-DEVK944342 end ins
from kna1 join knvv
on kna1kunnr = knvvkunnr
join knb1
on kna1kunnr = knb1kunnr
<<CR001-DEVK944252 start del
into corresponding fields of table gt_output_info
<<CR001-DEVK944252 end del
<<CR003-DEVK949538 start del
into table gt_output_info "<<CR001-DEVK944342 ins
<<CR003-DEVK949538 end del
<<CR003-DEVK949538 start ins
into corresponding fields of table gt_output_info
<<CR003-DEVK949538 end ins
where kna1~kunnr in s_kunnr
and knvv~vkorg in s_vkorg
and knvv~vtweg in s_vtweg
and knvv~spart in s_spart
and knvv~bzirk in s_bzirk
and knvv~kdgrp in s_kdgrp
and knvv~vkgrp in s_vkgrp
and knvv~vkbur in s_vkbur
and knvv~erdat in s_erdat
and kna1~ktokd in s_ktokd
and kna1~regio in s_regio
<<CR001-DEVK944252 start del
and kna1~loevm in s_loevm1
and knb1~loevm in s_loevm2
and knvv~loevm in s_loevm3
<<CR001-DEVK944252 end del
<<CR001-DEVK944252 start ins
and ( kna1~loevm in s_loevm1
or knb1~loevm in s_loevm2
or knvv~loevm in s_loevm3 )
<<CR001-DEVK944252 end ins
and knb1~zuawa in s_zuawa
and knb1~bukrs in s_bukrs
and knb1~altkn in s_altkn.
<<CR003-DEVK949538 start ins
loop at gt_output_info into gs_output_info.
select single adrnr
into kna1-adrnr
from kna1
where kunnr = gs_output_info-kunnr.
check sy-subrc eq 0.
select single smtp_addr
into adr6-smtp_addr
from adr6
where addrnumber = kna1-adrnr.
check sy-subrc eq 0.
gs_output_info-smtp_addr = adr6-smtp_addr.
modify gt_output_info from gs_output_info.
endloop.
<<CR003-DEVK949538 end ins
endif.
<<CR003-DEVK949538 start ins
loop at gt_output_info into gs_output_info.
lv_store = gs_output_info-loevm1.
endloop.
<<CR003-DEVK949538 end ins
endform.
FORM BUILD_SORT
form build_sort.
if pr_cust1 eq 'X' or
pr_cust2 eq 'X'.
clear gs_sort_info.
gs_sort_info-fieldname = 'VKORG'.
gs_sort_info-spos = 1.
gs_sort_info-up = 'X'.
append gs_sort_info to gt_sort_info.
endif.
clear gs_sort_info.
gs_sort_info-fieldname = 'KUNNR'.
gs_sorhi shivaji!
thx for the reply.
can u chk whether there is any problem with the queries or not.
regards
sachin -
How to delete the region code for country in T005U
Hello,
The region code for XX country are changed, So I have deleted all entries for that country in transaction code "OVK2" and updated the new region code which should be updated in Table T005S and T005U.
But in table T005U there are few region code for language other then EN. Now I need to delete the entries T005U for other language.
Now region code in OVK2 = Table T005S, but not equal to T005U
How language can be selected to delete the region code (TABLE T005U), please advise.
Thanks in advance.
PraveenHi Praveen,
In order to delete the entries from the language table T005U, you will have to maintain in T005S.
It means that, suppose in table T005U, you have a region appearing in two languages danish and german and the corresponding entry does not exist in T005S, then follow the steps below.
1. Maintain Region XX in EN in T005S.
2. Log on in language Danish, and in table T005U, only delete the text and log off.
3. Log on in Language German, and in table T005U, delete the text only and log off.
4. Now your T005U table is clear, log on in language EN and delete from table T005S.
5. Check both tables T005S and T005U for the region XX. they both should be empty.
Regards,
SAPFICO -
How to delete all data in all tables in one time ?!
1 CREATE OR REPLACE PROCEDURE delete_all_data
2 IS
3 v_statement VARCHAR2 (200);
4 BEGIN
5 FOR i IN (SELECT *
6 FROM user_tables)
7 LOOP
8 v_statement :=
9 'delete table ' || i.table_name ;
10 EXECUTE IMMEDIATE v_statement;
11 END LOOP;
12 commit;
13* END;
SQL> /
Procedure created.
SQL> exec delete_all_data
BEGIN delete_all_data; END;
ERROR at line 1:
ORA-00903: invalid table name
ORA-06512: at "DE2.DELETE_ALL_DATA", line 10
ORA-06512: at line 1
I made the previous code , but it's didn't work with me .... any help for this problem please ?!
I'm just reminder ..... all what I need ,that delete all data in all tables in one time only .
I'm waiting for the answer ..... and thanks in advancecreate or replace
FUNCTION TRUNC_SCHEMA RETURN NUMBER AS
CURSOR select_table IS SELECT TABLE_NAME AS TNAME FROM USER_TABLES ORDER BY 1;
sTableName Varchar2(128);
sUser Varchar2(128);
sConstraintName Varchar2(128);
plsql_block Varchar2(512);
BEGIN
SELECT USER INTO sUser FROM DUAL;
IF ((sUser='SYSTEM') OR (sUser='SYS')) THEN
RETURN 1;
END IF;
EXECUTE IMMEDIATE 'PURGE RECYCLEBIN';
-- DISABLE table's constraints
FOR C1 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'ENABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME) LOOP
sConstraintName := C1.CONSTRAINT_NAME;
sTableName := C1.TABLE_NAME;
plsql_block := 'ALTER TABLE ' || sTableName || ' DISABLE CONSTRAINT ' || sConstraintName;
EXECUTE IMMEDIATE plsql_block ;
END LOOP;
FOR D IN select_table LOOP
--get table name
sTableName := D.TNAME;
-- clear table
plsql_block := 'TRUNCATE TABLE ' || sTableName;
EXECUTE IMMEDIATE plsql_block ;
END LOOP;
-- ENABLE table's constraints
FOR C2 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'DISABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME desc) LOOP
sConstraintName := C2.CONSTRAINT_NAME;
sTableName := C2.TABLE_NAME;
plsql_block := 'ALTER TABLE ' || sTableName || ' ENABLE CONSTRAINT ' || sConstraintName;
EXECUTE IMMEDIATE plsql_block ;
END LOOP;
RETURN 0;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM);
RETURN 1;
END TRUNC_SCHEMA;
/ -
How to delete entries in the T030 table with LSMW?
Hi all,
I need to delete 600 entries from T030 table (Fix account table), Tcode OBYG, and I want to use a legacy for this,
but I don´t know how or if is possible delete entries from a table with a legacy.
Thanks in advance!You Can Use SCAT instead.
-
RPRAPA00 program deletion flag update issue
Hi,
I am stuck up with a specific company code whose deletion flag is updated for UPDATE variant(05001UDEMPVEN) when I execute PRAA tcode (or program RPRAPA00 ) and program writes to a file with the following contents:
2BLFB1 0002422000/ / / /LISI03VEXT/ / / / / / / / V00A/ / XA A/ // // / / / XX/ / / / / / // //
Marked in red , XX represents "Posting block for company code" and "Deletion Flag for Master Record (Company Code Level)" respectively.
Please advise from where deletion flag is updated and written to the file.
NOTE : Flag is not coming from LFB1 as I tried to remove the flag from table but still flags are written to the file.
Thanks,
Manzoor.Flags are not coming FROM LFA1/LFB1 but are going INTO LFA1/LFB1 from personal Infotypes : from HR Master Record: Infotype 0000 (Actions) to HR Master Record: Infotype 0009 (Bank Details) and reference vendor master record.
Regards,
Raymond -
Deleting rows from very large table
Hello,
I need to delete rows from a large table, but not all of them, so I can't use truncate. The delete condition is based on one column, something like this:
delete from very_large_table where col1=100;
There's an index (valid, B-tree) on col1, but it still goes very slow. Is there any instruction which can help delete rows faster?
Txh in adv.
A.Your manager doesn't agree to your running an EXPLAIN PLAN? What is his objection? Sounds like the prototypical 'pointy-hair boss'.
Take a look at these:
-- do_explain.sql
spool explain.txt
-- do EXPLAIN PLAN on target queries with current index definitions
truncate table plan_table
set echo on
explain plan for
<insert query here>
set echo off
@get_explain.sql
-- get_explain.sql
set linesize 120
set pagesize 70
column operation format a25
column query_plan format a35
column options format a15
column object_name format a20
column order format a12
column opt format a6
select lpad(' ',level) || operation "OPERATION",
options "OPTIONS",
decode(to_char(id),'0','COST = ' || NVL(to_char(position),'n/a'),object_name) "OBJECT NAME",
cardinality "rows",
substr(optimizer,1,6) "OPT"
from plan_table
start with id = 0
connect by prior id = parent_id
There are probably newer, better ways, but this should work with all living versions of Oracle and is something I've had in my back pocket for several years now. It's not actually executing the query or dml in question, just running an explain plan on it. -
How to delete the data in a table using function
hi all,
i need to delete the data in a table using four parameters in a function,
the parameters are passed through shell script.
How to write the function
Thanks>
But the only thing is that such function cannot be used in SQL.
>
Perhaps you weren't including the use of autonomous transactions?
CREATE OR REPLACE FUNCTION remove_emp (employee_id NUMBER) RETURN NUMBER AS
PRAGMA AUTONOMOUS_TRANSACTION;
tot_emps NUMBER;
BEGIN
SELECT COUNT(*) INTO TOT_EMPS FROM EMP3;
DELETE FROM emp3
WHERE empno = employee_id;
COMMIT;
tot_emps := tot_emps - 1;
RETURN TOT_EMPS;
END;
SQL> SELECT REMOVE_EMP(7499) FROM DUAL;
REMOVE_EMP(7499)
12
SQL> SELECT REMOVE_EMP(7521) FROM DUAL;
REMOVE_EMP(7521)
11
SQL> SELECT REMOVE_EMP(7566) FROM DUAL;
REMOVE_EMP(7566)
10
SQL>
Maybe you are looking for
-
Hi all, i have questions regarding the usage of big files with a BPM scenario. The functional requirements are as follows: 1. Pick up large (raw data) file (1MB) from FTP server 2. Drop this file to a second FTP server 3. After the file has been tran
-
English version of Firefox in China
I am an English speaker working and living in China. I just updated firefox (while on my VPN) for Windows 7 to Firefox 24 English version and I am now somehow running the Chinese version. I have uninstalled and reinstalled multiple times and checked
-
I can't send SMS text from iPad 4 w/ cellular, no option to add or turn off/on
I can no longer send SMS text with IPad 4 w/ cellular. There is no option in settings-messages to turn on SMS like on iphone5. Everything is trying to be sent iMessage which fails when sending text to non apple users. This change occurred after last
-
What is tethering used for?
If I'm using bridge why do I need to use tethering?
-
Hi, Can somebody please help me with how to use coverage analyzer? Thanks, Yogita