主页 > CDN > > 正文

香港服务器_mysql数据库安装步骤_免费领

浏览:

香港服务器_mysql数据库安装步骤_免费领

Below code logic is used to get the actual back-end documents line item status for SRM shopping carts.

In POWL, If you look at the header status of the shopping cart,most of them will be in "Approved" status and corresponding line item status will be "Follow-on Document Created". If we want to get the actual status of the individual line items, then we need to open the shopping cart and check for actual status.

In most of the clients, you might be asked to develop a report or enhance BW reports to show this actual status like (Purchase Requisition Created, Purchase Order created, GR completed, Partial GR, Partial Invoice , Invoice completed).

In order to meet such requirement, I have developed this logic by copying standard code.

This logic can be put into a function module and can be re-used.

REPORT ysasi1.

DATA: lv_object_key         TYPE bbps_object_key,

lv_val_cf_e           TYPE bbp_iv_value_e,

i_sc_item             TYPE TABLE OF bbp_pds_sc_item_d,

w_sc_item             TYPE bbp_pds_sc_item_d,

i_sc_status           TYPE TABLE OF bbp_pds_status,

w_sc_status           TYPE bbp_pds_status,

ls_item               TYPE bbp_pds_sc_item_d,

lt_item_pd            TYPE TABLE OF bbp_pds_item,

ls_item_pd            TYPE bbp_pds_item,

w_item_pd             TYPE bbp_pds_item,

lt_messages           TYPE bbpt_pds_messages,

es_status_description TYPE /sapsrm/s_status_info_desc,

lt_item_history       TYPE TABLE OF bbp_pds_history,

ls_item_history       TYPE bbp_pds_history,

ls_item_history1      TYPE LINE OF /sapsrm/t_history,

is_status             TYPE /sapsrm/s_status_info,

lv_once               TYPE abap_bool,

w_read_i_flags        TYPE bbps_detail_i_requested.

CONSTANTS: lc_objtype_storage TYPE crmd_orderadm_h-object_type VALUE ‘storage’,

lc_x               TYPE c                           VALUE ‘X’,

lc_bus2121001      TYPE swo_objtyp                  VALUE ‘BUS2121001’,

lc_bus2121         TYPE swo_objtyp                  VALUE ‘BUS2121’.

FIELD-SYMBOLS:       LIKE LINE OF lt_item_history.

PARAMETERS: p_sc TYPE crmd_orderadm_h-object_id DEFAULT ‘1001981426’ OBLIGATORY.

CALL FUNCTION ‘BBP_PD_SC_GETDETAIL’

EXPORTING

*   I_GUID      = p_pguid

i_object_id = p_sc

TABLES

e_item      = i_sc_item

e_status    = i_sc_status.

* set flag to read ITEM & Message tab.

w_read_i_flags-item_tab     = lc_x.

w_read_i_flags-messages_tab = lc_x.

LOOP AT i_sc_item INTO w_sc_item.

READ TABLE i_sc_status TRANSPORTING NO FIELDS

WITH KEY p_guid = w_sc_item-guid

inact  = space.

IF sy-subrc = 0.

CALL FUNCTION ‘BBP_PROCDOC_ITEM_GETDETAIL’

EXPORTING

i_guid         = w_sc_item-guid

i_object_type  = lc_bus2121001

i_read_i_flags = w_read_i_flags

TABLES

e_item         = lt_item_pd

e_messages     = lt_messages.

lv_object_key-h_object_type     =  lc_bus2121.

lv_object_key-h_guid            =  w_sc_item-parent.

lv_object_key-i_object_type     =  lc_bus2121001.

lv_object_key-i_guid            =  w_sc_item-guid.

CALL FUNCTION ‘BBP_PD_GETHISTORY’

EXPORTING

i_object_key                  = lv_object_key

TABLES

et_history                    = lt_item_history

EXCEPTIONS

incomplete_object_information = 1

OTHERS                        = 2.

***********************************************************************************************************

*   Looping to get the PO quantity for checking against Confirmation & Invoice.

LOOP AT lt_item_history INTO ls_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_po

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_po_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_po

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_po_item.

ls_item-quantity   =  ls_item_history-quantity.

ls_item-price      =  ls_item_history-value.

ENDLOOP.

*   Checking if the follow on documents that were created went into ‘ERROR IN PROCESS’ status.

LOOP AT lt_item_history INTO ls_item_history WHERE status = ‘I1019’.

ENDLOOP.

IF sy-subrc = 0.

es_status_description-status_description = text-058.

ENDIF.

