Samrtform Document for ABAP Consultant

Embed Size (px)

Citation preview

  • 8/18/2019 Samrtform Document for ABAP Consultant

    1/27

    SAP ABAP

    1 CONVERT SMARTFORM TO PDF

    https://wiki.scn.sap.com/wiki/isp!a"/Snipp#ts/Con$#%t&Sma%t'o%m&to&PDF&'o%mat

    http://www.sapt#chnica!.com/T(to%ia!s/Sma%t'o%ms/PDF/Simp!#.htm

    c%#at# )" Ni%an*an Na+!# on D#c ,1- 1 11:, AM- !ast moi0# )" Ni%an*an Na+!# on (!2- 13 4:35 AMV#%sion 14inSha%#26

    ABSTRACTToday IDocs are used in most SAP applications for transfer of message(information) from SAP system to other systems andvice versa. Though lot of documentation is available on IDocs it isdifficult for a functional consultant to understand such documentsdue to their technical nature. While a functional consultant isnot epected to !no" the IDoc concepts in its entirety# an efforthas been made to capture the minimum necessary informationthat one needs to be a"are of in order to handle pro$ect%support

    issues on IDocs.

    OVERVIEWIDoc is an SAP object that carries data of a business transaction from onesystem to another in the form of electronic message. IDoc is an acronymfor Intermediate Document. The purpose of an IDoc is to transfer data or information from SAP to other systems and vice versa. The transfer fromSAP to non-SAP system is done via EDI Electronic Data Interchange!subsystems "hereas for transfer bet"een t"o SAP systems# A$E is used. 

    IDoc can be triggered in SAP system or in EDI subsystem. This dependson the direction in "hich IDoc is sent and is called as Inbound IDoc and%utbound IDoc accordingly. In case of outbound flo"# IDoc is triggered inSAP through document message control "hich is then sent to EDIsubsystem. EDI converts the data from IDoc into &'$ or e(uivalent formatand then sends the data to partner system through Internet.

    https://wiki.scn.sap.com/wiki/display/Snippets/Convert+Smartform+to+PDF+formathttp://www.saptechnical.com/Tutorials/Smartforms/PDF/Simple.htmhttp://scn.sap.com/people/niranjan.naglehttp://scn.sap.com/people/niranjan.naglehttp://www.saptechnical.com/Tutorials/Smartforms/PDF/Simple.htmhttp://scn.sap.com/people/niranjan.naglehttp://scn.sap.com/people/niranjan.naglehttps://wiki.scn.sap.com/wiki/display/Snippets/Convert+Smartform+to+PDF+format

  • 8/18/2019 Samrtform Document for ABAP Consultant

    2/27

    http://sapt#chnica!.com/T(to%ia!s/Sma%t'o%ms/OTFPDF.htm

    )or inbound flo"# EDI converts partner data and IDoc is created in SAP. After successful processing of this IDoc# Application Document is posted inSAP.

    EDI STANDARDS AND IDOC*EDI is electronic e+change of business document bet"een the computer systems of business partners# using a standard format over acommunication net"or,. EDI stands for Electronic Data Interchange. 

    )or transmission of information electronically# t"o "idely used standardsare ASI AS/ &01 and EDI)A/T. ASI AS/ &01 is a committee formed byrepresentatives of major organi2ations# government bodies and EDIsoft"are companies "hich defines standards and guidelines for informationinterchange over EDI. 34EDI)A/T stands for 3nited ations EDI for 

     Administration# commerce and Transport and "as formed in 0567 using ASI &01 and 3TDI 3nited ations Trade Data interchange! as basestandards. ASI &01 describes business document as transactions andeach transaction is represented by three digit number e.g. 678 9 Purchase%rder# 677 - Purchase %rder Ac,no"ledgement. EDI)A/T describes

    business document as messages# represented by standard names e.g.%:DE:S for purchase order.

    http://www.st#chi#s.com/sma%t7'o%m7ot'7p'7con$#%sion81/

    http://www.#%p+%#at.com/sma%t'o%ms/con$#%sion7o'7sma%t'o%m7o(tp(t7to7p'.htm

    http://saptechnical.com/Tutorials/Smartforms/OTF2PDF.htmhttp://www.stechies.com/smart-form-otf-pdf-conversion_1/http://www.erpgreat.com/smartforms/conversion-of-smartform-output-to-pdf.htmhttp://saptechnical.com/Tutorials/Smartforms/OTF2PDF.htmhttp://www.stechies.com/smart-form-otf-pdf-conversion_1/http://www.erpgreat.com/smartforms/conversion-of-smartform-output-to-pdf.htm

  • 8/18/2019 Samrtform Document for ABAP Consultant

    3/27

     

    IDOC TERMINOLOGIESIDOC (BASIC) TYPEIDoc Types are based on the EDI standards and mostly on EDI)A/T

    standards.;asic Types or IDoc Type! defines the structure of an IDoc. Each basictype describes standard IDoc segments# format of data fields and their si2e.;asic Type also defines number of segments and fields in an IDoc. All thefields that are necessary for transmission of message for a particular business transaction are mapped in different segments. It also defines thestructure and relationship of IDoc segments along "ith mandatory andoptional segments. 

    http://www.+otothin+s.com/sma%t'o%ms/con$#%t7th#7sma%t7'o%m7into7p'7an7

    s#n.htm

    http://www.saph().com/sma%t'o%ms/sma%t'o%m7own!oa7p'70!#/

    http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/

  • 8/18/2019 Samrtform Document for ABAP Consultant

    4/27

    IDOC EXTENSION;asic type contains all the standard fields that are necessary for carryingout a business transaction.

  • 8/18/2019 Samrtform Document for ABAP Consultant

    5/27

    http://www.saph().com/sma%t'o%ms/sma%t'o%m7own!oa7p'70!#/

    INBO"ND#O"TBO"ND IDOCS

    IDocs sent outside the system are termed as %utbound IDocs and the onesthat are received into the system# are called as Inbound IDocs. 

    IDOC DIRECTIONThis signifies the direction is "hich information is sent and is similar to

    terminology used in mails. If information is sent outside the system then thedirection is outbo+ "hen it is received into the system then direction isinbo+. In SAP %utbo+ direction is represent by *0 i.e. outbo+ and Inbo+direction is represented by *1. 

    PARTNERhttp://www.+otothin+s.com/sma%t'o%ms/con$#%t7th#7sma%t7'o%m7into7p'7an7s#n.htm

    http://www.saph().com/sma%t'o%ms/sma%t'o%m7own!oa7p'70!#/

    Partner is the ;usiness Partner "ith "hich the e+change of information isto ta,e place using IDoc. It can be a vendor or customer or any other system. Depending on the direction of information in "hich the informationis sent it plays a role of either a *sending partner or a *receiving partner. 

    http://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/

  • 8/18/2019 Samrtform Document for ABAP Consultant

    6/27

     

    PARTNER TYPEPartner type4role is used to identify partners "ithin the sap systems.Partner type is =3 for customer# $I for vendor and $S for $ogical System.

    http://www.+otothin+s.com/sma%t'o%ms/con$#%t7th#7sma%t7'o%m7into7p'7an7s#n.htm

    http://www.saph().com/sma%t'o%ms/sma%t'o%m7own!oa7p'70!#/

     

    MESSAGE TYPEIDoc processing involves transmission or receipt of document in the form of a message# each of "hich represents a document in SAP. These

    documents can be %rder# Shipment /onfirmation# Advance Shippingotification# >oods :eceipt# or Invoice. 'essage type is associated "ith;asic IDoc Type ;asic Type! and defines the ,ind of data or document thatis e+changed "ith the partner. 

    PROCESS CODE

    http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/

  • 8/18/2019 Samrtform Document for ABAP Consultant

    7/27

    The process code contains the details of the )unction 'odule that are usedfor IDoc processing. 'essage Type can be lin,ed to the Process code.

     

    PORT IDoc Port contains the information about the "ay data is sent bet"een thesource or target system. The type of port defines the information contained"ithin the port. )or port type *Internet Port "ill contain IP address of thetarget system. )or port type *file# directory or file name information ismaintained. *t:)/ port contains information about the :)/ destination of the target system. )or IDoc transmission using A$E *t:)/ ports are used. 

    PARTNER PROFILE MAINTENANCE

    PARTNER PRO$I!E (%E&')Partner profile must be maintained for all the business partners to "hom"e "ant to send or receive the IDocs. The T/%DE for maintaining thepartner profile is ?E18. 

    Double clic,ing on the Partner "ill sho" the follo"ing screen@ http://www.+otothin+s.com/sma%t'o%ms/con$#%t7th#7sma%t7'o%m7into7p'7an7

    s#n.htm

    http://www.saph().com/sma%t'o%ms/sma%t'o%m7own!oa7p'70!#/

    http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/http://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.gotothings.com/smartforms/convert-the-smart-form-into-pdf-and-send.htmhttp://www.saphub.com/smartforms/smartform-download-pdf-file/

  • 8/18/2019 Samrtform Document for ABAP Consultant

    8/27

    Partner profile contains parameters for Inbound and %utbound processingof IDocs. )or each message type "e can maintain# inbound4outboundoptions# message control# post processing options and contact information"ithin Inbound and outbound parameters. 

    O"TBO"ND OPTIONS (O"TBO"ND PARAMETERS)This involves sender4receiver port# %utput mode and relation to IDoc typei.e. ;asic Type and e+tension.

  • 8/18/2019 Samrtform Document for ABAP Consultant

    9/27

     

    MESSAGE CONTRO! (O"TBO"ND PARAMETERS)This contains application for "hich IDoc "ill be created e.g. E) for Purchase order# the message type of the application that "ill trigger theIDoc and Process /ode that "ill convert SAP document to an IDoc. )or 

    e+ample# if P% is to be sent to the endor A&&&&B# then in the outboundoption of the partner A&&&&B "e need to maintain the message type B&&0and lin, it to the Process /ode 'E08. So "hen message type B&&0 istriggered in the P% then an IDoc "ill be created for the partner vendor 

     A&&&&B. 

    Process /ode is lin,ed to the )unction 'odule in SAP that convertsapplication data into an IDoc. Standard function modules are provided bySAP for this conversion ho"ever these can also be customi2ed as perbusiness needs.

     

  • 8/18/2019 Samrtform Document for ABAP Consultant

    10/27

    Change Message Indicator indicates "hether the IDoc is sent as anotification of change. )or e+ample# Purchase %rder change messages are

    sent to vendor using EDI standard message type 6C8.

    Separate message type should be triggered in the purchase order for P%change. Additional line "ith change message type must be added in the'essage control tab "ith change message indicator on. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    11/27

     

    INBO"ND OPTIONS (INBO"ND PARAMETERS) 

    )or inbound options process code is maintained in the Inbound screenonly. IDoc processing can be triggered by bac,ground program andtriggered immediately. 

    POST PROCESSING (INBO"ND#O"TBO"ND PARAMETERS) 

    In the post processing option "e can maintain the "or,flo" details of theusers or positions to "hich an error notification "ill be sent if an IDocprocessing fails. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    12/27

    TE!EPONY (INBO"ND#O"TBO"ND PARAMETERS)?e can also maintain the contact details in the telephony option.

     

    EDI STANDARD (O"TBO"ND PARAMETERS)EDI standard screen contains the details of the Standard EDI terminologyused for the IDoc transmission. 

    )or e+ample# 'essage Type 8! is an EDI standard for Purchase %rder IDoc and is lin,ed to IDoc 'essage Type Orders.

    IDOC STR"CT"RE AND RECORDSSTR"CT"REIDoc structure is divided into /ontrol :ecord# Data :ecords and Statusrecords.

     

  • 8/18/2019 Samrtform Document for ABAP Consultant

    13/27

     

    These records are stored in the transparent tables in SAP. These areEDID/# EDID and EDIDS. 

    CONTRO! RECORD (EDIDC)It contains information such as IDoc number# direction# IDoc Status# ;asicType# 'essage Type# Partner Sender4:eceiver!# date and time of creation4update# Interchange )ile or ISA number#etc. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    14/27

     

    DATA RECORD (EDID)It contains the details of the IDoc segments. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    15/27

    IDoc segment has fields that contain the data necessary for posting thedocuments. 

    STAT"S RECORDS (EDIDS)IDoc Status defines the processing status of the IDoc. IDoc statuses areused to trac, the IDoc and its various processing states. Status umbers

  • 8/18/2019 Samrtform Document for ABAP Consultant

    16/27

    represents IDoc status. /urrent status of the IDoc is present in /ontrolrecord. 

    Initial Status numbers are C for inbound and 8 for outbound. Successfulstatus is 7 for inbound and 0C for outbound IDocs. 

    SENDING AND RECEIVING IDOCSTRIGGERING AN O"TBO"ND IDOC%utbound IDocs can be triggered from the output message types of Purchase %rders# deliveries# 'aterial Documents# invoices# etc. Thefollo"ing figure sho"s that once the output B&&0 of P% &&&&&&&0 isprocessed an IDoc *888888&&&&&&&&&0 is added4created. 

    The relationship bet"een the IDoc and the application document can befound in t"o "ays@0. :elationship tab of IDoc

  • 8/18/2019 Samrtform Document for ABAP Consultant

    17/27

     

    1. :elationship tab of Application Document# e.g. P%# S%# 'aterial

    Document# etc. 

    The initial status of this IDoc "ill be 8# "hich after successful processing"ill convert into status 0C.

  • 8/18/2019 Samrtform Document for ABAP Consultant

    18/27

     

     A successful outbound IDoc "ill pass through all the above statuses inreverse order 80-8-06-8C-01-0C!. Each status represents an IDocvalidation step. If an IDoc passes all the validations it "ould reach status0C. These different validation steps for outbound IDocs are e+plainedbelo"@ 

    80@ IDoc generation successful8@ IDoc is ready to be processed by IDoc Processing job8@ IDoc data is passed to the Port06@ IDoc successfully triggered EDI subsystem

    8C@ IDoc data translated to EDI format01@ IDoc is dispatched successfully to the partner 0C@ Partner has received the IDoc successfully 

    IDoc can possibly fail at any of the above steps during validation.

     

    RECEIING AN INBO"ND IDOCThe initial status of an inbound IDoc is C and successful status is 7. 

    Different validation steps for inbound IDocs are e+plained belo"@

    78@ IDoc received successfully in the systemC@ IDoc is ready to be processed by IDoc processing job7@ Application document created and saved successfully. The documentnumber can be found by e+panding the status node 7

  • 8/18/2019 Samrtform Document for ABAP Consultant

    19/27

     An inbound IDoc goes through all the above statuses in reverse order 78-C-7!. 

    IDOC #ROCESSING A"TOMATIC#IMMEDIATE PROCESSINGIn this case# IDoc are processed immediately as they generated or addedin the system. The chec, *Transfer IDoc immediately is selected in%utbound %ptions and *Trigger Immediately is selected in Inbound %ption.These chec,s are generally used "hen the real time information e+changeis necessary bet"een t"o systems. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    20/27

    MAN"A! PROCESSINGIDocs can also be manually processed using the T/%DE ;D6F in SAP. 

    PROCESSING IA BAC*GRO"ND +OBIDoc processing by bac,ground is the most preferred "ay of processing the

    IDocs. )ollo"ing Programs are used from processing the IDocs usingbac,ground job@:;DAPP80 - Inbound IDocs:SE%3T88 - %utbound IDocs 

    REPROCESSING IDOCS

    &n the basis of IDoc statuses different programs can be used forreprocessing of failed IDocs. These are given belo"'

     

    TESTING AND EDITING IDOCSIf an IDoc contains error in the data then such IDocs can be edited usingT/ode ?E81 or ?E87. ?hen an IDoc is edited the original IDoc

    informationbac,up! is saved in a e" IDoc under status F8 for inbound! 4 for outbound!. These IDoc stays in the system for reference only andcannot be processed. The status of the edited IDoc becomes C5 inbound!and 1 outbound!. These IDocs can then be processed using ;D6Ftransaction or batch jobs. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    21/27

    Debugging of IDocs can be done using by copying the IDocs usingT/ode?E05. ?E05 is a test tool for Idocs processing. ?E05 copies thee+isting idoc and creates a ne" IDoc "hich can then be modified as per testing needs. The ne"ly generated IDoc can also be processed using;D6F.

     

    CONVERTING IDOC STAT"S:eport :/0GID%/GSETGSTAT3S can be used to change the status ofIDoc. Status changes are generally needed to move an IDoc to status C6 9no further processing

     

    SEARC$ING IDOCS IN SA#TCODE %E'%E',- GENERA! SEARCIDocs can be displayed in system via T/%DE ?E81 and ?E87. If IDocnumber is not ,no"n then search can be made on the basis of IDoc Date#

    Direction# ;ASI/ THPE# 'ESSA>E THPE# and PA:TE:3';E:.Partner number can be found in the %utput 'essages of thedocuments. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    22/27

     

    IDoc search can also be made on the basis of ISA or Transfer file:eference.

  • 8/18/2019 Samrtform Document for ABAP Consultant

    23/27

     

    TCODE %E'.- SEARCING DATA IN IDOC SEGMENTSIf "e are loo,ing for specific information "ithin the IDocs Segments thenthis can be found using T/%DE ?E85. This is useful if you are searchingfor a particular information in similar ,ind of IDoc "ithin IDoc segments. )or 

    e+ample# if you "ant to search a particular Purchase %rder number e.g.088888880 in multiple IDocs "hich lies in Segment E0ED=80 of an IDocunder field ;E$:. Then the search can be e+ecuted in the follo"ingmanner.

     

    IDOC VALIDATIONS% COMMON IDOC ERRORS AND

    SOL"TION

  • 8/18/2019 Samrtform Document for ABAP Consultant

    24/27

    Though# the IDoc failure may not be related to any of the above mentionedreasons# the best "ay to find the IDoc error is to compare the e+isting IDoc"ith the good e+ample. >ood e+ample IDoc can be easily searched "ithany of the IDoc search methods as described above.

    DOC"MENTATION &OR IDOC T'#ESIDoc documentation can be found using T/%DE ?EC8 and can be helpfulto obtain information of the IDoc Type or its particular segment. It alsoprovides information such as mandatory and optional segments# minimumand ma+imum number of segments# etc.

    GENERAL IN&ORMATION &OR COMMON IDOC MESSAGET'#ES

    The follo"ing list gives the ;asic Type and 'essage Type combination for common idocs

  • 8/18/2019 Samrtform Document for ABAP Consultant

    25/27

     

    ARC$IVING(DELETION O& IDOCS &ROM DATABASE As IDocs gro" older they are archived and deleted from the database. Archived IDocs can be vie"ed using T/%DE SA:I in Achieve E+plorer 

    using archiving object as IDoc. )ollo"ing are the fe" programs that areused for archiving and deletion of IDocs from database. 

  • 8/18/2019 Samrtform Document for ABAP Consultant

    26/27

    https://wiki.scn.sap.com/wiki/isp!a"/Snipp#ts/Con$#%t&Sma%t'o%m&to&PDF&'o%mat

    CONVERT SAP SCR9PT TO PDF

    http://www.sn.sap.com/i%*/scn/+o/po%ta!/p%t%oot/ocs/!i)%a%"/((i/62#136467#17

    172c)a7#5'66335;o$#%%i#!a"o(t

  • 8/18/2019 Samrtform Document for ABAP Consultant

    27/27