使用ABAP代码给SAP IPM Contract的行项目分配IP product

in 网站建设
关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9
\*&---------------------------------------------------------------------\*

\*& Report ZHANA\_PRODUCT\_SEARCH

\*&

\*&---------------------------------------------------------------------\*

\*&

\*&

\*&---------------------------------------------------------------------\*

  

REPORT zassign\_ip.

  

PARAMETERS: prod type comm\_product-product\_id OBLIGATORY DEFAULT '5600000010',

order TYPE CRMD\_ORDERADM\_H-object\_id.

  

DATA: lo\_core TYPE REF TO cl\_crm\_bol\_core,

lo\_collection TYPE REF TO if\_bol\_entity\_col,

lv\_query\_name TYPE crmt\_ext\_obj\_name,

lt\_selection\_parameter TYPE genilt\_selection\_parameter\_tab,

ls\_selection\_parameter TYPE genilt\_selection\_parameter,

ls\_query\_parameters TYPE genilt\_query\_parameters.

  

ls\_selection\_parameter-attr\_name = 'OBJECTID'.

ls\_selection\_parameter-option = 'EQ'.

ls\_selection\_parameter-sign = 'I'.

ls\_selection\_parameter-low = order.

APPEND ls\_selection\_parameter TO lt\_selection\_parameter.

  

ls\_query\_parameters-max\_hits = 1.

lv\_query\_name = 'BTAdvQueryAUI'.

  

lo\_core = cl\_crm\_bol\_core=>get\_instance( ).

lo\_core->load\_component\_set( 'BT' ).

  

lo\_collection = lo\_core->dquery(

iv\_query\_name = lv\_query\_name

it\_selection\_parameters = lt\_selection\_parameter

is\_query\_parameters = ls\_query\_parameters ).

  

  

DATA(lo\_contract) = lo\_collection->get\_current( ).

CHECK lo\_contract IS NOT INITIAL.

DATA(locked) = lo\_contract->lock( ).

  

CHECK locked = 'X'.

  

DATA(lr\_item\_handler) = cl\_crm\_ipm\_item\_handler\_provid=>get\_instance( lo\_contract ).

ASSERT lr\_item\_handler IS NOT INITIAL.

  

  

lv\_query\_name = 'ProdAdvSearchRgProducts'.

CLEAR: lt\_selection\_parameter.

ls\_selection\_parameter-attr\_name = 'PRODUCT\_ID'.

ls\_selection\_parameter-option = 'EQ'.

ls\_selection\_parameter-sign = 'I'.

ls\_selection\_parameter-low = prod.

APPEND ls\_selection\_parameter TO lt\_selection\_parameter.

lo\_core->load\_component\_set( 'PROD\_ALL' ).

  

lo\_collection = lo\_core->dquery(

iv\_query\_name = lv\_query\_name

it\_selection\_parameters = lt\_selection\_parameter

is\_query\_parameters = ls\_query\_parameters ).

  

  

DATA(lo\_product) = lo\_collection->get\_current( ).

ASSERT lo\_product IS NOT INITIAL.

DATA(result) = lr\_item\_handler->create\_ip( lo\_product ).

ASSERT result IS NOT INITIAL.

  

DATA(lo\_transaction) = lo\_core->get\_transaction( ).

  

lo\_core->modify( ).

DATA(lv\_changed) = lo\_transaction->check\_save\_needed( ).

  

CHECK lv\_changed EQ abap\_true.

DATA(lv\_success) = lo\_transaction->save( ).

IF lv\_success = abap\_true.

lo\_transaction->commit( ).

WRITE:/ 'IP Assigned Successfully'.

ELSE.

lo\_transaction->rollback( ).

WRITE: / 'IP Assigned failed'.

ENDIF.
关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9
扫一扫关注公众号添加购物返利助手,领红包
Comments are closed.

推荐使用阿里云服务器

超多优惠券

服务器最低一折,一年不到100!

朕已阅去看看