Skip to Content

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

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( ).

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
i_partner = ls_but000_old-PARTNER
i_credit_sgmnt = 'XXXX' " Since only one segment will be maintained the production also, so hard coded
ro_credit_account = io_account.

io_account->get_bp_cms_sgm( IMPORTING es_bp_cms_sgm = lw_bp_credit_sgm ).


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.



Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.