cancel
Showing results for 
Search instead for 
Did you mean: 

Flagging deletion Assembly process orders

former_member217741
Participant
0 Kudos

Hi Gurus,

I'm trying to set deletion flags to Assembly process orders (created with Strategy group 82). The orders are already Closed with CLSD status but the system disables Deletion flag option in COR2 transaction code. We have little diversion here. Our Assembly orders don't have Sales orders as Settlement receiver, we changed it to Material.

Please suggest.

Regards,

Shoyeb

UmeshMali4994
Active Contributor
0 Kudos

Hello Shoyeb,

As per the standard SAP process, It is not possible to remove the deletion flag for Assembly order.

Please refer the below SAP Note

154933 – Assembly:Inconsistency after run of report SAPKKA12

Regards
Umesh Mali

UmeshMali4994
Active Contributor
0 Kudos
Hello Shoyeb,


As per the standard SAP process, It is not possible to remove the deletion flag for Assembly order.

Please refer the below SAP Note

154933 – Assembly:Inconsistency after run of report SAPKKA12Regards

Regards
Umesh Mali

Accepted Solutions (1)

Accepted Solutions (1)

former_member217741
Participant
0 Kudos

Hi,

We're able to solve this issue with the help of SAP support. Below code was shared by them. After running below report, system allowed us to mark deletion flag through COR2 transaction code.

REPORT zpsfc166d.

INCLUDE: lcokotyp. "#EC *

DATA: BEGIN OF lt_orders OCCURS 0,
aufnr LIKE caufv-aufnr,
objnr LIKE caufv-objnr,
kdauf LIKE caufv-kdauf,
kdpos LIKE caufv-kdpos,
END OF lt_orders,
ls_vbup LIKE vbup,
ls_vbap LIKE vbap.
DATA: lt_stat LIKE jstat OCCURS 0 WITH HEADER LINE.

lt_stat-stat = 'I0170'.
lt_stat-inact = 'X'.
APPEND lt_stat.

TABLES: caufv.

SELECTION-SCREEN COMMENT /1(80) text1. "#EC NOTEXT
SELECTION-SCREEN COMMENT /1(80) text2. "#EC NOTEXT
SELECTION-SCREEN COMMENT /1(80) text3. "#EC NOTEXT
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /1(80) text_1. "#EC NEEDED
SELECT-OPTIONS: r_order FOR caufv-aufnr. "#EC *
SELECTION-SCREEN ULINE.
SELECTION-SCREEN BEGIN OF BLOCK block WITH FRAME TITLE title."#EC *
SELECTION-SCREEN COMMENT /1(72) text_2. "#EC NEEDED
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME.
PARAMETERS: testmode RADIOBUTTON GROUP mode DEFAULT 'X'. "#EC *
PARAMETERS: update RADIOBUTTON GROUP mode. "#EC *
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN COMMENT /1(72) text_3. "#EC NEEDED
SELECTION-SCREEN END OF BLOCK block.

INITIALIZATION.

text1 = 'This report checks if sales order items are deleted,'.
text2 = 'rejected or completed. In this case, the ASSEMBLY status of'.
text3 = 'the corresponding assembly order can be reset.'.
text_1 = 'Please specify order numbers of orders to be processed.'.
text_2 = 'If TESTMODE is set, no database update will occur.'.
text_3 = 'Set radio button UPDATE for updating the database entries.'.
title = 'Mode'.

AT SELECTION-SCREEN.

IF r_order IS INITIAL.
MESSAGE e889(co) WITH 'Please specify order numbers'.
ENDIF.

START-OF-SELECTION.

* Get all selected orders
SELECT aufnr objnr kdauf kdpos
FROM caufv
INTO TABLE lt_orders
WHERE aufnr IN r_order
AND ( autyp = auftragstyp-fert
OR autyp = auftragstyp-bord )
AND kdauf NE space
AND kdpos NE space.

IF lt_orders[] IS INITIAL.
WRITE: /'No orders were selected.'.
EXIT.
ENDIF.

