{"id":1446,"date":"2015-11-09T14:07:09","date_gmt":"2015-11-09T13:07:09","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=1446"},"modified":"2015-11-09T14:12:05","modified_gmt":"2015-11-09T13:12:05","slug":"sap-srm-get-current-status-of-a-shopping-cart","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=1446","title":{"rendered":"SAP SRM &#8211; Get current status of a Shopping Cart"},"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\" \/>There is a general function module (BBP_PD_SC_GETDETAIL) to get overall summary of a shopping cart which also provides a list of statuses assigned to the shopping cart. But this list tells you nothing about which status is the actual one. And how to find out the correct one?<!--more--><\/p>\n<p>Use function module BBP_PD_SC_GETDETAIL to get the list of actual statuses for your shopping cart:<\/p>\n<pre lang=\"abap\">  DATA:\r\n    lv_sc_number   TYPE crmt_object_id_db,\r\n    ls_header      TYPE bbp_pds_sc_header_d,\r\n    lt_items       TYPE bbpt_pd_sc_item_d,\r\n    lt_statuses    type BBPT_PD_STATUS,\r\n    lt_messages    TYPE bbpt_pd_messages.\r\n\r\n  CHECK lv_sc_number IS NOT INITIAL.\r\n\r\n  CALL FUNCTION 'BBP_PD_SC_GETDETAIL'\r\n    EXPORTING\r\n      i_object_id = lv_sc_number\r\n    IMPORTING\r\n      e_header    = ls_header\r\n    TABLES\r\n      e_item      = lt_items\r\n      e_messages  = lt_messages\r\n      e_status    = lt_statuses.<\/pre>\n<p><em>Note:<\/em> You can get the same list of statuses by selecting data from <strong>CRM_JEST<\/strong> table for your <em>ls_header-guid <\/em>(textual description of all the status IDs is available in table <strong>TJ02T<\/strong>)<\/p>\n<p>Now use the GUID of the shopping cart (<em>ls_header-guid<\/em>) and the list of statuses (<em>lt_statuses<\/em>) in the function module BBP_DOC_STATUS_GET for business object BUS2121 (shopping cart) &#8230; using different BUS you can get this information also for different business objects (inquiry, requisition, &#8230;):<\/p>\n<pre lang=\"abap\">  CALL FUNCTION 'BBP_DOC_STATUS_GET'\r\n    EXPORTING\r\n      IV_OBJTYPE                        = 'BUS2121'\r\n      IV_GUID                           = ls_header-guid\r\n    IMPORTING\r\n      EV_STATUS                         = lv_status\r\n      EV_STATUS_DESCRIPTION             = lv_status_description\r\n    TABLES\r\n      IT_STATUS                         = lt_statuses.<\/pre>\n<p>The result (status ID) you are looking for is stored in <em>lv_status<\/em>. It&#8217;s description can be found in <em>lv_status_description<\/em>.<\/p>\n<p><em>Note: <\/em>If a shopping cart approver rejects the shopping cart, it remains in I1015 &#8220;Awaiting Approval&#8221; status, because after approver&#8217;s rejection the shopping cart returns back to the requisitioner where it waits in his inbox until he either<\/p>\n<ul>\n<li>corrects the shopping cart and sends it for approval again<\/li>\n<li>confirms the rejection (only in this case the SC gets into status <strong>I1016<\/strong> &#8211; &#8220;Release rejected&#8221;)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There is a general function module (BBP_PD_SC_GETDETAIL) to get overall summary of a shopping cart which also provides a list of statuses assigned to the shopping cart. But this list tells you nothing about which status is the actual one. &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=1446\">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_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":"SAP SRM - Get current status of a Shopping Cart","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,9,437],"tags":[442,443,440,441,439,438],"class_list":["post-1446","post","type-post","status-publish","format-standard","hentry","category-abap","category-development","category-srm","tag-bbp_doc_status_get","tag-bbp_pd_sc_getdetail","tag-i1015","tag-i1016","tag-rejection","tag-srm"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-nk","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1446","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=1446"}],"version-history":[{"count":6,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions"}],"predecessor-version":[{"id":1452,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/1446\/revisions\/1452"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}