{"id":1054,"date":"2014-09-26T07:43:29","date_gmt":"2014-09-26T06:43:29","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1054"},"modified":"2014-09-26T08:09:52","modified_gmt":"2014-09-26T07:09:52","slug":"abap-apo-planning-book-macros-on-aggregated-levels","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1054","title":{"rendered":"ABAP &#8211; APO Planning book macros on aggregated levels"},"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=\"alignnone size-full wp-image-358 alignleft\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" alt=\"SAP\" width=\"44\" height=\"50\" \/>Here I&#8217;d like to present my solution of a problem in APO planning books where it was necessary to load multiple products and locations at the same time into the planning view and execute some <em>Default<\/em> macros on all of them. <!--more-->The requirement was to execute the macro always only per ONE product\/location. This was not possible because the planning data was aggregated on material and\/or location level.<\/p>\n<p>Therefore I have to modify the macros in macro editor (\/SAPAPO\/ADVM) so at first they <em>DRILL_DOWN <\/em>on material level, then on location level and then the computation macro itself is executed.<\/p>\n<h2>Macro &#8220;Drill down to Material level&#8221;<\/h2>\n<p>The basic idea is: IF ( AGG_LEVEL( &#8216;9AMATNR&#8217; ) = 1 ) DRILL_DOWN( &#8216;9AMATNR&#8217; ; &#8216;internal&#8217; )<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1055\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1055\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01.png\" data-orig-size=\"350,162\" 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;}\" data-image-title=\"Material Drill Down\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01.png\" class=\"alignnone wp-image-1055 size-medium\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01-300x138.png\" alt=\"Material Drill Down\" width=\"300\" height=\"138\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01-300x138.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_01.png 350w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Macro &#8220;Drill down to Location level&#8221;<\/h2>\n<p>The basic idea is the same as for material : IF ( AGG_LEVEL( &#8216;9ALOCNO&#8217; ) = 1 ) DRILL_DOWN( &#8216;9ALOCNO&#8217; ; &#8216;internal&#8217; )<\/p>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1056\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1056\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02.png\" data-orig-size=\"367,162\" 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;}\" data-image-title=\"Location Drill Down\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02.png\" class=\"alignnone wp-image-1056 size-medium\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02-300x132.png\" alt=\"Location Drill Down\" width=\"300\" height=\"132\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02-300x132.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_02.png 367w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Collective macro &#8220;Multiple: Calculation&#8221;<\/h2>\n<p>The collective macro executes the &#8220;sub-macros&#8221; in the list sequentially:<\/p>\n<ol>\n<li>Drill down to Material level<\/li>\n<li>Drill down to Location level<\/li>\n<li>Computation macro<\/li>\n<\/ol>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1057\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1057\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03.png\" data-orig-size=\"373,493\" 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;}\" data-image-title=\"Collective Macro\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03.png\" class=\"alignnone wp-image-1057 size-medium\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03-226x300.png\" alt=\"Collective Macro\" width=\"226\" height=\"300\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03-226x300.png 226w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_03.png 373w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/a><\/p>\n<h2>Planning book output<\/h2>\n<p>In the planning book (\/SAPAPO\/SDP94) it&#8217;s now visible that each key figure row is split into several rows:<\/p>\n<ul>\n<li>Total value (calculated automatically)<\/li>\n<li>1<sup>st<\/sup> product\/location value (calculated by our macro)<\/li>\n<li>2<sup>nd<\/sup> product\/location value (calculated by our macro)<\/li>\n<li>&#8230;<\/li>\n<\/ul>\n<p><a href=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1063\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=1063\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04.png\" data-orig-size=\"1612,758\" 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;}\" data-image-title=\"Planning book\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04-1024x481.png\" class=\"alignnone wp-image-1063 size-medium\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04-300x141.png\" alt=\"Planning book\" width=\"300\" height=\"141\" srcset=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04-300x141.png 300w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04-1024x481.png 1024w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04-500x235.png 500w, https:\/\/oprsteny.cz\/wp-content\/uploads\/APO_MACRO_DRILL_DOWN_04.png 1612w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I&#8217;d like to present my solution of a problem in APO planning books where it was necessary to load multiple products and locations at the same time into the planning view and execute some Default macros on all of &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=1054\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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 - APO Planning book macros on aggregated levels http:\/\/wp.me\/p3nYbe-h0","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},"jetpack_post_was_ever_published":false},"categories":[16,99,233,9],"tags":[320,319,446,322,448,321,308,323],"class_list":["post-1054","post","type-post","status-publish","format-standard","hentry","category-abap","category-apo","category-customizing","category-development","tag-sapapoadvm","tag-sapaposdp94","tag-abap","tag-agg_level","tag-apo","tag-drill_down","tag-macro","tag-snp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-h0","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1054","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=1054"}],"version-history":[{"count":3,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1054\/revisions"}],"predecessor-version":[{"id":1065,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1054\/revisions\/1065"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}