Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

UPDATE legal control data in S4/HANA system

0 Kudos

Hi All,

I want to update the legal control data coming from IDOC in the S4/HANA system.

In ECC system the legal control data has stored in the MAEX table whereas now in S4/HANA system the data coming from the IDOC should be updated in the /SAPSLL/MARLRG table.

Please let me know how to update the data in /SAPSLL/MARLRG table which is coming from the IDOC. SAP has given the FIORI app to update the legal control data in S4/HANA system but in my case the data coming from the IDOC should be updated in the /SAPSLL/MARLRG table.

Thanks & Regards,




Even I am looking for the answer to this question. I tried to update using update FM /SAPSLL/MARLRG_DB_INSERT but it is throwing exception saying duplicate key found. Its not working.

0 Kudos

Hi Praveen,

We can create the legal control data for the existing material using the CREATE_CLASSIFICATION method of /SAPSLL/CL_API_PRCLS_LEGAL_CON class.

Sample code for your reference

DATA(lo_legcon_new) =   NEW /sapsll/cl_api_prcls_legal_con( ).
DATA lt_legcon_data_new TYPE STANDARD TABLE OF /sapsll/marlrg.
DATA lt_products  TYPE /sapsll/matnr_t.
DATA: i_matnr TYPE matnr.
i_matnr = '12345679009' "Material Number
APPEND i_matnr TO lt_products.
IF lt_legcon_data_new IS NOT INITIAL.
LOOP AT lt_legcon_data_new INTO DATA(ls_legcon_data_new).
CALL METHOD lo_legcon_new->create_classification
iv_inicl = abap_true
*Pass abap_true to IV_INICL parameter incase of initial classifiacation
*Pass abap_false to IV_INICL parameter incase of reclassification.
iv_lgreg = ls_legcon_data_new-lgreg
iv_lccma = ls_legcon_data_new-lccma
iv_concl = ls_legcon_data_new-concl
iv_congr = ls_legcon_data_new-congr
iv_datab = sy-datum
iv_datbi = '99991231'
* iv_tclrm = lt_legcon_data_new-tclrm
it_products = lt_products
iv_no_commit = abap_true
et_messages = DATA(lt_messages).

I hope this would be helpful. Please let me know if you have any queries.

Best Regards,