cancel
Showing results for 
Search instead for 
Did you mean: 

BBP_DETERMINE_LOGSYS

Former Member
0 Kudos

Hi,

I am posting following code which will help you to determine logical system in EBP (SRM).

Please follow steps -

1. IMG ->SRM Server ->Business Add-Ins->Shopping Carts & Requirement Items -> Determine Backend System/Company code

2. It will display name of BAdI definition as BBP_DETERMINE_LOGSYS. Enter implementation name as ZBBP_GET_LOGSYS_SC.

3. You are on BAdI Builder screen. Enter the name short text for implementation.

4. Select 'Interface Tab'

5. Now you can see name of Implementing class and all related methods. ( in this case ZCL_IM_BBP_GET_LOGSYS_SC)

6. Double Click on method DETERMINE_LOGSYS.

7. Enter following code -

method IF_EX_BBP_DETERMINE_LOGSYS~DETERMINE_LOGSYS.

DATA : w_item_data TYPE bbps_detlogsys_item.

DATA : l_default_logsys TYPE logsys.

DATA : l_tabix TYPE sy-tabix.

CONSTANTS : l_logsys TYPE log_system VALUE 'SRMCLNT599'.

CONSTANTS : b_logsys TYPE log_system VALUE 'R3CLNT299'.

"....................................................

Check current default Logical System.................

"....................................................

CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

IMPORTING

OWN_LOGICAL_SYSTEM = l_default_logsys

EXCEPTIONS

OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE i000(zebp) WITH 'Logical System not defined !'.

ENDIF.

".................................................

"..Get Logical System name for b_logsys...........

  • CONCATENATE 'ECCCLNT' sy-mandt INTO b_logsys.

*"..Check entries in ITAB table and decide logical

" system..............

DESCRIBE TABLE item_data LINES sy-tfill.

IF sy-tfill > 0.

LOOP AT item_data INTO w_item_data.

MOVE sy-tabix TO l_tabix.

IF NOT w_item_data-pcnum IS INITIAL

AND w_item_data-logical_system EQ l_default_logsys.

MOVE l_logsys TO w_item_data-logical_system.

ELSE.

MOVE b_logsys TO w_item_data-logical_system.

ENDIF.

MODIFY item_data FROM w_item_data

TRANSPORTING logical_system.

ENDLOOP.

ENDIF.

endmethod.

-


If above code is help for you, please award few points to me.

Thanks and Warm Regards.

Pras Durafe

Accepted Solutions (0)

Answers (1)

Answers (1)

jason_boggans
Active Contributor
0 Kudos

Dear Poster,

As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.

Best Regards,

SDN SRM Moderation Team