READ TABLE lt_item_pd INTO ls_item_pd INDEX 1.

*   Checking if the Purchase Order created was Incomplete

IF es_status_description-status_description IS INITIAL.

LOOP AT lt_item_history INTO ls_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_po

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_po_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_po

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_po_item.

ENDLOOP.

IF sy-subrc = 0.

IF ls_item_history-status = ‘I1009’.

es_status_description-status_description = text-061.

ENDIF.

ENDIF.

ENDIF.

*************************************************************************************************************

*  The below logic for checking partial or complete Confirmation & Invoice has been taken from SRM 5.0 system

*  FM – BBP_PDH_SEARCH_SC_SUBLIST

*  SUBROUTINE – sc_item_history_status_get TABLES

*  New text elements 058,059,060 were added.

*************************************************************************************************************

*   Checking whether Invoice is Complete or Partial.

IF es_status_description-status_description IS INITIAL.

CLEAR ls_item-quan_iv_e.

CLEAR ls_item-val_iv_e.

LOOP AT lt_item_history INTO ls_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo_item.

"status should be either ‘Transfer in Process’ or ‘Approved’ or ‘Posted in backend’

IF ls_item_history-status EQ ‘I1017’ OR ls_item_history-status EQ ‘I1022’  OR ls_item_history-status EQ ‘I1018’ .

IF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_iv.

ls_item-quan_iv_e  = ls_item-quan_iv_e + ls_item_history-quantity.

ls_item-val_iv_e   = ls_item-val_iv_e  + ls_item_history-value.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_cm.

ls_item-quan_iv_e  = ls_item-quan_iv_e – abs( ls_item_history-quantity ).

ls_item-val_iv_e   = ls_item-val_iv_e  – abs( ls_item_history-value ).

ELSE.

IF ls_item_history-dcind EQ ‘H’.

ls_item-quan_iv_e  = ls_item-quan_iv_e – abs( ls_item_history-quantity ).

ls_item-val_iv_e   = ls_item-val_iv_e  – abs( ls_item_history-value ).

ELSE.

ls_item-quan_iv_e  = ls_item-quan_iv_e + ls_item_history-quantity.

ls_item-val_iv_e   = ls_item-val_iv_e  + ls_item_history-value.

ENDIF.

ENDIF.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_iv.

ls_item-quan_iv_e  = ls_item-quan_iv_e + ls_item_history-quantity.

ls_item-val_iv_e   = ls_item-val_iv_e  + ls_item_history-value.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_cm.

ls_item-quan_iv_e  = ls_item-quan_iv_e – abs( ls_item_history-quantity ).

ls_item-val_iv_e   = ls_item-val_iv_e  – abs( ls_item_history-value ).

ENDIF.

ENDLOOP.

IF sy-subrc = 0.

IF ls_item_pd-itm_type EQ /sapsrm/if_pdo_constants_gen_c=>gc_ptype_limit.

IF ls_item-val_iv_e = 0.

"invoices were cancelled with credit memo. So, discard invoice/credit memos from history

DELETE lt_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo_item.

ELSEIF ls_item_pd-final_inv EQ abap_true OR ( ls_item-val_iv_e GE ls_item-price ).

es_status_description-status_description = text-065.

ELSE.

es_status_description-status_description = text-060.

ENDIF.

ELSE.

IF ls_item-quan_iv_e LT ls_item-quantity AND

ls_item-quan_iv_e NE 0.

es_status_description-status_description = text-060.

ELSEIF ls_item-quan_iv_e GE ls_item-quantity.

es_status_description-status_description = text-065.

ELSEIF ls_item-quan_iv_e = 0 AND ls_item-val_iv_e = 0 AND ls_item-quantity > 0.

"invoices were cancelled with credit memo. So, discard invoice/credit memos from history

DELETE lt_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo_item.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

*   Checking whether Confirmation is Complete or Partial.

IF es_status_description-status_description IS INITIAL.

CLEAR ls_item-quan_cf_e.

CLEAR lv_val_cf_e.

LOOP AT lt_item_history INTO ls_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr_item.

"status should be either ‘Approved’ or ‘Posted in backend’

IF ls_item_history-status EQ ‘I1017’ OR ls_item_history-status EQ ‘I1022’ OR ls_item_history-status EQ ‘I1018’ .

IF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_cf.

ls_item-quan_cf_e  = ls_item-quan_cf_e + ls_item_history-quantity.

lv_val_cf_e        = lv_val_cf_e       + ls_item_history-value.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_ca OR

ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_rt.

