Skip to Content
0

Is it possible to change the source structure in AIF from the FM which is configured for action ?

Apr 02, 2017 at 10:42 AM

105

avatar image

Hello Experts,

Please let us know is it possible to change the source data structure in AIF from the FM which is configured for action ?

1). I have configured an FM for automatic processing, in that FM, is it possible to change the source data structure value?

I tried to change the DATA and CURR_LINE, but no luck in updating the value.

Below is the screenshot for source data structure in AIF.

Any suggestion are welcome.

Thanks,

Sabari

capture.png (14.6 kB)
capture1.png (37.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
David Rittinghaus Apr 18, 2017 at 09:02 AM
0

Hi,

at some stage you should have the following code:

call method /aif/cl_enabler_xml=>transfer_to_aif
 exporting
 is_any_structure = ls_source_data_structure

and so on

before calling the transfer to aif you can change ls_source_data_structre and that change will be reflected in the source data.

I would call this bad pratice though because the source data should be the responsibility of the sending system and the aim should be to get to the desired target data using what was sent.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi David,

Thanks for the input. Yes, i accept it is a bad practice to update the source data structure.

Due to some business requirement, we have to update some field later.

We can acheive it by below process.

CALL METHOD lr_aif->/aif/if_persistency_engine~retrieve

EXPORTING

iv_msgguid = 'GUID'

iv_ns = 'NAMESPACE'

iv_ifname = 'INTERFACE NAME'

iv_ifver = 'INTERFACE VERSION'

CHANGING

cs_xmlparse = lv_data.

CATCH /aif/cx_error_handling_general .

ENDTRY.

** Popluate the new data **

GET REFERENCE OF ls_return INTO lv_data-xi_data.

GET REFERENCE OF lv_data INTO lv_update.

TRY.

CALL METHOD lr_aif->/aif/if_persistency_engine~update

CHANGING

cr_xmlparse = lv_update.

CATCH /aif/cx_error_handling_general .

ENDTRY.

CALL METHOD lr_aif->/aif/if_persistency_engine~save_buffer.

Thanks,

Sabari

0

Hi Sabari,

good idea to directly use the persistency engine.

In the past i've done all this manually. Thanks for providing the valuable insight.

Kind Regards

David

0