0% found this document useful (0 votes)
62 views

Modify IDOC Status by Program - ABAP Development - SCN Wiki

The document describes how to modify the status of IDOCs via a custom program or via the standard SAP program RC1_IDOC_SET_STATUS. It provides details on the FM functions EDI_DOCUMENT_OPEN_FOR_PROCESS, EDI_STATUS_ADD_BLOCK, and EDI_DOCUMENT_CLOSE_PROCESS that can be used in a custom program to change the status. It also provides instructions for using the standard SAP program to change the status of IDOCs.

Uploaded by

sudh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Modify IDOC Status by Program - ABAP Development - SCN Wiki

The document describes how to modify the status of IDOCs via a custom program or via the standard SAP program RC1_IDOC_SET_STATUS. It provides details on the FM functions EDI_DOCUMENT_OPEN_FOR_PROCESS, EDI_STATUS_ADD_BLOCK, and EDI_DOCUMENT_CLOSE_PROCESS that can be used in a custom program to change the status. It also provides instructions for using the standard SAP program to change the status of IDOCs.

Uploaded by

sudh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

11/9/2016

ModifyIDOCStatusbyProgramABAPDevelopmentSCNWiki
GettingStarted

CommunityWIKI

SAPCommunity

Welcome,Guest

Login

Store

Register

ABAPDevelopment / / ALE,IDOC

ModifyIDOCStatusbyProgram
CreatedbyGuest,lastmodifiedbyBretHalfordonMay06,2014

SettingIDOCstatusviaCustomfunctionality
ThebusinessrequirementistosetIDOCtoacertainstatusviaaCustomProgram.ThiswasdoneasapartofIDOCArchival.TheIDOCthatqualifiedasperthecriteriawereselectedandtherestatus
wasmodified.TheBASISthentookuptheseIDOCsandcarriedoutIDOCArchivingfortheseIDOCs.
ThefollowingFMwereusedtochangethestatusofIDOCs:
EDI_DOCUMENT_OPEN_FOR_PROCESS
EDI_STATUS_ADD_BLOCK
EDI_DOCUMENT_CLOSE_PROCESSPROCESS

TheAboveIDOCsneedtobecalledoneaftertheanother.

EDI_DOCUMENT_OPEN_FOR_PROCESS
TheaboveFMbasicallyacquiresandopentheIDOCformodification.IttakesIDOCnumberasINPUTandreturnsControlRecordasOutput.
CALLFUNCTION'EDI_DOCUMENT_OPEN_FOR_PROCESS'
EXPORTING
document_number=idocnumber
IMPORTING
idoc_control=idoc_contrl
EXCEPTIONS
document_foreign_lock=01
document_not_exist=02
document_number_invalid=03
document_is_already_open=04.

EDI_STATUS_ADD_BLOCK
*Aftertheabovecall,thenwecalltheFM*EDI_STATUS_ADD_BLOCK.
IttakestheInputofIDOCnumberintoDOCUMENT_NUMBERandIDOCstatusrecordintoIDOC_STATUS_RECORDS.Forexample
wepassTB_EDI_DStoIDOC_STATUS_RECORDS.

TB_EDI_DSMANDT=SYMANDT.
TB_EDI_DSDOCNUM=DOCNUM_IV.
*TB_EDI_DSSTATUS=STATUS_IV."*HereyoupasstheStatustowhichIDOChastobemodifiedforexample68.
TB_EDI_DSLOGDAT=SYDATUM.
TB_EDI_DSLOGTIM=SYUZEIT.
TB_EDI_DSSTAMQU='SAP'.
TB_EDI_DSUNAME=SYUNAME.

AppendTB_EDI_DS.

EDI_DOCUMENT_CLOSE_PROCESSPROCESS

Aftertheabovementionedcallissuccessful,thenyoucalltheFMEDI_DOCUMENT_CLOSE_PROCESSPROCESSandpasstheIDOCDocumentnumbertoDOCUMENT_NUMBER
andthenCOMMITwork.
InthiswayyoucanmodifythestatusofIDOCsviayourownprogramf

ChangethestatusofanIDOC,Analternativeway.
AnotheralternativeistousethestandardSAPprogram:RC1_IDOC_SET_STATUS.

https://wiki.scn.sap.com/wiki/display/ABAP/Modify+IDOC+Status+by+Program

1/2

11/9/2016

ModifyIDOCStatusbyProgramABAPDevelopmentSCNWiki

RuntheprogramRC1_IDOC_SET_STATUS.
GivetheIdocnumbersforwhichyouwanttochangethestatusesintheselectionscreen.
Givethecurrentandthenewstatus.
UnchecktheTestRuncheckboxandpressF8.
Thestatusesoftheidocswillbechanged.

idoc

status

change

code

1ChildPage

ProgramstochangeidocStatus

ContactUs
Privacy

SAPHelpPortal
TermsofUse

LegalDisclosure

Copyright

https://wiki.scn.sap.com/wiki/display/ABAP/Modify+IDOC+Status+by+Program

FollowSCN

2/2

You might also like