ls_item-quan_cf_e  = ls_item-quan_cf_e – abs( ls_item_history-quantity ).

lv_val_cf_e        = lv_val_cf_e       – abs( ls_item_history-value ).

ELSE.

IF ls_item_history-dcind EQ ‘H’.

ls_item-quan_cf_e  = ls_item-quan_cf_e – abs( ls_item_history-quantity ).

lv_val_cf_e        = lv_val_cf_e       – abs( ls_item_history-value ).

ELSE.

ls_item-quan_cf_e  = ls_item-quan_cf_e + ls_item_history-quantity.

lv_val_cf_e        = lv_val_cf_e       + ls_item_history-value.

ENDIF.

ENDIF.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_cf.

IF lv_once EQ abap_false.

LOOP AT lt_item_history INTO ls_item_history1 WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_se.

IF ls_item_history1-dcind EQ ‘S’.

ls_item-quan_cf_e  = ls_item-quan_cf_e + ls_item_history1-quantity.

lv_val_cf_e        = lv_val_cf_e       + ls_item_history1-value.

ELSE.

ls_item-quan_cf_e  = ls_item-quan_cf_e – abs( ls_item_history1-quantity ).

lv_val_cf_e        = lv_val_cf_e       – abs( ls_item_history1-value ).

ENDIF.

ENDLOOP.

IF sy-subrc NE 0.

ls_item-quan_cf_e  = ls_item-quan_cf_e + ls_item_history-quantity.

lv_val_cf_e        = lv_val_cf_e       + ls_item_history-value.

ENDIF.

lv_once = abap_true.

ENDIF.

ELSEIF ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_ca OR

ls_item_history-subtype EQ /sapsrm/if_pdo_obj_types_c=>gc_subtype_rt.

ls_item-quan_cf_e  = ls_item-quan_cf_e – abs( ls_item_history-quantity ).

lv_val_cf_e        = lv_val_cf_e       – abs( ls_item_history-value ).

ENDIF.

ENDLOOP.

IF sy-subrc = 0.

IF ls_item_pd-itm_type EQ /sapsrm/if_pdo_constants_gen_c=>gc_ptype_limit.

IF lv_val_cf_e = 0.

"goods receives were cancelled. So, discard confirmations/cancellations from history

DELETE lt_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr_item.

ELSEIF ls_item_pd-final_entry EQ abap_true OR ( lv_val_cf_e GE ls_item-price ).

es_status_description-status_description = text-064.

ELSE.

es_status_description-status_description = text-059.

ENDIF.

ELSE.

IF ls_item-quan_cf_e LT ls_item-quantity AND

ls_item-quan_cf_e NE 0.

es_status_description-status_description = text-059.

ELSEIF ls_item-quan_cf_e GE ls_item-quantity.

es_status_description-status_description = text-064.

ELSEIF ls_item-quan_cf_e = 0 AND lv_val_cf_e = 0 AND ls_item-quantity > 0.

"goods receives were cancelled. So, discard confirmations/cancellations from history

DELETE lt_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse_item

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr

OR objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr_item.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

**************************************************************************************************************

*   If there was no Partial Confirmation or Invoice Created then Check for the other possible documents.

*   This includes even the complete Confirmation and Complete Invoice.

IF es_status_description-status_description IS INITIAL.

SORT lt_item_history BY display_level DESCENDING.

READ TABLE lt_item_history INDEX 1 ASSIGNING .

IF IS ASSIGNED.

MOVE-CORRESPONDING is_status TO es_status_description.

es_status_description-langu = sy-langu.

CASE -objtype.

* purchase requisition

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_pr

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_pr_item.

es_status_description-status_description = text-051.

* reservation

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_rs

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_rs_item.

es_status_description-status_description = text-050.

* Confirmation

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_grse_item

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_gr_item.

es_status_description-status_description = text-053.

* Invoice

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_invoice_item

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_iv_lo_item  .

es_status_description-status_description = text-054.

* Bid Invitation

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_biddingdoc

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_biddoc_item

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_quot_item

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_quotation  .

es_status_description-status_description = text-055.

* Auction

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_auction

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_auction_item.

es_status_description-status_description = text-056.

* Contract

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_contract

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_contract_item

OR /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_ctr_item.

es_status_description-status_description = text-057.

* when a limit item is included along with the service, RFx is created

* for the service but the limit item status should be blank.

* Here, bus type will be always BUS2121001.

WHEN ‘BUS2121001’.

CLEAR es_status_description-status_description.

* Withdrawal

