Skip to Content
0
Aug 11, 2016 at 06:27 PM

ABAP Proxy guide needed

64 Views

Hi Developers,

As I am new to ABAP Proxy & having knowledge in OOPS.

Please guide me How to start with my work on coding?

Below picture is my Service Interface.

interface.png

This code below is my system existing proxy code,

data: proxy TYPE REF TO CL_PROXY.

DATA :FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .

data : lclobjsi_sap_price_out type ref to ZPICO_SI_SAP_PRICE_MASTER_OUT,

lwa_mt_price_out type ZPIMT_SAP_PRICE_MASTER_OUT,

lwa_dt_price_out type ZPIDT_SAP_PRICE_MASTER_OUT,

lt_Dt_price type standard table of ZPIDT_SAP_PRICE_MASTER_OUT_PRICE,

lwa_dt_price type ZPIDT_SAP_PRICE_MASTER_OUT_PRICE,

lvcx_ai_system_Fault type ref to cx_ai_system_fault.

delete it_price where kschl eq space.

* break savic_abap2.

loop at it_price into wa_price.

lwa_Dt_price-kschl = wa_price-kschl. "'1'.

lwa_Dt_price-aland = wa_price-aland. "'IN' .

lwa_Dt_price-matnr = wa_price-matnr .

lwa_Dt_price-ean11 = wa_price-ean11 .

lwa_Dt_price-kbetr = wa_price-kbetr .

lwa_Dt_price-konwa = wa_price-konwa .

IF wa_price-ctype = 'ADD'.

lwa_Dt_price-change_type = 'N'.

ELSEIF wa_price-ctype = 'UPDATE'.

lwa_Dt_price-change_type = 'U'.

ENDIF.

append lwa_dt_price to lt_Dt_price.

endloop.

if not lt_dt_price[] is initial.

lwa_dt_price_out-PRICEMASTER_REC = lt_Dt_price.

lwa_mt_price_out-MT_SAP_PRICE_MASTER_OUT = lwa_dt_price_out.

endif.

try.

CREATE OBJECT lclobjsi_sap_price_out.

catch cx_ai_system_fault into lvcx_ai_system_fault.

endtry.

TRY.

CALL METHOD LCLOBJSI_SAP_price_OUT->SI_SAP_PRICE_MASTER_OUT

EXPORTING

OUTPUT = lwa_mt_price_out.

CATCH CX_AI_SYSTEM_FAULT into lvcx_ai_system_fault .

ENDTRY.

if sy-subrc eq 0.

commit work.

endif.

While changing the new tax code in VK12, its has to add as a new line item in other system (non-sap) instead of updating the existing line.

If other system is maintaining interface/class from there side for adding new line on there side instead of updating the existing line...What changes should be done from our end?

Please give some logical hint or anything that I can explore.

Regards,

Sudarshan D