Quantcast
Channel: SCN : Discussion List - Supplier Relationship Management (SAP SRM)
Viewing all 3184 articles
Browse latest View live

SRM & Portal Independent Navigation vs. NWBC (HTML and Desktop)

$
0
0

Hi,

 

I hope that someone here on the forums with some experience in using SRM with NWBC can answer this question. All of the SRM implementations I have been involved with to date have used the NetWeaver Portal and the supplied SRM Business Packages. Now I have the scenario where we are evaluating the possibility to only use the NWBC for Desktop (no portal) and I would like to understand the options available.

 

As I understand it based on the documentation you can run the SRM with the Portal-Independent Navigation frame. In that documentation it states

 

NetWeaver Business Client for Desktop


To run SAP SRM applications in the Portal-independent navigation frame, you can only use the NetWeaver Business Client for HTML, not the NetWeaver Business Client for Desktop.

 

We would rather use the NWBC for Desktop (as we plan to roll out all other content this way), but the statement above rules that out - but I don't understand why. Does anyone have any experience with this scenario? Can anyone explain why it must use NWBC for HTML and not NWBC for Desktop (my general understanding is that NWBC for HTML is less feature rich than NWBC for Desktop - but in this case it seems the opposite is true). I could understand if it was just addressing an external facing scenario (e.g. you need a zero footprint option) - but what about internal e.g. Shopping Cart?

 

I am interested to hear your thoughts and experiences.

Thanks,

Simon


UNCAUGHT_EXCEPTION the object was deleted already PO

$
0
0

Hi Experts,

 

When we try to edit a PO in portal, we get the below exception. Even when we click on 'refresh' we encounter the same error.

 

Any idea on what could be the issue?

 

=====================================================

UNCAUGHT_EXCEPTION

The object was deleted already

Method: IF_OS_STATE~HANDLE_EXCEPTION of program /SAPSRM/CL_WF_PROCESS_LEVEL===CP

Method: GET_MV_LEVEL_GUID of program /SAPSRM/CL_WF_PROCESS_LEVEL===CP

Method: GETOID of program /SAPSRM/CL_WF_PROCESS_LEVEL===CP

Method: CREATE_PROCESS_FORECAST of program /SAPSRM/CL_WF_APV_FACADE======CP

Method: RETRIEVE_PROCESS_INFO_60_RES of program /SAPSRM/CL_WF_APV_FACADE======CP

Method: RETRIEVE_COMP_PROCESS_DATA of program /SAPSRM/CL_WF_APV_FACADE======CP

Method: GET_PROCESS_INFO of program /SAPSRM/CL_WF_APV_FACADE======CP

Method: /SAPSRM/IF_PDO_DO_APV_EXT~INITIALIZE of program /SAPSRM/CL_PDO_DO_APV_EXT=====CP

Method: KEEP_PROCESS_INFO_FRESH of program /SAPSRM/CL_PDO_DO_APV_EXT=====CP

Method: /SAPSRM/IF_PDO_DO_APV_EXT~GET_PROCESS_INFO_REF of program /SAPSRM/CL_PDO_DO_APV_EXT=====CP

 

Regards,

Pavithra Kumar

BBPGETVD - All backend descriptions are already assigned in the system.

$
0
0

Friends,

 

I would ask for your help. When replicating the suppliers by BBPGETVD am getting the following error: "All backend descriptions are already assigned in the system."

 

The number range settings are:

 

SRM

SAP Implementation Guide -> Cross-Application Components -> SAP Business Partner -> Business Partner -> Basic Settings -> Number Ranges and Groupings -> Prints: "Define Number Ranges - SRM" and "Define Groupings and Assign Number Ranges - SRM ";

 

ECC

OMSJ -> Intervals

OMSJ -> Number range

Prints: "OMSJ Intervals - ECC".

 

Replicate a large number of suppliers to the base of SRM (BUT000), but there are some suppliers that are the basis of ECC (LFA1) and that are not in SRM, confirmed some suppliers and could confirm this.

 

Arrived to do something, how do I proceed?

 

Best regards.

SRM UI Add on

$
0
0

Hi Gurus,

 

1. If a client have not setup internal MDM Catalogs or external punch-out catalogs and not done any configuration related to Catalogs in SRM,can we still use SRM UI Add on Component only for Material Masters ( Say creation of SC carts in SRM using Product Masters) using the new SRM UI Add on.

2. If answer to 1. above is yes,then what all setting must be done to setup SRM UI add on and make it working.

