{"id":1585,"date":"2016-12-23T11:21:06","date_gmt":"2016-12-23T10:21:06","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1585"},"modified":"2016-12-23T11:21:06","modified_gmt":"2016-12-23T10:21:06","slug":"abap-modify-rfq-item-data-during-save","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1585","title":{"rendered":"ABAP &#8211; Modify RFQ item data during SAVE"},"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=\"alignleft size-full wp-image-358\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/SAP.jpg\" alt=\"\" width=\"44\" height=\"50\" \/>There&#8217;s a user exit\u00a0EXIT_SAPMM06E_012 (include\u00a0ZXM06U43) you can use to perform various user checks before an RFQ is saved in Tx ME41\/ME42. But what if you need to modify the line item data?<!--more--><\/p>\n<p>Becasue I was tired (or rather lazy) to google for any other possible user exit which would allow me to modify item data in RFQ, I made a little <em>&#8220;hack&#8221;<\/em> in the user exit mentioned above (EXIT_SAPMM06E_012).<\/p>\n<pre lang=\"abap\">FIELD-SYMBOLS  TYPE mmpur_bekpo.\r\n* We have to modify data in the outside program SAPMM06E\r\n* because this user exit does not allow to modify EKPO data\r\n  ASSIGN ('(SAPMM06E)POT[]') TO &lt;lt_bekpo&gt;.\r\n  \r\n* Set custom description for configurable materials\r\n* (cuobj IS NOT INITIAL)\r\n  IF sy-subrc = 0.\r\n    LOOP AT &lt;lt_bekpo&gt; ASSIGNING FIELD-SYMBOL(&lt;ls_bekpo&gt;)\r\n      WHERE cuobj IS NOT INITIAL.\r\n\r\n      &lt;ls_bekpo&gt;-txz01 = |{ &lt;ls_bekpo&gt;-txz01 } (CONFIGURABLE)|.\r\n    ENDLOOP.\r\n  ENDIF.\r\n<\/pre>\n<p>The core of the &#8220;magic&#8221; is hidden in the line where I&#8217;m accessing a variable from an outside program:<\/p>\n<pre lang=\"abap\"> ASSIGN ('(SAPMM06E)POT[]') TO &lt;lt_bekpo&gt;.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a user exit\u00a0EXIT_SAPMM06E_012 (include\u00a0ZXM06U43) you can use to perform various user checks before an RFQ is saved in Tx ME41\/ME42. But what if you need to modify the line item data?<\/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 - Modify RFQ item data during SAVE","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,233,9,402],"tags":[497,495,496,498],"class_list":["post-1585","post","type-post","status-publish","format-standard","hentry","category-abap","category-customizing","category-development","category-materials-management","tag-exit_sapmm06e_012","tag-me41","tag-me42","tag-zxm06u43"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-pz","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1585","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=1585"}],"version-history":[{"count":1,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1585\/revisions"}],"predecessor-version":[{"id":1586,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1585\/revisions\/1586"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}