LOOP AT lt_orders.
CALL FUNCTION 'STATUS_CHECK'
EXPORTING
objnr = lt_orders-objnr
status = 'I0170' " Assembly order
EXCEPTIONS
object_not_found = 1
status_not_active = 2
OTHERS = 3.
IF sy-subrc IS INITIAL.
SELECT SINGLE * FROM vbap INTO ls_vbap
WHERE vbeln = lt_orders-kdauf
AND posnr = lt_orders-kdpos.
IF sy-subrc IS INITIAL AND
ls_vbap-abgru IS INITIAL.
* check status of the sales order item
SELECT SINGLE * FROM vbup INTO ls_vbup
WHERE vbeln = lt_orders-kdauf
AND posnr = lt_orders-kdpos.
IF sy-subrc IS INITIAL AND
ls_vbup-lfsta = 'C' AND
ls_vbup-uvall = 'C'.
* keep entry to deactivate assembly status
ELSE.
DELETE lt_orders.
ENDIF.
ENDIF.
ELSE.
DELETE lt_orders.
ENDIF.
ENDLOOP.

IF lt_orders[] IS INITIAL.
WRITE: / 'No orders to be deleted found.'.
EXIT.
ELSE.
WRITE: / 'For the following orders, the assembly status',
'can be reset'.
ENDIF.

LOOP AT lt_orders.
WRITE:/ 'Production Order', lt_orders-aufnr.
IF testmode IS INITIAL.
CALL FUNCTION 'STATUS_CHANGE_INTERN'
EXPORTING
objnr = lt_orders-objnr
TABLES
status = lt_stat
EXCEPTIONS
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
OTHERS = 4.
IF sy-subrc IS INITIAL.
WRITE: /'Database entry updated.' COLOR COL_POSITIVE.
ENDIF.
ENDIF.
ENDLOOP.
CALL FUNCTION 'STATUS_UPDATE_DIALOG'.
COMMIT WORK.

Regards,

Shoyeb

Answers (5)

Answers (5)

former_member217741
Participant
0 Kudos

Hi Umesh,

We don't have WIP for any of the Process orders. The settings were changed to make Material as a Settlement Receiver.

Regards,

Shoyeb

former_member217741
Participant
0 Kudos

Hi Umesh,

Thanks for reply.

Through configuration we changed the Settlement receiver from Sales order to Material and the Assembly type is Static and we do settlement using KKS2/ KO88 transaction codes and not by VA88 transaction code. I think in our case set the Rejection at SO item level or complete SO should work. What do you say?

Regards,

Shoyeb

UmeshMali4994
Active Contributor
0 Kudos

Hello Shoyeb,

Yes, but are you changing the standard setting in Classes, Which is not good SAP practice.

But still, have a question, Your configuration changes reflected your WIP/closed order?

Please check and revert.

Regards
Umesh Mali

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello,

Did you try the reason for rejection for sales order item?

Which kind of document is this 4900000078?

Brest Regards,

R.Brahmankar

former_member217741
Participant
0 Kudos

Hi Rupesh,

4900000078 is a material document created during PGI.

Yes, I tried using Reason for rejection option also but still the issue is same. Even after the rejection is marked, the relevant Process order is not marked with Deletion flag.

Regards,

Shoyeb

rupesh_brahmankar3
Active Contributor
0 Kudos

Hello,

Please refer SAP note 540834 points the pre-requisites to setting the deletion flag. Question 8

In an assembly order, the deletion flag cannot be set manually. This it is set automatically if the sales order item in question: o

Has been closed (only for static assembly orders)

Has been rejected

Has been deleted

You can set the deletion flag manually using the archiving PP_ORDER and, as per SAP note 1628094.

Best Regards,

R.Brahmankar

former_member217741
Participant
0 Kudos

Hi Rupesh,

Thanks for reply.

I tried that already with no luck. When I try to run report PRARCHP1 and try to mark the deletion flag using that, it throws error,

Order 40000001: Assembly order can only be deleted via customer order 3000000045

And when I try to delete the SO line item, it shows below message.

Item 000010 cannot be deleted because of subsequent document 4900000078

SO statuses are

Regards,

Shoyeb

Raja_S_Reddy_B
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shoyeb,

Can you Please share the screen shots of the current Order status & with CO02
Thanks & Regards : Raja

former_member217741
Participant
0 Kudos

Hi Raja Sekhara,

Thanks for your reply.

Screen shot#1 shows order status.

Screen shot#2 shows that Set deletion flag is disabled.

Regards,

Shoyeb