Skip to Content

Cannot update or create the credit segment in s4 hana

Hi experts,

We used cl_md_bp_maintain=>maintain method to update or create the credit segment data.

Although it works successfully but it doesn't really update or create the credit limit field of the db UKMBP_CMS_SGM.

Here is my code.

DATA:
lt_data TYPE cvis_ei_extern_t,
lds_data LIKE LINE OF lt_data,
lds_role TYPE bus_ei_bupa_roles,
lds_segments TYPE ukm_ei_bp_cms_sgm.

CONSTANTS:
task_upd TYPE char01 VALUE 'U'.

lds_data-partner-header-object_task = 'U'.
lds_data-partner-header-object_instance-bpartner = pvf_i_bpartner.
lds_data-partner-header-object_instance-bpartnerguid = pvf_i_bpartner_guid.

lds_data-partner-central_data-common-data-bp_control-category = '2'.

*----------------- Partner / Central data / role -----------------*
lds_role-task = pvf_i_object_task.
lds_role-data_key = 'UKM000'.


APPEND lds_role TO lds_data-partner-central_data-role-roles.
lds_data-partner-central_data-role-current_state = abap_true.

*----------------- Partner / UKMBP_DATA -----------------*
lds_segments-task = pvf_i_object_task.
lds_segments-data_key-partner = pvf_i_bpartner.
lds_segments-data_key-credit_sgmnt = pvf_i_credit_segment.

lds_segments-data-xblocked = pvf_i_xblocked.
lds_segments-data-credit_limit = pvf_i_credit_limit.
lds_segments-data-limit_valid_date = pvf_i_limit_valid_date.
lds_segments-data-limit_chg_date = pvf_i_limit_chg_date.
lds_segments-data-x_limit_zero = pvf_i_xlimitzero.

lds_segments-datax-xblocked = abap_true.
lds_segments-datax-x_limit_zero = abap_true.
lds_segments-datax-credit_limit = abap_true.
lds_segments-datax-limit_valid_date = abap_true.
lds_segments-datax-limit_chg_date = abap_true.

APPEND lds_segments TO lds_data-partner-ukmbp_data-segments-segments.
lds_data-partner-ukmbp_data-segments-current_state = abap_true.

APPEND lds_data TO lt_data.

CALL METHOD cl_md_bp_maintain=>maintain
EXPORTING
i_data = lt_data
* i_test_run =
IMPORTING
e_return = prt_o_return.

IF prt_o_return IS INITIAL.
COMMIT WORK AND WAIT.
ELSE.
ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

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.