How BW manages deletion of Sales Order by LIS Data Source
Hi experts,
we implemented LIS data sources for SD and MM modules to BW.
Loading the deltas, we see many order quantity as negative numbers... they are cancelled sales orders!
How we can manage that?
thanks in advance
cs
Hi Costabile,
Jusyt check what have u mapped your 0recordmode or 0rocancel field in BW datasource/transfer rules, as they nullify the records .
order=100
cancelled=-100
total=0
There are lot of threadds on 0RECORDMODE ,just check for it and understand about it,which will help u solve your query.
Rgds
SVU213
Similar Messages
-
Hi,
In MD04, I see many sales order having a lot of quantity. I want to delete the sales orders.
Does anyone know how i can delete these sales orders and in which tables i can view the changes?
Thanks.Hi,
I believe you can delete the orders in VA02..
In VA02..Goto sales document -> Delete..
Try this..
Thanks,
Naren -
How to delete a sales order which has already approved
Hi,
Could anyone please tell me how can we delete an already approved Sales order if no delivery doc is created and billing document has already been cancelled.
When i try to delete the order it is not allowing to delete the sales order.
It allows to put the reason for rejection in the sales order.
It does not allow me to put the reason for rejection in the sales quotation.
Please help and guide me.
Thanks and RegardsHi,
My query is regarding if the delivery is not there and the sales order is already approved and if the billing docu has been cancelled then why can not we delete the sales order?
After that i need to put the reason for rejection in the sales quotation.
So please guide me.
Thanks and Regards
Edited by: MPVash Vash on Jul 22, 2008 7:29 AM
Edited by: MPVash Vash on Jul 22, 2008 7:29 AM -
I have deleted a sales order,how to retreve the same document number
Hai,
I have deleted the sales order,so that document number is out.When i craete the next order will i get the same number which i have already deleted.
I want the same number again,for that what should i do...
I dont want that number be missed,the reason is there should be a flow in number,with out missing some numbers in between.
Thx
Venu
Edited by: venugopal on Aug 6, 2008 9:12 AMDear Venu
Yes this is possible but should not hand over the responsibility to end users.
B4 implementing this in production, please test a document and proceed.
Go to VOV8, select your order type and execute. There see what numeric value is maintained against the field "No.range int.assgt". Now go to VN01, [click on Status] tab and go to that number. On your right, you can see the last generated sale order number with editable option. You can change it.
For example, if your last created sale order reference is 805, you will see this 805 in the above area. Change it to 804 and save. Now if you create a new order, the reference of that particular sale order will again be 805.
But as I already mentioned, each and every time, you need to go and change this area which is not recommended.
thanks
G. Lakshmipathi -
WHILE DELETING A SALE ORDER GETTING A RUNTIME ERROR " Screen: Illegal message"
Hi Experts,
While deleting a sales order giving run time error. PFB runtime error details.
If you know any OSS message, please let m know. I tried, but there is no luck.
Short text
Screen: Illegal message
What happened?
The current screen processing action was terminated since a situation
occurred where the application could not continue.
This is probably due to an error in the ABAP program or in the current
screen.
What can you do?
Note which actions and input led to the error.
For further help in handling the problem, contact your SAP administrator.
You can use the ABAP dump analysis transaction ST22 to view and manage
termination messages, in particular for long term reference.
Error analysis
The program attempted to issue a " " message during "Exit Command" processing.
This is an illegal operation.
The program was terminated.
Screen name.............. "SAPMV45A"
Screen number............ 4001
How to correct the error
The program must be modified to correct the error.
The modification must be made in "Exit Command" processing.
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
Source Code Extract
Line SourceCde
1 *---------------------------------------------------------------------*
2 * FORM YVBEP_LESEN *
3 *---------------------------------------------------------------------*
4 * Lesen der Tabelle YVBEP (nicht sortiert) *
5 *---------------------------------------------------------------------*
6 FORM YVBEP_LESEN USING US_POSNR
7 US_ETENR
8 CHANGING CH_TABIX.
9
10 YVBEP = SPACE.
11 YVBEP-MANDT = VBAK-MANDT.
12 YVBEP-VBELN = VBAK-VBELN.
13 YVBEP-POSNR = US_POSNR.
14 YVBEP-ETENR = US_ETENR.
15 READ TABLE YVBEP.
16 IF SY-SUBRC > 0.
17 MESSAGE E506 WITH US_POSNR US_ETENR.
18 ENDIF.
>>>>> CH_TABIX = SY-TABIX.
20
21 ENDFORM.
Could you please help on this issue.
Thanks
SrinuHi Srinu,
it looks like you got the error message Schedule line &1 &2 is missing in table YVBEP while deleting the sales order.
It seems, that there are no SAP notes regarding this issue. Do you have this issue with all orders or with a single order?
If only a single order causes this issue, maybe something was wrong during an update.
If you get this error for many orders, then custom code (modification, enhancement, user exit in MV45AFZZ, ...) may be the reason for it.
If you have no custom code in module pool SAPMV45A, then contact SAP for this issue.
Regards,
Klaus -
How to configure rescheduling for sale order quantities
kindly explain how to configure rescheduling for sale order quantities that are created last month. kindly explain. i am in urgent.
regards,
g.v.shivakkumarHi,
Short text
Rescheduling sales and stock transfer documents: by material
Description
The 'Rescheduling' program (SDV03V02) processes sales document items that are contained in the item directory for the material. It takes into consideration open items and schedule lines from stock transfer items, stock transfer scheduling agreements and purchase order requests (items only), referred to hereafter as stock transfer documents, for the materials.
All sales documents for the material that are still open are selected. This means that the material index must be activated for at least all sales document types, whose items may have requirements. All stock transfer documents or items for the material that are still open are also selected. Open in this case means for example, that there is no deletion indicator, that the item from a stock transfer purchase order request cannot be labeled as completed or that the quantity delivered and posted to goods issue for the item in a stock transfer purchase order is the same as the amount ordered. An availability check can only be carried out if a checking rule is assigned to the document type - if this is not the case, the document or document item is not checked.
Checking rule 'A' is used as a basis for rescheduling sales orders (exceptions to this are rush orders they use checking rule B, and orders with individual customer stock; they use checking rule AE). Stock transfer documents use the checking rule that is assigned in Customizing for Purchasing. It is important that the scope of checks is consistent for both the stock transfer documents and the sales documents and that they do not exclude each other, as this can lead to incorrect test results. An example of an incorrect setting would be: The scope of check for checking rule 'A' checks delivery schedules for stock transfer purchase orders and stock transfer purchase requests, however the scope of check for the checking rule for the stock transport scheduling agreement does not.
The items and schedule lines found in the selection are sorted according to 'Priorities' - document category, delivery priority, creation date of the item or schedule line (for stock transfer purchase orders and delivery plans) entered on the selection screen or according to the schedule line date of the earliest schedule line with order quantity, document number and item number and then transferred to the availability check. Priority 1 is highest priority and priority 5 the lowest. Stock transfer purchase order requests are sorted after stock transfer purchase orders and scheduling agreements, as they are less binding. This means that when you have identical sort criteria such as delivery dates, the stock transfer purchase order item is checked first and then the item from the stock transfer purchase order request.
The preset option 'Unconfirmed documents required' only carries out rescheduling for materials for which there is at least one unconfirmed transaction.
You can use the parameters 'Sorting criteria delivery date' to define whether sorting is carried out with the order quantity after the creation date of the item or the delivery date of the earliest schedule line.
If you mark the 'Simulation' field, the checked documents are not saved. Instead a results list is generated and saved. However, the availability check for the corresponding documents continues as if saving has taken place already, that is, that the simulated list corresponds to the actual one.
Under 'Options' on the selection screen, specify whether sales documents and/or stock transfer documents should be processed. For stock transfer documents you can enter whether stock transfer purchase orders and scheduling agreements should be processed at item or schedule line level:
Processing at item level:
All open schedule lines for the item are read and collected, then transferred to the availability check. To sort and prioritize documents, you do not need each individual schedule line. It is sufficient to have the item or data from the first schedule line. All open schedule lines for the item are processed and checked.
Example of processing at item level:
Sorting: Date (Delivery date first schedule line) - Document number - Document item
Doc. cat. Doc. number Doc. item Doc. schedule line Delivery date PO 4500000012 10 0001 26.01. PO 4500000012 10 0002 26.02. PO 4500000025 20 0001 28.01. PO 4500000025 20 0002 02.02.
You can see that the second schedule line for document 4500000025/20 from 02.02 was processed after the second schedule line for document 4500000012/10 from 26.02. This is because all open schedule lines for an item are read and processed. The first schedule line from 4500000012/10 has the earliest delivery date, therefore it has priority.
Processing at schedule line level:
Each open schedule line for an item is entered in document sorting in accordance with the values entered under 'Priorities'. The availability check is carried out for each individual schedule line.
Example for processing at schedule line level:
Sorting: Date (delivery date first schedule line) - document number -document item
Doc. cat. Doc. number Doc. item Doc. sched. line Del. date PO 4500000012 10 0001 26.01. PO 4500000025 20 0001 28.01. PO 4500000025 20 0002 02.02. PO 4500000012 10 0002 26.02.
Here you can see that each schedule line was sorted according to its delivery date. Note that this type of processing requires more runtime due to the individual checks and more frequent saving.
The results of rescheduling are saved, as long as the program was not started in simulation mode. When calling up from the 'Sales' area menu or when directly starting via the development environment, the iniator is informed via a dialog box that he has just started a process that changes data. He can then decide whether or not he wants to continue.
Checking procedure for stock transfer documents:
An availability check of stock transfer documents in rescheduling is carried out in accordance with the check carried out when manually creating a document. If, however, the required quantity for a schedule line is not available on a particular date and will not be ready until later, new schedule lines are created for the stock transfer purchase orders and scheduling agreements, containing the relevant data. New items are created in this case for stock transfer purchase order requirements. The total sum of schedule line quantities for a processed schedule line corresponds to the schedule line quantity of the original schedule line.
First example: Using a stock transfer purchase order item with a schedule line:
a) Status of item before rescheduling run:
Del. date PO quantity Confirmed quant Confirmed del. date 23.07. 50 items 0 items -
==> This now affects the stock/requirement situation:
- Goods issue is posted for the material in the delivering plant on the 23.07.
- A purchase order of 10 items was created for the material in the delivering plant. Delivery is expected on the 29.07.
b) Status of stock transfer purchase order item after rescheduling run:
Del. date PO quantity Confirmed quant Confirmed del. date 23.07. 40 items 40 items 23.07. 29.07. 10 items 10 items 29.07.
==> The first schedule line was changed in accordance with the results of the rescheduling availability check. Only 40 of the 50 original items could be delivered on the 23.07. Therefore, a new schedule line is created for the rest on the 29.07. for 10 confirmed items.
Second example: Same output situation as the above example.
==> There is now a change in the requirement/stock situation:
A purchase order for 10 items is created for the material in the delivering plant. Delivery is expected on the 29.07. A further purchase shows another 40 planned items on the 30.07.
Status of stock transfer purchase order item after rescheduling run:
Del. date PO quantity Confirmed quant Confirmed del. date 29.07. 10 items 10 items 29.07. 30.07. 40 items 40 items 30.07.
==> The first schedule line was changed in accordance with the result of the availability check for rescheduling. The original delivery date is set to the date confirmed in the ATP check. A new schedule line is created for the remaining 40 items, that are available on the 30.07.
Note:
Any set fixed delivery date and quantity indicators and creation indicators for schedule lines or items are 'inherited' by newly created schedule lines. Assuming that the original schedule line was fixed in the above example (since it is created manually), this indicator is also set for the newly created schedule line.
If shipping scheduling is activated for a stock transfer document type, this is also implemented for newly created schedule lines, with the exception of route schedule determination. This means that in the current version of the program no route schedule has been determined for a schedule line containing a route schedule for which new schedule lines may need to be created.
The results of the run are issued in the form of a list, which is also saved, so that the results can be controlled at a later date. This is done using the function 'Evaluate rescheduling', but it is only a good idea to do this after the first rescheduling has taken place. You can restrict selection requirements but these can however affect the runtime. You can use this function to analyze the saved list until the next rescheduling run, which writes over the result. If you start rescheduling in the background, a spool file with the result list referred to will be created in the corresponding setting. You can see this in spool management.
Output
A list of changed documents, a list of documents in which an error occurred during processing and as a result were not changed, can be called up via the menu 'Edit - Error log'. If in a subsequent evaluation a restricted selection is carried out, a note appears at the end of the list to say that not all document items are displayed.
You can set the scope of the list under the menu option 'List' in the list display. You can view improvements, deteriorations and the whole list. Before the documents can be included in one or either of the restricted lists, the date or quantity has to have changed so that the item can be contained in both the list of improved or deteriorated documents.
You can use the interface for changing transactions and the order list to navigate. Use 'Back' to exit the list and 'New selection' to return to the selection screen.
Recommendation
You should only start this program occasionally and use very restricted selectin criteria during working hours as it requires enormous system resources.
Note
The columns for 'New date' and 'New confirmed qty' only contain entries if the dates or quantities have changed.
As the system only runs the change check (dates/quantities) per line in the original list, an item whose backlog has increased in the list of improvements. This occurs, for example, if the whole quantity can be delivered at once but at a later date. In this situation, the system determines an increase for the line when it compares quantities.
Regards,
Amrish Purohit -
hi all
how can i delete the list of sales order from a particular date to particular date.
regards
venkat.Hi Tarun
you can delete sales orders only if there are no subsequent documents.
if accounting documents are generated for a sales order then
after reversing the accounting documents with the help of FI guys then
cancel the invoice by VF11
reverse PGI thru VL09 and making the picking qty '0' in the delivery doc
delete the delivery using VL02N
then delete the sales order by VA02.
Hope this will help you.
Rewards point if helpful
Regards
Hansraj meena -
Deleting the Sales Order Linked to Prodution Order
Hi all,
I have created Production Order with ref. to Sales Order and made the status Released.
Now my requirement is when i am able to delete the sales order which has been linked to the production order.I.e,At what status of production order the linked sales order will be able to get deleted.
For Eg.If the Status is settlement rule completed.them am i able to delete the Sales order.
And how do i know the status of production order that it is being processed or it is yet to get processed.
Thaks in advance,
M.Badrinarain.Hi,
This is common problem of deletion of sales order in MTO scenario. First thing is that you cannot delete entire production order from database. you need to TECO for the that production order.
sales order does not gets deleted unless its subsequent document gets deleted (production order).
So only solution here is TECO for the that production order & then reject the line item in sales order by giving reason for rejection.
Pls refer below link
How can I terminate the sales order item?
Regards,
Sankaran -
How to retrieve the ARCHIVED Sales order data
Hi All,
When issuing the output for the delivery, it is giving an error saying 'Sales Order XXXX does not exist' due to which the prices in the output were displayed as '0'. Reason for this can be that 'the order might have been archived'.
My requirement is,
1. If Sales Order doesnu2019t exist in data base then need to check if Sales order exists in archive data base.
2. If yes, take needed data from archive data base tables to calculate price. The logic of price calculation should be the same as for not archived Sales Orders.
Can anyone help me on this..?
Please tell me how to check whether the Sales order exists in the Archived database. Please share the table names(sample logic if possible) sothat I can use them in the report logic.
Please tell me how to pull the data from the archive database tables to calculate the price.
Thank you in advance.
Thanks & Regards,
Paddu.
Edited by: Paddu K on Feb 23, 2009 3:42 PM*& Form get_archive_data
* Fetch Archive Data
FORM get_archive_data .
CLEAR: g_read_handle, g_commit_cnt,
g_read_cnt, g_reload_cnt,it_rel_tab,it_bseg_a,it_bkpf_a,
it_bset_a, gt_result.
REFRESH: it_rel_tab[],it_bseg_a[],it_bkpf_a[],
it_bset_a[], gt_result[].
*Populating selection screen fields to field-symbols
PERFORM build_fs_select_options.
*Call FM as_api_read FI Data
CALL FUNCTION 'AS_API_READ'
EXPORTING
i_fieldcat = 'SAP_FI_DOC_002'
i_selections = ft_selections[]
* I_OBLIGATORY_FIELDS =
* I_MAXROWS =
IMPORTING
e_result = gt_result[]
EXCEPTIONS
parameters_invalid = 1
no_infostruc_found = 2
field_missing_in_fieldcat = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT gt_result[] IS INITIAL.
*Sorting by KEY and Offset
SORT gt_result BY archivekey archiveofs.
*To delete duplicates
DELETE ADJACENT DUPLICATES FROM gt_result COMPARING archivekey
archiveofs.
*looping the internal table
LOOP AT gt_result.
*Get read handle for object
CALL FUNCTION 'ARCHIVE_READ_OBJECT'
EXPORTING
object = 'FI_DOCUMNT'
archivkey = gt_result-archivekey
offset = gt_result-archiveofs
IMPORTING
archive_handle = g_read_handle
EXCEPTIONS
OTHERS = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
IF sy-subrc = 0.
*Get Acoounting Document details
PERFORM object_read_opened
TABLES it_rel_tab
it_bseg_a
it_bkpf_a
* it_bset_a
* it_bsik_a
* it_bsak_a
it_bsid_a
it_bsad_a
* it_bsec_a
USING g_read_handle
l_archobj
g_commit_cnt
g_read_cnt
g_reload_cnt
ENDIF.
*close the file.
CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
EXPORTING
archive_handle = g_read_handle
EXCEPTIONS
internal_error = 1
wrong_access_to_archive = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i004." 'Unable to close archive session'.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE i000 WITH 'No data found for Archived data'(095).
EXIT.
ENDIF.
*Start of Changes by GTHATIKONDA on 10/17/2008 #ECDK902204
IF NOT it_bkpf_a[] IS INITIAL.
SORT it_bkpf_a BY belnr.
DELETE ADJACENT DUPLICATES FROM it_bkpf_a COMPARING belnr.
DELETE it_bkpf_a WHERE budat GT p_budat. "#ECDK902206
ENDIF.
*Start of Changes by GTHATIKONDA on 10/17/2008 #ECDK902206
IF it_bkpf_a[] IS INITIAL.
MESSAGE i000 WITH 'No data found for Archived data'(095).
ENDIF.
*End of Changes by GTHATIKONDA on 10/17/2008 #ECDK902206
IF NOT it_bseg_a[] IS INITIAL.
SORT it_bseg_a BY belnr gjahr buzei.
DELETE ADJACENT DUPLICATES FROM it_bseg_a COMPARING
belnr gjahr buzei.
ENDIF.
*End of Changes by GTHATIKONDA on 10/17/2008 #ECDK902204
ENDFORM. " get_archive_data
*& Form build_fs_select_options
FORM build_fs_select_options .
REFRESH: ft_selections.
*Comapny code
APPEND INITIAL LINE TO ft_selections ASSIGNING <fw_selections>.
<fw_selections>-fieldname = 'BUKRS'.
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_bukrs TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
*Customer
APPEND INITIAL LINE TO ft_selections ASSIGNING <fw_selections>.
<fw_selections>-fieldname = 'KUNNR'.
LOOP AT s_kunnr.
APPEND INITIAL LINE TO <fw_selections>-selopt_t
ASSIGNING <lw_selopt>.
MOVE-CORRESPONDING s_kunnr TO <lw_selopt>.
ENDLOOP.
*Start of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
**Customer Group
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'KTOKD'.
* loop at s_ktokd.
* append initial line to <fw_selections>-selopt_t
* assigning <lw_selopt>.
* move-corresponding s_ktokd to <lw_selopt>.
* endloop.
*End of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
*Profit Center
APPEND INITIAL LINE TO ft_selections ASSIGNING <fw_selections>.
<fw_selections>-fieldname = 'PRCTR'.
LOOP AT s_prctr.
APPEND INITIAL LINE TO <fw_selections>-selopt_t
ASSIGNING <lw_selopt>.
MOVE-CORRESPONDING s_prctr TO <lw_selopt>.
ENDLOOP.
*Commented #ECDK902210
**Key Date
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'BUDAT'.
* append initial line to <fw_selections>-selopt_t assigning <lw_selopt>
* move p_budat to <lw_selopt>-low.
* move 'I' to <lw_selopt>-sign.
* move 'EQ' to <lw_selopt>-option.
*Aging Period1
APPEND INITIAL LINE TO ft_selections ASSIGNING <fw_selections>.
<fw_selections>-fieldname = 'ANZTA'.
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_ag1 TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
*Aging Period2
*Start of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'ANZTA'.
*End of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_ag2 TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
*Aging Period3
*Start of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'ANZTA'.
*End of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_ag3 TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
*Aging Period4
*Start of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'ANZTA'.
*End of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_ag4 TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
*Aging Period5
*Start of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
* append initial line to ft_selections assigning <fw_selections>.
* <fw_selections>-fieldname = 'ANZTA'.
*End of changes by GTHATIKONDA on 16/10/2008 #ECDK902192
APPEND INITIAL LINE TO <fw_selections>-selopt_t ASSIGNING <lw_selopt>.
MOVE p_ag5 TO <lw_selopt>-low.
MOVE 'I' TO <lw_selopt>-sign.
MOVE 'EQ' TO <lw_selopt>-option.
ENDFORM. " build_fs_select_options
*& Form object_read_opened
* To Fetch Arichive Data
FORM object_read_opened TABLES it_rel_tab
it_bseg_a
it_bkpf_a
* it_bset_a
* it_bsik_a
* it_bsak_a
it_bsid_a
it_bsad_a
* it_bsec_a
USING value(g_read_handle) LIKE sy-tabix
value(l_archobj) LIKE arch_def-object
value(g_commit_cnt) LIKE arch_usr-arch_comit
g_read_cnt TYPE i
g_reload_cnt TYPE i.
DATA: BEGIN OF table_wa ,
table LIKE arch_stat-tabname,
END OF table_wa.
DATA: lit_data(2048) TYPE c OCCURS 1 WITH HEADER LINE.
DATA: l_structure LIKE arch_stat-tabname,
l_lin TYPE i.
CLEAR: it_table_org1,lit_struc,it_table_org2,table_wa,it_rel_tab.
REFRESH: it_table_org1[],lit_struc[],it_table_org2[],it_rel_tab[].
CLEAR: g_duprec,g_read_cnt,g_reload_cnt,g_object_cnt.
*Read data from the infostructure
DO.
ADD 1 TO g_object_cnt.
CLEAR l_structure.
CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
EXPORTING
archive_handle = g_read_handle
IMPORTING
record = lit_data
* RECORD_CURSOR =
* RECORD_FLAGS =
record_structure = l_structure
* RECORD_LENGTH =
* RECORD_REF =
EXCEPTIONS
end_of_object = 1
internal_error = 2
wrong_access_to_archive = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
EXIT.
ENDIF.
IF NOT l_structure IS INITIAL.
table_wa-table = l_structure.
APPEND table_wa TO it_rel_tab.
ENDIF.
APPEND lit_data.
CLEAR l_lin.
FIELD-SYMBOLS: <fs_struc> TYPE c.
CASE l_structure.
*BKPF data
WHEN 'BKPF'.
ASSIGN it_bkpf_a TO <fs_struc> CASTING.
<fs_struc> = lit_data.
APPEND it_bkpf_a.
*BSID data
WHEN 'BSID'.
ASSIGN it_bsid_a TO <fs_struc> CASTING.
<fs_struc> = lit_data.
APPEND it_bsid_a.
*BSAD data
WHEN 'BSAD'.
ASSIGN it_bsad_a TO <fs_struc> CASTING.
<fs_struc> = lit_data.
APPEND it_bsad_a.
*BSEG data
WHEN 'BSEG'.
ASSIGN it_bseg_a TO <fs_struc> CASTING.
<fs_struc> = lit_data.
APPEND it_bseg_a.
ENDCASE.
REFRESH lit_data.
CLEAR g_object_cnt.
ENDDO.
ENDFORM. " object_read_opened
*& Form get_bsid_bsad_archive_data
*If Exclude Spl. GL Trnasaction is initial get BSID BSAD Archive data *
FORM get_bsid_bsad_archive_data .
*Work Area
DATA: wa_bsid TYPE type_bsid.
*Reading BSAD Archive internal table
* loop at it_bsad_a where bukrs eq p_bukrs
*Start of changes by GTHATIKONDA on 10/14/2008 #ECDK902180
*Commented by GTHATIKONDA on 10/17/2008 #ECDK902204
LOOP AT it_bkpf_a WHERE bukrs = p_bukrs AND
budat LE p_budat. "#ECDK902206
*End of changes by GTHATIKONDA on 10/14/2008 #ECDK902180
LOOP AT it_bseg_a WHERE bukrs EQ p_bukrs AND
belnr EQ it_bkpf_a-belnr AND
gjahr EQ it_bkpf_a-gjahr AND
augdt GT p_budat AND
* koart eq 'D' and
kunnr IN s_kunnr AND
prctr IN s_prctr.
*Changes by GTHATIKONDA on 10/17/2008 #ECDK902204
* loop at it_bkpf_a where budat le p_budat."#ECDK902206
*Move corresponding fiels
MOVE-CORRESPONDING it_bseg_a TO wa_bsid.
wa_bsid-blart = it_bkpf_a-blart.
wa_bsid-budat = it_bkpf_a-budat.
wa_bsid-bldat = it_bkpf_a-bldat.
APPEND wa_bsid TO i_bsad.
CLEAR wa_bsid.
ENDLOOP.
ENDLOOP.
IF NOT i_bsad[] IS INITIAL.
APPEND LINES OF i_bsad TO i_bsid.
ENDIF.
*Start of Changes by GTHATIKONDA on 10/17/2008 #ECDK902206
IF NOT i_bsid[] IS INITIAL.
SORT i_bsid BY belnr.
*Commenting this logic by GTATIKONDA on 10/31/2008 #ECDK902245
* delete adjacent duplicates from i_bsid comparing belnr.
ENDIF.
*End of Changes by GTHATIKONDA on 10/17/2008 #ECDK902206
ENDFORM. " get_bsid_bsad_archive_data
*Reading BSAD Archive internal table
* loop at it_bsad_a where bukrs eq p_bukrs
*Start of changes by GTHATIKONDA on 10/14/2008 #ECDK902180
*Commented by GTHATIKONDA on 10/17/2008 #ECDK902204
LOOP AT it_bkpf_a WHERE bukrs = p_bukrs AND "#ECDK902206
budat LE p_budat.
*End of changes by GTHATIKONDA on 10/14/2008 #ECDK902180
LOOP AT it_bseg_a WHERE bukrs EQ p_bukrs AND
belnr EQ it_bkpf_a-belnr AND
gjahr EQ it_bkpf_a-gjahr AND
kunnr IN s_kunnr AND
umskz EQ space AND
augdt GT p_budat AND
prctr IN s_prctr.
*Changes by GTHATIKONDA on 10/17/2008 #ECDK902204
* loop at it_bkpf_a where budat le p_budat. "#ECDK902206
*Move corresponding fiels
MOVE-CORRESPONDING it_bseg_a TO wa_bsid.
wa_bsid-blart = it_bkpf_a-blart.
wa_bsid-budat = it_bkpf_a-budat.
wa_bsid-bldat = it_bkpf_a-bldat.
APPEND wa_bsid TO i_bsad.
CLEAR wa_bsid.
ENDLOOP.
ENDLOOP.
IF NOT i_bsad[] IS INITIAL.
APPEND LINES OF i_bsad TO i_bsid.
ENDIF. -
How to know that a sales order is approved?
Hi all,
Can any one let me know how to know that a sales order is approved? Is there any flag or status code to pull the information from the backend?
Thanks for your help,
PrathimaHi Prathima,
Oracle Order Management does not have any approvals, i.e. there is no status as 'Approved' for Order. You can consider an order to be final once it is booked, which you can know from the booked_flag or the value of flow_Status_code field in oe_order_headers_all.
Hope this helps -
Interesting scenario- user facing error while deleting a sales order
Hello All,
I have one interesting scenario and want feedback from your side as soon as possible
Scenario-
One of my clients is facing a problem while deleting a sales order.
the sales order he is trying to delete is the old order created in 2007.
when i see the document flow the user has created the export order, then delivered it, invoiced and sent it to accounting, accounting document is also cleared. then he cancelled the invoice, reverse PGI and deleted the delivery. the status of the sales order system is showing is being processed. but please note in this case after reversing PGI and deleting a delivery the delivery document disappears from the document flow.
document flow looks like this
Order - 200004715 Being processed
invoice- 700005310 completed
accounting 700005311 cleared
Cancel Invoice 700005315 completed
Accounting 700005316 cleared
Now, in 2008 user is trying to delete the sales order but he is unable to do the same. system is giving him message "unable to delete sales order because of subsequent document 70005310 (which is invoice number)"
Can somebody please throw some light on this problem.
Thanks in advance.Hi,
As fas as I know, this is standard system behaviour. The reason - you have done PGI (which has created a material document as well as accounting doc) and invoiced & reversed (which again has created accounting documents & rversal documents). All these documents are referencing the sales order.
If you delete sales order, sales order number gets deleted from VBAK /VBAP tables.
Hence, in relational data base scenario (meanin SAP in this context), deletion of sales order after creation of subsequent documents is not feasible.
Hope it clarifies the issue.
Regards
Murali -
How to count number of sales orders generated in a month in SAP SD
Hi SD Gurus,
I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
Regards
Vinod KumarHi,
Goto the T.Code "SE16" or "SE16n" or "SE11".
Enter the table name as VBAK
Enter the created on date as the starting date of the period and to date as the end date.
Enter.
Click on "Number of Entries".It will tell you the number of entries created in a particular period.
If you want a report,goto the T.Code "VA05n".
Regards,
Krishna. -
How can I create multiple sales orders with reference to one contract?
Hello Gurus,
Can you please how can I create multiple sales orders with reference to one contract?
thanks!
Rakeshhi
Lets consider example
In your contract for line item 1 you have entered qty 100
You careated sales order with 70 quantity, and now you want to creat another sales order for 30
For this first you need to check what is your item category in contract (VA42)
Goto VOV7
SPRO - IMG - Sales and distribution - Sales - Sales document item - Define item categories - Go to change mode
Make the completion rule = B Item is completed after full quantity has been referenced -
How to find that a sales order for which there is delivery but no goods
Hi
How to find that a sales order for which there is delivery but no goods issue has been done i.e we have an open delivery for a sales order.
How in VBUK table can we find out with the sales order no .
Thanks in advancemake use of table VBFA.
Regards
Peram -
How can we reject a Sales order after first Down payment invoice for Italy?
Hello,
As a legal requirement in Italy the Down paymenty have to be transformed into real invoices, another legal requirement is that an invoice cannot be cancelled it has to reversed by a credit memo.
I would like to know in this context how we can reject a sales order line once a Down payment invoice has been emitted.
When I do enter a reason for rejection in the sales order line I receive the message : V1036: Subsequent documenst exist for item XXX and then V2432 Cancellation not possible. Down payment request already created.
I can create a down payment credit memo in order to cancel the down payment invoice but how can I get rid of my SD requirement in MD04 if I cannot reject the sales order line?Hello,
have you tried using a recjection code which is not relevant for billing?
Regards,
Uli
Maybe you are looking for
-
Why is the content missing from my messages in the Mail app?
Yesterday, because my email addresses are changing, I modified the settings to my accounts in the email application Mail so that they properly connect to the new email addresses and settings. Most of the accounts are working fine. However, in one of
-
Generate XML based on MySQL Query
Hello guys, I need to create a XML file like this one(same structure) but based on MySQL query: <chart> <chart_type>pie</chart_type> <chart_data> <row> <null/> <string>2007</string> <string>2008</string>
-
Diffrence between Oracle BI Publisher and OBIEE
Now iam using SQL Server Reporting Services (SSRS). I want to migrate SSRS to Oracle Reports. I want to know the diffrence between Oracle BI Publisher and Oracle Business Intellingence Enterprise Edition (OBIEE). Which one is the best tool to generat
-
Clickable TOC in FM10- PDF conversion
I have a book in Framemaker 10 that I am making into a PDF document. When I choose the Save As PDF option, the PDF looks fine, but the TOC is not clickable. I think I selected the Create Hyperlinks option when I created it, and the mouse pointer tu
-
Hello All, I wann to upgrade the patch level of my SAPECC6.0/MSsql 2005 server I put the support patckeges in approvl list from www.service.sap.com then login to solution manger and go trough the following steps 1)DSWP 2)select Change management 3)su