{"id":1301,"date":"2015-03-02T11:04:40","date_gmt":"2015-03-02T10:04:40","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1301"},"modified":"2015-03-03T09:35:23","modified_gmt":"2015-03-03T08:35:23","slug":"abap-sd-document-flow-monitoring","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1301","title":{"rendered":"ABAP &#8211; SD Document flow monitoring"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"358\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=358\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" data-orig-size=\"44,50\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Picasa&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1365690880&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"SAP\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" class=\" size-full wp-image-358 alignleft\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" alt=\"SAP\" width=\"44\" height=\"50\" \/>All documents created in SAP SD module goes sooner or later through VBFA table where all transitions are stored.<!--more-->The main idea of VBFA table contents is that you are able to track all transitions (documents flow) during the whole logistic chain.<\/p>\n<p>Besides other fields of VBFA the main idea is in it&#8217;s KEY fields named:<\/p>\n<ul>\n<li>VBELV + POSNV (<strong>Preceding<\/strong> SD Document + Item)<\/li>\n<li>VBELN + POSNN (<strong>Subsequent<\/strong> SD Document + Item)<\/li>\n<li>VBTYP_N (Document <strong>category of subsequent <\/strong>document)<\/li>\n<li>VBTYP_V (Document <strong>category of preceding<\/strong> SD document &#8211; NOT A KEY FIELD)<\/li>\n<\/ul>\n<p>If you examine VBTYP_N field and its domain (VBTYP), you&#8217;ll find pre-defined types (see attachment <a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/VBFA_VBTYP.txt\">VBFA-VBTYP_V -&gt; VBFA-VBTYP_N<\/a>)<\/p>\n<p>For the following example where Delivery is being Invoiced and such invoice is then canceled, you&#8217;ll get 2 entries in VBFA table created:<\/p>\n<ol>\n<li>Delivery (J) -&gt; Invoice (M)<\/li>\n<li>Invoice (M) -&gt; Invoice cancelation (N)<\/li>\n<\/ol>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1304\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1304\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp.png\" data-orig-size=\"378,315\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Document flow\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp.png\" class=\"alignnone size-medium wp-image-1304\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp-300x250.png\" alt=\"Document flow\" width=\"300\" height=\"250\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp-300x250.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp-360x300.png 360w, https:\/\/oprsteny.cz\/wp-content\/uploads\/vbfa_vbtyp.png 378w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Information relevant to documents hidden under VBELV and VBELN key fields can than be found in their corresponding tables:<\/p>\n<ol>\n<li>Material Management\n<ul>\n<li><strong>MSEG<\/strong> &#8211; Segment of Material Document<\/li>\n<li><strong>MKPF<\/strong> &#8211; Header for Material Document<\/li>\n<\/ul>\n<\/li>\n<li>Finance\n<ul>\n<li><strong>BSEG<\/strong> &#8211; Accounting Document Segment<\/li>\n<li><strong>BKPF<\/strong> &#8211; Accounting Document Header<\/li>\n<li>BSEG\/BKPF pulls data relevant to company code<\/li>\n<\/ul>\n<\/li>\n<li>MM \/ FI\n<ul>\n<li><strong>RSEG<\/strong> &#8211; Document Item: Incoming Invoice<\/li>\n<li><strong>RKPF<\/strong> -Document Header: Reservation<\/li>\n<li><strong>RBKP<\/strong> &#8211; Document Header: Invoice Receipt<\/li>\n<li>RSEG\/RKPF does not have the field Company code it only takes incoming invoice and reservation irrespective of company code<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>The same as <strong>VFBA <\/strong>for SD is <strong>VTFA <\/strong>table for Shipment documents flow.<br \/>\nSimilarly there is table <strong>EKBE <\/strong>for monitoring history of a Purchasing document and <strong>EKBZ<\/strong> &#8211; History per Purchasing Document: Delivery Costs.<\/p>\n<p>One of possible links between an <em>Invoice<\/em> <em>Receipt<\/em> and a <em>Material Document<\/em> is a <em>Purchase Order<\/em><br \/>\nFor Example we have:<\/p>\n<ul>\n<li>Pucharse Order EBELN = <strong>14<\/strong>00095975 and one Line item EBELP = 1.<\/li>\n<li>Material Document MBLNR = <strong>50<\/strong>01321695 in MSEG<\/li>\n<li>Accounting document for invoice BELNR = <strong>51<\/strong>03166127 in BKPF<\/li>\n<\/ul>\n<ul>\n<li>In MSEG for MBLNR = <strong>50<\/strong>01321695 we get\n<ul>\n<li>EBELN\u00a0 = <strong>14<\/strong>00095975<\/li>\n<li>EBELP = 1<\/li>\n<\/ul>\n<\/li>\n<li>In BSEG for BELNR =\u00a0\u00a0<strong>51<\/strong>03166127 for the entry belonging to GR\/IR account (HKONT), we get\n<ul>\n<li>EBELN\u00a0 = <strong>14<\/strong>00095975<\/li>\n<li>EBELP = 1<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>One of possible links between <strong>MKPF<\/strong> and <strong>BKPF<\/strong> is<\/p>\n<ul>\n<li>Concatente MKPF-MBLNR, MKPF-MJAHR into a temporary variable<\/li>\n<li>Select from BKPF with AWTYP = &#8216;MKPF&#8217; and AWKEY = &lt;Concatenated_string&gt;<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All documents created in SAP SD module goes sooner or later through VBFA table where all transitions are stored.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"ABAP - SD Document flow monitoring","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16,390,389],"tags":[397,396,400,401,399,398,394,395,393,392,391],"class_list":["post-1301","post","type-post","status-publish","format-standard","hentry","category-abap","category-sales-distribution","category-sap","tag-bkpf","tag-bseg","tag-ekbe","tag-ekbz","tag-mkpf","tag-mseg","tag-rbkp","tag-rkpf","tag-rseg","tag-vbeln","tag-vbfa"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-kZ","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1301"}],"version-history":[{"count":9,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1301\/revisions"}],"predecessor-version":[{"id":1313,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1301\/revisions\/1313"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}