cancel
Showing results for 
Search instead for 
Did you mean: 

Class or F.M to read Credit segment data during run-time in BP transaction

sarath_27
Explorer
0 Kudos

Hello Experts,

In S/4 Hana 1809, BP Transaction credit segment in the IDOC was not found, so Credit limit,risk category,valid to date fields were not going to external system. Our requirement is to send the credit limit, valid to date and few partner header fields through proxy on save action.

I have implemented BADI BUPA_GENERAL_UPDATE here i am not able to get the screen credit segment data. I am attaching the source code .

DATA : io_facade TYPE REF TO cl_ukm_facade,
rs_credit_sgmnt TYPE ukmcred_sgm0c,
io_calculator TYPE REF TO if_ukm_calculator,
io_partner TYPE REF TO cl_ukm_business_partner,
io_bupa_factory TYPE REF TO cl_ukm_bupa_factory,
io_account TYPE REF TO cl_ukm_account,
lw_bp_credit_sgm TYPE ukm_s_bp_cms_sgm,
lt_return TYPE ukm_t_monitor_return,
i_partner TYPE bu_partner,
i_creditsegment TYPE ukm_credit_sgmnt.
DATA: ls_but000_old TYPE but000,
lt_but000_old TYPE TABLE OF but000,
ls_but000_new TYPE but000,
lt_but000_new TYPE TABLE OF but000,
ls_but000_td_new TYPE vbut000_td,
lt_but000_td_new TYPE TABLE OF vbut000_td,
ls_but000_td_old TYPE vbut000_td,
lt_but000_td_old TYPE TABLE OF vbut000_td.


io_facade = cl_ukm_facade=>create( i_activity = cl_ukm_cnst_eventing=>bp_maintenance ).
io_bupa_factory = io_facade->get_bupa_factory( ).

CALL FUNCTION 'BUPA_GENERAL_CALLBACK'
TABLES
ET_BUT000_OLD = lt_but000_old
ET_BUT000_NEW = lt_but000_new
ET_BUT000_TD_NEW = lt_but000_td_new
ET_BUT000_TD_OLD = lt_but000_td_old.

READ TABLE LT_BUT000_OLD into ls_but000_old INDEX 1."ls_but000_old-PARTNER
IF sy-subrc EQ 0.
CALL METHOD io_bupa_factory->get_credit_account
EXPORTING
i_partner = ls_but000_old-PARTNER
i_credit_sgmnt = 'XXXX' " Since only one segment will be maintained the production also, so hard coded
RECEIVING
ro_credit_account = io_account.

io_account->get_bp_cms_sgm( IMPORTING es_bp_cms_sgm = lw_bp_credit_sgm ).

ENDIF.

Here lw_bp_credit_sgm is having the credit limit,valid date & other required fields. But this is not working as expected. If this is not right code, kindly provide the buffer f.m / class to pull the screen fields.

Regards,

Sarath.K

Accepted Solutions (0)

Answers (0)