Reg. SRM UI 5 Add on: How to create SC with Internal Goods/Services

$
0
0

Hi SRM Gurus,

 

Need your inputs on implementing SAP SRM UI Add on our existing SRM 7.01 system for direct procurement to support Inventory Purchasing process using SRM classic scenario and how to create Shopping Carts from internal goods and services in SRM UI5.We don't use/have any external or internal catalogs and we will use SRM for internal goods/services, services,limit/Blanket POs and free text, But how to create a SC with internal goods and services, can you assist with reference to the SRM UI5 screens that will be of great help.

 

We are currently on below landscape

SAP NW 7.02 SP15

SAP SRM 7.1 SP12

SAP PORTAL 7.02 SP15

SAP UI5 1.0 SP 07

Gateway GW_Core 2.0 SP08

 

Thanks

Ankur

Error during mapping product

$
0
0
WeSRM7.02 andECC6.5.

We have aproblem whenwe transfera requisitionofECCtoSRM.

IntheSMQ1transactionECCerroris observed.InSRMintheerroSLG1transactionoccurs:
Error duringmappingproduct
No.message:BBP_BD002

The errorseems verystrange, becauseall objectsrunning ontheR3AStransaction,MATERIALSandSERVICES,were transferredcorrectame.

The configuration ofPlanDrivenProcurementforpurchaserequisitionwas madebyT_160PRandT_160EXtables in ECC. Communication channel in SRM.

Please help

PRODUCT_CUSTOMER2

$
0
0

Hello Experts, we are having issues in the implementation of BADI PRODUCT_CUSTOMER2 to download custom fields from material maste on ECC to SRM.

 

Basically the BADI has been correctly implemented and i can see the BDoc correctly filled up in SRM, but it remains in status waiting and i got a dump of standard program SAPLCOM_PRD_SET_REG:

   36     ENDLOOP.

   37     IF SY-SUBRC IS INITIAL.

   38 */    Mixed entries (some w/ KeyGUID specified; some w/O) -> must not occur

>>>>>       MESSAGE X000(COM_PRD_LH_LINKS).

   40     ELSE.

   41       EV_READ_GENERIC = CL_COM_PRD_LH_CO=>SC_TRUE.

   42     ENDIF.

 

I know this is a pretty known issue, therfore can you help us out?

 

Thanks in advance!

Products associated with Product Category

$
0
0

Hi Sap Gurus,

 

In ECC we have table MARA to find the Material and Material group for those Materials. Likewise where can we find the Products associated with Product category in SAP SRM.

 

We have tables  COMM_PRODUCT & COMM_CATEGORY, but how can i find the products under particular product category.

 

Thanks in advance


HR Org Structure

$
0
0

Hi Sap Gurus,

 

Can somebody tell me the procedure or provide me the document on  how the User assigned to HR org structure in ECC will be replicated to SRM..

 

I heard of some T-Codes and Program , PFAL, HRP1001... but i'm not sure about the functionality and how the Process happens...

 

As per my knowledge....

 

* Security will create a New user and handover to SAP HR team

* SAP HR team will assign the User to Org Structure in ECC

* From SAP SRM we use the T-Code PFAL to get the user assignment data into SRM Org Strucuture..

 

Correct me if I'm wrong..

 

In this process I'm not sure of Idoc's we have to use and the what values we need to enter in PFAL screen??

 

Thanks in advance

Transfer attachments in PR from ECC to SRM

$
0
0

Hello Everybody,

 

We have a requirement in our project as below,

 

Plan Driven Procurement with Extended classic scenario... PR is created with attachment and transferred to SRM.

 

My question is,

 

How to transfer the attachment in PR to SRM ??

 

 

How to transfer SRM PO attachment(PO created in SRM) to ECC PO.

 

Kindly let me know what needs to be done...

 

Regards,

Kiran

Enhance the FM "BBP_PD_SC_TRANSFER"

$
0
0

Hi All,

I am trying to enhance the FM " BBP_PD_SC_TRANSFER" but for each object inside this FM  I am getting message 'function group BBP_PD_SC'

can not be enhanced. Is there any object where I can put my custom code in SRMafter PO is getting created in ECC and PO# is passed to SRM.

 

 

Regards,

Sachin

Spend Limit for Ve

$
0
0

Hello Friends,

 

Is there’s any way for Procurement to set a spend limit against a vendor per

year in SRM, but not through the creation of contracts? So once the spend limit

is reached no further orders can be placed against the vendor?

 

 

Img.png

 