WHEN lc_objtype_storage.

es_status_description-status_description = text-062.

*  hopefully the rest are purchase orders

WHEN OTHERS.

CLEAR ls_item_history.

es_status_description-status_description = text-052.

* we need to check if any purchase order is in deleted state out of the list of backend POs, if so set the status to purchase order deleted

LOOP AT lt_item_history INTO ls_item_history WHERE objtype = /sapsrm/if_pdo_obj_types_c=>gc_pdo_be_po

AND   status EQ ‘I1040’.

es_status_description-status_description = text-066.

EXIT.

ENDLOOP.

ENDCASE.

ENDIF.

ENDIF.

WRITE: /’Status:’, es_status_description-status_description.

CLEAR: es_status_description.

ELSE.

WRITE: /’Item Status other than I1113′.

ENDIF.

ENDLOOP.

Hi Sasikant,

We have a similar requirement as you had posted in one of the discussions.

We need to enable the Add button for Contract for the limit SC for the Product Cat in ECS scenario.

Can you please help me out , how you achieved it?

It would be of great help if there is any document of any sort.

Please mail it to me @ johny.g9@gmail.com.

Thanks

Johnson George

Dear Sasikant,

nice coding there. Can you provide Information about the text elements you used ? I guess u made up some Z-messageclass or something ?

Best regards

Andy

Hi Andy, This code is copy from standard method /SAPSRM/IF_PDO_DO_STATUS~GET_STATUS_TEXT. Please refer this class method for text elements. Regards, Sasi

Hi Sasikant,

thanks for your reply, i found it by myself but forgot to update the Information here.

Anyway, your post was very very helpful. Thanks again.

,爱回扣返现网,im即时通讯云,云购,个人大数据,淘客app开发
发表评论
验证码: 点击我更换图片

注:网友评论仅供其表达个人看法,并不代表本站立场。

热门文章

  • 谷歌云_mysql中间件_免费领
    谷歌云_mysql中间件_免费领

    谷歌云_mysql中间件_免费领

    现在工作场所正在发生重大变化。我们协作、计划项目和管理工作量的方式正在改变,如果企业没有做好准备,它们将很快被抛在后面。准确地理解是什么...

  • 域名交易_阿里云翼_企业级
    域名交易_阿里云翼_企业级

    域名交易_阿里云翼_企业级

    通常认为搅动器是一个漏水的桶。你有多少顾客?你损失了多少?你留了多少钱,漏了多少钱?让我们把顾客流失看作是导致医生就诊的原因,比如偏头痛...

  • 金山云_华为云台_怎么申请
    <strong>金山云_华为云台_怎么申请</strong>

    金山云_华为云台_怎么申请

    在我们发布通知(以前是Engage)后的四个月里,我们在后端做了大量的改进。大多数更新在UI中不可见。相反,我们的客户可能已经注意到他们发送的电子...

  • 云主机_深圳企业网站设计_评分榜
    <strong>云主机_深圳企业网站设计_评分榜</strong>

    云主机_深圳企业网站设计_评分榜

    更新:有本文的更新版本。阅读"RPA如何转换数据迁移"(2019年出版)。 在本文中,数据迁移被定义为将数据从旧的遗留系统移动到新的替换系统。通常,...

  • 域名备案_已备案未注册的域名_最新活动
    <strong>域名备案_已备案未注册的域名_最新活动</strong>

    域名备案_已备案未注册的域名_最新活动

    今天是Skype推出十年来的日子,Skype是一款免费的互联网通话应用,用户已超过3亿。Skype是一家来自爱沙尼亚的初创公司,来自点对点文件共享应用Kazaa的开...

云储存

更多 >
  • <strong>京东云_最新电影百度云_返利</strong>
    京东云_最新电影百度云_返利

    在之前的第1部分博客中,我描述了不同的过滤属性,这些属性目前可用于 (需要SAP Service Marketplace登录) 中新启动的云KPI目录https://go.support.sap.com/kpicata...

  • 香港带宽_百度云免费会员_评分榜
    香港带宽_百度云免费会员_评分榜

    亲爱的合作伙伴, 我们想邀请您参加即将推出的SAP enablement产品"S/4HANA DB Migration to HANA",请使用右侧的注册按钮立即预订您的座位! 在这里注册6月22日上午...

云储存对象存储_数据库连接类_价格
云储存服务器_好用的服务器_优惠券
云储存对象存储_西部数码虚拟主机_学生机
云储存香港带宽_六盘水网站建设_测评
云储存服务器_H漫画百度云_稳定性好