on 12-10-2020 9:57 AM
Hi,
I have two interaction is coming to marketing with specific fields. In the first inbound IA i have a field with data, same
field data needs to be updated in second interaction data.
Please check the usecase below and code, but in second IA payload FIELD 1 data is not getting updated.
IF interaction_data-ia_type =INBOUND_SALE'.
SELECT SINGLE * FROM I_Mkt_Interaction INTO @data(ls_copyleaddata) WHERE Interaction = @interaction_data-ia_key.
IF sy-subrc EQ 0.
interaction_data-YY1_FIELD1_mia = ls_copyleaddata-YY1_FIELD1_mia.
ENDIF.
ENDIF.
Kindly suggest if something I am missing here.
Regards,
Bhaskar
Hello,
I think you are doing it wrong. The reason is, when you write the shown "select" query then you are actually querying the same data that is currently being processed. Therefore, "interaction_data-YY1_FIELD1_mia = ls_copyleaddata-YY1_FIELD1_mia." will actually have no difference in the output being generated. (Because buffered data == Database Data)
I would have a question. How do the 2nd interaction is linked to 1st inetraction? If there is any common & Unique ID then you should pass that as a filetr in select query and then ideally this should work fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh,
Thank you for the update.
Objective is for some business scenario's we are doing manual export, in the second interaction if i don't have the FIELD1, it would be meaningless for the data. So, I need to manually copy the FIELD1 to second interaction.
This FIELD1 is part of IA Type MARKETING_LEAD only, whichever is updated in the contact interaction FIELD1 should be copied to when the interaction is flowing with IA type INBOUND_SALES. Can you suggest me here.
Regards,
Bhaskar
Hello Bhaskar,
But my question still remains, what is the relationship or linkage between these 2 interaction "technically"? To make it simple, how does I come to know about, which MARKETING_LEAD IA would be picked for field1 that needs be copied to field2 of INBOUND_SALES? Without this technical relation, it is not possible to uniqueluy identify from which MARKETING_LEAD you would pick the field1.
BR
yes, it can be done using the same BADI but you need to make an interconnection between these two interactions without which it is not possible. For example, interconnection could be in the form of "SourceObejctID" of IA1 in the customer field of IA2 (or anything else). But if you are unable to establish this link between the interaction then you can't do anything to resolve the issue as the system does not know from which IA it has to copy the field.
Another "dirty" workaround would be, SELECT all the interaction of type INBOUND_SALES for the IC in the subject and sort them by "InteractionCreationUTCDateTime" or "InteractionLastChangedDateTime". In this select you will pick the first/second record.This would definitely work but not recommended because what happens if there are 2 MARKETING_LEAD for the same contact have come around same time and this could lead to potential issues.
Now its upto you to validate which solution you want to proceed with.
BR
Saurabh
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.