Also, any thoughts on what the ‘Budget’ link below checks

 

 

Thanks,

San

ITS Portal link from SAP-SRM

$
0
0

Hello friends,

 

I have heared taht there is a T-code in SRM,by using that you can find concern SRM-ITS portal link...

 

 

Can anyone of you share that information...

 

 

Thanks,

San

Tax amount for Central Contracts in SRM

$
0
0

Hi,

 

Please, for Central Contracts the Tax Amount calculation regarding tax code is displayed in SRM?

 

The field "Tax Amount" (ICC_BR_TAXAMT) is specific for localization Brazil.

 

Thanks.

 

Keila

is it possible to use MDM Catalogue without portal and with NWBC ?

$
0
0

Hi All,

 

As per information available in www.service.sap.com, SRM 7.0 with EHP1(enhance package 1) can be implemented without Enterprise Portal. Portal-Independent navigation frame(NWBC) can be used in place of EP.  I have following doubt regarding SRM MDM catalogue without portal :

 

1. Can we use SRM MDM catalogue without Portal and with Portal-independent navigation frame (NWBC) ?

2. If yes, where  the MDM catalogue UI will be placed ?

3. Is it possible to call MDM UI in Portal-Independent navigation frame(NWBC) ?

 

Thanks,

Regards,

Jennifer

 

Edited by: Jennifer Batty on Jul 29, 2011 8:15 AM

 

Edited by: Jennifer Batty on Jul 29, 2011 8:16 AM

 

Edited by: Jennifer Batty on Jul 29, 2011 10:13 AM


Zero price PO items in ECS

$
0
0

Hi guys,

 

Since we did a SP upgrade from 7.01 SP10 to SP11 we have troubles with our Change BAdI implementation, which we used to enable zero price PO for some catalog articles. In case an article has a zero price and comes from a catalog, we used to delete the IR_IND and GR_BASEDIV flags in the PO change BAdI when in creation mode, the PO was created and approved automatically and transferred directly to ERP. This logic worked fine until the upgrade to SP11, now the flags based on the vendor data are set after the change BAdI, so there is no way to change the flags before. The PO is in status saved because of the zero price and the corresponding IR/GR flags error.

I know there is an OSS note which describes this issue. Apparently it’s only possible to change these flags if no vendor is assigned to the item. I also searched here for some ideas on how to get this working again. But none of the threads gave helpful answers.

 

Is there any way to accomplish the old behavior again? I already tested some things in the check and save BAdI but nothing worked so far. Maybe one of you has a good idea

 

Thanks for your help!

Best regards

Martin

Shopping Cart Sourcing Relevant Indicator Updating Incorrectly

$
0
0

Requirements (shopping carts) sourcing relevant indicator is not updating correctly. The requirement has already been sourced but has a sourcing relevant indicator of X (sourcing relevant) but it should be Y (sourcing complete) or space (not sourcing relevant). Is there a note to correct this issue?

Allow/disallow the requester to modify

$
0
0

Hi all,

 

I want set the EDIT FPM button visible for BUS2121...

 

Visualizar vista Config.metadatos.jpg

 

I understand I have to add an implementation in view /SAPSRM/V_MDA_HC according to the comments in EDIT_DURING_WORKFLOW method...

 

How can I do that?

I can't see any enhancement point...

 

Regards,

Karina

Enable Edit button in FPM_OIF_COMPONENT

$
0
0

Hi all,

 

I'm new in SRM and I need some guidance.

 

I have the requirement to enable button edit in the next screen:

 

1.png

This is the technical help:

 

2.jpg

 

They want this:

 

3.jpg

Is the same component, but I don't know where could I change that. What should I do?

 

Thanks in advance, best regards!

Problem using PDO-Classes

$
0
0

Hi all,

 

I'm trying to learn how to use PDO classes. In this case I'm tryint to create a CTR from a SC.

But I always get the same errors:

 

Enter at least one item

 

Enter exactly one partner of type Supplier

 

I'm creating a new CTR instance using the method  /sapsrm/cl_pdo_factory_ctr_adv=>create_new_instance.

Then I'm trying to add the items with the method  /sapsrm/if_pdo_bo_ctr~add_item. I've tried also with method /sapsrm/if_pdo_bo_ctr~update_item.

For partners I'm using method  add_header_partners.

And finally I'm using /sapsrm/if_pdo_base~save to save and create the document.

 

But I'm doing something wrong because I get always these messages...

 

