Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc Status doubt...

Former Member
0 Kudos

Hello,

If an Idoc(Inbound) is in status 64 (Idoc ready to be passed to application) is there any way to force it to any other status so that it will not be processed by the backgroung job(running for RBDAPP01)...?

Is it possible to force an inbound idoc to other status...?

We need to stop the idoc before its been processed by Scheduled background job...

Thanks,

Larry

7 REPLIES 7

Former Member
0 Kudos

Hi,

Exclude this IDOC number with the RBDAPP01 program selection screen variant.Thats the way we do normally .

Hope this resolves your requirement.

Thank you.

Regards,

Karun.M

rainer_hbenthal
Active Contributor
0 Kudos

Use this:

<code>

REPORT z_idoc_status.

TYPE-POOLS:

slis.

TABLES:

edidc.

TYPES:

BEGIN OF out_type,

docnum LIKE edidc-docnum,

mestyp LIKE edidc-mestyp,

status_old LIKE edidc-status,

status_new LIKE edidc-status,

END OF out_type.

DATA:

wa_out TYPE out_type,

out TYPE STANDARD TABLE OF out_type.

*----


  • DATA for ALV GRID VIEW

*----


DATA: fcat TYPE slis_t_fieldcat_alv,

wa_fcat TYPE slis_fieldcat_alv,

alv_layout TYPE slis_layout_alv,

alv_variant TYPE disvariant,

alv_grid_title TYPE lvc_title,

alv_sort TYPE slis_t_sortinfo_alv,

wa_alv_sort TYPE slis_sortinfo_alv,

alv_report_id LIKE sy-repid.

SELECTION-SCREEN BEGIN OF BLOCK idoc WITH FRAME TITLE text-001.

SELECT-OPTIONS s_docnum FOR edidc-docnum.

SELECT-OPTIONS s_mestyp FOR edidc-mestyp.

SELECT-OPTIONS s_staold FOR edidc-status.

PARAMETER p_stanew TYPE edidc-status.

PARAMETER p_update AS CHECKBOX.

SELECTION-SCREEN END OF BLOCK idoc.

START-OF-SELECTION.

SELECT

docnum

mestyp

status

INTO (wa_out-docnum

,wa_out-mestyp

,wa_out-status_old

)

FROM edidc

WHERE docnum IN s_docnum

AND mestyp IN s_mestyp

AND status IN s_staold.

wa_out-status_new = p_stanew.

APPEND wa_out TO out.

ENDSELECT.

IF p_update = 'X'.

LOOP AT out INTO wa_out.

UPDATE edidc

SET status = p_stanew

WHERE docnum = wa_out-docnum.

ENDLOOP.

ENDIF.

CLEAR wa_fcat.

wa_fcat-fieldname = 'DOCNUM'.

wa_fcat-ref_tabname = 'EDIDC'.

wa_fcat-ref_fieldname = 'DOCNUM'.

wa_fcat-key = 'X'.

APPEND wa_fcat TO fcat.

CLEAR wa_fcat.

wa_fcat-fieldname = 'MESTYP'.

wa_fcat-ref_tabname = 'EDIDC'.

wa_fcat-ref_fieldname = 'MESTYP'.

APPEND wa_fcat TO fcat.

CLEAR wa_fcat.

wa_fcat-fieldname = 'STATUS_OLD'.

wa_fcat-seltext_l = 'Status alt'(002).

wa_fcat-seltext_m = 'Status alt'(002).

wa_fcat-seltext_s = 'Status alt'(002).

APPEND wa_fcat TO fcat.

CLEAR wa_fcat.

wa_fcat-fieldname = 'STATUS_NEW'.

wa_fcat-seltext_l = 'Status neu'(003).

wa_fcat-seltext_m = 'Status neu'(003).

wa_fcat-seltext_s = 'Status neu'(003).

APPEND wa_fcat TO fcat.

*----


  • alv sortierung

*----


CLEAR wa_alv_sort.

wa_alv_sort-spos = 1.

wa_alv_sort-fieldname = 'DOCNUM'.

wa_alv_sort-up = 'X'.

APPEND wa_alv_sort TO alv_sort.

*----


  • alv Ausgabe

*----


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = alv_report_id

i_grid_title = alv_grid_title

is_layout = alv_layout

it_fieldcat = fcat

i_save = 'A'

it_sort = alv_sort

is_variant = alv_variant

TABLES

t_outtab = out

EXCEPTIONS

program_error = 1

OTHERS = 2.

</code>

You can manipulate the status of each idoc.

Former Member
0 Kudos

Hi larry,

Preferably you should change the status of the IDoc to 68 (ready for deletion), which ensures no further processing will take place.

To do this use FM 'IDOC_STATUS_WRITE_TO_DATABASE' (and NEVER update the DB-tables yourself).

Regards,

John.

Former Member
0 Kudos

Thanks guys is there any transactions to do it because i dont have authorizations in prod system to execute any codes...

Larry

0 Kudos

SAP does not offer to change idoc status nor deleting idocs themselves.

ferry_lianto
Active Contributor
0 Kudos

Hi Larry,

Have you looked at standard program/report <b>RC1_IDOC_SET_STATUS</b>?

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

that standard PGM:rc1_idoc_set_status is using the FM:IDOC_STATUS_WRITE_TO_DATABASE. actually there are many good standard PGMs for us to refer to. we can also change the control data, idoc structure, segement data using some pre-defined functions as enhancements as well.