cancel
Showing results for 
Search instead for 
Did you mean: 

Applying function for whole structure

Former Member
0 Kudos

     Hi experts, I need some help with AIF.

I have an interface with structure contining a table. I need to start some function for each line of this table, and if I received an error for some lines of table, I need to change values of some fields and restart a message once - that's not a problem.

But finally, I need to execute one function with whole data in table. How can I do this?

ps Just for understanding - I receive a table with some persons and their phone numbers. The first function is checking if the person is exist alredy and returns business partner ID.

Thanks in advance!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andrey,

you said you want to execute a function with the whole data of the table. There are a couple of places where you can access the complete raw or sap structure. Christoph already mentioned two of them.

The only place where you can change the source data is the Init Function before Mapping. In all other places you can only change the destination structure.

From what you wrote above I assume that function should be called after the mapping. But what should this function do? Enrich some more fields in the destination structure or posting the data?

In the first case I think the Init Function before Processing might be the right place. Its executed after the mapping and before the actions.

In the second case you need to assign an action to your structure mapping. I assume the table is directly under the root structure? In this case simply leave field Record Type blank in Assign Actions. This will pass the complete destination structure to action. Parameter CURR_LINE of the action function will contain the complete destination structure then.

Best regards,

Verena

Former Member
0 Kudos

Hi Andrey,

to see all message data and manipulate them there are two function modules available. Both are entered in the AIF customizing screen Define Interface:

- Init Function before Mapping. Here you can see and manipulate all source data. The function module is executed before the mapping. Use function module /AIF/FILE_TEMPL_INIT_MAPPING as template.

- Check Function Module: Here you can see the complete source data and the can manipulate the result of the complete structure/value mapping. The function module is executed after the mapping and before the execution of the action(s). Use function module /AIF/FILE_TEMPL_CHECK_MAPPING as template. Parameter RAW_STRUCT contains the data of the source structure. Parameter OUT_STRUCT contains the data of the destination structure.

Detailed information are well described in the SAP document "Template Function Modules of the SAP Application Interface Framework" by Verena.

Kind regards

Christoph