This is my code: (sorry for the text format, I'm trying to paste the code with abap highlighting)

 

*&---------------------------------------------------------------------*

*&---------------------------------------------------------------------*

 

REPORT ztest_ric.


TYPE-POOLS: icon.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.


PARAMETERS:


  pa_sc    TYPE crmt_object_id_db OBLIGATORY ,

  pa_suppl TYPE bu_partner OBLIGATORY ,

  pa_start TYPE sy-datum DEFAULT sy-datum OBLIGATORY ,

  pa_end   TYPE sy-datum DEFAULT sy-datum OBLIGATORY.


SELECTION-SCREEN END OF BLOCK b1.


START-OF-SELECTION.


CONSTANTS: lc_process_type TYPE crmt_process_type_db VALUE 'WK'.


DATA:

    lv_error                   TYPE xfeld,

    lv_guid                    TYPE bu_partner_guid,

    lv_sc_guid               TYPE bbp_guid,

    lv_object_id             TYPE crmt_object_id_db,

 

    ls_sc_header            TYPE bbp_pds_sc_header_d,

    ls_guid                     TYPE bbp_guid_tab,

    ls_ctr_partner           TYPE bbp_pds_partner,

    ls_ctr_header           TYPE /sapsrm/s_pdoctr_header,

    ls_ctr_item              TYPE /sapsrm/s_pdoctr_item,

    ls_ctr_orgdata          TYPE bbp_pds_org,

 

    lt_sc_item                TYPE bbpt_pd_sc_item_d,

    lt_sc_partner            TYPE bbpt_pd_partner,

    lt_sc_orgdata            TYPE bbpt_pds_org,

    lt_guid                      TYPE bbpt_guid,

    lt_item_guid              TYPE /sapsrm/t_pdo_hier_guid_list,

    lt_ctr_item                TYPE /sapsrm/t_pdoctr_item,

    lt_ctr_partner            TYPE bbpt_pds_partner,

    lt_messages             TYPE bbpt_pd_messages,

 

    lo_exception             TYPE REF TO cx_root,

    lo_messages            TYPE REF TO /sapsrm/cl_pdo_msg,

    lo_sc_instance         TYPE REF TO /sapsrm/if_pdo_bo_sc_adv,

    lo_ctr_instance         TYPE REF TO /sapsrm/if_pdo_bo_ctr_adv,

    lo_message_handler TYPE REF TO /sapsrm/if_pdo_msg_consumer.


FIELD-SYMBOLS:

     <ls_sc_item>    TYPE bbp_pds_sc_item_d,

     <ls_sc_orgdata> TYPE bbp_pds_org,

     <ls_item_guid>  TYPE /sapsrm/s_pdo_hier_guid_list.


* Get SC GUID;

CALL FUNCTION 'BBP_PD_SC_GUID_GET'

EXPORTING

       iv_object_id = pa_sc

IMPORTING

       ev_guid      = lv_sc_guid

TABLES

       et_messages  = lt_messages.


IF lv_sc_guid IS INITIAL.

     MESSAGE 'SC doesnt exist' TYPE 'S' DISPLAY LIKE 'E'.

     RETURN.

ENDIF.


* SC Instance;

CALL METHOD /sapsrm/cl_pdo_factory_sc_adv=>get_instance

EXPORTING

       iv_header_guid = lv_sc_guid

       iv_mode        = /sapsrm/if_pdo_constants_gen_c=>gc_mode_display

     RECEIVING

       ro_instance    = lo_sc_instance.


CHECK lo_sc_instance IS BOUND.


* Create new instance for the new Contract;

TRY.

CALL METHOD /sapsrm/cl_pdo_factory_ctr_adv=>create_new_instance

EXPORTING

           iv_uname           = sy-uname

           iv_process_type    = lc_process_type

           iv_is_template     = space

IMPORTING

           eo_ctr_instance    = lo_ctr_instance

CHANGING

           co_message_handler = lo_message_handler.

 

CATCH /sapsrm/cx_pdo_wf_mode_ban INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_wrong_bus_type INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_pd_read_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_lock_failed INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_no_authorizatio INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_parameter_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.    

     RETURN.

CATCH /sapsrm/cx_pdo_status_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_incons_user INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.


* Get SC header details;

TRY.

CALL METHOD lo_sc_instance->/sapsrm/if_pdo_bo_sc~get_header_detail

IMPORTING

           es_header = ls_sc_header.

CATCH /sapsrm/cx_pdo_no_authorizatio INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.


* Fill CTR Header:

MOVE-CORRESPONDING ls_sc_header TO ls_ctr_header.

   ls_ctr_header-vper_start   = pa_start.

   ls_ctr_header-vper_end     = pa_end.

   ls_ctr_header-process_type = lc_process_type.

   ls_ctr_header-pmnttrms     = 'Z004'.

CLEAR ls_ctr_header-object_id.


CALL FUNCTION 'BBP_LA_UTILITY_GENERATE_GUID'

IMPORTING

       e_guid = ls_ctr_header-guid.

* Get SC items;

   ls_guid-guid = lv_sc_guid.

APPEND ls_guid TO lt_guid.


CALL METHOD lo_sc_instance->/sapsrm/if_pdo_base~get_item_list

EXPORTING

       it_parent_guid = lt_guid

IMPORTING

       et_item_guid   = lt_item_guid.


* Get SC item details;

CLEAR: lt_guid.

LOOP AT lt_item_guid

ASSIGNING <ls_item_guid>.

     ls_guid-guid = <ls_item_guid>-guid.

APPEND ls_guid TO lt_guid.

ENDLOOP.


TRY.

CALL METHOD lo_sc_instance->/sapsrm/if_pdo_bo_sc~get_item_detail

EXPORTING

           it_item_guids = lt_guid

IMPORTING

           et_item       = lt_sc_item

           et_partner    = lt_sc_partner

           et_orgdata    = lt_sc_orgdata.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.



* Fill CTR Items:

LOOP AT lt_sc_item

ASSIGNING <ls_sc_item>.

CHECK <ls_sc_item>-del_ind EQ space.

MOVE-CORRESPONDING <ls_sc_item> TO ls_ctr_item.

     ls_ctr_item-parent          = ls_ctr_header-guid.

     ls_ctr_item-header          = ls_ctr_header-guid.

     ls_ctr_item-ps_handle_itm   = ls_ctr_header-guid.

     ls_ctr_item-src_guid        = <ls_sc_item>-guid.

     ls_ctr_item-src_object_type = /sapsrm/if_pdo_obj_types_c=>gc_pdo_shop_item.

     ls_ctr_item-itm_released    = abap_true.

CALL FUNCTION 'BBP_LA_UTILITY_GENERATE_GUID'

IMPORTING

         e_guid = ls_ctr_item-guid.

IF ls_ctr_header-co_code IS INITIAL.

       ls_ctr_header-co_code = <ls_sc_item>-be_co_code.

ENDIF.



*   Add the item to the contract;

TRY.

CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_bo_ctr~add_item

CHANGING

             cs_item = ls_ctr_item.

CATCH /sapsrm/cx_pdo_incons_user.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_no_authorizatio.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_abort.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.

*    APPEND ls_ctr_item TO lt_ctr_item


ADD ls_ctr_item-value TO ls_ctr_header-total_value.


*   Move Org. data from the first SC item;

IF ls_ctr_orgdata IS INITIAL.

 

     READ TABLE lt_sc_orgdata

     ASSIGNING <ls_sc_orgdata>

     WITH KEY p_guid = <ls_sc_item>-guid

                del_ind = space.

          IF sy-subrc EQ 0.

              ls_ctr_orgdata = <ls_sc_orgdata>.

          ENDIF.

     ENDIF.

ENDLOOP.



* Update Header;

TRY.

CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_bo_ctr~update_header

EXPORTING

           is_header          = ls_ctr_header

CHANGING

           co_message_handler = lo_message_handler.

CATCH /sapsrm/cx_pdo_no_authorizatio INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_wrong_mode INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_parameter_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.



* Update Items;

*  TRY.

*      CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_bo_ctr~update_item

*        EXPORTING

*          it_items           = lt_ctr_item

*        CHANGING

*          co_message_handler = lo_message_handler.

*    CATCH /sapsrm/cx_pdo_no_authorizatio INTO lo_exception.

*      PERFORM get_exception_text USING lo_exception.

*      RETURN.

*    CATCH /sapsrm/cx_pdo_wrong_mode INTO lo_exception.

*      PERFORM get_exception_text USING lo_exception.

*      RETURN.

*    CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

*      PERFORM get_exception_text USING lo_exception.

*      RETURN.

*    CATCH /sapsrm/cx_pdo_incons_user INTO lo_exception.

*      PERFORM get_exception_text USING lo_exception.

*      RETURN.

*    CATCH /sapsrm/cx_pdo_parameter_error INTO lo_exception.

*      PERFORM get_exception_text USING lo_exception.

*      RETURN.

*  ENDTRY.



* Add Orgdata:

   ls_ctr_orgdata-p_guid     = ls_ctr_header-guid.

CALL FUNCTION 'BBP_LA_UTILITY_GENERATE_GUID'

IMPORTING

       e_guid = ls_ctr_orgdata-guid.



TRY.

CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_do_orgdata~add_header_orgdata

EXPORTING

           is_orgdata         = ls_ctr_orgdata

CHANGING

           co_message_handler = lo_message_handler.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

PERFORM get_exception_text USING lo_exception.

RETURN.

ENDTRY.



* Add Vendor;

   ls_ctr_partner-partner_id  = pa_suppl.

   ls_ctr_partner-p_guid      = ls_ctr_header-guid.

   ls_ctr_partner-partner_fct = '00000019'.

CALL FUNCTION 'BBP_LA_UTILITY_GENERATE_GUID'

IMPORTING

       e_guid = ls_ctr_partner-partner_guid.

CALL FUNCTION 'BUPA_NUMBERS_GET'

EXPORTING

       iv_partner      = ls_ctr_partner-partner_id

IMPORTING

       ev_partner_guid = lv_guid.

   ls_ctr_partner-partner_no = lv_guid.


APPEND ls_ctr_partner TO lt_ctr_partner.


CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_do_partner_base~add_header_partners

EXPORTING

       it_partner         = lt_ctr_partner

CHANGING

       co_message_handler = lo_message_handler.



* Check if there are errors;

PERFORM check_messages USING lo_message_handler

CHANGING lv_error.

CHECK lv_error EQ space.


*  TRY.

*  CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_base~submit_update

*    CHANGING

*      co_message_handler = lo_message_handler.

*      .

*   CATCH /sapsrm/cx_pdo_wrong_mode .

*   CATCH /sapsrm/cx_pdo_abort .

*  ENDTRY.



* Save the document;

CREATE OBJECT lo_messages.

   lo_message_handler ?= lo_messages.

TRY.

CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_base~save

CHANGING

           co_message_handler = lo_message_handler.

CATCH /sapsrm/cx_pdo_abort INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

CATCH /sapsrm/cx_pdo_error INTO lo_exception.

     PERFORM get_exception_text USING lo_exception.

     RETURN.

ENDTRY.



* Check if there are errors;

PERFORM check_messages USING lo_message_handler

CHANGING lv_error.

CHECK lv_error EQ space.



CALL METHOD lo_ctr_instance->/sapsrm/if_pdo_base~get_object_id

     RECEIVING

       rv_object_id = lv_object_id.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.


WRITE: / icon_led_green AS ICON, 'Contract created: ', lv_object_id.



*&---------------------------------------------------------------------*

*&      Form  GET_EXCEPTION_TEXT

*&---------------------------------------------------------------------*

*  Get exception text

*----------------------------------------------------------------------*

*      -->P_LO_EXCEPTION  Exception

*----------------------------------------------------------------------*

FORM get_exception_text  USING    p_lo_exception TYPE REF TO cx_root.


DATA: lv_text TYPE string.


   lv_text = p_lo_exception->get_text( ).


WRITE: / icon_led_red AS ICON, lv_text.


ENDFORM.                    " GET_EXCEPTION_TEXT



*&---------------------------------------------------------------------*

*&      Form  CHECK_MESSAGES

*&---------------------------------------------------------------------*

*   Check messages

*----------------------------------------------------------------------*

*      -->P_LO_MESSAGE_HANDLER  messages

*      <--P_LV_ERROR            There are errors

*----------------------------------------------------------------------*

FORM check_messages  USING    p_lo_message_handler TYPE REF TO /sapsrm/if_pdo_msg_consumer

                                     CHANGING p_lv_error TYPE xfeld .


DATA:

     lt_message TYPE bbpt_pd_messages.


FIELD-SYMBOLS:

     <ls_message> TYPE bbp_pds_messages.


IF lo_message_handler IS NOT BOUND.

     RETURN.

ENDIF.


CALL METHOD p_lo_message_handler->get_messages

IMPORTING

       et_messages = lt_message.


LOOP AT lt_message

     ASSIGNING <ls_message>

     WHERE msgty EQ 'E'

          OR msgty EQ 'A'.


WRITE: / icon_led_red AS ICON, <ls_message>-message.

     p_lv_error = 'X'.

 

ENDLOOP.


ENDFORM.                    " CHECK_MESSAGES

 

Thanks in advance,

Regards,

Ricardo.

 

 

 

Viewing all 3184 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>